Skip to content

Commit

Permalink
[SCons] Disable OMP on XCode Clang
Browse files Browse the repository at this point in the history
According to several sources online, XCode does not support OMP. This
disables checking for OMP support when Apple's clang (XCode) is being
used.

In addition, the library associated with GCC is called gomp. This fixes
the CI to run the samples correctly.
  • Loading branch information
bryanwweber committed Dec 10, 2021
1 parent a14c4b3 commit efa3029
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Install Apt dependencies
run: |
sudo apt update
sudo apt install libboost-dev gfortran libopenmpi-dev
sudo apt install libboost-dev gfortran libopenmpi-dev libomp-dev
- name: Upgrade pip
run: python3 -m pip install -U pip setuptools wheel
- name: Install Python dependencies
Expand Down
6 changes: 5 additions & 1 deletion SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -1164,7 +1164,11 @@ else:
env['cxx_stdlib'] = []

env['HAS_CLANG'] = conf.CheckDeclaration('__clang__', '', 'C++')
env['HAS_OPENMP'] = conf.CheckLibWithHeader("omp", "omp.h", language="C++")
if not env["using_apple_clang"]:
env['HAS_OPENMP'] = conf.CheckLibWithHeader("gomp", "omp.h", language="C++")
else:
env["HAS_OPENMP"] = False
logger.info("Not checking for OpenMP support due to using XCode compiler.")

boost_version_source = get_expression_value(['<boost/version.hpp>'], 'BOOST_LIB_VERSION')
retcode, boost_lib_version = conf.TryRun(boost_version_source, '.cpp')
Expand Down

0 comments on commit efa3029

Please sign in to comment.