Python Boost Library #25
-
Hey i'm trying to use your action to build a test project against boost. Using:
but it set boost_python_FOUND to FALSE so package "boost_python" is Is there a flag to configure the boost build to build the python lib too? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 10 replies
-
All libraries except If that doesn't work, I don't have any experience with the boost python libraries, maybe I'll need to configure the binaries differently? |
Beta Was this translation helpful? Give feedback.
-
Hey @MarkusJx thanks for your fast answer. After adjusting my settings cmake now finds the libraries:
Unfortunatly when building my project i do get now a lot of linking issues.
Locally i only tested with shared libraries not with static libraries This is the Action I'm using which unfortunatly failed: |
Beta Was this translation helpful? Give feedback.
-
Apparently, the boost python libraries work in a weird way, so that's good to know. I've tried compiling your project locally and found this stackoverflow answer. So for some reason, when using boost static libraries, you have to define Thus, I present you two options solving your issue:
#define BOOST_PYTHON_STATIC_LIB
#include <boost/python.hpp>
# Use static python libs in CI runs
if(DEFINED ENV{CI})
add_definitions(-DBOOST_PYTHON_STATIC_LIB)
endif() Again, I can't provide shared boost libraries with python due to memory limitations, so these may be the only possible options. Just let me know if this helped and have a nice day :) |
Beta Was this translation helpful? Give feedback.
Apparently, the boost python libraries work in a weird way, so that's good to know.
I've tried compiling your project locally and found this stackoverflow answer. So for some reason, when using boost static libraries, you have to define
BOOST_PYTHON_STATIC_LIB
before includingboost/python.hpp
. So I've added this to your project and it compiles.Thus, I present you two options solving your issue:
BOOST_PYTHON_STATIC_LIB
in yourmyClass.cpp
before includingboost/python.hpp
:CMakeLists.txt
:# …