[petsc-users] Beginner : question about fortran modules and makefile

Fabien Tholin fabien.tholin at onera.fr
Wed Jun 14 10:35:11 CDT 2017


Hello,

I am a beginner with Petsc and i'm trying

to compile a very simple fortran program "test" with

a calling program in "test.F90" and a module "my_module.F90".

Unfortunately, i do not know how to write properly the makefile

to be able to compile the module with "#include petsc" statements inside:

I can not find any example on how to do it.

here is my non-working makefile:


CFLAGS         =
FFLAGS         =
PETSC_DIR=/home/fab/Program/PETSC/petsc-3.7.6
PETSC_ARCH=arch-linux2-c-debug
FLINKER=mpif90
CLINKER=mpicc

include ${PETSC_DIR}/lib/petsc/conf/variables
include ${PETSC_DIR}/lib/petsc/conf/rules

list=my_module.o

test: test.o $(list) chkopts
     -${FLINKER} -o test test.o  $(list)

my_module.o my_module.mod: my_module.F90
     -${FLINKER} -c my_module.F90


Thank you very much for helping me.

Regards,

Fabien THOLIN
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: makefile
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20170614/628b6781/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: test.F90
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20170614/628b6781/attachment-0001.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: my_module.F90
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20170614/628b6781/attachment-0002.ksh>


More information about the petsc-users mailing list