demichie / IMEX_SfloW2D_v2

Shallow water variable density gas-particle flow
https://demichie.github.io/IMEX_SfloW2D_v2/
GNU General Public License v3.0
7 stars 1 forks source link

configure compiler flags #3

Open jklebes opened 1 month ago

jklebes commented 1 month ago

Hi, I am starting to work on your software together with Eric Breard . First I wanted to compile and profile an example with gprof. To do that I need to add fortran compiler flag -pg. The command recommended in INSTALL, ./configure FCFLAGS=-pg or ./configure FCFLAGS="-pg", had no effect. The make progress looks like

gfortran  -fopenmp -Ofast -funroll-all-loops -c -o parameters_2d.o parameters_2d.f90
gfortran  -fopenmp -Ofast -funroll-all-loops -c -o complexify.o complexify.f90
gfortran  -fopenmp -Ofast -funroll-all-loops -c -o geometry_2d.o geometry_2d.f90
gfortran  -fopenmp -Ofast -funroll-all-loops -c -o constitutive_2d.o constitutive_2d.f90
gfortran  -fopenmp -Ofast -funroll-all-loops -c -o solver_2d.o solver_2d.f90
gfortran  -fopenmp -Ofast -funroll-all-loops -c -o init_2d.o init_2d.f90
gfortran  -fopenmp -Ofast -funroll-all-loops -c -o inpout_2d.o inpout_2d.f90
gfortran  -fopenmp -Ofast -funroll-all-loops -c -o IMEX_SfloW2D.o IMEX_SfloW2D.f90
gfortran  -fopenmp -Ofast -funroll-all-loops   -o IMEX_SfloW2D parameters_2d.o complexify.o geometry_2d.o constitutive_2d.o solver_2d.o init_2d.o inpout_2d.o IMEX_SfloW2D.o  -lm -llapack

without my added flags. To check this is not just a printing issue, I also ran the resulting binary on EXAMPLES/EXAMPLE_BOX/ . No gmon.out was generated. My flags appear in config.log during compiler checks, but are apparently not passed all the way to build steps. Instead the default optimization flags are always applied.

In practice this is not a problem because I can specify my flags at the make command instead. However something is not going as intended in config steps and the INSTALL document is misleading.

demichie commented 1 month ago

Hi, the INSTALL file was created automatically by the autoconf/atomake tools, so I'm not able to help too much with the content. But I've another suggestion. Have you tried to modify the line starting with "FCFLAGS =" in src/Makefile?