question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Build error: OpenMP_libomp_LIBRARY on MacOs

See original GitHub issue

Not sure, if this dependency is optional? If so, how to force Cmake to ignore the error?

-- Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES) 
-- Could NOT find OpenMP_CXX (missing: OpenMP_CXX_FLAGS OpenMP_CXX_LIB_NAMES) 
-- Could NOT find OpenMP (missing: OpenMP_C_FOUND OpenMP_CXX_FOUND) 
-- Found AMD library: /opt/local/lib/libamd.dylib
-- Found AMD header in: /opt/local/include
-- Found CAMD library: /opt/local/lib/libcamd.dylib
-- Found CAMD header in: /opt/local/include
-- Found COLAMD library: /opt/local/lib/libcolamd.dylib
-- Found COLAMD header in: /opt/local/include
-- Found CCOLAMD library: /opt/local/lib/libccolamd.dylib
-- Found CCOLAMD header in: /opt/local/include
-- Found CHOLMOD library: /opt/local/lib/libcholmod.dylib
-- Found CHOLMOD header in: /opt/local/include
-- Found CXSPARSE library: /opt/local/lib/libcxsparse.dylib
-- Found SuiteSparseQR library: /opt/local/lib/libspqr.dylib
-- Found SuiteSparseQR header in: /opt/local/include
-- Did not find Intel TBB library, assuming SuiteSparseQR was not compiled with TBB.
-- Found SuiteSparse_config library: /opt/local/lib/libsuitesparseconfig.dylib
-- Found SuiteSparse_config header in: /opt/local/include
-- Found METIS library: /opt/local/lib/libmetis.dylib.
CMake Warning (dev) at /opt/local/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:424 (message):
  The package name passed to `find_package_handle_standard_args` (ceres) does
  not match the name of the calling package (Ceres).  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):
  cmake/FindCeres.cmake:49 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:38 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- No preference for use of exported gflags CMake configuration set, and no hints for include/library directories provided. Defaulting to preferring an installed/exported gflags CMake configuration if available.
-- Found installed version of gflags: /opt/local/lib/cmake/gflags
-- Detected gflags version: 2.2.2
-- Found OpenCV: /opt/local (found version "3.4.12") 
-- Found OpenCV: /opt/local (found version "3.4.12") found components: core imgproc calib3d imgcodecs 
-- pybind11 v2.2.4
-- Configuring done
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
OpenMP_libomp_LIBRARY (ADVANCED)
    linked by target "foundation" in directory .../Source/OpenSfM/opensfm/src/foundation

-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.
Traceback (most recent call last):
  File "setup.py", line 36, in <module>
    configure_c_extension()
  File "setup.py", line 27, in configure_c_extension
    subprocess.check_call(cmake_command, cwd='cmake_build')
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '../opensfm/src', '-DPYTHON_EXECUTABLE=.../.virtualenvs/proto-sfm/bin/python']' returned non-zero exit status 1.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
zhengminxucommented, Jan 27, 2021

I faced the same problem, and after I installed libomp via homebrew, the CMake error was gone and the build went successfully.

1reaction
fabianschenkcommented, Dec 16, 2020

In OpenSfM/opensfm/src/CMakeLists.txt, I commented:

# find_package(OpenMP)

Then I deleted the cmake_build folder and rebuilt. You can also install cmake tool on Mac and check if any of the OpenMP variables for libraries and includes are set.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Enable OpenMP support in clang in Mac OS X (sierra & Mojave)
Try using Homebrew's llvm: brew install llvm. You then have all the llvm binaries in /usr/local/opt/llvm/bin . Compile the OpenMP Hello ...
Read more >
OpenMP on macOS with Xcode tools
The unfortunate part about this is that Apple is not shipping the necesssary libomp.dylib run-time library needed for OpenMP support.
Read more >
LightGBM is incompatible with libomp 12 and 13 on macOS
LightGBM cannot be used to fit multiple models in parallel using threads with the latest libomp. On 2014 MacBook Pro: OMP: Error #13:...
Read more >
Enable OpenMP on macOS For Building scikit-learn - OpenBox
Below we present a solution to this issue: install libomp with Homebrew to extend the default Apple clang compiler. Please note that if...
Read more >
Install OpenMP Library on macOS Platform - MathWorks
Download the OpenMP source. Compile the source and install. Install libomp by using homebrew. At the terminal, run this command.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found