Do not link against libpython when building python bindings

Summary:
our cmake build used to link against libpython.so with its absolute path (instead of -LSOME_LIB_PATH -lpython), so at runtime loader will think it needs the libpython.so at that specific path, and so load in an additional libpython.so, which causes the python binding built with one python installation not reusable by another (maybe on same machine or sometimes even not on same machine). The solution is quite simple, which is we don't link against libpython, leave all the python related symbols unresolved at build time, they will be resolved at runtime when imported into python.
Closes https://github.com/caffe2/caffe2/pull/1514

Reviewed By: dzhulgakov

Differential Revision: D6412405

Pulled By: bddppq

fbshipit-source-id: 9ff5b752ae3806bfac94085942f82d89c304c887
2 files changed
tree: b0c86c264864fa4843ad500752d348b1506f99eb
  1. .jenkins/
  2. .travis/
  3. caffe/
  4. caffe2/
  5. cmake/
  6. conda/
  7. docker/
  8. docs/
  9. modules/
  10. scripts/
  11. third_party/
  12. .Doxyfile
  13. .Doxyfile-c
  14. .Doxyfile-python
  15. .gitattributes
  16. .gitignore
  17. .gitmodules
  18. .travis.yml
  19. appveyor.yml
  20. CMakeLists.txt
  21. LICENSE
  22. Makefile
  23. NOTICE
  24. README.md
  25. release-notes.md
  26. setup.py
  27. VERSION_NUMBER
README.md

Caffe2

License TravisCI Build Status Appveyor Build Status

Caffe2 is a lightweight, modular, and scalable deep learning framework. Building on the original Caffe, Caffe2 is designed with expression, speed, and modularity in mind.

News and Events

Caffe2 research award competition request for proposals

Questions and Feedback

Please use Github issues (https://github.com/caffe2/caffe2/issues) to ask questions, report bugs, and request new features.

Please participate in our survey (https://www.surveymonkey.com/r/caffe2). We will send you information about new releases and special developer events/webinars.

License

Caffe2 is released under the Apache 2.0 license. See the NOTICE file for details.

Further Resources on Caffe2.ai