Problem with compiling CosmoMC October 2009 update 2

Use of Cobaya. camb, CLASS, cosmomc, compilers, etc.
Post Reply
Marianne Talvitie
Posts: 8
Joined: November 20 2009
Affiliation: University of Helsinki

Problem with compiling CosmoMC October 2009 update 2

Post by Marianne Talvitie » November 20 2009

Hi,
I downloaded the new CosmoMC release from October 09 and made necessary changes to Makefile. The camb part compiled ok. When compiling CosmoMC, everything runs fine till I get the error message:
____________________________________________
#gfortran -DMATRIX_SINGLE -O2 -I../camb -I/home/Software/cfitsio/include -I/home/Software/likelihood_v3 -c cmbtypes.f90
Warning: cmbtypes.f90:18: Illegal preprocessor directive
Warning: cmbtypes.f90:25: Illegal preprocessor directive
Warning: cmbtypes.f90:31: Illegal preprocessor directive
cmbtypes.f90:26.40:

integer, parameter :: num_matter_power = 74 !number of points computed in mat
1
Error: Symbol 'num_matter_power' at (1) already has basic type of INTEGER
cmbtypes.f90:27.42:

real, parameter :: matter_power_minkh = 0.999e-4 !1e-4 !minimum value of
1
Error: Symbol 'matter_power_minkh' at (1) already has basic type of REAL
cmbtypes.f90:28.42:

real, parameter :: matter_power_dlnkh = 0.143911568 !log spacing in k/h
1
Error: Symbol 'matter_power_dlnkh' at (1) already has basic type of REAL
cmbtypes.f90:29.41:

real, parameter :: matter_power_maxz = 0. !6.0
1
Error: Symbol 'matter_power_maxz' at (1) already has basic type of REAL
cmbtypes.f90:30.45:

integer, parameter :: matter_power_lnzsteps = 1 !20
1
Error: Symbol 'matter_power_lnzsteps' at (1) already has basic type of INTEGER
make: *** [cmbtypes.o] Error 1
_______________________________________________
Can you give me a hint of what I should do? I do not intend to use the SDSS LRG dataset for now, so the compiling should work without it.

Thanks!

Pascal Vaudrevange
Posts: 50
Joined: March 26 2006
Affiliation: DESY
Contact:

Problem with compiling CosmoMC October 2009 update 2

Post by Pascal Vaudrevange » November 20 2009

Hi Marianne,

adding

Code: Select all

-x f95-cpp-input
to the FFLAGS compiler flags will make gfortran preprocess the source files. I think that might fix your problem.

Pascal

Marianne Talvitie
Posts: 8
Joined: November 20 2009
Affiliation: University of Helsinki

Problem with compiling CosmoMC October 2009 update 2

Post by Marianne Talvitie » November 20 2009

Hi again,

Thanks a lot, adding this row really helped and the compilation continued a long way without errors. The next thing that came up was a warning:

_________________________________________________
...
gfortran -DMATRIX_SINGLE -O2 -x f95-cpp-input -I../camb -I/home/Software/cfitsio/include -I/home/Software/likelihood_v3 -c GetDist.f90
GetDist.f90:1859.53:

if (chain_exclude(ix) == chain_ix) goto 30
1
GetDist.f90:1998.15:

30 end do
2
Warning: Deleted feature: GOTO at (1) jumps to END of construct at (2)
GetDist.f90:1996.16:

goto 30
1
GetDist.f90:1998.15:

30 end do
2
Warning: Deleted feature: GOTO at (1) jumps to END of construct at (2)
gfortran -o ../getdist utils.o ParamNames.o Matrix_utils.o settings.o GetDist.o -L../camb -lcamb -llapack -L/home/Software/cfitsio/lib -L/home/Software/likelihood_v3 -lcfitsio -DMATRIX_SINGLE -O2 -x f95-cpp-input -I../camb -I/home/Software/cfitsio/include -I/home/Software/likelihood_v3
@:~/Software/cosmomc/source$
____________________________________________
Can this problem also be solved somehow?

Thanks again,
Marianne

Pascal Vaudrevange
Posts: 50
Joined: March 26 2006
Affiliation: DESY
Contact:

Problem with compiling CosmoMC October 2009 update 2

Post by Pascal Vaudrevange » November 21 2009

Hi Marianne,

you can safely ignore the warnings. It's just the compiler's way of discouraging the use of goto

http://en.wikipedia.or/wiki/Go_To_State ... ed_Harmful

Pascal

Marianne Talvitie
Posts: 8
Joined: November 20 2009
Affiliation: University of Helsinki

Problem with compiling CosmoMC October 2009 update 2

Post by Marianne Talvitie » November 21 2009

Thank you very much for your advice! I started running the program and it indeed seems to work alright.
br,
Marianne

Marianne Talvitie
Posts: 8
Joined: November 20 2009
Affiliation: University of Helsinki

Problem with compiling CosmoMC October 2009 update 2

Post by Marianne Talvitie » January 11 2010

Hi again,
When trying to compile CosmoMC October 2009 update 2 with Pathscale, I encounter a new but similar problem, where the previously found solution does not help. Any ideas how to get rid of these errors (see below)?
Thanks!
source> make all
cd ../camb && make --file=Makefile_main libcamb.a
make[1]: Entering directory `/cosmomc/camb'
ftn -O2 -mp -c constants.f90
/bin/ftn: INFO: linux target is being used
ftn -O2 -mp -c utils.F90
/bin/ftn: INFO: linux target is being used
ftn -O2 -mp -c ...
...
ftn -O2 -mp -c cmbmain.f90
/bin/ftn: INFO: linux target is being used
"cmbmain.f90", line 2139: Warning: Referenced scalar variable LFAC is SHARED by default
ftn -O2 -mp -c camb.f90
/bin/ftn: INFO: linux target is being used
ar -r libcamb.a constants.o utils.o subroutines.o inifile.o power_tilt.o recfast.o reionization.o modules.o bessels.o equations.o halofit.o lensing.o cmbmain.o camb.o
make[1]: Leaving directory `/cosmomc/camb'
ftn -DMATRIX_SINGLE -O2 -mp -I../camb -I/cfitsio/include -I/wrk/likelihood_v3 -c utils.F90
/bin/ftn: INFO: linux target is being used
utils.F90:2772: warning: no newline at end of file
ftn -DMATRIX_SINGLE -O2 -mp -I../camb -I/cfitsio/include -I/wrk//likelihood_v3 -c ParamNames.f90
/bin/ftn: INFO: linux target is being used
ftn -DMATRIX_SINGLE -O2 -mp -I../camb -I/cfitsio/include -I/wrk/likelihood_v3 -c Matrix_utils.F90
/bin/ftn: INFO: linux target is being used
ftn -DMATRIX_SINGLE -O2 -mp -I../camb -I/cfitsio/include -I/wrk/likelihood_v3 -c settings.f90
/bin/ftn: INFO: linux target is being used
ftn -DMATRIX_SINGLE -O2 -mp -I../camb -I/cfitsio/include -I/wrk/likelihood_v3 -c IO.f90
/bin/ftn: INFO: linux target is being used
ftn -DMATRIX_SINGLE -O2 -mp -I../camb -I/cfitsio/include -I/wrk/likelihood_v3 -c cmbtypes.f90
/bin/ftn: INFO: linux target is being used

module cmbtypes
^
pathf95-855 pathf90-3.2: ERROR CMBTYPES, File = cmbtypes.f90, Line = 3, Column = 8
The compiler has detected errors in module "CMBTYPES". No module information file will be created for this module.

#ifdef DR71RG
^
pathf95-100 pathf90-3.2: ERROR CMBTYPES, File = cmbtypes.f90, Line = 18, Column = 1
This statement must begin with a label, a keyword, or an identifier.

#else
^
pathf95-100 pathf90-3.2: ERROR CMBTYPES, File = cmbtypes.f90, Line = 25, Column = 1
This statement must begin with a label, a keyword, or an identifier.

integer, parameter :: num_matter_power = 74 !number of points computed in matter power spectrum
^
pathf95-1259 pathf90-3.2: WARNING CMBTYPES, File = cmbtypes.f90, Line = 26, Column = 25
"NUM_MATTER_POWER" (which first appeared at line 20) has been given the INTEGER(KIND=4) attribute more than once.
^
pathf95-554 pathf90-3.2: ERROR CMBTYPES, File = cmbtypes.f90, Line = 26, Column = 25
"NUM_MATTER_POWER" has the PARAMETER attribute. It must not be given the PARAMETER attribute again (identifier first appeared at line 20)

real, parameter :: matter_power_minkh = 0.999e-4 !1e-4 !minimum value of k/h to store
^
pathf95-1259 pathf90-3.2: WARNING CMBTYPES, File = cmbtypes.f90, Line = 27, Column = 25
"MATTER_POWER_MINKH" (which first appeared at line 21) has been given the REAL(KIND=4) attribute more than once.
^
pathf95-554 pathf90-3.2: ERROR CMBTYPES, File = cmbtypes.f90, Line = 27, Column = 25
"MATTER_POWER_MINKH" has the PARAMETER attribute. It must not be given the PARAMETER attribute again (identifier first appeared at line 21)

real, parameter :: matter_power_dlnkh = 0.143911568 !log spacing in k/h
^
pathf95-1259 pathf90-3.2: WARNING CMBTYPES, File = cmbtypes.f90, Line = 28, Column = 25
"MATTER_POWER_DLNKH" (which first appeared at line 22) has been given the REAL(KIND=4) attribute more than once.
^
pathf95-554 pathf90-3.2: ERROR CMBTYPES, File = cmbtypes.f90, Line = 28, Column = 25
"MATTER_POWER_DLNKH" has the PARAMETER attribute. It must not be given the PARAMETER attribute again (identifier first appeared at line 22)

real, parameter :: matter_power_maxz = 0. !6.0
^
pathf95-1259 pathf90-3.2: WARNING CMBTYPES, File = cmbtypes.f90, Line = 29, Column = 25
"MATTER_POWER_MAXZ" (which first appeared at line 23) has been given the REAL(KIND=4) attribute more than once.
^
pathf95-554 pathf90-3.2: ERROR CMBTYPES, File = cmbtypes.f90, Line = 29, Column = 25
"MATTER_POWER_MAXZ" has the PARAMETER attribute. It must not be given the PARAMETER attribute again (identifier first appeared at line 23)

integer, parameter :: matter_power_lnzsteps = 1 !20
^
pathf95-1259 pathf90-3.2: WARNING CMBTYPES, File = cmbtypes.f90, Line = 30, Column = 25
"MATTER_POWER_LNZSTEPS" (which first appeared at line 24) has been given the INTEGER(KIND=4) attribute more than once.
^
pathf95-554 pathf90-3.2: ERROR CMBTYPES, File = cmbtypes.f90, Line = 30, Column = 25
"MATTER_POWER_LNZSTEPS" has the PARAMETER attribute. It must not be given the PARAMETER attribute again (identifier first appeared at line 24)

#endif
^
pathf95-100 pathf90-3.2: ERROR CMBTYPES, File = cmbtypes.f90, Line = 31, Column = 1
This statement must begin with a label, a keyword, or an identifier.

pathf95: PathScale(TM) Fortran Version 3.2 (f14) Sun Jan 10, 2010 23:43:46
pathf95: 425 source lines
pathf95: 9 Error(s), 5 Warning(s), 0 Other message(s), 0 ANSI(s)
pathf95: "explain pathf95-message number" gives more information about each message
make: *** [cmbtypes.o] Error 2

Marianne Talvitie
Posts: 8
Joined: November 20 2009
Affiliation: University of Helsinki

Problem with compiling CosmoMC October 2009 update 2

Post by Marianne Talvitie » January 27 2010

Solved.

Post Reply