Using GitHub Actions cache is a little more complicated than not caching, but makes the setup time dramatically shorter.
This example uses MKL and MPI.
Live example with Fortran only (no MKL or MPI).
Using GitHub Actions cache is a little more complicated than not caching, but makes the setup time dramatically shorter.
This example uses MKL and MPI.
Live example with Fortran only (no MKL or MPI).
source /opt/intel/oneapi/setvars.sh | |
export CC=icx CXX=icpx FC=ifx | |
export MPI_ROOT=$I_MPI_ROOT |
# when wanting to use NVIDIA HPC SDK, type in Terminal | |
# source ~/nvidia-hpc.sh | |
nvroot=/opt/nvidia/hpc_sdk/Linux_x86_64/2023/ | |
cudaroot=${nvroot}/cuda/ | |
export PATH=$PATH:${cudaroot}/bin/:${nvroot}/compilers/bin/ | |
export CC=nvc CXX=nvc++ FC=nvfortran |
This example is for BU SCC, but other HPC work similarly.
A couple of the source files take several minutes each to compile--whole build takes about 20 minutes.
NOTE: if you previously loaded other modules, best to logoff and logon to have a known fresh environment.
/* example of VTK HDF5 file format | |
This is a de facto HDF5 file template using specific group names and dataset hierarchy. | |
ParaView can also read these VTK HDF5 files. | |
Build: use the HDF5 compiler wrapper for convenience: | |
h5cc vtk_write.c -o vtk_demo | |
./vtk_demo hi.h5 |
cmake_minimum_required(VERSION 3.10) | |
project(LotOfModules LANGUAGES Fortran) | |
message(STATUS "CMake ${CMAKE_VERSION}") | |
add_library(m1 OBJECT m1.f90) | |
add_library(m2 OBJECT m2.f90) | |
target_link_libraries(m2 PRIVATE m1) |
cmake_minimum_required(VERSION 3.23) | |
set(CMAKE_FIND_DEBUG_MODE true) | |
# in my opinion, I shouldn't need to set CMAKE_IGNORE_PATH as well. | |
if(DEFINED ENV{CONDA_PREFIX}) | |
list(APPEND CMAKE_IGNORE_PREFIX_PATH $ENV{CONDA_PREFIX}) | |
list(APPEND CMAKE_IGNORE_PATH $ENV{CONDA_PREFIX}/bin) | |
endif() |
# NOTE: Safari doesn't work from the command line, so Safari is omitted from the search. | |
find_program(browser | |
NAMES | |
"Microsoft Edge" msedge | |
"Google Chrome" google-chrome chrome | |
Chromimum chromium-browser chromium | |
Firefox firefox firefox-bin | |
PATHS | |
"$ENV{PROGRAMFILES\(x86\)}/Microsoft/Edge/Application" | |
"$ENV{PROGRAMFILES}/Google/Chrome/Application" |