[petsc-users] PETSc + SLEPc makefile

Jose E. Roman jroman at dsic.upv.es
Mon Sep 6 06:29:10 CDT 2010


El 06/09/2010, a las 13:01, jordi poblet escribió:

> Dear all,
> 
> I am trying to use PETSc and SLEPc but I have problems with the makefiles. Could someone provide me an example of makefiles that compiles multiple C++ files and include external libraries different than PETSc and SLEPc?
> 
> In the makefile that I am trying to use (attached):
> 
> -main.cpp: is the main file where some tests are done
> -UsePETSc.cpp: A class that uses PETSc
> -UseSLEPc.cpp: A class that uses SLEPc
> 
> I have no problem when using UsePETSc.cpp without SLEPc or when compiling single examples that call SLEPc functions (with the makefiles provided in the SLEPc examples).
> Sorry if this is not a purelly PETSc question but I have supposed that there is someone else here using also SLEPc.  
> 
> Thank you very much in advance,
> 
> Jordi Poblet-Puig
> 

Probably you need to add ${PETSC_INCLUDE} also to the UseSLEPc.o target. Anyway, your makefile does not seem to be well formed. Try the following:

CFLAGS	   = -I../MyIncludefiles -Wno-deprecated
MYLIB	   = -L../MyLibraries -lMyLibrary
MYOBJS     = main.o UseSLEPc.o UsePETSc.o 
EXE        = MyExecutableFile

all: ${EXE}

include ${SLEPC_DIR}/conf/slepc_common

${EXE}: ${MYOBJS} chkopts
	-${CLINKER} -o ${EXE} ${MYOBJS} ${MYLIB} ${SLEPC_LIB}
	${RM} ${MYOBJS}





More information about the petsc-users mailing list