You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I suspect that this might be a bug introduced after the commit 3d30510 (PR #2059).
The environment with which I've tested is: Mac OS X 10.10. I haven't tested with Ubuntu, since I don't have any Linux machine with matlab installed as of now.
$ cd build
$ cmake .. -DBUILD_matlab=ON && make -j4
However, building matcaffe fails with the message ld: library not found for -lpython2.
[100%] Building Matlab interface: ${CAFFE_ROOT}/matlab/caffe/caffe.mexmaci64
Building with 'Xcode Clang++'.
ld: library not found for -lpython2
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Let's see the command line argument passed (absolute paths were replaced by ${CAFFE_ROOT}).
There are python-related link flags, -lpython2 and -lboost_python-mt, which were added from ${PYTHON_LIBRARIES}
The reason why ld fails might be that the ordering of link flags (-L and -l) has changed in the internal invocation, and thus it was not able to link the python2 dynamic module.
This build step with cmake, succeeds prior to 3d30510.
As I am doubtful these flags (e.g. -lpython) are necessary to build matlab targets, these flags could be removed when building matlab bindings so that the build could be successful out-of-box. Currently, I tried a workaround setting BUILD_python_layer to OFF, but after inspection to find better solution, I think I could submit a PR to fix this. Thanks.
The text was updated successfully, but these errors were encountered:
I am experiencing the same issue (but on Scientific Linux 6.6 with the g++ compiler). From what I can tell, the issue is that the compilation line is using -lpython2 instead of the actual Python version, such as -lpython2.7
The flag -lpython2 tells the linker to look for a library file named libpython2.so. As far as I can tell, no version of Python has shipped such a file for ages.
It's possible to work around this by manually changing that flag to -lpython2.7. You can also create a symlink from libpython2.so to libpython2.7.so (although that's a nasty hack).
Because python doesn't need to be linked here, the cleanest would be to remove the -lpython2 from the Matlab build line. I'm submitting a pull request with the change.
Just for completeness, this answer (http://stackoverflow.com/a/35286218/424986) solves the problem of missing lbypthon2 library with Matlab by updating the CMake rules.
Hello, I suspect that this might be a bug introduced after the commit 3d30510 (PR #2059).
The environment with which I've tested is: Mac OS X 10.10. I haven't tested with Ubuntu, since I don't have any Linux machine with matlab installed as of now.
However, building matcaffe fails with the message
ld: library not found for -lpython2
.Let's see the command line argument passed (absolute paths were replaced by
${CAFFE_ROOT}
).There are python-related link flags,
-lpython2
and-lboost_python-mt
, which were added from${PYTHON_LIBRARIES}
The reason why
ld
fails might be that the ordering of link flags (-L
and-l
) has changed in the internal invocation, and thus it was not able to link thepython2
dynamic module.This build step with cmake, succeeds prior to 3d30510.
As I am doubtful these flags (e.g.
-lpython
) are necessary to build matlab targets, these flags could be removed when building matlab bindings so that the build could be successful out-of-box. Currently, I tried a workaround settingBUILD_python_layer
toOFF
, but after inspection to find better solution, I think I could submit a PR to fix this. Thanks.The text was updated successfully, but these errors were encountered: