makefile for OpenAcc fortran code

Hi,

I am trying to accelerate my fortran code using OpenACC.
It seems the code is not palatalized with following makefile.

I have tested my computer using examples on this webpage and they works well. https://www.pgroup.com/lit/articles/insider/v4n1a1a.htm

I found a template here, should I modify my makefile like this?
https://github.com/pathscale/OpenACC-benchmarks/blob/master/matmul/pgi/makefile

Thanks,
Guanfeng

F90=pgfortran
# -------------------End-macro-Defs---------------------------

# Here is the link step 
EMUNE3D:Objects.obj Global_variables.obj module_precision.obj Input_subroutines.obj Horizon.obj  Get_family.obj damage.obj peri_motion.obj dynamics.obj Solver.obj EMUNE3D.obj 
	 $(F90) -acc -Minfo -o EMUNE3D Objects.obj Global_variables.obj module_precision.obj Input_subroutines.obj Horizon.obj Get_family.obj damage.obj peri_motion.obj dynamics.obj Solver.obj EMUNE3D.obj
# Here are the compile steps

module_precision.obj:./module_precision.f90  
	 $(F90) -c ./module_precision.f90 
# Here are the compile steps
....

Hi Guanfeng,

As written, the Makefile isn’t adding any OpenACC compiler flags to the compilation, only the link. In the example Makefile you based this on, they put these flags as part of the compiler variable. Instead, I’d recommend adding an “OPT” variable.

F90=pgfortran 
OPT=-acc -Minfo=accel
# -------------------End-macro-Defs--------------------------- 

# Here is the link step 
EMUNE3D:Objects.obj Global_variables.obj module_precision.obj Input_subroutines.obj Horizon.obj  Get_family.obj damage.obj peri_motion.obj dynamics.obj Solver.obj EMUNE3D.obj 
    $(F90) $(OPT) -o EMUNE3D Objects.obj Global_variables.obj module_precision.obj Input_subroutines.obj Horizon.obj Get_family.obj damage.obj peri_motion.obj dynamics.obj Solver.obj EMUNE3D.obj 
# Here are the compile steps 

module_precision.obj:./module_precision.f90  
    $(F90) $(OPT) -c ./module_precision.f90 
# Here are the compile steps 
....

Hope this helps,
Mat

Thanks Mat, now I can get accelerator messages now.

Thanks,
Guanfeng