Closed wikfeldt closed 3 years ago
@wikfeldt , where did you test. these CFLGAS should be setting in the makefile.
CCFLAGS=-g -O3 -acc -Minfo=accel -ta=nvidia -L/proj/snic2021-22-274/CUDA/11.2.0/lib64 -lcurand
@wikfeldt
$ cat ./compile.sh
module use /proj/snic2021-22-274/hpc_sdk/modulefiles module add nvhpc # make clean make $ ls Makefile compile.sh job.sh pi_MC_openacc pi_MC_openacc.c
sorry, you are running on colab
yes this is for making it work on Colab. If we manage to make most exercises work on Colab, we should add something like this to all Makefiles:
else ifeq ($(COMP),gnu)
CC=gcc
CCFLAGS=-g -O3 -fopenacc -I/usr/local/cuda-11.0/include/ -L/usr/local/cuda-11.0/lib64/ -lcurand
RUN=
endif
this is now done
i'm testing to see if the exercises can be made to work with gcc and cuda libraries on colab, but running into several issues. I'll report them in this issue to see if @zhmurov or @jigo3635 have solutions.
In the pi_monte_carlo c version of the solution, I can make it work with curand by adding
-I/usr/local/cuda-11.0/include/ -L/usr/local/cuda-11.0/lib64/ -lcurand
to CFLAGS, but then it fails with:error: variable ‘y’ declared in enclosing ‘host_data’ region
any ideas?