-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mac Compiling issue #1727
Comments
Temporary solution:
Long term solution:
Recent CMake seems to have new ways to handle OpenMP but it was not stable on all the machine I tried. |
Thanks pmoulon, I tried to recompile with the following command, cmake -DCMAKE_BUILD_TYPE=RELEASE -DOpenMVG_USE_OPENMP=OFF -DOpenMVG_BUILD_TESTS=ON -DOpenMVG_BUILD_EXAMPLES=ON . ../openMVG/src/ which disabled OpenMP, and run make install : Scanning dependencies of target openMVG_test_progress Somehow it keeps stuck in openMVG_sample_image_undistort linker error, it seems to me Let me know if you have any suggestion. Thanks. |
For this issue, you can see here for the putative fix #1720 |
I see , after I add "-DOpenMVG_BUILD_GUI_SOFTWARES=OFF" to disable the gui, it works for compiling src code. Thanks a lot ! : ) |
Without OpenMP OpenMVG will be a bit slow, I would advise you to use OpenMVG in a docker to use OpenMVG at its full speed on your Mac |
An alternative to build with openMP is to install a clang compiler with openMP enabled. That's possible using macports (maybe homebrew) and it works fine with openMVG. |
The Apple Clang compiler does support OpenMP. I have a similar issue on macOS 10.15.4. This is IMHO related to header files not being found; not to OpenMP support in the compiler:
|
@virtualritz You should access this line only if
So you could fix your build by using |
I tried:
|
I also tried out commenting our the |
My bad, to forwards the preprocessor to the compiler you need to use https://cmake.org/cmake/help/v3.0/command/add_definitions.html. |
The bottom line is that the macOS build of OpenMVG is broken for users of Apple Clang. Using OpenMVG w/o OpenMP is too slow to be feasible. I'm building darktable with Apple Clang with OpenMP support w/o issues on my machine. Aka: this is not a compiler issue. |
Well, as I said: I commented out that line with the |
There are many issues :
There is no alternative of using a different compiler (aka macports clang) if you want openMP support. If you want to keep apple clang you must agree with it's drawback. |
Sidenote: You can use OpenMVG in a Docker and so still using all the core of your machine to run OpenMVG |
You are mistaken. As I wrote above – I am building darktable (which needs OpenMP) on the same system using Apple Clang. See e.g. here for how to do this. Again. This is not a compiler issue. TLDR; Try this using Apple Clang:
|
Thanks for your suggestion, but it's actually building openMP (using llvm version) to bring support to apple clang. That's exactly the same as macports/homebrew clang version did in a more cleaner way. Since you compile an openMP version that is not exactly the same version as the LLVM backend you may encounter performance degradation (because of some LTO that may not be possible). Strong/deep integration of openMP is always preferable. Even it works, i strongly suggest that you use a clean install of llvm/clang/libomp from the same source/version for maximum performance and compatibility. |
The issue is that there are tons of issues with building stuff when you have the Homebrew (or MacPorts) clang installed next to Apple clang. I've been fighting with them over two years and I do not want to go back there. I'm usually avoiding building stuff with OpenMP on macOS and just switch to Linux but at the moment I'm far from home and stuck with an old MBP that doesn't have the space to install even a VM. |
I agree. We try our best to avoid openMP in openMVG (using std::thread for ex), but it' a tedious task. |
Im with this problem on Mac OS X Catalina. I'm using develop branch: I use the flags: But I had this error: [ 80%] Built target openMVG_sample_pano_spherical_to_cubic This is the first time in years, that I have problem with openMVG compilation. |
[SOLVED] How I need only some of the coomand, i solved the problem ignoring the make errors: make -i Thank you all to show how to solve the other problems! |
@cogitas3d Normally the problem should be solved with this https://github.com/openMVG/openMVG/blob/develop/src/software/SfM/CMakeLists.txt#L154 Can you add |
Compiles and links in develop branch using Xcode 13.3 under macOS Monterey 12.2.1 (march/2022). Likely also builds with XCode 12.5.1 under Big Sur. The problem was that cmake would proceed OK, but there were build errors such as 'omp.h' not found. See Issue openMVG#1727. See also this commit in an unmerged PR for additional fixes that may be needed in other branches: openMVG@b775118
@virtualritz please see PR #1908 for a fix on the |
Hi all,
I tried to follow the steps :
and then I got the following message:
[ 0%] Building HTML documentation with Sphinx
Running Sphinx v2.4.0
WARNING: html_static_path entry '_static' does not exist
loading pickled environment... done
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 0 source files that are out of date
updating environment: 0 added, 0 changed, 0 removed
looking for now-outdated files... none found
no targets are out of date.
build succeeded, 1 warning.
The HTML pages are in htmlDoc.
[ 0%] Built target doc
[ 14%] Built target lib_CoinUtils
[ 17%] Built target lib_Osi
[ 30%] Built target lib_clp
[ 31%] Built target lib_OsiClpSolver
[ 32%] Built target openMVG_stlplus
[ 34%] Built target openMVG_lemon
[ 34%] Built target main_svgSample
[ 35%] Built target openMVG_easyexif
[ 37%] Built target openMVG_fast
[ 37%] Built target openMVG_exif
[ 39%] Built target openMVG_features
[ 40%] Built target openMVG_numeric
[ 41%] Built target openMVG_image
[ 42%] Built target openMVG_linearProgramming
[ 48%] Built target openMVG_multiview
[ 49%] Built target openMVG_lInftyComputerVision
[ 51%] Built target openMVG_geometry
[ 52%] Built target openMVG_matching
[ 53%] Built target openMVG_kvld
[ 54%] Built target openMVG_matching_image_collection
[ 54%] Built target openMVG_multiview_test_data
[ 54%] Built target openMVG_robust_estimation
[ 54%] Built target openMVG_system
[ 60%] Built target openMVG_sfm
[ 60%] Linking CXX executable ../../Darwin-x86_64-RELEASE/openMVG_sample_cameras_undistoBrown
ld: library not found for -lgomp
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [Darwin-x86_64-RELEASE/openMVG_sample_cameras_undistoBrown] Error 1
make[1]: *** [openMVG_Samples/cameras_undisto_Brown/CMakeFiles/openMVG_sample_cameras_undistoBrown.dir/all] Error 2
make: *** [all] Error 2
It seems the linker cannot find the target, could anyone instruct me how to modify the CmakeList.txt to solve this problem?
Thanks.
The text was updated successfully, but these errors were encountered: