Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bootstrap
- b2 -j12 --stagedir=libx64 architecture=x86 address-model=64 --with-python --build-type=complete stage
- cmake_minimum_required(VERSION 3.13)
- project(pylibtest)
- set(CMAKE_CXX_STANDARD 17)
- set(GCC_COVERAGE_COMPILE_FLAGS "-march=native -O2 -m64 -D_hypot=hypot -Wall")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS}" )
- message(STATUS "start running cmake...")
- set(Boost_USE_MULTITHREADED ON)
- find_package(Boost 1.68.0)# COMPONENTS system filesystem REQUIRED)
- if(Boost_FOUND)
- message(STATUS "Boost_INCLUDE_DIRS: ${Boost_INCLUDE_DIRS}")
- set(Boost_LIBRARY_DIR "${Boost_Path}/lib/x64/lib")
- message(STATUS "Boost_LIBRARIES: ${Boost_LIBRARY_DIR}")
- message(STATUS "Boost_VERSION: ${Boost_VERSION}")
- include_directories(${Boost_INCLUDE_DIRS})
- link_directories(${Boost_LIBRARIES})
- endif()
- find_package(PythonInterp 3.7 REQUIRED)
- find_package(PythonLibs 3.7 REQUIRED)
- if(PYTHONLIBS_FOUND)
- message(STATUS "PYTHON_LIBRARIES = ${PYTHON_LIBRARIES}")
- message(STATUS "PYTHON_EXECUTABLE = ${PYTHON_EXECUTABLE}")
- message(STATUS "PYTHON_INCLUDE_DIRS = ${PYTHON_INCLUDE_DIRS}")
- include_directories(${PYTHON_INCLUDE_DIRS})
- link_directories(${PYTHON_LIBRARIES})
- endif()
- add_library(pylibtest SHARED library.cpp library.h)
- if(Boost_FOUND AND PYTHONLIBS_FOUND)
- target_include_directories(pylibtest SYSTEM PRIVATE ${Boost_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS})
- target_link_libraries(pylibtest ${Boost_LIBRARIES} ${PYTHON_LIBRARIES})
- endif()
- #include "library.h"
- #include <iostream>
- void hello() {
- std::cout << "Hello, World!" << std::endl;
- }
- #include "library.h"
- #include <boost/python.hpp>
- BOOST_PYTHON_MODULE(hello_ext)
- {
- using namespace boost::python;
- def("hello", hello);
- }
- "C:Program FilesCMakebincmake.exe" --build "C:ESI CloudProgTestpylibtestcmake-build-debug" --target pylibtest -- -j 6
- Scanning dependencies of target pylibtest
- [ 50%] Building CXX object CMakeFiles/pylibtest.dir/library.cpp.obj
- [100%] Linking CXX shared library libpylibtest.dll
- CMakeFilespylibtest.dir/objects.a(library.cpp.obj):C:/PROGRA~1/boost/BOOST_~1/boost/python/make_function.hpp:38: undefined reference to `__imp__ZN5boost6python7objects15function_objectERKNS1_11py_functionE'
- CMakeFilespylibtest.dir/objects.a(library.cpp.obj):C:/PROGRA~1/boost/BOOST_~1/boost/python/def.hpp:91: undefined reference to `__imp__ZN5boost6python6detail17scope_setattr_docEPKcRKNS0_3api6objectES3_'
- CMakeFilespylibtest.dir/objects.a(library.cpp.obj): In function `PyInit_hello_ext':
- C:/ESI Cloud/Prog/Test/pylibtest/library.cpp:13: undefined reference to `__imp__ZN5boost6python6detail11init_moduleER11PyModuleDefPFvvE'
- CMakeFilespylibtest.dir/objects.a(library.cpp.obj):C:/PROGRA~1/boost/BOOST_~1/boost/python/type_id.hpp:160: undefined reference to `__imp__ZN5boost6python6detail12gcc_demangleEPKc'
- CMakeFilespylibtest.dir/objects.a(library.cpp.obj): In function `boost::python::converter::expected_pytype_for_arg<void>::get_pytype()':
- C:/PROGRA~1/boost/BOOST_~1/boost/python/converter/pytype_function.hpp:67: undefined reference to `__imp__ZN5boost6python9converter8registry5queryENS0_9type_infoE'
- C:/PROGRA~1/boost/BOOST_~1/boost/python/converter/pytype_function.hpp:70: undefined reference to `__imp__ZNK5boost6python9converter12registration25expected_from_python_typeEv'
- CMakeFilespylibtest.dir/objects.a(library.cpp.obj): In function `boost::python::objects::caller_py_function_impl<boost::python::detail::caller<void (*)(), boost::python::default_call_policies, boost::mpl::vector1<void> > >::~caller_py_function_impl()':
- C:/PROGRA~1/boost/BOOST_~1/boost/python/object/py_function.hpp:30: undefined reference to `__imp__ZN5boost6python7objects21py_function_impl_baseD2Ev'
- CMakeFilespylibtest.dir/objects.a(library.cpp.obj):C:/PROGRA~1/boost/BOOST_~1/boost/python/object/py_function.hpp:30: undefined reference to `__imp__ZN5boost6python7objects21py_function_impl_baseD2Ev'
- CMakeFilespylibtest.dir/objects.a(library.cpp.obj):library.cpp:(.rdata$_ZTVN5boost6python7objects23caller_py_function_implINS0_6detail6callerIPFvvENS0_21default_call_policiesENS_3mpl7vector1IvEEEEEE[_ZTVN5boost6python7objects23caller_py_function_implINS0_6detail6callerIPFvvENS0_21default_call_policiesENS_3mpl7vector1IvEEEEEE]+0x30): undefined reference to `boost::python::objects::py_function_impl_base::max_arity() const'
- collect2.exe: error: ld returned 1 exit status
- mingw32-make.exe[3]: *** [CMakeFilespylibtest.dirbuild.make:87: libpylibtest.dll] Error 1
- mingw32-make.exe[2]: *** [CMakeFilesMakefile2:72: CMakeFiles/pylibtest.dir/all] Error 2
- mingw32-make.exe[1]: *** [CMakeFilesMakefile2:84: CMakeFiles/pylibtest.dir/rule] Error 2
- mingw32-make.exe: *** [Makefile:117: pylibtest] Error 2
Add Comment
Please, Sign In to add comment