CAMB - make errors

Use of Healpix, camb, CLASS, cosmomc, compilers, etc.
Post Reply
Behzad Ansarinejad
Posts: 3
Joined: February 25 2016
Affiliation: Durham University

CAMB - make errors

Post by Behzad Ansarinejad » February 25 2016

I downloaded and unzipped the latest version of CAMB but when I tried to run 'make' I encountered the following errors:

Code: Select all

]$ make -k
which: no ifort in (/opt/local/starlink/64bit/star-2015B/java/jre/bin:/opt/local/starlink/64bit/star-2015B/java/bin:/usr/lib64/qt-3.3/bin:/opt/local/texlive/2015/bin/x86_64-linux:/opt/local/python/python/2.7.10/bin:/opt/local/latexdiff/latexdiff-1.03/bin:/opt/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/rptd37/bin:/opt/local/starlink/64bit/star-2015B/bin/startcl:/opt/local/starlink/64bit/star-2015B/bin:/opt/local/starlink/64bit/star-2015B/starjava/bin)
mkdir -p Release
gfortran -O3 -fopenmp -ffast-math -fmax-errors=4 -march=native -JRelease -IRelease/ -c constants.f90 -o Release/constants.o
constants.f90:84.19:

        if (id==0) error stop('Error id must be non-zero')
                   1
Error: Cannot assign to a named constant at (1)
make: *** [Release/constants.o] Error 1
gfortran -O3 -fopenmp -ffast-math -fmax-errors=4 -march=native -JRelease -IRelease/ -c utils.F90 -o Release/utils.o
utils.F90:1062.4:

    error stop
    1
Error: Unclassifiable statement at (1)
utils.F90:2590.16:

    use AMLUtils
                1
Fatal Error: Can't open module file 'amlutils.mod' for reading at (1): No such file or directory
make: *** [Release/utils.o] Error 1
mkdir -p Releaselib
gfortran -shared -fPIC -O3 -fopenmp -ffast-math -fmax-errors=4 -march=native -JReleaselib -IReleaselib/ -c constants.f90 -o Releaselib/constants.o
constants.f90:84.19:

        if (id==0) error stop('Error id must be non-zero')
                   1
Error: Cannot assign to a named constant at (1)
make: *** [Releaselib/constants.o] Error 1
gfortran -shared -fPIC -O3 -fopenmp -ffast-math -fmax-errors=4 -march=native -JReleaselib -IReleaselib/ -c utils.F90 -o Releaselib/utils.o
utils.F90:1062.4:

    error stop
    1
Error: Unclassifiable statement at (1)
utils.F90:2590.16:

    use AMLUtils
                1
Fatal Error: Can't open module file 'amlutils.mod' for reading at (1): No such file or directory
make: *** [Releaselib/utils.o] Error 1
make: Target `Release' not remade because of errors.
Is this because I'm missing something / should modify the makefile or is it due to a bug?

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

Re: CAMB - make errors

Post by Antony Lewis » February 25 2016

Perhaps your version of gfortran is too old? It works with 4.9 and higher.

Behzad Ansarinejad
Posts: 3
Joined: February 25 2016
Affiliation: Durham University

CAMB - make errors

Post by Behzad Ansarinejad » February 26 2016

I was using an old version of gfotran. I switched to 4.8.3 which is the latest we currently have on our system and got the following errors:

Code: Select all

 CAMB]$ make clean 
which: no ifort in (/opt/local/gcc/4.8.3/bin:/opt/local/starlink/64bit/star-2015B/java/jre/bin:/opt/local/starlink/64bit/star-2015B/java/bin:/usr/lib64/qt-3.3/bin:/opt/local/texlive/2015/bin/x86_64-linux:/opt/local/python/python/2.7.10/bin:/opt/local/latexdiff/latexdiff-1.03/bin:/opt/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/rptd37/bin:/opt/local/starlink/64bit/star-2015B/bin/startcl:/opt/local/starlink/64bit/star-2015B/bin:/opt/local/starlink/64bit/star-2015B/starjava/bin)
rm -f *.o *.a *.d core *.mod Releaselib/*.o Releaselib/*.mod
rm -f *.o *.a *.d core *.mod Release/*.o Release/*.mod
rm -rf Release*
rm -rf Debug*
CAMB]$ make
which: no ifort in (/opt/local/gcc/4.8.3/bin:/opt/local/starlink/64bit/star-2015B/java/jre/bin:/opt/local/starlink/64bit/star-2015B/java/bin:/usr/lib64/qt-3.3/bin:/opt/local/texlive/2015/bin/x86_64-linux:/opt/local/python/python/2.7.10/bin:/opt/local/latexdiff/latexdiff-1.03/bin:/opt/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/rptd37/bin:/opt/local/starlink/64bit/star-2015B/bin/startcl:/opt/local/starlink/64bit/star-2015B/bin:/opt/local/starlink/64bit/star-2015B/starjava/bin)
mkdir -p Release
gfortran -O3 -fopenmp -ffast-math -fmax-errors=4 -march=native -JRelease -IRelease/ -c constants.f90 -o Release/constants.o
gfortran -O3 -fopenmp -ffast-math -fmax-errors=4 -march=native -JRelease -IRelease/ -c utils.F90 -o Release/utils.o
gfortran -O3 -fopenmp -ffast-math -fmax-errors=4 -march=native -JRelease -IRelease/ -c subroutines.f90 -o Release/subroutines.o
gfortran -O3 -fopenmp -ffast-math -fmax-errors=4 -march=native -JRelease -IRelease/ -c inifile.f90 -o Release/inifile.o
gfortran -O3 -fopenmp -ffast-math -fmax-errors=4 -march=native -JRelease -IRelease/ -c power_tilt.f90 -o Release/power_tilt.o
gfortran -O3 -fopenmp -ffast-math -fmax-errors=4 -march=native -JRelease -IRelease/ -c recfast.f90 -o Release/recfast.o
gfortran -O3 -fopenmp -ffast-math -fmax-errors=4 -march=native -JRelease -IRelease/ -c reionization.f90 -o Release/reionization.o
gfortran -O3 -fopenmp -ffast-math -fmax-errors=4 -march=native -JRelease -IRelease/ -c modules.f90 -o Release/modules.o
gfortran -O3 -fopenmp -ffast-math -fmax-errors=4 -march=native -JRelease -IRelease/ -c bessels.f90 -o Release/bessels.o
gfortran -O3 -fopenmp -ffast-math -fmax-errors=4 -march=native -JRelease -IRelease/ -c equations.f90 -o Release/equations.o
gfortran -O3 -fopenmp -ffast-math -fmax-errors=4 -march=native -JRelease -IRelease/ -c halofit_ppf.f90 -o Release/halofit_ppf.o
gfortran -O3 -fopenmp -ffast-math -fmax-errors=4 -march=native -JRelease -IRelease/ -c lensing.f90 -o Release/lensing.o
gfortran -O3 -fopenmp -ffast-math -fmax-errors=4 -march=native -JRelease -IRelease/ -c SeparableBispectrum.F90 -o Release/SeparableBispectrum.o
gfortran -O3 -fopenmp -ffast-math -fmax-errors=4 -march=native -JRelease -IRelease/ -c cmbmain.f90 -o Release/cmbmain.o
gfortran -O3 -fopenmp -ffast-math -fmax-errors=4 -march=native -JRelease -IRelease/ -c camb.f90 -o Release/camb.o
gfortran -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
mkdir -p Releaselib
gfortran -shared -fPIC -O3 -fopenmp -ffast-math -fmax-errors=4 -march=native -JReleaselib -IReleaselib/ -c constants.f90 -o Releaselib/constants.o
gfortran -shared -fPIC -O3 -fopenmp -ffast-math -fmax-errors=4 -march=native -JReleaselib -IReleaselib/ -c utils.F90 -o Releaselib/utils.o
gfortran -shared -fPIC -O3 -fopenmp -ffast-math -fmax-errors=4 -march=native -JReleaselib -IReleaselib/ -c subroutines.f90 -o Releaselib/subroutines.o
gfortran -shared -fPIC -O3 -fopenmp -ffast-math -fmax-errors=4 -march=native -JReleaselib -IReleaselib/ -c inifile.f90 -o Releaselib/inifile.o
gfortran -shared -fPIC -O3 -fopenmp -ffast-math -fmax-errors=4 -march=native -JReleaselib -IReleaselib/ -c power_tilt.f90 -o Releaselib/power_tilt.o
gfortran -shared -fPIC -O3 -fopenmp -ffast-math -fmax-errors=4 -march=native -JReleaselib -IReleaselib/ -c recfast.f90 -o Releaselib/recfast.o
gfortran -shared -fPIC -O3 -fopenmp -ffast-math -fmax-errors=4 -march=native -JReleaselib -IReleaselib/ -c reionization.f90 -o Releaselib/reionization.o
gfortran -shared -fPIC -O3 -fopenmp -ffast-math -fmax-errors=4 -march=native -JReleaselib -IReleaselib/ -c modules.f90 -o Releaselib/modules.o
gfortran -shared -fPIC -O3 -fopenmp -ffast-math -fmax-errors=4 -march=native -JReleaselib -IReleaselib/ -c bessels.f90 -o Releaselib/bessels.o
gfortran -shared -fPIC -O3 -fopenmp -ffast-math -fmax-errors=4 -march=native -JReleaselib -IReleaselib/ -c equations.f90 -o Releaselib/equations.o
gfortran -shared -fPIC -O3 -fopenmp -ffast-math -fmax-errors=4 -march=native -JReleaselib -IReleaselib/ -c halofit_ppf.f90 -o Releaselib/halofit_ppf.o
gfortran -shared -fPIC -O3 -fopenmp -ffast-math -fmax-errors=4 -march=native -JReleaselib -IReleaselib/ -c lensing.f90 -o Releaselib/lensing.o
gfortran -shared -fPIC -O3 -fopenmp -ffast-math -fmax-errors=4 -march=native -JReleaselib -IReleaselib/ -c SeparableBispectrum.F90 -o Releaselib/SeparableBispectrum.o
gfortran -shared -fPIC -O3 -fopenmp -ffast-math -fmax-errors=4 -march=native -JReleaselib -IReleaselib/ -c cmbmain.f90 -o Releaselib/cmbmain.o
gfortran -shared -fPIC -O3 -fopenmp -ffast-math -fmax-errors=4 -march=native -JReleaselib -IReleaselib/ -c camb.f90 -o Releaselib/camb.o
gfortran -shared -fPIC -O3 -fopenmp -ffast-math -fmax-errors=4 -march=native -JReleaselib -IReleaselib/ -c camb_python.f90 -o Releaselib/camb_python.o
camb_python.f90: In function ‘convert_cltransferdata’:
camb_python.f90:153:0: internal compiler error: Segmentation fault
         cData%q = c_loc(data%q%points)
 ^
0x86b27f crash_signal
	../../../source/gcc-4.8.3/gcc/toplev.c:332
0x5b830f conv_isocbinding_procedure
	../../../source/gcc-4.8.3/gcc/fortran/trans-expr.c:3731
0x5b830f gfc_conv_procedure_call&#40;gfc_se*, gfc_symbol*, gfc_actual_arglist*, gfc_expr*, vec<tree_node*, va_gc, vl_embed>*&#41;
	../../../source/gcc-4.8.3/gcc/fortran/trans-expr.c&#58;3971
0x5b932a gfc_conv_function_expr
	../../../source/gcc-4.8.3/gcc/fortran/trans-expr.c&#58;5569
0x5b97ca gfc_conv_expr&#40;gfc_se*, gfc_expr*&#41;
	../../../source/gcc-4.8.3/gcc/fortran/trans-expr.c&#58;6261
0x5bedb6 gfc_trans_assignment_1
	../../../source/gcc-4.8.3/gcc/fortran/trans-expr.c&#58;7748
0x593285 trans_code
	../../../source/gcc-4.8.3/gcc/fortran/trans.c&#58;1422
0x5d6e43 gfc_trans_if_1
	../../../source/gcc-4.8.3/gcc/fortran/trans-stmt.c&#58;984
0x5dc57a gfc_trans_if&#40;gfc_code*&#41;
	../../../source/gcc-4.8.3/gcc/fortran/trans-stmt.c&#58;1015
0x5930e7 trans_code
	../../../source/gcc-4.8.3/gcc/fortran/trans.c&#58;1519
0x5b0692 gfc_generate_function_code&#40;gfc_namespace*&#41;
	../../../source/gcc-4.8.3/gcc/fortran/trans-decl.c&#58;5402
0x593a51 gfc_generate_module_code&#40;gfc_namespace*&#41;
	../../../source/gcc-4.8.3/gcc/fortran/trans.c&#58;1755
0x553c19 translate_all_program_units
	../../../source/gcc-4.8.3/gcc/fortran/parse.c&#58;4460
0x553c19 gfc_parse_file&#40;&#41;
	../../../source/gcc-4.8.3/gcc/fortran/parse.c&#58;4687
0x58f615 gfc_be_parse_file
	../../../source/gcc-4.8.3/gcc/fortran/f95-lang.c&#58;189
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http&#58;//gcc.gnu.org/bugs.html> for instructions.
make&#58; *** &#91;Releaselib/camb_python.o&#93; Error 1
I thought I'd copy that here in case it's caused by a bug. But I will look into getting version 4.9 and see how it works with that.

Thanks for your time,

Behzad

Behzad Ansarinejad
Posts: 3
Joined: February 25 2016
Affiliation: Durham University

CAMB - make errors (SOLVED)

Post by Behzad Ansarinejad » February 29 2016

Problem solved with gfortran version 5.3.0.

Many thanks.

Behzad

Mostafa Amini Nasab
Posts: 1
Joined: March 15 2016
Affiliation: University of Tehran

CAMB - make errors

Post by Mostafa Amini Nasab » March 15 2016

I tried to run make for CAMB with gcc-5.3 installed on my PC. but i got this error:

version 'GOMP_4.0' not found (required by CAMB)

Then i removed -openmp from the Makefile's FFLAGS and it compiled successfully.
what's the problem? can't it be solved without removing the -openmp?

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

Re: CAMB - make errors

Post by Antony Lewis » March 15 2016

This is a general gcc linking issue, see e.g.

http://askubuntu.com/questions/626537/h ... ed-program

Post Reply