[petsc-users] FLAGS in makefile

Timothée Nicolas timothee.nicolas at gmail.com
Tue Sep 13 12:16:31 CDT 2016


Hi all,

I can't seem to figure out how to specify my compilation options with
PETSc. For my makefiles, I've always been using Petsc examples inspired
makefiles, just tuning them to my needs, and I have never played with
compilation options so far. Now, I am trying to add some compilation
options, but they are not taken into account by the compiler. My makefile
looks like this

all: energy


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

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


#FLAGS = -g -O0 -fbounds-check




MYFLAGS = -mcmodel=medium -shared-intel


OBJS =  main.o \

        modules.o \

        diags.o \

        functions.o \

        conservation.o \


EXEC = energy


main.o: modules.o \

        functions.o \

        conservation.o \

        diags.o \


energy: $(OBJS)  chkopts

        -$(FLINKER) -o $(EXEC) $(MYFLAGS) $(FLAGS) $(OBJS) $(PETSC_SNES_LIB)


clean_all:

        $(RM) $(OBJS) $(EXEC)


The compiler then executes things like

/opt/mpi/bullxmpi/1.2.8.4/bin/mpif90 -c -fPIC -g -O3
-I/ccc/scratch/cont003/gen0198/lutjensh/Timothee/petsc-3.7.3/include
-I/ccc/scratch/cont003/gen0198/lutjensh/Timothee/petsc-3.7.3/arch-linux2-c-debug/include
-I/opt/mpi/bullxmpi/1.2.8.4/include    -o modules.o modules.F90


without taking my variable MYFLAGS into account. What may be the reason?
Also, what does "chkopts" mean ?


Best


Timothee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20160913/84229f59/attachment.html>


More information about the petsc-users mailing list