error in compiling with gfortran

Use of Cobaya. camb, CLASS, cosmomc, compilers, etc.
Post Reply
Fateme Fehresti
Posts: 3
Joined: May 28 2013
Affiliation: Zanjan University

error in compiling with gfortran

Post by Fateme Fehresti » November 06 2013

Dear all
I use 2013 oct version of CAMB
I wanted to compile my program with gfortran compiler, but it makes error.
its error is:
unrecognized option'-cxxlib'

could you please help me to solve this problem?
Best regards

Jason Dossett
Posts: 97
Joined: March 19 2010
Affiliation: The University of Texas at Dallas
Contact:

error in compiling with gfortran

Post by Jason Dossett » November 07 2013

Hi Feteme,

You should comment out that first set of lines for compiling with ifort and uncomment the lines for compiling with gfortran as follows

Code: Select all

#Intel , -openmp toggles mutli-processor:
#note version 10.0 gives wrong result for lensed when compiled with -openmp [fixed in 10.1]
#F90C     = ifort
#FFLAGS = -openmp -O2 -W0 -WB -fpp2 -vec_report0
## This is flag is passed to the Fortran compiler allowing it to link C++ if required (not usually):
#F90CRLINK = -cxxlib
#ifneq ($(FISHER),)
#FFLAGS += -mkl
#endif

#Gfortran compiler:
#The options here work in v4.5, delete from RHS in earlier versions (15% slower)
#if pre v4.3 add -D__GFORTRAN__
#With v4.6+ try -Ofast -march=native -fopenmp
#On my machine v4.5 is about 20% slower than ifort
F90C     = gfortran
FFLAGS =  -O3 -fopenmp -ffast-math -march=native -funroll-loops
Also a quick note, the current version of camb does not seem to compile below gcc 4.4. Version 4.3 does not appear to have the built in bessel functions needed when compiling lensing.f90.

Fateme Fehresti
Posts: 3
Joined: May 28 2013
Affiliation: Zanjan University

error in compiling with gfortran

Post by Fateme Fehresti » November 09 2013

Hi Jason
Thanks for your help
I tried ifort command but because my ifort version was 2011 it didnt work. I know that I should use ifort 2013 but I dont have license for this version.

anyway thanks alot

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

Re: error in compiling with gfortran

Post by Antony Lewis » November 09 2013

camb should work with old ifort versions, only CosmoMC needs ifort 13+.

Post Reply