How do I tell Make where to find "omp.h" when compiling openMVG in MacOS? [closed]
Asked Answered
E

0

6

I'm trying to build openMVG on my MacBook running Catalina. When I run "make" I get an error that it can't find 'omp.h'.

jaireaux@Johns-MBP ~/Downloads/software/openMVG/build % make
[  9%] Built target lib_CoinUtils
[ 12%] Built target lib_Osi
[ 21%] Built target lib_clp
[ 21%] Built target lib_OsiClpSolver
[ 22%] Built target openMVG_stlplus
[ 24%] Built target openMVG_lemon
[ 24%] Built target main_svgSample
[ 33%] Built target openMVG_cxsparse
[ 55%] Built target openMVG_ceres
[ 56%] Built target openMVG_easyexif
[ 57%] Built target openMVG_fast
[ 57%] Built target openMVG_exif
[ 57%] Building CXX object openMVG/features/CMakeFiles/openMVG_features.dir/akaze/AKAZE.cpp.o
In file included from /Users/jaireaux/Downloads/software/openMVG/src/openMVG/features/akaze/AKAZE.cpp:9:
In file included from /Users/jaireaux/Downloads/software/openMVG/src/openMVG/features/akaze/AKAZE.hpp:39:
In file included from /Users/jaireaux/Downloads/software/openMVG/src/openMVG/image/image_container.hpp:12:
In file included from /Users/jaireaux/Downloads/software/openMVG/src/third_party/eigen/Eigen/Dense:1:
/Users/jaireaux/Downloads/software/openMVG/src/third_party/eigen/Eigen/Core:247:10: fatal error: 'omp.h' file not found
#include <omp.h>
         ^~~~~~~
1 error generated.
make[2]: *** [openMVG/features/CMakeFiles/openMVG_features.dir/akaze/AKAZE.cpp.o] Error 1
make[1]: *** [openMVG/features/CMakeFiles/openMVG_features.dir/all] Error 2
make: *** [all] Error 2

How do I tell make where to find 'omp.h' (which is in /usr/local/include.)

Expenditure answered 12/7, 2020 at 4:1 Comment(6)
You need to tell the build system to add -I/usr/local/include to the compiler options.Fritts
@HristoIliev I have it in CFLAGS (echo $CFLAGS; -I/usr/local/include;) and I've run it with Make (make -I/usr/local/include) and I get the same output.Expenditure
That’s C++. You most likely need to set CXXFLAGS.Fritts
I tried that and have the same result. I also tried setting CPPFLAGS with no luck.Expenditure
You appear to have a CMake project, so you should never fiddle with the generated Makefiles. Did you follow github.com/openMVG/openMVG/blob/develop/BUILD.md? Did you search the known issues or file a new issue on that project? If you want help here, reduce your problem to a minimal reproducible example and post the source, the CMakeLists.txt and the commands you executed to reproduce the error.Groark
I am unable to replicate this error (same platform as you) when following the instructions that @Groark mentioned. Make sure you are building using Cmake, and editing only the Cmakelists.txt if needed, and not the generated makefiles. See lines 28 and 124-147 of this file: github.com/openMVG/openMVG/blob/…Comstockery

© 2022 - 2024 — McMap. All rights reserved.