-
Notifications
You must be signed in to change notification settings - Fork 28
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 #248 from ngs333/cpp_dev
Updating GFDL repo with numerous commits.
- Loading branch information
Showing
14 changed files
with
402 additions
and
917 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{ | ||
"version": 6, | ||
"cmakeMinimumRequired": { | ||
"major": 3, | ||
"minor": 21, | ||
"patch": 0 | ||
}, | ||
"configurePresets": [ | ||
{ | ||
"name": "gcc-debug-pr", | ||
"displayName": "GCC-DEBUG", | ||
"description": "Debug build options for GCC", | ||
"generator": "Unix Makefiles", | ||
"binaryDir": "${sourceDir}/build_gcc_debug_pr", | ||
"toolchainFile":"${sourceDir}/gcc_toolchain", | ||
"cacheVariables": { | ||
"CMAKE_CXX_FLAGS_INIT": "-g -O0 -Wall -Wpedantic -Wextra" | ||
} | ||
}, | ||
{ | ||
"name": "gcc-release-pr", | ||
"displayName": "GCC-RELEASE", | ||
"description": "Release build options for GCC", | ||
"generator": "Unix Makefiles", | ||
"binaryDir": "${sourceDir}/build_gcc_release_pr", | ||
"toolchainFile":"${sourceDir}/gcc_toolchain", | ||
"cacheVariables": { | ||
"CMAKE_CXX_FLAGS_INT": "-g -O2 -Wall -Wpedantic -Wextra" | ||
} | ||
}, | ||
{ | ||
"name": "gpu-nvhpc-pr", | ||
"displayName": "GPU-NVHPC", | ||
"description": "NVC++ build option for gpu with std::par", | ||
"generator": "Unix Makefiles", | ||
"binaryDir": "${sourceDir}/build_gpu_nvhpc_pr", | ||
"toolchainFile":"${sourceDir}/nvhpc_toolchain", | ||
"cacheVariables": { | ||
"CMAKE_CXX_FLAGS_INIT": "-O2 -std=c++20 -stdpar=gpu --gcc-toolchain=/opt/gcc/12.3.0 -I/opt/gcc/12.3.0/include/c++/12.3.0 -I/opt/netcdf/4.9.2/NVHPC/23.7/include -I/opt/hdf5/1.14.1-2/NVHPC/23.7/include" | ||
} | ||
} | ||
], | ||
"buildPresets": [ | ||
{ | ||
"name": "gcc-debug-build-pr", | ||
"displayName": "GCC-DEBUG-BUILD", | ||
"targets": [ "fregrid.x"], | ||
"verbose": true, | ||
"configurePreset": "gcc-debug-pr" | ||
}, | ||
{ | ||
"name": "gcc-release-build-pr", | ||
"displayName": "GCC-RELEASE-BUILD", | ||
"targets": ["fregrid.x"], | ||
"verbose": true, | ||
"configurePreset": "gcc-release-pr" | ||
}, | ||
{ | ||
"name": "gpu-nvhpc-build-pr", | ||
"displayName": "GPU-NVHPC-BUILD", | ||
"targets": ["fregrid.x"], | ||
"verbose": true, | ||
"configurePreset": "gpu-nvhpc-pr" | ||
} | ||
] | ||
} |
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,24 @@ | ||
# I) load desired compilers and libs | ||
|
||
# IIA) #Compiling with CMake presets: | ||
# inspect the preset files under dir FRE-NCtools/cpp | ||
# if you dont find one to you liking, modify one or make a | ||
# new one | ||
# List the available presets: | ||
cd FRE-NCtools/cpp | ||
cmake --list-presets | ||
#choose one of the presets, e.g. gpu-nvhpc-pr : | ||
cmake . --preset=gpu-nvhpc-pr -Dwith-gpu=ON | ||
#cd to the directory listed in the last output line - its | ||
# where the build files are written. | ||
cd build_gpu_nvhpc_pr | ||
# run cmake in verbose mode | ||
cmake --build . -v | ||
# note the executables are currently copied to dir FRE-NCtools | ||
----------------- | ||
# IIB) Compiling using env vars and more cmake command line options. | ||
#set the compiler | ||
export CXX=/opt/nvidia/hpc_sdk/Linux_x86_64/23.7/compilers/bin/nvc++ | ||
#pass to cmake the flags you want. | ||
cmake .. -Dwith-gpu="ON" -DCMAKE_CXX_FLAGS="-O2 -std=c++20 -stdpar=gpu" | ||
cmake --build . -v |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
set(tools /usr) | ||
set(CMAKE_C_COMPILER ${tools}/bin/gcc) | ||
set(CMAKE_CXX_COMPILER ${tools}/bin/g++) |
Oops, something went wrong.