{"action":"opened","issue":{"url":"https://api.github.com/repos/andrewssobral/bgslibrary/issues/128","repository_url":"https://api.github.com/repos/andrewssobral/bgslibrary","labels_url":"https://api.github.com/repos/andrewssobral/bgslibrary/issues/128/labels{/name}","comments_url":"https://api.github.com/repos/andrewssobral/bgslibrary/issues/128/comments","events_url":"https://api.github.com/repos/andrewssobral/bgslibrary/issues/128/events","html_url":"https://github.com/andrewssobral/bgslibrary/issues/128","id":339611316,"node_id":"MDU6SXNzdWUzMzk2MTEzMTY=","number":128,"title":"compilation errors when compiling against opencv 4","user":{"login":"headdab","id":1169194,"node_id":"MDQ6VXNlcjExNjkxOTQ=","avatar_url":"https://avatars0.githubusercontent.com/u/1169194?v=4","gravatar_id":"","url":"https://api.github.com/users/headdab","html_url":"https://github.com/headdab","followers_url":"https://api.github.com/users/headdab/followers","following_url":"https://api.github.com/users/headdab/following{/other_user}","gists_url":"https://api.github.com/users/headdab/gists{/gist_id}","starred_url":"https://api.github.com/users/headdab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/headdab/subscriptions","organizations_url":"https://api.github.com/users/headdab/orgs","repos_url":"https://api.github.com/users/headdab/repos","events_url":"https://api.github.com/users/headdab/events{/privacy}","received_events_url":"https://api.github.com/users/headdab/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-09T21:19:52Z","updated_at":"2018-07-09T21:19:52Z","closed_at":null,"author_association":"NONE","body":"If you open a GitHub issue, here is our policy:\r\n\r\n1. It must be a bug, a feature request, or a significant problem with documentation (for small docs fixes please send a PR instead).\r\n2. The form below must be filled out.\r\n\r\n**Describe the bug**\r\nOn ubunut17.10, using  apt installed boost 1.62 libraries, bgs library fails to compile.\r\n\r\nI made several changes to get it to compile, but don't know if they are correct.\r\nPlease review and comment and, hopefully, check them or another fix in.\r\nThere are a total of 5 1-line changes described in detail below:\r\n\r\npython3 to python in CMakeLists.txt\r\nadded #include <opencv2/core/types_c.h> to conversions.h\r\nchanged == 3 to >= 3 at 3 places in conversion.cpp\r\n\r\n**To Reproduce**\r\n> git clone https://github.com/andrewssobral/bgslibrary.git\r\n> sudo apt-get install libboost-all-dev\r\nReading package lists... Done\r\nBuilding dependency tree       \r\nReading state information... Done\r\nlibboost-all-dev is already the newest version (1.62.0.1).\r\n0 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.\r\n\r\n> cd bgslibrary/build\r\n> cmake -DBGS_PYTHON_SUPPORT=ON -DBGS_PYTHON_VERSION=3 ..\r\n-- BGSLIBRARY WITH PYTHON SUPPORT: ON\r\n-- PYTHON VERSION: 3\r\n-- OpenCV library status:\r\n--     version: 4.0.0\r\n--     libraries: opencv_calib3d;opencv_core;opencv_dnn;opencv_features2d;opencv_flann;opencv_highgui;opencv_imgcodecs;opencv_imgproc;opencv_ml;opencv_objdetect;opencv_photo;opencv_shape;opencv_stitching;opencv_superres;opencv_video;opencv_videoio;opencv_videostab;opencv_aruco;opencv_bgsegm;opencv_bioinspired;opencv_ccalib;opencv_datasets;opencv_dnn_objdetect;opencv_dpm;opencv_face;opencv_freetype;opencv_fuzzy;opencv_hdf;opencv_hfs;opencv_img_hash;opencv_line_descriptor;opencv_optflow;opencv_phase_unwrapping;opencv_plot;opencv_reg;opencv_rgbd;opencv_saliency;opencv_stereo;opencv_structured_light;opencv_surface_matching;opencv_text;opencv_tracking;opencv_xfeatures2d;opencv_ximgproc;opencv_xobjdetect;opencv_xphoto\r\n--     include path: /usr/include;/usr/include/opencv\r\n-- SEARCHING FOR BOOST COMPONENT FOR PYTHON 3\r\nCMake Warning at /usr/share/cmake-3.9/Modules/FindBoost.cmake:1582 (message):\r\n  No header defined for python3; skipping header check\r\nCall Stack (most recent call first):\r\n  CMakeLists.txt:96 (find_package)\r\n\r\n\r\nCMake Error at /usr/share/cmake-3.9/Modules/FindBoost.cmake:1898 (message):\r\n  Unable to find the requested Boost libraries.\r\n\r\n  Boost version: 1.62.0\r\n\r\n  Boost include path: /usr/include\r\n\r\n  Could not find the following Boost libraries:\r\n\r\n          boost_python3\r\n\r\n  No Boost libraries were found.  You may need to set BOOST_LIBRARYDIR to the\r\n  directory containing Boost libraries or BOOST_ROOT to the location of\r\n  Boost.\r\nCall Stack (most recent call first):\r\n  CMakeLists.txt:96 (find_package)\r\n\r\n\r\n-- Boost library status:\r\n--     version: 106200\r\n--     libraries: \r\n--     include path: /usr/include\r\n-- Python library status:\r\n--     executable: /home/estes/git/cv/CV/bin/python3\r\n--     version: 3.6.3\r\n--     library: /usr/lib/x86_64-linux-gnu/libpython3.6m.so\r\n--     include path: /usr/include/python3.6m\r\n-- NUMPY_INCLUDE_DIR: /home/estes/git/cv/CV/lib/python3.6/site-packages/numpy/core/include\r\n-- Configuring incomplete, errors occurred!\r\nSee also \"/home/estes/git/bgslibrary/build/CMakeFiles/CMakeOutput.log\".\r\n\r\n** Note that it can't find boost_python3\r\n\r\n# edit CMakeLists.txt\r\n  if(BGS_PYTHON_VERSION EQUAL 2)\r\n    find_package(Boost REQUIRED COMPONENTS python)\r\n  else()\r\n    find_package(Boost REQUIRED COMPONENTS python) # was python3\r\n  endif()\r\n\r\n> cd build && rm -rf * && cmake -DBGS_PYTHON_SUPPORT=ON -DBGS_PYTHON_VERSION=3 ..\r\n-- The C compiler identification is GNU 7.2.0                          \r\n-- The CXX compiler identification is GNU 7.2.0                        \r\n-- Check for working C compiler: /usr/bin/cc                           \r\n-- Check for working C compiler: /usr/bin/cc -- works                  \r\n-- Detecting C compiler ABI info   \r\n-- Detecting C compiler ABI info - done                                \r\n-- Detecting C compile features    \r\n-- Detecting C compile features - done                                 \r\n-- Check for working CXX compiler: /usr/bin/c++                        \r\n-- Check for working CXX compiler: /usr/bin/c++ -- works               \r\n-- Detecting CXX compiler ABI info \r\n-- Detecting CXX compiler ABI info - done                              \r\n-- Detecting CXX compile features  \r\n-- Detecting CXX compile features - done                               \r\n-- BGSLIBRARY WITH PYTHON SUPPORT: ON                                  \r\n-- PYTHON VERSION: 3               \r\n-- Found OpenCV: /usr (found version \"4.0.0\")                          \r\n-- OpenCV library status:          \r\n--     version: 4.0.0              \r\n--     libraries: opencv_calib3d;opencv_core;opencv_dnn;opencv_features2d;opencv_flann;opencv_highgui;opencv_imgcodecs;opencv_imgproc;opencv_ml;opencv_objdetect;opencv_photo;opencv_shape;opencv_stitching;opencv_superres;opencv_video;opencv_videoio;opencv_videostab;opencv_aruco;opencv_bgsegm;opencv_bioinspired;opencv_ccalib;opencv_datasets;opencv_dnn_objdetect;opencv_dpm;opencv_face;opencv_freetype;opencv_fuzzy;opencv_hdf;opencv_hfs;opencv_img_hash;opencv_line_descriptor;opencv_optflow;opencv_phase_unwrapping;opencv_plot;opencv_reg;opencv_rgbd;opencv_saliency;opencv_stereo;opencv_structured_light;opencv_surface_matching;opencv_text;opencv_tracking;opencv_xfeatures2d;opencv_ximgproc;opencv_xobjdetect;opencv_xphoto                        \r\n--     include path: /usr/include;/usr/include/opencv                  \r\n-- SEARCHING FOR BOOST COMPONENT FOR PYTHON 3                          \r\n-- Boost version: 1.62.0           \r\n-- Found the following Boost libraries:                                \r\n--   python                        \r\n-- Found PythonInterp: /home/estes/git/cv/CV/bin/python3 (found suitable version \"3.6.3\", minimum required is \"3\")                            -- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.6m.so (found suitable version \"3.6.3\", minimum required is \"3\")                     -- Boost library status:           \r\n--     version: 106200             \r\n--     libraries: /usr/lib/x86_64-linux-gnu/libboost_python.so         \r\n--     include path: /usr/include  \r\n-- Python library status:          \r\n--     executable: /home/estes/git/cv/CV/bin/python3                   \r\n--     version: 3.6.3              \r\n--     library: /usr/lib/x86_64-linux-gnu/libpython3.6m.so             \r\n--     include path: /usr/include/python3.6m                           \r\n-- NUMPY_INCLUDE_DIR: /home/estes/git/cv/CV/lib/python3.6/site-packages/numpy/core/include                                                    -- Configuring done                \r\n-- Generating done                 \r\n-- Build files have been written to: /home/estes/git/bgslibrary/build  \r\n\r\n** Looks like it found everything\r\n\r\n> make\r\n\r\n** compile almost finishes, but we get errors about CV_MAX_DIM not being defined (first one is shown below)\r\n\r\n/home/estes/git/bgslibrary/wrapper_python/utils/conversion.cpp:257:17: error: ‘CV_MAX_DIM’ was not declared in this scope                     \r\n     if(ndims >= CV_MAX_DIM)                                                                                                                  \r\n\r\nAfter adding:\r\n\r\n#include <opencv2/core/types_c.h>\r\n\r\nto conversion.h, I get:\r\n\r\n/home/estes/git/bgslibrary/wrapper_python/utils/conversion.cpp: In member function ‘cv::Mat NDArrayConverter::toMat(const PyObject*)’:\r\n/home/estes/git/bgslibrary/wrapper_python/utils/conversion.cpp:319:11: error: ‘class cv::Mat’ has no member named ‘refcount’\r\n         m.refcount = refcountFromPyObject(o);\r\n\r\nwhich I fixed by changing all\r\n\r\n#if CV_MAJOR_VERSION == 3\r\n\r\nto\r\n\r\n#if CV_MAJOR_VERSION >= 3\r\n\r\nin conversion.cpp\r\n\r\n**Expected behavior**\r\nA clear and concise description of what you expected to happen.\r\n\r\n**Screenshots**\r\n\r\nIncluded in explanation above.\r\n\r\n### System information\r\n**Desktop (please complete the following information):**\r\n- **OS Platform and Distribution (e.g., Linux Ubuntu 16.04)**:\r\n\r\n> lsb_release -a\r\nDistributor ID: Ubuntu\r\nDescription:    Ubuntu 17.10\r\nRelease:        17.10\r\nCodename:       artful\r\n\r\n- **Python version (for issues related to the python wrapper)**: \r\n\r\nIts in the output above.\r\n\r\n- **Java version (for issues related to the java wrapper)**: \r\n- **MATLAB version (for issues related to the matlab wrapper)**: \r\n\r\n**Additional context**\r\nAdd any other context about the problem here.\r\n"}}
{"actor":{"display_login":"headdab"}}