Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,17 @@ find_package(NumPy REQUIRED)
# set(Boost_USE_STATIC_LIBS ON)
# set(Boost_USE_MULTITHREADED ON)
# set(Boost_USE_STATIC_RUNTIME ON)
FIND_PACKAGE(Boost COMPONENTS python REQUIRED)
if(${PYTHON_VERSION_STRING} GREATER 3.0)
message(STATUS "Use Python3")
find_package(Boost COMPONENTS python3 REQUIRED)
else()
message(STATUS "Use Python2")
find_package(Boost COMPONENTS python REQUIRED)
endif()

message( STATUS "found boost:"
"\nINCLUDE: ${Boost_INCLUDE_DIRS}"
"\nLIB: ${Boost_LIBRARIES}"
)
message( STATUS "Paths of Boost:")
message( STATUS "Include : " ${Boost_INCLUDE_DIRS})
message( STATUS "Libraries: " ${Boost_LIBRARIES})

# add_definitions( -DBOOST_ALL_NO_LIB )
# In some cases, you may need to explicitly specify that a dynamic Boost is used; if so use:
Expand Down
7 changes: 5 additions & 2 deletions libs/numpy/example/wrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,11 @@ BOOST_PYTHON_MODULE(example) {
int main(int argc, char **argv)
{
// This line makes our module available to the embedded Python intepreter.
PyImport_AppendInittab("example", &initexample);

# if PY_VERSION_HEX >= 0x03000000
PyImport_AppendInittab("example", &PyInit_example);
# else
PyImport_AppendInittab("example", &initexample);
# endif
// Initialize the Python runtime.
Py_Initialize();

Expand Down