[petsc-users] Compiling program with program files dependencies (SLEPC )

Satish Balay balay at mcs.anl.gov
Thu Apr 24 19:25:15 CDT 2014


On Thu, 24 Apr 2014, Steve Ndengue wrote:

> Dear all,
> 
> I am having trouble compiling a code with some dependencies that shall call
> SLEPC.
> The compilation however goes perfectly for the various tutorials and tests in
> the package.
> 
> A sample makefile looks like:
> 
> ***
> 
> /default: code//
> //routines: Rout1.o Rout2.o Rout3.o Module1.o//
> //code: PgmPrincipal//
> //sources=Rout1.f Rout2.f Rout3.f Module1.f90//

Its best to rename your sourcefiles .F/.F90 [and not .f/.f90
[this enables using default targets from petsc makefiles - and its
the correct notation for preprocessing - which is required by petsc/slepc]

> //objets=Rout1.o Rout2.o Rout3.o Module1.o Pgm//Principal//.o//
> //
> //%.o: %.f//
> //        -${FLINKER} -c $<//

And you shouldn't need to create the above .o.f target.

Satish


> //
> //Module1_mod.mod Module1.o: //Module1//.f90//
> //        -${FLINKER} -c //Module1//.f90//
> //
> //include ${SLEPC_DIR}/conf/slepc_common//
> //
> //Pgm//Principal//: ${objets} chkopts//
> //        -${FLINKER} -o $@ ${objets} ${SLEPC_LIB}//
> //
> //.PHONY: clean//
> //        ${RM} *.o *.mod Pgm//Principal//
> /
> ***
> 
> The code exits with Warning and error messages of the type:
> 
> *Warning: Pgm**Principal**.f90:880: Illegal preprocessor directive**
> **Warning: Pgm**Principal**.f90:889: Illegal preprocessor directive**
> **Warning: Pgm**Principal**.f90:892: Illegal preprocessor directive**
> **Warning: Pgm**Principal**.f90:895: Illegal preprocessor directive*
> 
> and
> 
> *USE slepceps**
> **                    1**
> **Fatal Error: Can't open module file 'slepceps.mod' for reading at (1): No
> such file or directory
> 
> 
> *I do not get these errors with the tests and errors files.
> 
> 
> Sincerely,
> 
> 



More information about the petsc-users mailing list