Error on compiling CAMB FORTRAN

Use of Cobaya. camb, CLASS, cosmomc, compilers, etc.
Post Reply
Jose Lozano
Posts: 14
Joined: June 27 2023
Affiliation: Universidad Nacional Autónoma de México

Error on compiling CAMB FORTRAN

Post by Jose Lozano » August 22 2023

Hello dear people,

I have been manipulating the CAMB code for a specific dark energy model. Anyhow, once I compile the FORTRAN CAMB code in the terminal by making "make" I get the following message:

ifort: command line error: '-fminshared' conflicts with '-fpic'
make: *** [Releaselib/constants.o] Error 1

I'm using the latest version of ifort 2021.10.0 20230609 in my Mac with the Intel Chip. Do you know how to fix this? I'm using the CAMB version November 2016 for special reasons.

I'm hope you can give me a hand on this.

Thank you

Antony Lewis
Posts: 1945
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

Re: Error on compiling CAMB FORTRAN

Post by Antony Lewis » August 22 2023

Maybe you have fminshared in some linked code, or default ifort args. In any case I would use latest CAMB if at all possible.

Jose Lozano
Posts: 14
Joined: June 27 2023
Affiliation: Universidad Nacional Autónoma de México

Re: Error on compiling CAMB FORTRAN

Post by Jose Lozano » August 22 2023

Hola Anthony,

I have already fixed the problem. Now, I'm dealing with the following error:

gfortran -ffree-line-length-none -O3 -fopenmp -ffast-math -fmax-errors=4 -JRelease -IRelease/ -c equations_ppf.f90 -o Release/equations_ppf.o
equations_ppf.f90:997:26:

997 | type(EvolutionVars) EV
| 1
Error: Name 'ev' at (1) is an ambiguous reference to 'ev' from current program unit
equations_ppf.f90:1008:12:

1008 | else
| 1
Error: Unexpected ELSE statement at (1)
equations_ppf.f90:1013:11:

1013 | end if
| 1
Error: Expecting END SUBROUTINE statement at (1)
equations_ppf.f90:1014:7:

1014 | end if
| 1
Error: Expecting END SUBROUTINE statement at (1)
compilation terminated due to -fmax-errors=4.
make: *** [Release/equations_ppf.o] Error 1

I tried to include "-ffree-line-length-none" in FFLAGS of the makefile. But still, it is giving out the same error.

Do you have an idea or possible solution to fix this?

Antony Lewis
Posts: 1945
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

Re: Error on compiling CAMB FORTRAN

Post by Antony Lewis » August 23 2023

Not specifically, apart from try the latest version

Post Reply