-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #141 from CasparJungbacker/dev-cmake
CMake fixes. Remove CMake presets again :-) Now, select a Fortran compiler using regular CMake variables. E.g., for GNU: ``` FC=mpif90 cmake <options> <path> ``` and for Intel: ``` FC=mpiifx cmake <options> <path> ```
- Loading branch information
Showing
8 changed files
with
123 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Compiler flag presets for some frequently used compilers | ||
if( CMAKE_Fortran_COMPILER_ID MATCHES GNU ) | ||
ecbuild_add_fortran_flags( "-cpp -W -Wall -Wno-tabs -Wno-compare-reals -fdefault-real-8 -fdefault-double-8 -march=native -ffree-line-length-none -std=gnu -Werror=implicit-interface" ) | ||
ecbuild_add_fortran_flags( "-funroll-all-loops -fno-f2c -Ofast -g -fbacktrace" BUILD RELEASE ) | ||
ecbuild_add_fortran_flags( "-finit-real=nan -fbounds-check -fbacktrace -fno-f2c -O0 -g -ffpe-trap=invalid,zero,overflow" BUILD DEBUG ) | ||
elseif( CMAKE_Fortran_COMPILER_ID MATCHES Intel ) | ||
ecbuild_add_fortran_flags( "-cpp -r8 -ftz" ) | ||
ecbuild_add_fortran_flags( "-O3" BUILD RELEASE ) | ||
ecbuild_add_fortran_flags( "-traceback -fpe1 -O0 -g -check all" BUILD DEBUG ) | ||
elseif( CMAKE_Fortran_COMPILER_ID MATCHES PGI|NVHPC ) | ||
ecbuild_add_fortran_flags( "-Mpreprocess -Mr8 -Mfree" ) | ||
ecbuild_add_fortran_flags( "-Ofast" BUILD RELEASE ) | ||
ecbuild_add_fortran_flags( "-Minit-real=snan -traceback -O0 -g -ffpe-trap=invalid,zero,overflow" BUILD DEBUG ) | ||
elseif( CMAKE_Fortran_COMPILER_ID MATCHES Fujitsu ) | ||
ecbuild_add_fortran_flags( "-Cpp -CcdRR8 -g -Koptmsg=2" ) | ||
ecbuild_add_fortran_flags( "-Kfast -x 128" BUILD RELEASE ) | ||
ecbuild_add_fortran_flags( "-Haefosux -O0" BUILD DEBUG ) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
macro( dales_find_cuda ) | ||
# Check if a target architecture has been set. If not, default to 80 (A100 & RTX3090) | ||
# For H100, use 90 | ||
if( NOT DEFINED CMAKE_CUDA_ARCHITECTURES ) | ||
set( CMAKE_CUDA_ARCHITECTURES 80 ) | ||
endif() | ||
|
||
# Look for the CUDA Toolkit, which has cuFFT and NVTX | ||
find_package( CUDAToolkit ) | ||
if( NOT TARGET CUDA::cufft AND ENABLE_ACC ) | ||
ecbuild_error( "Could not find cuFFT, which is required for GPU builds!" ) | ||
else() | ||
ecbuild_info( "Found cuFFT: ${CUDA_cufft_LIBRARY}" ) | ||
endif() | ||
if( NOT TARGET CUDA::nvToolsExt AND ENABLE_NVTX ) | ||
ecbuild_error( "Could not find NVTX library for profiling" ) | ||
else() | ||
ecbuild_info( "Found NVTX: ${CUDA_nvToolsExt_LIBRARY}" ) | ||
endif() | ||
endmacro() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters