Detect alignment when pcl_find_sse is not called & fix detection of Eigen#6261
Conversation
6de63d4 to
0d41f8c
Compare
mvieth
left a comment
There was a problem hiding this comment.
- Please change
check_cxx_source_runstocheck_cxx_source_compilesfor both checks (for reason described in #6255 (comment) ) - There should be an easy way for the user to tell CMake to not perform the two
check_cxx_source_runs/compileschecks. Previously, this was e.g. possible by settingPCL_ENABLE_SSE=OFF. I would suggest to wrap the checks inif(NOT DEFINED HAVE_MM_MALLOC)andif(NOT DEFINED HAVE_POSIX_MEMALIGN), respectively.
…) is not used. This ensures the methods are used when SSE is enabled by setting CMAKE_CXX_FLAGS.
… (e.g. for Eigen3)
|
Done! Before I push, one remark though: the test will be skipped when you run #if defined(MALLOC_ALIGNED)would probably still evaluate to true. |
I am not sure I follow: Line 53 in 27fb1f5 will be replaced by
|
0d41f8c to
6163b2f
Compare
|
You are right, I forgot about |
As discussed on #6255, we are extracting the checks for
posix_memalign()and_mm_malloc()frompcl_find_sse.cmakein order to always test for them. Previously, they were not checked if PCL is compiled with customCMAKE_CXX_FLAGS.The second commit fixes the test that sets
PCL_USES_EIGEN_HANDMADE_ALIGNED_MALLOCfor builds where Eigen is installed in a non-standard location (e.g. Conan, but possibly also Homebrew). The problem is thattry_compiledoes not set include paths and preprocessor definitions unlessCMAKE_TRY_COMPILE_CONFIGURATIONis set (https://gitlab.kitware.com/cmake/cmake/-/issues/22414). This made the test fail at the#include <Eigen/Core>in https://github.com/PointCloudLibrary/pcl/blob/master/CMakeLists.txt#L454.What worked for me is to add