CAMB: camb_python compilation error

Use of Cobaya. camb, CLASS, cosmomc, compilers, etc.
Post Reply
Rohin Kumar
Posts: 2
Joined: December 08 2015
Affiliation: Research Scholar

CAMB: camb_python compilation error

Post by Rohin Kumar » December 08 2015

Hello all,

This is my first post here. So, please guide my way through. I tried installing the latest "CAMB" on my kubuntu 14.04. But with "make" I encountered the following error

Code: Select all

camb_python.f90:153:0: internal compiler error: Segmentation fault cData%q = c_loc(data%q%points)
Antony suggested (in a quick mail reply) that it could be because of my gfortran compiler being older than 4.9. Indeed my compiler was older (4.8.3). But updating didn't help...

I installed gfortran-5 (version 5.3) and gfortran-4.9 (version 4.9.3) and made changes to the compiler line in the make file accordingly (F90C = gfortran-5 and F90C = gfortran-4.9respectively). But now I get the following "Fatal Error" in "make"

Code: Select all

mkdir -p Release
gfortran-5 -O3 -fopenmp -ffast-math -fmax-errors=4 -march=native -
JRelease -IRelease/ Release/constants.o  Release/utils.o   
Release/subroutines.o Release/inifile.o  Release/power_tilt.o  
Release/recfast.o Release/reionization.o Release/modules.o 
Release/bessels.o Release/equations.o Release/halofit_ppf.o 
Release/lensing.o Release/SeparableBispectrum.o Release/cmbmain.o 
Release/camb.o inidriver.F90 -lstdc++ -o camb
inidriver.F90:7:8:

     use IniFile
        1
Fatal Error: Cannot read module file ‘inifile.mod’ opened at (1), because it was created by a different version of GNU Fortran
compilation terminated.
make: *** [camb] Error 1
another case

Code: Select all

mkdir -p Release
gfortran-4.9 -O3 -fopenmp -ffast-math -fmax-errors=4 -march=native -
JRelease -IRelease/ Release/constants.o  Release/utils.o   
Release/subroutines.o Release/inifile.o  Release/power_tilt.o  
Release/recfast.o Release/reionization.o Release/modules.o 
Release/bessels.o Release/equations.o Release/halofit_ppf.o 
Release/lensing.o Release/SeparableBispectrum.o Release/cmbmain.o 
Release/camb.o inidriver.F90 -lstdc++ -o camb
inidriver.F90:7.8:

    use IniFile
        1
Fatal Error: Cannot read module file 'inifile.mod' opened at (1), because it was created by a different version of GNU Fortran
make: *** [camb] Error 1
Looking forward to some inputs.

Thanks & Regards,
Rohin.

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

Re: CAMB: camb_python compilation error

Post by Antony Lewis » December 08 2015

Do a "make clean"

Rohin Kumar
Posts: 2
Joined: December 08 2015
Affiliation: Research Scholar

CAMB: camb_python compilation error

Post by Rohin Kumar » December 08 2015

That worked! I needed to additionally install g++5 to get libstdc++ and to complete the compilation.

It might be useful to include about the min. version of gcc required somewhere if it is not there already. May be a line in the Makefile to give warning/error after version comparison/dependency check. (The current version of Makefile says "#The options here work in v4.6+" in a comment about gfortran)

Thank you!

Post Reply