[petsc-users] FLAGS in makefile
Matthew Knepley
knepley at gmail.com
Tue Sep 13 12:21:57 CDT 2016
On Tue, Sep 13, 2016 at 12:16 PM, Timothée Nicolas <
timothee.nicolas at gmail.com> wrote:
> 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 ?
>
1) You want to change CFLAGS or FFLAGS
2) 'chkopts' is an internal check for PETSc
3) You realize that it is very dangerous to compile with options not
configure with.
Thanks,
Matt
> Best
>
>
> Timothee
>
--
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20160913/d2e3003a/attachment-0001.html>
More information about the petsc-users
mailing list