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 6c8cb21 commit d0e26e1
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 34 deletions.
24 changes: 15 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform.
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml
name: CMake on multiple platforms

on:
Expand All @@ -17,21 +15,29 @@ jobs:
fail-fast: false

matrix:

# matrix of runs
environment: [ubuntu-gcc, ubuntu-clang, macos-apple, windows-msvc]
build_type: [Release, Debug]
cpp_compiler: [cl, g++, clang++, c++]

# describe os and compiler per environment
include:
- os: windows-latest
c_compiler: cl
cpp_compiler: cl
- os: ubuntu-latest
- environment: ubuntu-gcc
os: ubuntu-latest
c_compiler: gcc
cpp_compiler: g++
- os: ubuntu-latest
- environment: ubuntu-clang
os: ubuntu-latest
c_compiler: clang
cpp_compiler: clang++
- os: macos-latest
- environment: macos-apple
os: macos-latest
c_compiler: cc
cpp_compiler: c++
- environment: windows-msvc
os: windows-latest
c_compiler: cl
cpp_compiler: cl

steps:
- uses: actions/checkout@v3
Expand Down
48 changes: 24 additions & 24 deletions source/girgs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,30 @@
#

# find_package(THIRDPARTY REQUIRED)
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")
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 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()


#
Expand Down
2 changes: 1 addition & 1 deletion source/tests/girgs-test/Generator_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ TEST_F(Generator_test, testEstimation)
observed_avg /= runs;

// test the goodness of the estimation for weight scaling
EXPECT_LT(abs(desired_avg - observed_avg)/desired_avg, 0.05) << "estimated constant does not produce desired average degree";
EXPECT_LT(abs(desired_avg - observed_avg)/desired_avg, 0.08) << "estimated constant does not produce desired average degree";
}
}
}
Expand Down

0 comments on commit d0e26e1

Please sign in to comment.