Skip to content

NVCC Specific Compiler Flag Propagates to Downstream Fortran Compiler #90

Description

@Fuad-HH

I was using PCMS (with MeshFields) for XGC and was getting the following error.

[ 50%] Building Fortran object CMakeFiles/libxgc-es-cpp-gpu.dir/XGC_core/one_d_cub_mod.F90.o
gfortran: error: unrecognized command-line option '--expt-relaxed-constexpr'
gfortran: error: unrecognized command-line option '--expt-relaxed-constexpr'
gfortran: error: unrecognized command-line option '--expt-relaxed-constexpr'
gfortran: error: unrecognized command-line option '--expt-relaxed-constexpr'
gfortran: error: unrecognized command-line option '--expt-relaxed-constexpr'
gfortran: error: unrecognized command-line option '--expt-relaxed-constexpr'
gfortran: error: unrecognized command-line option '--expt-extended-lambda'
gmake[3]: *** [CMakeFiles/libxgc-es-cpp-gpu.dir/build.make:1520: CMakeFiles/libxgc-es-cpp-gpu.dir/XGC_core/cpp/domain_decomposition/partition_intersect.F90.o] Error 1
gmake[3]: *** Waiting for unfinished jobs....
gfortran: error: unrecognized command-line option '--expt-extended-lambda'

This is coming from manually specified compiler flag here:

if(Kokkos_ENABLE_CUDA)
target_compile_options(meshfields INTERFACE "--expt-relaxed-constexpr")
endif()

I think this can be fixed with a CXX language guard. Here's an example in StackOverflow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions