PCL Point-Cloud-Library cmake install error - OpenMP - macos

this is my first post so please be gentle!
I'm getting what appear to be cmake errors when trying to configure an install of pcl 1.7 in OSX 10.8.5. The error which appears 18 times is:
Performing Test OpenMP_FLAG_DETECTED - Failed
and then after the 18 failed searches for OpenMP:
Could NOT find OpenMP (missing: OpenMP_C_FLAGS OpenMP_CXX_FLAGS)
Not found OpenMP
I'm also getting a red error (using cmake GUI) stating:
CMake Error at cmake/Modules/FindEigen.cmake:25 (file):
file Internal CMake error when trying to open file:
/Library/Frameworks/Eigen.framework/Eigen/src/Core/util/Macros.h for
reading.
Call Stack (most recent call first):
CMakeLists.txt:238 (find_package)
But then followed in black by:
Found Eigen: /Library/Frameworks/Eigen.framework
Eigen found (include: /Library/Frameworks/Eigen.framework, version: ..)
so perhaps this isn't the issue (also there are no references to Eigen in the CMakeError.log.
Any help diagnosing or fixing the problem would be greatly appreciated.
Thanks,
Mark

So it seems the OpenMP errors may be able to be resolved by switching the compiler from Clang to g++, though I haven't done this as I'll be OK without OpenMP. The Eigen error (which was what was halting the build) was fixed by uninstalling then reinstalling MacPorts.

Related

CGAL Polyhedron demo (5.0.2) boost problem

I seem to be unable to configure the Polyhedron demo on Cgal 5.0.2.
I am able to make and build everything else so wondered what the problem was? I am faced with this output upon using cmake.
Boost version: 1.65.1
Found the following Boost libraries:
serialization
iostreams
regex
CMake Error at Installation/cmake/modules/CGAL_Boost_iostreams_support.cmake:36 (set_target_properties):
set_target_properties called with incorrect number of arguments.
Call Stack (most recent call first):
Polyhedron/demo/Polyhedron/Plugins/Classification/CMakeLists.txt:9 (include)
I am not well-versed on cmake etc. so apopolgies if there is something I have missed. I have trawled the internet on this to no avail on this so far. Can anyone help?
Thanks
Thanks to sehe for the suggestion. An upgrade from CMAKE 3.10 > 3.17 solved the problem and I was then able to make and build the demo.

Setting up CMake with gfortran in Windows to run CACTUS

My ultimate goal is to run CACTUS. It requires CMake, so I have downloaded both. I think CMake needs a compiler, so I downloaded MinGW (or gfortran or GNU, I'm not really sure the distinction).
Using the MinGW Installation Manager, I've installed mingw32-base, mingw32-gcc-fortran, and also all the MinGW libraries because at one point I thought it would help. I have navigated through
control panel>system>advanced system settings>advanced>environment
variables and in user variables I have added the variables CMake and FC with the values C:\ProgramFiles\CMake\bin and C:\MinGW\bin, respectively.
I also edited the path in system variables to include both of those as well as C:\MinGW\mingw32\bin. I've also downloaded and installed Microsoft Visual Studio 2019 because I read somewhere that it was necessary for gfortran to work, though I have not done anything directly with it so far. At this point, I open Windows command prompt (this is all in Windows 10), navigate to the build folder that I have created in the top CACTUS folder and type
cmake ../
It returns this:
-- Could NOT find BLAS (missing: BLAS_LIBRARIES)
-- LAPACK requires BLAS
-- A library with LAPACK API not found. Please specify library location.
-- Could NOT find OpenMP_Fortran (missing: OpenMP_Fortran_FLAGS OpenMP_Fortran_LIB_NAMES)
CMake Warning (dev) at C:/Program Files/CMake/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:272 (message):
The package name passed to `find_package_handle_standard_args` (OpenMP)
does not match the name of the calling package (OPENMP). This can lead to
problems in calling code that expects `find_package` result variables
(e.g., `_FOUND`) to follow a certain pattern.
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.17/Modules/FindOpenMP.cmake:579 (find_package_handle_standard_args)
CMakeLists.txt:30 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Could NOT find OpenMP (missing: OpenMP_Fortran_FOUND)
CMake Error at CMakeLists.txt:32 (message):
OPENMP option was set to true (default), but no OpenMP was found. Install
OpenMP, or try again with -DOPENMP=OFF. Exiting.
-- Configuring incomplete, errors occurred!
Starting at the top of that error, I did some googling and found these instructions starting at "Build Instructions to create LAPACK and LAPACKE 3.5.0 dlls for Windows with MinGW". I followed those instructions for Win32. After running C:/MinGW/bin/mingw32-make.exe from command prompt, it gets to 36% and errs with the following message:
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../../mingw32/bin/ld.exe: cannot find -lFALSE
collect2.exe: error: ld returned 1 exit status
SRC\CMakeFiles\lapack.dir\build.make:28574: recipe for target 'bin/liblapack.dll' failed
mingw32-make.exe[2]: *** [bin/liblapack.dll] Error 1
CMakeFiles\Makefile2:2077: recipe for target 'SRC/CMakeFiles/lapack.dir/all' failed
mingw32-make.exe[1]: *** [SRC/CMakeFiles/lapack.dir/all] Error 2
Makefile:181: recipe for target 'all' failed
mingw32-make.exe: *** [all] Error 2
I have also tried directions here and here and have either had no luck or, frankly, don't understand them. I am not a programmer. I have lived a life spoiled by GUIs and single install programs with everything included. I don't know what to try anymore. I don't really understand what's wrong or, honestly, why I've taken most of the steps I've taken except that someone in another help forum suggested them. I guarantee that I will have follow up questions to your answers, but please help.
EDIT
As requested below, here is the config file for lapack after cmake:
# Load the LAPACK package with which we were built.
set(LAPACK_DIR "C:/Users/x/Downloads/lapack/lapack-3.9.0/build")
find_package(LAPACK NO_MODULE)
# Load lapack targets from the build tree, including lapacke targets.
if(NOT TARGET lapacke)
include("C:/Users/x/Downloads/lapack/lapack-3.9.0/build/lapack-targets.cmake")
endif()
# Hint for project building against lapack
set(LAPACKE_Fortran_COMPILER_ID ${LAPACK_Fortran_COMPILER_ID})
# Report lapacke header search locations from build tree.
set(LAPACKE_INCLUDE_DIRS "C:/Users/x/Downloads/lapack/lapack-3.9.0/build/include")
# Report lapacke libraries.
set(LAPACKE_LIBRARIES lapacke ${LAPACK_LIBRARIES})
And, yes, I did choose to build the LAPACKE Library in CMake.

Cmake won't find correct version of Boost

I am trying to build some code using cmake. The code uses some Boost libraries. Because of that I try to find Boost in the cmakefile:
find_package(Boost 1.65.1 REQUIRED COMPONENTS unit_test_framework program_options )
I have installed boost version 1.58 via apt (I am using Linux Mint 18.3), so I obviously get the error message when trying to cmake the code:
CMake Error at /usr/share/cmake-3.5/Modules/FindBoost.cmake:1677 (message):
Unable to find the requested Boost libraries.
Boost version: 1.58.0
Boost include path: /usr/include
Detected version of Boost is too old. Requested version was 1.65.1 (or newer).
Call Stack (most recent call first):
CMakeLists.txt:14 (find_package)
-- Configuring incomplete, errors occurred!
So I went on and downloaded Boost 1.65.1 by source and built it the intended way and installed it with the prefix
sudo ./b2 install --prefix=/usr/include
When I try to build the code again, it still gives the exact same error message as before, stating that it didn't find the newer version. I have tried to uninstall version 1.58 and build, but then cmake doesn't find Boost at all.
How can I install Boost in a way, that cmake is able to find it?
Thanks in advance,
cheers!
When changing the version information of Boost in a find_package(Boost) call you need to clear the CMakeCache.txt file. Otherwise the cached information from the previous run is used.

Building vtk with QT5 windows 8

I'm facing a rather weird error. I can see on the wiki that we can build vtk with support for qt5. However, when trying to do so and first configuring with cmake I get the following output:
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.2/Modules/FindQt4.cmake:1326 (message):
Found unsuitable Qt version "5.4.2" from
C:/Qt/5.4/msvc2012_opengl/bin/qmake.exe, this code requires Qt 4.x
Call Stack (most recent call first):
GUISupport/Qt/CMakeLists.txt:71 (find_package)
I have followed previous posts on SO like: How to find qt5 CMake module on windows
or
cmake does not find qt 5.1.1 but they do not solve my problem so far.
I have tried to set CMAKE_PREFIX_PATH to C:/Qt/5.4/msvc2012_opengl/ and QT_QMAKE_EXECUTABLE to C:/Qt/5.4/msvc2012_opengl/bin/qmake.exe
And yet it doesn't work. Does anyone have an explanation for that?
Did you do step 3 and 4 here? : Combining Qt 5.4.1 with vtk 6.2.0 (using CMake GUI 3.2.1) on windows
I'm guessing you didn't change VTK_QT_VERSION to 5

CMake reports 'Boost_DIR-NOT_FOUND' when trying to find Boost

I want to build a library called CSWNet on my machine. Cmake can find Boost_INCLUDE_DIR and Boost_LIB_DIR but it cannot find an option called Boost_DIR which is a directory containing a CMake configuration file for Boost. Where is it? Please help, thanks ahead. The error I got is shown below and I installed boost from ubuntu repository and it's installed in /usr/local.
CMake Error at /usr/local/share/cmake-2.8/Modules/FindBoost.cmake:429 (message):
When requesting a specific version of Boost, you must provide at least the
major and minor version numbers, e.g., 1.34
Call Stack (most recent call first):
demos/CMakeLists.txt:149 (find_package)
It seems you misunderstood the meaning of Boost_DIR.
Boost_DIR is an environment variable used as a hint by CMake to find the boost installation directory. If this is set to Boost_DIR-NOTFOUND that does not mean that it did not find Boost. Boost_FOUND is used to indicate whether the search was successful:
find_package(Boost REQUIRED thread)
if(Boost_FOUND)
message(STATUS "Success!")
endif()
In case of a successful search, CMake will also print a diagnostic message during the configure phase which looks something like
Boost version: 1.53.0
Found the following Boost libraries:
thread
Hope its not too late to post this.
Passing it in the command line along with cmake command would resovle it
cmake -DCMAKE_CXX_COMPILER=g++ -DCMAKE_INSTALL_PREFIX=dist -DBOOST_DIR="boost installation location"

Resources