flang: make sure to find libstdc++ if needed (#17480)

This commit is contained in:
Dr Owain Kenway 2020-07-30 13:55:16 +01:00 committed by GitHub
parent d512537417
commit 8b515f3ba0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View File

@ -71,6 +71,11 @@ def cmake_args(self):
spec['python'].command.path)
]
# Make sure llvm-flang can find GCC's libstdc++
if self.compiler.name == "gcc":
gcc_prefix = ancestor(self.compiler.cc, 2)
options.append('-DGCC_INSTALL_PREFIX=' + gcc_prefix)
if '+cuda' in spec:
options.append('-DFLANG_OPENMP_GPU_NVIDIA=ON')
else:

View File

@ -195,6 +195,11 @@ def cmake_args(self):
args.append('-DLIBOMP_FORTRAN_MODULES=ON')
args.append('-DLIBOMP_ENABLE_SHARED=TRUE')
# Make sure llvm-flang can find GCC's libstdc++
if self.compiler.name == "gcc":
gcc_prefix = ancestor(self.compiler.cc, 2)
args.append('-DGCC_INSTALL_PREFIX=' + gcc_prefix)
# used by libomptarget for NVidia gpu
if '+cuda' in spec:
args.append('-DOPENMP_ENABLE_LIBOMPTARGET=ON')