Skip to content

Commit

Permalink
more macos debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
chistopher committed Dec 4, 2023
1 parent d0e26e1 commit 2d9b121
Showing 1 changed file with 21 additions and 24 deletions.
45 changes: 21 additions & 24 deletions source/girgs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,27 @@
#

# find_package(THIRDPARTY REQUIRED)
find_package(OpenMP REQUIRED)

# # FindOpenMP.cmake does not reliably find a user installed openmp library for clang/llvm on
# # both Linux- and macOS-systems (even for CMake Version >= 3.12). The following section
# # manually sets the required fields for clang-like compiler.
# if(NOT OpenMP_FOUND)
# if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
# message(STATUS "try appleclang fallback")
# # This will find default libomp-installations for homebrew/MacPorts
# find_library(LIBOMP_PATH NAMES omp PATHS "/usr/local/opt/libomp/lib" "/opt/local/lib/libomp" "/opt/homebrew/opt/libomp/lib")
# find_path(LIBOMP_INCLUDE NAMES omp.h PATHS "/usr/local/opt/libomp/include" "/opt/local/include/libomp" "/opt/homebrew/opt/libomp/include")
# message(STATUS "{LIBOMP_PATH}")
# message(STATUS "{LIBOMP_INCLUDE}")
# if(LIBOMP_PATH AND LIBOMP_INCLUDE)
# set(OpenMP_CXX_FLAGS "-Xpreprocessor -fopenmp -I${LIBOMP_INCLUDE}" CACHE STRING "Manually set" FORCE)
# set(OpenMP_CXX_LIB_NAMES "omp" CACHE STRING "Manually set" FORCE)
# set(OpenMP_omp_LIBRARY "${LIBOMP_PATH}" CACHE STRING "Manually set" FORCE)
# endif()
# endif()

# # After setting basic OpenMP-folders, run find_package again to set everything. Also acts as a final sanity check.
# find_package(OpenMP REQUIRED)
# message(STATUS "OMP lib found manually after CMake module failed")
# endif()
find_package(OpenMP)

# FindOpenMP.cmake does not reliably find a user installed openmp library for clang/llvm on
# both Linux- and macOS-systems (even for CMake Version >= 3.12). The following section
# manually sets the required fields for clang-like compiler.
if(NOT OpenMP_FOUND)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
# This will find default libomp-installations for homebrew/MacPorts
find_library(LIBOMP_PATH NAMES omp PATHS "/usr/local/opt/libomp/lib" "/opt/local/lib/libomp" "/opt/homebrew/opt/libomp/lib")
find_path(LIBOMP_INCLUDE NAMES omp.h PATHS "/usr/local/opt/libomp/include" "/opt/local/include/libomp" "/opt/homebrew/opt/libomp/include")
if(LIBOMP_PATH AND LIBOMP_INCLUDE)
set(OpenMP_CXX_FLAGS "-Xpreprocessor -fopenmp -I${LIBOMP_INCLUDE}" CACHE STRING "Manually set" FORCE)
set(OpenMP_CXX_LIB_NAMES "omp" CACHE STRING "Manually set" FORCE)
set(OpenMP_omp_LIBRARY "${LIBOMP_PATH}" CACHE STRING "Manually set" FORCE)
endif()
endif()

# After setting basic OpenMP-folders, run find_package again to set everything. Also acts as a final sanity check.
find_package(OpenMP REQUIRED)
message(STATUS "OMP lib found manually after CMake module failed")
endif()


#
Expand Down

0 comments on commit 2d9b121

Please sign in to comment.