As suggested in the answer from the following post, I am trying to build my Fortran program using mpif90
with -acc=gpu
flag.
Getting started with OpenACC + MPI Fortran program
I was shown the following error:
gfortran: error: unrecognized command line option ‘-acc=gpu’
I don't understand how I can use mpif90
to compile OpenACC parts of the code. Don't I need a compiler like nvfortran
to tell the computer about my OpenACC directives in the code? It's so confusing for me to know how I can tell to the computer about both of my mpi and OpenACC parts of the code simultaneously.
I am posting my make file here for reference:
OBJECTS = Main.o Module.o Pre_processing.o boundary_conditions.o \
interpolation.o viscous_fluxes.o
MODULES = Module.mod
CASE = Riemann.f90
# FC= pgfortran
# FFLAG = -acc -fast -mcmodel=medium -ta=tesla:managed -Minfo=accel
# FFLAG = -fast -mcmodel=medium
FC= mpif90
FFLAG = -acc=gpu
output: a.out
a.out: $(MODULES) $(OBJECTS) cases/$(CASE)
$(FC) $(FFLAG) $(OBJECTS) cases/$(CASE) -o a.out
%.o: %.f90
$(FC) $(FFLAG) -c $<
%.mod: %.f90
$(FC) $(FFLAG) -c $<
.PHONY: clean
clean :
rm -f *.o *.mod *.out *.qdrep
I have following compilers installed on my PC which has two Nvidia A6000 GPU cards:
GNU Fortran (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0 & nvfortran 21.9-0 64-bit target on x86-64 Linux -tp zen