ndarray / Boost.NumPy

Boost.Python interface for NumPy; now deprecated in factor of the version in Boost.Python itself.
Boost Software License 1.0
151 stars 73 forks source link

Use PythonLibs (cmake) #56

Closed termoshtt closed 8 years ago

termoshtt commented 8 years ago

This project cannot be compiled by cmake in Python3 environment since cmake cannot find the shared library such as libpython3.5m.so. It is caused by libs/numpy/cmake/FindPythonLibsNew.cmake, which was copied from numexpr project: https://github.com/pydata/numexpr/blob/master/FindPythonLibsNew.cmake As argued on the issue https://github.com/pydata/numexpr/issues/102 , this is because the shared library has additional suffix "m". This bug has been fixed in the numexpr project, but it has not been copied yet. Indeed, when I copy it, I can build in Python3 env. And I also confirm that I can build with FindPythonLibs.cmake, which is supplied by the official cmake package. So I propose to use FindPythonLIbs.cmake instead.

I apologize that this PR should be included in the previous one #39 .

dgolden1 commented 8 years ago

:+1: I confirm that this PR fixes cmake build problems that I was having using Anaconda Python 3.5.1 on OS X.

Thank you, @termoshtt !

This is the error I was getting before this PR after running make:

make[2]: *** No rule to make target `/Users/dgolden/anaconda3/lib/libpython3.5.dylib', needed by `lib/libboost_numpy.dylib'.  Stop.
make[1]: *** [libs/numpy/src/CMakeFiles/boost_numpy.dir/all] Error 2
make: *** [all] Error 2