Skip to content

Commit

Permalink
Merge branch 'fix_gcc_toolchain_under_spack' into 'develop'
Browse files Browse the repository at this point in the history
Fix compiler flag logic for XL gcc-toolchain used with spack.

See merge request draco/draco!302
  • Loading branch information
keadyk committed Aug 24, 2023
2 parents 5bcea7b + 522d7d4 commit 7161baf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion config/unix-cuda.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ if(NOT CUDA_FLAGS_INITIALIZED)
file(READ /etc/redhat-release rhr)
string(REGEX REPLACE "[^0-9]*([0-9]+).([0-9]+).*" "\\1.\\2" redhat_version "${rhr}")
# If manually specified (eg. spack), do not add the --gcc-toolchain option
if(NOT (CMAKE_CUDA_FLAGS MATCHES "--gcc-toolchain=" OR ENV{SPACK_CFLAGS} MATCHES
if(NOT (CMAKE_CUDA_FLAGS MATCHES "--gcc-toolchain=" OR $ENV{SPACK_CFLAGS} MATCHES
"--gcc-toolchain="))
string(APPEND CMAKE_CUDA_FLAGS " -Xcompiler")
if(redhat_version MATCHES "^8.([0-9]+)")
Expand Down
4 changes: 2 additions & 2 deletions config/unix-xl.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ if(NOT CXX_FLAGS_INITIALIZED)
file(READ /etc/redhat-release rhr)
string(REGEX REPLACE "[^0-9]*([0-9]+).([0-9]+).*" "\\1.\\2" redhat_version "${rhr}")
# If manually specified (eg. spack), do not add the --gcc-toolchain option
if(NOT (CMAKE_C_FLAGS MATCHES "--gcc-toolchain=" OR ENV{SPACK_CFLAGS} MATCHES "--gcc-toolchain="
))
if(NOT (CMAKE_C_FLAGS MATCHES "--gcc-toolchain=" OR $ENV{SPACK_CFLAGS} MATCHES
"--gcc-toolchain="))
if(redhat_version MATCHES "^8.([0-9]+)")
string(APPEND CMAKE_C_FLAGS " --gcc-toolchain=/usr/tce/packages/gcc/gcc-11.2.1")
else()
Expand Down

0 comments on commit 7161baf

Please sign in to comment.