SARAH-SPheno Makefile vs SPheno Makefile

Questions concerning the stand-alone SPheno without SARAH modules
Bjorn
Posts: 2
Joined: 11. Jun 2017, 12:55

SARAH-SPheno Makefile vs SPheno Makefile

Postby Bjorn » 12. Jun 2017, 09:38

The Makefile which is part of SPheno contains

Code: Select all

# Intels ifort, default in optimized mode
F90 = ifort
comp = -c -O -module ${Mdir} -I${InDir}
LFlagsB = -O

# Intels ifort, debug modus
ifeq (${F90},ifortg)
 F90 = ifort
 comp = -c -g -module ${Mdir} -I${InDir}
 LFlagsB = -g
endif

# gfortran
ifeq (${F90},gfortran)
 comp = -c -O -J${Mdir} -I${InDir}
 LFlagsB = -O
endif

# g95
ifeq (${F90},g95)
 comp = -c -O -fmod=${Mdir} -I${InDir}
 LFlagsB = -O
endif

# Lahey F95 compiler
ifeq (${F90},lf95)
 comp = -c -O -M ${Mdir} -I${InDir}
 LFlagsB = -O
endif

# NAG f95/2003
ifeq (${F90},nagfor)
 comp = -c -O  -DONLYDOUBLE -mdir ${Mdir} -I${InDir}
 LFlagsB = -O
endif


But the Makefile produced by SARAH for SPheno contains

Code: Select all

# Default Compiler 
F90=gfortran
comp= -c -O -module ${Mdir} -I${InDir} 
LFlagsB= -O 
# Intels ifort,debug modus 
ifeq (${F90},ifortg) 
F90=ifort 
comp= -c -g -module ${Mdir} -I${InDir} 
LFlagsB= -g 
endif 
# gfortran 
ifeq (${F90},gfortran) 
comp= -c -g -ffree-line-length-none -J${Mdir} -I${InDir} 
LFlagsB= -g 
endif 
# g95 
ifeq (${F90},g95) 
comp= -c -O -fmod=${Mdir} -I${InDir} 
LFlagsB= -O 
endif 
# Lahey F95 compiler 
ifeq (${F90},lf95) 
comp=-c -O -M ${Mdir} -I${InDir} 
LFlagsB=-O 
endif 
# NAG f95/2003 
ifeq (${F90},nagfor) 
comp= -c -O -mdir ${Mdir} -I${InDir} 
LFlagsB= -O -DONLYDOUBLE -mdir ${MDir} -I${InDir} 
endif   


I have a few questions about that.

1.) Why is the default compiler for SARAH gfortran while it is ifort for SPHENO? Maybe this is just a typo? It doesn’t seem to make much sense to set the default compiler settings for gfortran at the top of the file and to overwrite them later and not to have any settings for ifort in optimized mode.

2.) Why are the compiler settings for gfortran different, especially why does SARAH use debug mode while SPheno uses optimized mode?

3.) I would be grateful if both Makefiles would allow to set the F90 variable to the full path of the compiler, not only its "type".
Unfortunately this would require to change the mechanism how the compiler flags are determined. Just as an idea, a pragmatic approach could be to test if the F90 variable *contains* a certain string which identifies the compiler type instead of requiring the F90 variable to be *equal* to that string.
This could for example be achieved by replacing the lines which look like

Code: Select all

 "ifeq (${F90},${COMPILER})"

with

Code: Select all

 "ifneq (,$(findstring ${COMPILER},${F90}))"

The latter is true if the return value of findstring is not equal to empty, i.e. the searched string was found in the compiler name/path.

FStaub
Site Admin
Posts: 643
Joined: 13. Apr 2016, 14:05

Re: SARAH-SPheno Makefile vs SPheno Makefile

Postby FStaub » 12. Jun 2017, 09:51

Hi,

Why is the default compiler for SARAH gfortran while it is ifort for SPHENO? Maybe this is just a typo?

I think there is no deep reason. At the end, the compiler set by the Makefile in the SPheno root directory is used anyway.

Why are the compiler settings for gfortran different

Again, also there is no particular reason for that.

I would be grateful if both Makefiles would allow to set the F90 variable to the full path of the compiler, not only its "type".

Ok, I need to discuss that with Werner.

Cheers,
Florian


Return to “SPheno”

Who is online

Users browsing this forum: No registered users and 1 guest