Page MenuHomec4science

Makefile
No OneTemporary

File Metadata

Created
Wed, Nov 13, 02:24

Makefile

EXEC=gbs_gradients # Excutable name
# on izar
#FC=gfortran # GNU Fortran compiler
#FC=nvfortran # NVHPC Fortran compiler
FC=ftn
#
#FLAGS= -O3 -fopenmp -foffload=-lgfortran -lm -foffload="-lm" # options for OpenMP with GNU
#FLAGS= -O3 -static-nvidia -mp=gpu -gpu=cc70 -Minfo=mp # options for openMP with NVHPC
#FLAGS=-O3 -acc -gpu=cc70 # options for openACC with NVHPC
#FLAGS=-O3 -homp -hnoacc # OpenMP with ftn on piz-daint
FLAGS=-O3 -acc -Minfo # OpenACC with pgi on piz-daint
#
CUDAC=nvcc # CUDA C compiler
CUDAFLAGS= -O3 # options for CUDA C
CUDA=CUDA
#
all: $(EXEC)
gbs_gradients: test_gbs_gradients.F90 gradients_mod.F90 space_grid_mod.F90 prec_const_mod.F90
$(FC) $(FLAGS) prec_const_mod.F90 space_grid_mod.F90 gradients_mod.F90 test_gbs_gradients.F90 -o $(EXEC)
gbs_gradients_cuda: fortranfiles.o cudafiles.o fortranmain.o
$(CUDAC) -o $(EXEC) $(CUDAFLAGS) -D$(CUDA) -lgfortran -lcuda test_gbs_gradients.o gradients_mod.o gradients_cuda_mod.o gradients_fd4.o space_grid_mod.o prec_const_mod.o cuda_memory.o
fortranmain.o: test_gbs_gradients.F90
$(FC) -c $(FLAGS) -D$(CUDA) test_gbs_gradients.F90
fortranfiles.o: gradients_mod.F90 space_grid_mod.F90 prec_const_mod.F90
$(FC) -c $(FLAGS) -D$(CUDA) prec_const_mod.F90 space_grid_mod.F90 gradients_mod.F90 gradients_cuda_mod.F90
cudafiles.o: cuda_memory.cu
$(CUDAC) $(CUDAFLAGS) -c cuda_memory.cu gradients_fd4.cu
clean:
rm -f gbs_gradients gbs_gradients_cuda *.mod *.o *~

Event Timeline