We have to be careful with adding hard-coded version numbers in library names. We have to determine the used Python version and based on this determine the name of the component.apeltauer wrote: ↑Mon Mar 25, 2019 9:57 amsolved this by adding thisBut maybe there is a smarter solution...Code: Select all
set (BOOST_COMPONENTS ${BOOST_COMPONENTS} python37)
Building Libs for Windows Debug Version with VS2017/Qt5.12
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Building Libs for Windows Debug Version with VS2017/Qt5.12
Re: Building Libs for Windows Debug Version with VS2017/Qt5.12
regarding this problem:
Does it really make sense to continue using boost python. In my opinion using pybind11 will simplify the builds a lot because it can be used header only. (This way boost doesn't have a matching python version, which will simplefy the version matrix a lot) Also it has tools to connect numpy to eigen which is (in my opinion) quite important for low-level stuff.set (BOOST_COMPONENTS ${BOOST_COMPONENTS} python37)
Re: Building Libs for Windows Debug Version with VS2017/Qt5.12
Added the cmake files for shiboken2 and pyside2. Now cmake finds this two components with no other adoptionwmayer wrote: ↑Sun Mar 24, 2019 11:40 amActually I don't need these files because it's very easy to create them manually. Inside the Libpack under cmake create the file Shiboken2Config.cmake with this contentand the file PySide2Config.cmake with this content:Code: Select all
SET(SHIBOKEN_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/shiboken2) SET(SHIBOKEN_LIBRARY optimized ${FREECAD_LIBPACK_DIR}/lib/shiboken2.cp37-win_amd64.lib debug ${FREECAD_LIBPACK_DIR}/lib/shiboken2_d_d.cp37-win_amd64.lib)
Code: Select all
SET(PYSIDE_INCLUDE_DIR ${FREECAD_LIBPACK_DIR}/include/PySide2) SET(PYSIDE_LIBRARY optimized ${FREECAD_LIBPACK_DIR}/lib/pyside2.cp37-win_amd64.lib debug ${FREECAD_LIBPACK_DIR}/lib/pyside2_d.cp37-win_amd64_d.lib) SET(PYSIDE_PYTHONPATH ${FREECAD_LIBPACK_DIR}/pyside/Lib/site-packages) SET(PYSIDE_TYPESYSTEMS ${FREECAD_LIBPACK_DIR}/pyside/share/PySide/typesystems)
Re: Building Libs for Windows Debug Version with VS2017/Qt5.12
I have create a new PCL-config.cmake to find the new version 1.9.wmayer wrote: ↑Sun Mar 24, 2019 11:40 am Currently the clbunder has some special handling for the PCL stuff which could be simplified too. Therefore create the file PCLConfig.cmake with (rename that one pcl has generated because it's not easy to use anyway because it messes up our boost handling):Then in the UseLibPackCLbundler.cmake we can writeCode: Select all
link_directories(${FREECAD_LIBPACK_DIR}/lib) set(PCL_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/pcl-1.9) set(PCL_LIBRARY_DIRS ${FREECAD_LIBPACK_DIR}/lib) set(PCL_COMMON_LIBRARIES optimized pcl_common_release debug pcl_common_debug) set(PCL_FEATURES_LIBRARIES optimized pcl_features_release debug pcl_features_debug) set(PCL_FILTERS_LIBRARIES optimized pcl_filters_release debug pcl_filters_debug) set(PCL_IO_LIBRARIES optimized pcl_io_release debug pcl_io_debug) set(PCL_IO_PLY_LIBRARIES optimized pcl_io_ply_release debug pcl_io_ply_debug) set(PCL_KDTREE_LIBRARIES optimized pcl_kdtree_release debug pcl_kdtree_debug) set(PCL_KEYPOINTS_LIBRARIES optimized pcl_keypoints_release debug pcl_keypoints_debug) set(PCL_ML_LIBRARIES optimized pcl_ml_release debug pcl_ml_debug) set(PCL_OCTREE_LIBRARIES optimized pcl_octree_release debug pcl_octree_debug) set(PCL_RECOGNITION_LIBRARIES optimized pcl_recognition_release debug pcl_recognition_debug) set(PCL_REGISTRATION_LIBRARIES optimized pcl_registration_release debug pcl_registration_debug) set(PCL_SAMPLE_CONSENSUS_LIBRARIES optimized pcl_sample_consensus_release debug pcl_sample_consensus_debug) set(PCL_SEARCH_LIBRARIES optimized pcl_search_release debug pcl_search_debug) set(PCL_SEGMENTATION_LIBRARIES optimized pcl_segmentation_release debug pcl_segmentation_debug) set(PCL_STEREO_LIBRARIES optimized pcl_stereo_release debug pcl_stereo_debug) set(PCL_SURFACE_LIBRARIES optimized pcl_surface_release debug pcl_surface_debug) set(PCL_TRACKING_LIBRARIES optimized pcl_tracking_release debug pcl_tracking_debug) set(PCL_LIBRARIES ${PCL_COMMON_LIBRARIES} ${PCL_FEATURES_LIBRARIES} ${PCL_FILTERS_LIBRARIES} ${PCL_IO_LIBRARIES} ${PCL_IO_PLY_LIBRARIES} ${PCL_KDTREE_LIBRARIES} ${PCL_KEYPOINTS_LIBRARIES} ${PCL_ML_LIBRARIES} ${PCL_OCTREE_LIBRARIES} ${PCL_RECOGNITION_LIBRARIES} ${PCL_REGISTRATION_LIBRARIES} ${PCL_SAMPLE_CONSENSUS_LIBRARIES} ${PCL_SEARCH_LIBRARIES} ${PCL_SEGMENTATION_LIBRARIES} ${PCL_STEREO_LIBRARIES} ${PCL_SURFACE_LIBRARIES} ${PCL_TRACKING_LIBRARIES} ) set(PCL_FOUND TRUE) set(PCL_COMMON_FOUND TRUE) set(PCL_FEATURES_FOUND TRUE) set(PCL_FILTERS_FOUND TRUE) set(PCL_IO_FOUND TRUE) set(PCL_IO_PLY_FOUND TRUE) set(PCL_KDTREE_FOUND TRUE) set(PCL_KEYPOINTS_FOUND TRUE) set(PCL_ML_FOUND TRUE) set(PCL_OCTREE_FOUND TRUE) set(PCL_RECOGNITION_FOUND TRUE) set(PCL_REGISTRATION_FOUND TRUE) set(PCL_SAMPLE_CONSENSUS_FOUND TRUE) set(PCL_SEARCH_FOUND TRUE) set(PCL_SEGMENTATION_FOUND TRUE) set(PCL_STEREO_FOUND TRUE) set(PCL_SURFACE_FOUND TRUE) set(PCL_TRACKING_FOUND TRUE)
Code: Select all
find_package(PCL)
In the UseLibPackCLbundler.cmake i have added this line, so the old libpack should also work (with a warning)
Code: Select all
find_package(PCL)
if(NOT EXISTS ${PCL_INCLUDE_DIRS})
set(PCL_INCLUDE_DIRS ${FREECAD_LIBPACK_DIR}/include/pcl-1.7)
set(PCL_LIBRARY_DIRS ${FREECAD_LIBPACK_DIR}/lib)
.....
Re: Building Libs for Windows Debug Version with VS2017/Qt5.12
The question is how long VS2013 should be supported because the minimum version for pybind11 is VS2015. But for the libpack for VS2017 I also vote to use pybind11 instead of boost.python.looo wrote: ↑Mon Mar 25, 2019 11:31 am regarding this problem:
Does it really make sense to continue using boost python. In my opinion using pybind11 will simplify the builds a lot because it can be used header only. (This way boost doesn't have a matching python version, which will simplefy the version matrix a lot) Also it has tools to connect numpy to eigen which is (in my opinion) quite important for low-level stuff.set (BOOST_COMPONENTS ${BOOST_COMPONENTS} python37)
Re: Building Libs for Windows Debug Version with VS2017/Qt5.12
ok, i already have added pybind11 to the new libpack, will try to use it...wmayer wrote: ↑Mon Mar 25, 2019 1:25 pmThe question is how long VS2013 should be supported because the minimum version for pybind11 is VS2015. But for the libpack for VS2017 I also vote to use pybind11 instead of boost.python.looo wrote: ↑Mon Mar 25, 2019 11:31 am regarding this problem:
Does it really make sense to continue using boost python. In my opinion using pybind11 will simplify the builds a lot because it can be used header only. (This way boost doesn't have a matching python version, which will simplefy the version matrix a lot) Also it has tools to connect numpy to eigen which is (in my opinion) quite important for low-level stuff.set (BOOST_COMPONENTS ${BOOST_COMPONENTS} python37)
Re: Building Libs for Windows Debug Version with VS2017/Qt5.12
Can you please attach the pybind11 cmake config file to this thread?
Re: Building Libs for Windows Debug Version with VS2017/Qt5.12
you can find the file in
Code: Select all
share\cmake\pybind11\
- Attachments
-
- pybind11_install.7z
- (108.57 KiB) Downloaded 51 times
Re: Building Libs for Windows Debug Version with VS2017/Qt5.12
To use pybind11 in the libarea project if have to adopt the cmake file with this:
Then pybind is included correctly....
Code: Select all
.....
else()
include_directories(${pybind11_INCLUDE_DIR})
endif(NOT FREECAD_USE_PYBIND11)
Re: Building Libs for Windows Debug Version with VS2017/Qt5.12
So, did setting FREECAD_USE_PYBIND11 pass the cmake configure check? For me it always failed with an error that it cannot find the Python libraries. pybind11Tools.cmake usesapeltauer wrote: ↑Mon Mar 25, 2019 3:58 pm To use pybind11 in the libarea project if have to adopt the cmake file with this:
Then pybind is included correctly....Code: Select all
..... else() include_directories(${pybind11_INCLUDE_DIR}) endif(NOT FREECAD_USE_PYBIND11)
Code: Select all
find_package(PythonLibsNew ${PYBIND11_PYTHON_VERSION} REQUIRED)
Code: Select all
# raise an error if the python libs are still not found.
if(NOT EXISTS "${PYTHON_LIBRARY}")
message(FATAL_ERROR "Python libraries not found")
endif()