mrnorman / miniWeather

A parallel programming training mini app simulating weather-like flows
Other
145 stars 67 forks source link

Update cpp perlmutter compile script for gpus #11

Closed mark-petersen closed 1 year ago

mark-petersen commented 1 year ago

In order to compile for YAKL_ARCH="CUDA" on perlmutter, we need module load PrgEnv-nvidia and need to use c++ wrapper MAKE_CXX_COMPILER=CC.

mark-petersen commented 1 year ago

Before this change, I get the compile error:

cd cpp/build/
source cmake_perlmutter_gnu_gpu.sh

make
...
[ 30%] Linking CXX executable serial
/usr/bin/ld: cannot find -lcufft: No such file or directory

I asked the nersc consult desk, who recommended this:

% module load PrgEnv-nvidia
% CC -o cufft_example cufft_example.cu -lcufft

Where the example script is here: cufft_example.cu

After this change, compile works to completion.