Error compiling dlib on os x - python

I'm trying to compile dlib on my computer (OS X 10.10) but am running into an error I'm not sure how to fix. When I run CMake I get this output
Configuring cmake ...
-- The C compiler identification is AppleClang 7.0.0.7000176
-- The CXX compiler identification is AppleClang 7.0.0.7000176
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Could NOT find Boost
-- Boost version: 1.59.0
-- Found the following Boost libraries:
-- python
CMake Error at /usr/local/Cellar/cmake/3.3.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
Could NOT find PythonLibs: Found unsuitable version "2.7.10", but required
is at least "3.4" (found PYTHON_LIBRARY-NOTFOUND)
Call Stack (most recent call first):
/usr/local/Cellar/cmake/3.3.2/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:386 (_FPHSA_FAILURE_MESSAGE)
/usr/local/Cellar/cmake/3.3.2/share/cmake/Modules/FindPythonLibs.cmake:205 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
/Users/gabriel/Devspace/dlib/dlib/add_python_module:64 (FIND_PACKAGE)
CMakeLists.txt:6 (include)
-- Configuring incomplete, errors occurred!
See also "/Users/gabriel/Devspace/dlib/tools/python/build/CMakeFiles/CMakeOutput.log".
error: cmake configuration failed!
First of all I'm wondering how CMake could not find Boost but then in the next line give the version of boost I currently have installed on my computer? Second, I'm wondering how I go about fixing the pythonlibs error? I've tried Googling around but mainly have just found other people with similar errors but not what it means or how to fix it. Any help would be greatly appreciated. Thanks

Is that your boost installed with python 3?If so, I suggest you to set your default python version 3.x, or reinstall boost with the current python version like this:
To compile Boost.Python yourself download boost from boost.org and then go into the boost root folder and run these commands:
./bootstrap.sh --with-libraries=python
./b2
sudo ./b2 install
I've solved the problem Could NOT find Boost with the above solution.

Related

Boost/Py-Boost not being found in Conda Environment while Installing ParallelFDTD

I'm trying to follow the instructions here to install ParallelFDTD's python bindings on a windows machine. I've barely worked with C++ before, and certainly never with Boost! Mostly have experience with Python.
So far, I have done the following:
installed the Windows SDK
installed the CUDA toolkit
I have successfully created a conda environment:
conda create -n PFDTD -c conda-forge boost py-boost cmake numpy scipy
conda activate PFDTD
Running conda list shows that boost 1.73 is installed, along with py-boost 1.73 and libboost 1.73 as well as boost-cpp 1.68.
So far so good.
When I try to install and build the library as per the instructions with the following, I get an error
pip install git+https://github.com/AaltoRSE/ParallelFDTD.git
produces:
Building wheels for collected packages: pyParallelFDTD
Running command python setup.py bdist_wheel
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-38
creating build\lib.win-amd64-cpython-38\pyParallelFDTD
copying dist\libPyFDTD\__init__.py -> build\lib.win-amd64-cpython-38\pyParallelFDTD
running build_ext
-- Building for: Visual Studio 17 2022
-- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.22000.
-- The CXX compiler identification is MSVC 19.33.31630.0
-- The CUDA compiler identification is NVIDIA 11.8.89
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.33.31629/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Check for working CUDA compiler: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/bin/nvcc.exe - skipped
-- Detecting CUDA compile features
-- Detecting CUDA compile features - done
-- CONDA_PREFIX C:\ProgramData\Anaconda3\envs\opti-acoustics
-- Found Python: C:/ProgramData/Anaconda3/envs/opti-acoustics/python.exe (found version "3.8.13") found components: Interpreter
-- Found PythonLibs: C:/Python310/libs/python310.lib (found version "3.10.0")
-- CONDA_PREFIX C:\ProgramData\Anaconda3\envs\opti-acoustics
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - not found
-- Found Threads: TRUE
CMake Error at C:/ProgramData/Anaconda3/envs/opti-acoustics/Library/share/cmake-3.24/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find Boost (missing: Boost_INCLUDE_DIR system thread date_time
unit_test_framework python38 chrono numpy38) (Required is at least version
"1.41")
Call Stack (most recent call first):
C:/ProgramData/Anaconda3/envs/opti-acoustics/Library/share/cmake-3.24/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
C:/ProgramData/Anaconda3/envs/opti-acoustics/Library/share/cmake-3.24/Modules/FindBoost.cmake:2376 (find_package_handle_standard_args)
CMakeLists.txt:86 (find_package)
-- Configuring incomplete, errors occurred!
See also "C:/Users/../AppData/Local/Temp/pip-req-build-3mu877y3/build/temp.win-amd64-cpython-38/Release/CMakeFiles/CMakeOutput.log".
See also "C:/Users/../AppData/Local/Temp/pip-req-build-3mu877y3/build/temp.win-amd64-cpython-38/Release/CMakeFiles/CMakeError.log".
The key part of the error message seems to be:
Could NOT find Boost (missing: Boost_INCLUDE_DIR system thread date_time
unit_test_framework python38 chrono numpy38) (Required is at least version
"1.41")
The instructions suggest that the installation with conda should be sufficient, but it seems some environment variables are missing. In ParallelFDTD's CMakeLists.txt, you can see how it tries to handle boost installation in a conda env here.
It appears that conda install -c conda-forge boost py-boost installed successfully, for instance there are a lot of .hpp files and a /python folder as well as a bunch of other directories in C:\ProgramData\Anaconda3\envs\acoustics_env\library\include\boost. There are also a lot of boost_xxx.dll files in C:\ProgramData\Anaconda3\envs\acoustics_env\library\bin.
So far, I've forked the ParallelFDTD library so that I can make changes to the CMakeLists.txt, including pointing the BOOST_ROOT, Boost_INCLUDE_DIR and/or Boost_LIBRARY_DIR explicitly to folders in the anaconda env if need be, but I haven't been able to figure out the correct paths to use... I can also try installing boost manually, but just not sure what the best approach is.
Desperate for help! I'm sure it's a simple step I am missing...
Found lots of other threads that were somewhat related, but none of them seemed to be dealing with this kind of context of working in a conda environment with boost/py-boost.

Running CMAKE couldn't find python executable

Link for the issue raised in github: github issue link for reference
Application Version: CURA 3.6 version
Platform:
Processor: Intel(R) Core(TM) i5-8300H CPU # 2.30 GHz
RAM: 16.0 GB
System type: 64-bit Operating system, x64-based processor
Steps to Reproduce
I am trying to run source from https://github.com/Ultimaker/Cura/wiki/Running-Cura-from-Source-on-Windows#microsoft-visual-studio-2019.
And attempting to run step 10.
10:
Open CMake and point its source directory to your cura-build repository and the build directory to the build subdirectory.
Actual Results
D:\work\cura-build-master\cura-build-master\build>cmake -DCMAKE_INSTALL_PREFIX=../install_dir -DCMAKE_BUILD_TYPE=Release -G "NMake Makefiles" ..
-- The C compiler identification is MSVC 19.0.24215.1
-- The CXX compiler identification is MSVC 19.0.24215.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: D:/MicrosoftVisualStudio14.0/VC/bin/amd64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: D:/MicrosoftVisualStudio14.0/VC/bin/amd64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at C:/Program Files/CMake/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
Could NOT find Python3 (missing: Python3_EXECUTABLE Interpreter)
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE)
C:/Program Files/CMake/share/cmake-3.18/Modules/FindPython/Support.cmake:2966 (find_package_handle_standard_args)
C:/Program Files/CMake/share/cmake-3.18/Modules/FindPython3.cmake:389 (include)
CMakeLists.txt:94 (find_package)
-- Configuring incomplete, errors occurred!
See also "D:/work/cura-build-master/cura-build-master/build/CMakeFiles/CMakeOutput.log".
Expected results
CMake should generate all files in build directory.
From the above error it is evident that the CMake is not able to find python executable.
I have no python installed on system. The only python available is from the CURA (which is installed when the cura-build-environment is build). How to link or make the CMake find the python executable which is installed?
For my case it is installed/found the executable in this folder:
\cura-build-environment-master\install_dir\bin
I have checked and found that we can set the python executable:
for windows:
set(Python3_EXECUTABLE D:/cura-build-environment-master/install_dir/bin/python.exe)

Getting dependencies error while installing ViZDoom

I am trying to install ViZDoom on Ubuntu system. I am following the steps given the following link https://github.com/mwydmuch/ViZDoom/blob/master/doc/Building.md.
However, I am getting the following error:
Collecting vizdoom
Using cached https://files.pythonhosted.org/packages/2d/6c/23565c09387173423883e7881fce53541ff89b5209ca0904c67e577dd6ac/vizdoom-1.1.7.tar.gz
Collecting numpy (from vizdoom)
Using cached https://files.pythonhosted.org/packages/3d/fc/4763e5f17ac6e7e7d55f377cde859ca1c5d5ac624441ab45315bc578aa9e/numpy-1.18.3-cp36-cp36m-manylinux1_x86_64.whl
Building wheels for collected packages: vizdoom
Running setup.py bdist_wheel for vizdoom ... error
Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-n60bvxmm/vizdoom/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpynt30bvbpip-wheel- --python-tag cp36:
running bdist_wheel
running build
CMake Warning:
No source or binary directory provided. Both will be assumed to be the
same as the current working directory, but note that this warning will
become a fatal error in future CMake releases.
-- The C compiler identification is GNU 8.3.0
-- The CXX compiler identification is GNU 8.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found Boost: /usr/include (found version "1.67.0") found components: filesystem thread system date_time chrono regex iostreams atomic
CMake Deprecation Warning at cmake_modules/CreateLaunchers.cmake:48 (cmake_policy):
The OLD behavior for policy CMP0026 will be removed from a future version
of CMake.
The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
src/vizdoom/CMakeLists.txt:13 (include)
-- Could NOT find BZip2 (missing: BZIP2_LIBRARIES BZIP2_INCLUDE_DIR)
-- Found JPEG: /usr/lib/x86_64-linux-gnu/libjpeg.so (found version "80")
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11")
-- Could NOT find GME (missing: GME_LIBRARIES GME_INCLUDE_DIR)
-- Using system zlib
-- Using system jpeg library
-- Using internal bzip2 library
-- Using internal gme library
-- Performing Test HAVE_NO_ARRAY_BOUNDS
-- Performing Test HAVE_NO_ARRAY_BOUNDS - Success
-- Performing Test __LIBGME_TEST_VISIBILITY
-- Performing Test __LIBGME_TEST_VISIBILITY - Success
-- Looking for strdup
-- Looking for strdup - found
-- Looking for strndup
-- Looking for strndup - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of char
-- Check size of char - done
-- Check size of short
-- Check size of short - done
-- Check size of int
-- Check size of int - done
-- Check size of long
-- Check size of long - done
-- /usr/include
-- /tmp/pip-build-n60bvxmm/vizdoom/src/vizdoom/bzip2
-- /tmp/pip-build-n60bvxmm/vizdoom/src/vizdoom/lzma/C
-- Looking for itoa
-- Looking for itoa - not found
-- Performing Test DUMB_CAN_USE_SSE
-- Performing Test DUMB_CAN_USE_SSE - Success
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
-- Checking for module 'gtk+-2.0'
-- No package 'gtk+-2.0' found
CMake Error at /usr/local/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find SDL2 (missing: SDL2_LIBRARY SDL2_INCLUDE_DIR)
Call Stack (most recent call first):
/usr/local/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
cmake_modules/FindSDL2.cmake:179 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
src/vizdoom/src/CMakeLists.txt:206 (find_package)
-- Configuring incomplete, errors occurred!
See also "/tmp/pip-build-n60bvxmm/vizdoom/CMakeFiles/CMakeOutput.log".
See also "/tmp/pip-build-n60bvxmm/vizdoom/CMakeFiles/CMakeError.log".
Installation failed, you may be missing some dependencies.
Please check https://github.com/mwydmuch/ViZDoom/blob/master/doc/Building.md for details
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-n60bvxmm/vizdoom/setup.py", line 119, in <module>
keywords=['vizdoom', 'doom', 'ai', 'deep learning', 'reinforcement learning', 'research']
File "/home/rishabh29/.local/lib/python3.6/site-packages/setuptools/__init__.py", line 144, in setup
return distutils.core.setup(**attrs)
File "/usr/lib/python3.6/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib/python3.6/distutils/dist.py", line 955, in run_commands
self.run_command(cmd)
File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/home/rishabh29/.local/lib/python3.6/site-packages/wheel/bdist_wheel.py", line 223, in run
self.run_command('build')
File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
cmd_obj.run()
File "/tmp/pip-build-n60bvxmm/vizdoom/setup.py", line 81, in run
subprocess.check_call(['cmake'] + cmake_arg_list)
File "/usr/lib/python3.6/subprocess.py", line 311, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '-DCMAKE_BUILD_TYPE=Release', '-DBUILD_PYTHON=ON', '-DPYTHON_EXECUTABLE=/usr/bin/python3.6', '-DBUILD_PYTHON3=ON']' returned non-zero exit status 1.
When I try to install the ZDoom dependencies, I get the following error:
E: Unable to locate package libsdl2-dev
E: Unable to locate package nasm
E: Unable to locate package libbz2-dev
E: Package 'libgtk2.0-dev' has no installation candidate
E: Package 'cmake' has no installation candidate
E: Unable to locate package libfluidsynth-dev
E: Unable to locate package libgme-dev
E: Unable to locate package libopenal-dev
E: Unable to locate package timidity
E: Unable to locate package libwildmidi-dev
I think that there is CMake error or some version mismatch error but being new to it, I am unable to resolve it. Any help is appreciated.
Thanks!

installing cgal-swig-bindings with Mac Mojave and brew, after that getting the Error Symbol not found: _PyClass_Type

I try to use cgal-swig-bindings in this way:
i installed cmake 3.17.0 and brew
>>brew install cgal
>>brew install swig
>>cmake -DCGAL_DIR=/usr/local/lib/cmake/CGAL -DBUILD_JAVA=OFF -DPYTHON_LIBRARIES=/usr/local/bin/python3
then I got the following:
cmake -DCGAL_DIR=/usr/local/lib/cmake/CGAL -DBUILD_JAVA=OFF -DPYTHON_LIBRARIES=/usr/local/bin/python3
CMake Warning:
No source or binary directory provided. Both will be assumed to be the
same as the current working directory, but note that this warning will
become a fatal error in future CMake releases.
-- The C compiler identification is AppleClang 10.0.1.10010046
-- The CXX compiler identification is AppleClang 10.0.1.10010046
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Using header-only CGAL
-- Targetting Unix Makefiles
-- Using /Library/Developer/CommandLineTools/usr/bin/c++ compiler.
-- DARWIN_VERSION=18
-- Mac Leopard detected
-- Found GMP: /usr/local/lib/libgmp.dylib
-- Found MPFR: /usr/local/lib/libmpfr.dylib
-- Found Boost: /usr/local/lib/cmake/Boost-1.72.0/BoostConfig.cmake (found suitable version "1.72.0", minimum required is "1.48")
-- Boost include dirs: /usr/local/include
-- Boost libraries:
-- Found ZLIB: /usr/lib/libz.dylib (found version "1.2.11")
-- Found SWIG: /usr/local/bin/swig (found version "4.0.1")
-- Build type:
-- USING CXXFLAGS = ' '
-- USING EXEFLAGS = ' '
-- Requested component: ImageIO
-- Requested component: MPFR
-- Requested component: GMP
-- NOTICE: Intel TBB was not found. Parallelism will be disabled.
-- BUILD_RUBY is set to OFF: no CGAL-bindings for Ruby will be generated.
-- Found PythonInterp: /usr/bin/python (found version "2.7.10")
-- Found PythonLibs: /usr/lib/libpython2.7.dylib (found version "2.7.10")
-- BUILD_JAVA is set to OFF: no CGAL-bindings for Java will be generated.
-- Found Python libs.
-- CGAL-SWIG Python files and libraries will be written in /Users/karinstaring/Documents/cgal-swig-bindings/build-python/CGAL.
-- Now adding packages
-- NOTICE : LAS IO requires LASlib and will not be available.
-- Found Eigen3: /usr/local/include/eigen3 (found suitable version "3.3.7", minimum required is "3.1.0")
CMake Warning at /usr/local/lib/cmake/boost_serialization-1.72.0/libboost_serialization-variant-shared.cmake:64 (message):
Target Boost::serialization already has an imported location
'/usr/local/lib/libboost_serialization-mt.dylib', which will be overwritten
with '/usr/local/lib/libboost_serialization.dylib'
Call Stack (most recent call first):
/usr/local/lib/cmake/boost_serialization-1.72.0/boost_serialization-config.cmake:57 (include)
/usr/local/lib/cmake/Boost-1.72.0/BoostConfig.cmake:120 (find_package)
/usr/local/lib/cmake/Boost-1.72.0/BoostConfig.cmake:185 (boost_find_component)
/Applications/CMake.app/Contents/share/cmake-3.17/Modules/FindBoost.cmake:444 (find_package)
SWIG_CGAL/Classification/CMakeLists.txt:5 (find_package)
CMake Warning at /usr/local/lib/cmake/boost_iostreams-1.72.0/libboost_iostreams-variant-shared.cmake:64 (message):
Target Boost::iostreams already has an imported location
'/usr/local/lib/libboost_iostreams-mt.dylib', which will be overwritten
with '/usr/local/lib/libboost_iostreams.dylib'
Call Stack (most recent call first):
/usr/local/lib/cmake/boost_iostreams-1.72.0/boost_iostreams-config.cmake:57 (include)
/usr/local/lib/cmake/Boost-1.72.0/BoostConfig.cmake:120 (find_package)
/usr/local/lib/cmake/Boost-1.72.0/BoostConfig.cmake:185 (boost_find_component)
/Applications/CMake.app/Contents/share/cmake-3.17/Modules/FindBoost.cmake:444 (find_package)
SWIG_CGAL/Classification/CMakeLists.txt:5 (find_package)
-- Found Boost: /usr/local/lib/cmake/Boost-1.72.0/BoostConfig.cmake (found version "1.72.0") found components: serialization iostreams
-- Found Eigen3: /usr/local/include/eigen3 (found suitable version "3.3.7", minimum required is "3.2.0")
CMake Warning at /usr/local/lib/cmake/CGAL/CGAL_enable_end_of_configuration_hook.cmake:99 (message):
=======================================================================
CGAL performance notice:
The variable CMAKE_BUILD_TYPE is set to "". For performance reasons, you
should set CMAKE_BUILD_TYPE to "Release".
Set CGAL_DO_NOT_WARN_ABOUT_CMAKE_BUILD_TYPE to TRUE if you want to disable
this warning.
=======================================================================
Call Stack (most recent call first):
CMakeLists.txt:9223372036854775807 (CGAL_run_at_the_end_of_configuration)
-- Configuring done
-- Generating done
after this I run in the terminal: >> make
In file included from /usr/include/python2.7/Python.h:94:
/usr/include/python2.7/stringobject.h:173:5: warning: 'register' storage class specifier is deprecated and incompatible with
C++17 [-Wdeprecated-register]
register PyObject *obj, /* string or Unicode object */
^~~~~~~~~
/usr/include/python2.7/stringobject.h:174:5: warning: 'register' storage class specifier is deprecated and incompatible with
C++17 [-Wdeprecated-register]
register char **s, /* pointer to buffer variable */
^~~~~~~~~
/usr/include/python2.7/stringobject.h:175:5: warning: 'register' storage class specifier is deprecated and incompatible with
C++17 [-Wdeprecated-register]
register Py_ssize_t *len /* pointer to length variable or NULL
^~~~~~~~~
after this, I run a test file in python and I get the following error:
Traceback (most recent call last):
File "/.../Documents/cgal-swig-bindings/examples/python/test_aabb.py", line 4, in <module>
from CGAL.CGAL_Kernel import Point_3
File "/.../Documents/cgal-swig-bindings/build-python/CGAL/CGAL_Kernel.py", line 15, in <module>
from . import _CGAL_Kernel
ImportError: dlopen(/.../Documents/cgal-swig-bindings/build-python/CGAL/_CGAL_Kernel.so, 2): Symbol not found: _PyClass_Type
Referenced from: /.../Documents/cgal-swig-bindings/build-python/CGAL/_CGAL_Kernel.so
Expected in: flat namespace
in /.../Documents/cgal-swig-bindings/build-python/CGAL/_CGAL_Kernel.so
I tried the following from Can't compile C program on a Mac after upgrade to Mojave, but it did not help:
>> open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
the same applies when building cgal-swig-bindings in the following way:
git clone https://github.com/cgal/cgal-swig-bindings
cd cgal-swig-bindings
mkdir build/CGAL-5.0_release -p
cd build/CGAL-5.0_release
cmake -DCGAL_DIR=/usr/lib/CGAL -DBUILD_JAVA=OFF -DPYTHON_OUTDIR_PREFIX=../../examples/python ../.
I hope someone knows what the problem is or suggestions which things to check?
I installed python with brew and followed this https://github.com/davisking/dlib/issues/889 and included this
>>>cmake -DCGAL_DIR=/usr/local/lib/cmake/CGAL -DBUILD_JAVA=OFF -DPYTHON_LIBRARIES=/usr/local/lib/python3.7 -DPYTHON_LIBRARY=/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/libpython3.7.dylib -DPython_FRAMEWORKS=/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework -DPYTHON_INCLUDE_DIR=/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Headers
this worked for me!

buildroot opencv3 python package builds for the wrong target?

I am using buildroot tagged 2017.11.2 (building for aarch64). I enable build of python3 library for opencv3 in the buildroot configuration:
BR2_PACKAGE_PYTHON3=y
BR2_PACKAGE_OPENCV3=y
BR2_PACKAGE_OPENCV3_LIB_PYTHON=y
I can see during the build that cmake says:
-- Host: Linux 4.13.0-36-generic x86_64
-- Target: Linux aarch64
-- C++ Compiler: /home/buildroot/output/host/bin/aarch64-linux-gnu-g++ (ver 6.4.1)
But later I see
[100%] Linking CXX shared module ../../lib/python3/cv2.cpython-36m-x86_64-linux-gnu.so
[100%] Built target opencv_python3
I would expect cv2.cpython-36m-x86_64-linux-gnu.so to be named cv2.cpython-36m-aarch64-linux-gnu.so. What can I do to fix this?
It looks like the required distutils environment variables are not set. Can you try setting OPENCV3_CONF_ENV to $(PKG_PYTHON_DISTUTILS_ENV)? If that works, please prepare a patch and send it to the Buildroot mailing list.

Categories