Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link to OpenACC libs if GPU_PHYSICS option is set #482

Draft
wants to merge 7 commits into
base: develop
Choose a base branch
from
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ ecbuild_add_executable (
SOURCES GEOSgcm.F90
LIBS GEOSgcm_GridComp esmf OpenMP::OpenMP_Fortran
)
if (GPU_PHYSICS)
target_link_libraries (
GEOSgcm.x
-fopenacc -foffload="-lgfortran -lgomp -lm" -foffload=nvptx-none
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pchakraborty This might be better as a variable or set of variables in ESMA_cmake in compiler/flags/GNU_Fortran.cmake. That way if you need to reuse them anywhere they can be (not sure you will, but just in case).

Note that if you do that, you might as well do it in GEOS-ESM/ESMA_cmake#322, but you might have to move up your GPU_PHYSICS option in there to before we do the ### Compiler Support ### bits.

)
endif ()

ecbuild_add_executable (
TARGET idfupd.x
Expand Down