PGF90-F-0004-Unable to open MODULE file error

I am trying to compile my fortran f90 code using pgf90

PGF90-F-0004-Unable to open MODULE file parameter_fmodule.mod (/home/navier01b/sathiah/FINAL/CODE1/flame6-beta-1.3/program/src/flame_fmodule.f90: 4)
PGF90/x86 Linux 7.1-6: compilation aborted

I get the following error. Do you have any clue.


Perhaps a file that contains parameter_fmodule.mod has not been compiled yet? Make sure they are in the same directory, if not you will need to add -Ilocation_of_mod_file to your compile line.


This is waht my make file looks like.

PROGRAM = blalblah

MODDIR = $(XROOT)/obj_mod/Linux
OBJDIR = $(XROOT)/obj_mod/Linux

F90 = pgf90
MODULES = -module $(MODDIR)
#FFLAGS = -oO -C=all -gline $(PRECISION) $(MODULES) $(INCDIRS)
LD = f95

$(OBJDIR)/flamelet1.o \


Inference rules


default: $(OBJS)
@echo “Linking $(PROGRAM) …”
@if [ $(EXEDIR) != . ]; then
(echo Moving $(PROGRAM) to $(EXEDIR);
mv -f $(PROGRAM) $(EXEDIR)) ; fi

clean:; @rm -f $(PROGRAM) $(OBJS)


Compiling rules


$(F90) $(FFLAGS) -c $(XROOT)/src/flame_fmodule.f90 ;
if [ -f *.mod ]; then mv -f *.mod $(MODDIR); fi;
mv -f flame_fmodule.o $(OBJDIR)

$(F90) $(FFLAGS) -c $(XROOT)/src/flamelet.f90 ;
if [ -f *.mod ]; then mv -f *.mod $(MODDIR); fi;
mv -f flamelet.o $(OBJDIR)






End of Makefile


Could you please let me know now.


Can you please try without makefile to see if it works? Compile parameter_fmodule.f90 first to get .mod file.

If it works, then you will need to fix your makefile.


I’m getting the following error:

/opt/pgi/linux86-64/2017/bin/pgfortran -Mcuda -Mprof -O2 -mp -I/home/ccevallos/DFTB+/prg_dftb/…/libs -I/usr/local/cuda/include -I~/magma/include -I~/magma/control -I~/magma/sparse/include -o eigensolver.o -c eigensolver.f90

PGF90-F-0004-Unable to open MODULE file magma.mod (/home/ccevallos/DFTB+/prg_dftb/…/lib_math/eigensolver.F90: 10)
PGF90/x86-64 Linux 17.4-0: compilation aborted
/home/ccevallos/DFTB+/prg_dftb/…/Makefile.common:114: recipe for target ‘eigensolver.o’ failed
make[1]: *** [eigensolver.o] Error 2

Somehow my eigensolver file is unable to open magma.mod. I know magma is compiling right because magma.mod is saved in magma’s include file.
However, this is the line giving trouble:

module eigensolver
use message
use accuracy, only : rsp, rsp2, rdp
use magma ------> THIS ONE

I have no idea why. I have tried several versions of cuda, pgi, and magma and always get the same error.

Three possibilities

  1. magma.mod file does not exist.

The file with the line
module magma

needs to be compiled, so that magma.mod will be created.

  1. The file exists, but not in a directory searched
    if you find magma.mod in /usr/xxx/yyy, be sure to add
    -I/usr/xxx/yyy to your compile line.

  2. The file magma.mod exists but was not created with PGI 64-bit compilers. *.mod files differ from compiler to compiler, and it may be
    that pgf90 needs to recompile the source so that magma.mod
    is no in PGI format.