简体   繁体   中英

PETSc error for mpicc

I am using a code in C for hydro simulations with radiative transfer. There is need for PETSc, which I got compiled on my local machine. But on compiling my code I get the error message: error: '__SDIR__' undeclared (first use in this function). The makefile has:

include $(PETSC_DIR)/conf/variables
CFLAGS += $(PETSC_INCLUDE)
CFLAGS += $(PETSC_CC_INCLUDES)
LDFLAGS += $(PETSC_KSP_LIB)

Can any one suggest with a solution ?

linker parameters must have the library references (paths then library names) after any object files. This is because the libraries are used to resolve symbols, and the parameters are handled in the order they are listed, left to right. so when a library is listed early, before some object file where the object file creates the unresolved symbol, then the library will not be used to resolve the symbol. Suggest placing the library paths and library names last on the linker line.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM