File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 1
1
option (USE_OpenMP "Use OpenMP" ON )
2
2
3
+ # We don't want GOMP because its performance sinks for large core count, so we force libomp
4
+ # This finds the library path from the system's clang for OpenMP
5
+ #
6
+ # On Fedora, it's at the same place as others, so we don't need to look elsewhere
7
+ # On Ubuntu, it's in /usr/lib/llvm-${version}, so find_package finds GOMP for GCC instead.
8
+ execute_process (
9
+ COMMAND bash -c "for lib in $(clang -lomp -### 2>&1); do echo $lib | grep -o \"\\ /.*llvm.*\\ w\" ; done"
10
+ OUTPUT_VARIABLE LLVM_OMP_PATH
11
+ )
12
+ # Only if we found an "llvm" path that we need to add
13
+ if (LLVM_OMP_PATH)
14
+ set (CMAKE_PREFIX_PATH ${LLVM_OMP_PATH} )
15
+ endif ()
16
+
3
17
if (USE_OpenMP)
4
18
find_package (OpenMP)
5
19
if (OPENMP_FOUND)
You can’t perform that action at this time.
0 commit comments