Guest User

Untitled

a guest
Oct 16th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.62 KB | None | 0 0
  1. bootstrap
  2. b2 -j12 --stagedir=libx64 architecture=x86 address-model=64 --with-python --build-type=complete stage
  3.  
  4. cmake_minimum_required(VERSION 3.13)
  5. project(pylibtest)
  6.  
  7. set(CMAKE_CXX_STANDARD 17)
  8.  
  9. set(GCC_COVERAGE_COMPILE_FLAGS "-march=native -O2 -m64 -D_hypot=hypot -Wall")
  10. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS}" )
  11.  
  12. message(STATUS "start running cmake...")
  13.  
  14. set(Boost_USE_MULTITHREADED ON)
  15. find_package(Boost 1.68.0)# COMPONENTS system filesystem REQUIRED)
  16. if(Boost_FOUND)
  17. message(STATUS "Boost_INCLUDE_DIRS: ${Boost_INCLUDE_DIRS}")
  18. set(Boost_LIBRARY_DIR "${Boost_Path}/lib/x64/lib")
  19. message(STATUS "Boost_LIBRARIES: ${Boost_LIBRARY_DIR}")
  20. message(STATUS "Boost_VERSION: ${Boost_VERSION}")
  21. include_directories(${Boost_INCLUDE_DIRS})
  22. link_directories(${Boost_LIBRARIES})
  23. endif()
  24.  
  25. find_package(PythonInterp 3.7 REQUIRED)
  26. find_package(PythonLibs 3.7 REQUIRED)
  27. if(PYTHONLIBS_FOUND)
  28. message(STATUS "PYTHON_LIBRARIES = ${PYTHON_LIBRARIES}")
  29. message(STATUS "PYTHON_EXECUTABLE = ${PYTHON_EXECUTABLE}")
  30. message(STATUS "PYTHON_INCLUDE_DIRS = ${PYTHON_INCLUDE_DIRS}")
  31. include_directories(${PYTHON_INCLUDE_DIRS})
  32. link_directories(${PYTHON_LIBRARIES})
  33. endif()
  34.  
  35. add_library(pylibtest SHARED library.cpp library.h)
  36.  
  37. if(Boost_FOUND AND PYTHONLIBS_FOUND)
  38. target_include_directories(pylibtest SYSTEM PRIVATE ${Boost_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS})
  39. target_link_libraries(pylibtest ${Boost_LIBRARIES} ${PYTHON_LIBRARIES})
  40. endif()
  41.  
  42. #include "library.h"
  43. #include <iostream>
  44.  
  45. void hello() {
  46. std::cout << "Hello, World!" << std::endl;
  47. }
  48.  
  49. #include "library.h"
  50. #include <boost/python.hpp>
  51.  
  52. BOOST_PYTHON_MODULE(hello_ext)
  53. {
  54. using namespace boost::python;
  55. def("hello", hello);
  56. }
  57.  
  58. "C:Program FilesCMakebincmake.exe" --build "C:ESI CloudProgTestpylibtestcmake-build-debug" --target pylibtest -- -j 6
  59. Scanning dependencies of target pylibtest
  60. [ 50%] Building CXX object CMakeFiles/pylibtest.dir/library.cpp.obj
  61. [100%] Linking CXX shared library libpylibtest.dll
  62. 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'
  63. 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_'
  64. CMakeFilespylibtest.dir/objects.a(library.cpp.obj): In function `PyInit_hello_ext':
  65. C:/ESI Cloud/Prog/Test/pylibtest/library.cpp:13: undefined reference to `__imp__ZN5boost6python6detail11init_moduleER11PyModuleDefPFvvE'
  66. 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'
  67. CMakeFilespylibtest.dir/objects.a(library.cpp.obj): In function `boost::python::converter::expected_pytype_for_arg<void>::get_pytype()':
  68. C:/PROGRA~1/boost/BOOST_~1/boost/python/converter/pytype_function.hpp:67: undefined reference to `__imp__ZN5boost6python9converter8registry5queryENS0_9type_infoE'
  69. C:/PROGRA~1/boost/BOOST_~1/boost/python/converter/pytype_function.hpp:70: undefined reference to `__imp__ZNK5boost6python9converter12registration25expected_from_python_typeEv'
  70. 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()':
  71. C:/PROGRA~1/boost/BOOST_~1/boost/python/object/py_function.hpp:30: undefined reference to `__imp__ZN5boost6python7objects21py_function_impl_baseD2Ev'
  72. 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'
  73. 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'
  74. collect2.exe: error: ld returned 1 exit status
  75. mingw32-make.exe[3]: *** [CMakeFilespylibtest.dirbuild.make:87: libpylibtest.dll] Error 1
  76. mingw32-make.exe[2]: *** [CMakeFilesMakefile2:72: CMakeFiles/pylibtest.dir/all] Error 2
  77. mingw32-make.exe[1]: *** [CMakeFilesMakefile2:84: CMakeFiles/pylibtest.dir/rule] Error 2
  78. mingw32-make.exe: *** [Makefile:117: pylibtest] Error 2
Add Comment
Please, Sign In to add comment