CosmoMC compiling error

Use of Healpix, camb, CLASS, cosmomc, compilers, etc.
Post Reply
Jisu Kang
Posts: 5
Joined: June 06 2016
Affiliation: SNU

CosmoMC compiling error

Post by Jisu Kang » June 06 2016

Hello.
I want to install CosmoMC, so I followed the instruction.
(installing Fortran compiler, open MPI, CFITSIO, HEALPix, and building WMAP, Planck data)
But when I type "make" to compile CosmoMC after editing Makefile, I have an error.

Code: Select all

cd ./source && make cosmomc BUILD=MPI
make[1]: Entering directory '/packages/cosmomc/source'
mkdir -p ReleaseMPI
cd ../camb && \
make --file=Makefile_main libcamb OUTPUT_DIR=ReleaseMPI \
RECOMBINATION=recfast EQUATIONS=equations_ppf NONLINEAR=halofit_ppf
make[2]: Entering directory '/packages/cosmomc/camb'
mkdir -p ReleaseMPI
mpif90 -mkl -openmp -O3 -no-prec-div -fpp -xHost -DMPI -module ReleaseMPI -IReleaseMPI/ -c constants.f90 -o ReleaseMPI/constants.o
gfortran: error: unrecognized command line option '-mkl'
gfortran: error: unrecognized command line option '-no-prec-div'
gfortran: error: unrecognized command line option '-fpp'
gfortran: error: unrecognized command line option '-module'
Makefile_main:88: recipe for target 'ReleaseMPI/constants.o' failed
make[2]: *** [ReleaseMPI/constants.o] Error 1
make[2]: Leaving directory '/packages/cosmomc/camb'
Makefile:304: recipe for target 'camb' failed
make[1]: *** [camb] Error 2
make[1]: Leaving directory '/packages/cosmomc/source'
Makefile:17: recipe for target 'cosmomc' failed
make: *** [cosmomc] Error 2
I just edit my Makefile as follows
vi cosmomc/source/Makefile

Code: Select all

WMAP = /packages/wmap_likelihood_v5
cfitsio = /packages/cfitsio
…
ifeq ($(COSMOHOST), darwin)
WMAP = /packages/wmap_likelihood_v5
cfitsio = /packages/cfitsio
endif
vi cosmomc/camb/Makefile

Code: Select all

FITSDIR       = /packages/cfitsio
FITSLIB       = /packages/cfitsio/lib
HEALPIXDIR    = /packages/Healpix_3.30
What should I do?

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

CosmoMC compiling error

Post by Jason Dossett » June 06 2016

Are you using intel's MPI? If so, in source/Makefile, change MPIF90C from mpif90 to mpiifort.

Otherwise you need to switch which compiler mpif90 points to to ifort, this can be done with the option

Code: Select all

-f90=ifort

Jisu Kang
Posts: 5
Joined: June 06 2016
Affiliation: SNU

CosmoMC compiling error

Post by Jisu Kang » June 07 2016

Thank you for your reply!
I edit the source/Makefile as follows

Code: Select all

MPIF90C = mpif90 -f90=ifort
and add the openmpi/lib path to LD_LIBRARY_PATH.

Code: Select all

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/packages/openmpi/lib
But I met another error like this.

Code: Select all

/packages/wmap_likelihood_v5/libwmap9.a(read_archive_map.o): In function `read_archive_map_':
read_archive_map.f90:(.text+0x3c): undefined reference to `ftgiou_'
read_archive_map.f90:(.text+0x58): undefined reference to `ftopen_'
read_archive_map.f90:(.text+0x85): undefined reference to `ftmahd_'
read_archive_map.f90:(.text+0x118): undefined reference to `ftgnrw_'
read_archive_map.f90:(.text+0x28c): undefined reference to `ftgcve_'
read_archive_map.f90:(.text+0x501): undefined reference to `ftgcve_'
read_archive_map.f90:(.text+0x623): undefined reference to `ftclos_'
read_archive_map.f90:(.text+0x637): undefined reference to `ftfiou_'
/packages/wmap_likelihood_v5/libwmap9.a(read_fits.o): In function `read_fits_real_2d_':
read_fits.f90:(.text+0x48): undefined reference to `ftgiou_'
read_fits.f90:(.text+0x65): undefined reference to `ftopen_'
read_fits.f90:(.text+0x77): undefined reference to `ftgidm_'
read_fits.f90:(.text+0x132): undefined reference to `ftgkyj_'
read_fits.f90:(.text+0x160): undefined reference to `ftgkyj_'
read_fits.f90:(.text+0x806): undefined reference to `ftgpve_'
read_fits.f90:(.text+0x94d): undefined reference to `ftclos_'
read_fits.f90:(.text+0x961): undefined reference to `ftfiou_'
/packages/wmap_likelihood_v5/libwmap9.a(read_fits.o): In function `read_fits_double_2d_':
read_fits.f90:(.text+0xb58): undefined reference to `ftgiou_'
read_fits.f90:(.text+0xb75): undefined reference to `ftopen_'
read_fits.f90:(.text+0xb87): undefined reference to `ftgidm_'
read_fits.f90:(.text+0xc42): undefined reference to `ftgkyj_'
read_fits.f90:(.text+0xc70): undefined reference to `ftgkyj_'
read_fits.f90:(.text+0x12fd): undefined reference to `ftgpvd_'
read_fits.f90:(.text+0x1431): undefined reference to `ftclos_'
read_fits.f90:(.text+0x1445): undefined reference to `ftfiou_'
/packages/wmap_likelihood_v5/libwmap9.a(read_fits.o): In function `read_fits_real_3d_':
read_fits.f90:(.text+0x1eff): undefined reference to `ftgiou_'
read_fits.f90:(.text+0x1f1c): undefined reference to `ftopen_'
read_fits.f90:(.text+0x1f2e): undefined reference to `ftgidm_'
read_fits.f90:(.text+0x1fe9): undefined reference to `ftgkyj_'
read_fits.f90:(.text+0x201a): undefined reference to `ftgkyj_'
read_fits.f90:(.text+0x2048): undefined reference to `ftgkyj_'
read_fits.f90:(.text+0x290f): undefined reference to `ftgpve_'
read_fits.f90:(.text+0x292c): undefined reference to `ftclos_'
read_fits.f90:(.text+0x2940): undefined reference to `ftfiou_'
/packages/wmap_likelihood_v5/libwmap9.a(read_fits.o): In function `read_fits_complex_2d_lm_':
read_fits.f90:(.text+0x34ac): undefined reference to `ftgiou_'
read_fits.f90:(.text+0x34d0): undefined reference to `ftopen_'
read_fits.f90:(.text+0x34e4): undefined reference to `ftgidm_'
read_fits.f90:(.text+0x359f): undefined reference to `ftgkyj_'
read_fits.f90:(.text+0x35cf): undefined reference to `ftgkyj_'
read_fits.f90:(.text+0x37c8): undefined reference to `ftgpve_'
read_fits.f90:(.text+0x383e): undefined reference to `ftclos_'
read_fits.f90:(.text+0x3858): undefined reference to `ftfiou_'
/packages/wmap_likelihood_v5/libwmap9.a(br_mod_dist.o): In function `br_mod_dist_mp_read_gibbs_chain_':
br_mod_dist.f90:(.text+0x1234): undefined reference to `ftopen_'
br_mod_dist.f90:(.text+0x1272): undefined reference to `ftgkyj_'
br_mod_dist.f90:(.text+0x12a2): undefined reference to `ftgkyj_'
br_mod_dist.f90:(.text+0x12d2): undefined reference to `ftgkyj_'
br_mod_dist.f90:(.text+0x1306): undefined reference to `ftgkyj_'
br_mod_dist.f90:(.text+0x14fd): undefined reference to `ftgpve_'
br_mod_dist.f90:(.text+0x1525): undefined reference to `ftclos_'
Makefile:286: recipe for target 'cosmomc' failed
make[1]: *** [cosmomc] Error 1
make[1]: Leaving directory '/packages/cosmomc/source'
Makefile:17: recipe for target 'cosmomc' failed
make: *** [cosmomc] Error 2
Do you have any idea to solve this?

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

Re: CosmoMC compiling error

Post by Antony Lewis » June 07 2016

Make sure WMAP etc are compiled with the same compiler.

Jisu Kang
Posts: 5
Joined: June 06 2016
Affiliation: SNU

CosmoMC compiling error

Post by Jisu Kang » June 08 2016

I compiled WMAP with ifort, but it didn't changed at all.
So I just gave up using WMAP data and compiled CosmoMC successfully.
Thank you for your help!

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

CosmoMC compiling error

Post by Jason Dossett » June 08 2016

Those errors are from CFITSIO routines that can't be found. Make sure you are linking to CFITSIO correctly. Maybe try compiling the wmap likelihood alone and running the tests to see how you need to do the linking.

Jisu Kang
Posts: 5
Joined: June 06 2016
Affiliation: SNU

CosmoMC compiling error

Post by Jisu Kang » June 09 2016

Oh, Thank you so much!
I didn't designate the cfitsio path in the source/Makefile and it didn't make any errors.
Thank you for all of your helps, everyone!

Yutong Wang
Posts: 9
Joined: May 06 2014
Affiliation: UCAS

Re: CosmoMC compiling error

Post by Yutong Wang » June 10 2016

Jisu Kang wrote:Thank you for your reply!
I edit the source/Makefile as follows

Code: Select all

MPIF90C = mpif90 -f90=ifort
and add the openmpi/lib path to LD_LIBRARY_PATH.

Code: Select all

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/packages/openmpi/lib
But I met another error like this.

Code: Select all

/packages/wmap_likelihood_v5/libwmap9.a(read_archive_map.o): In function `read_archive_map_':
read_archive_map.f90:(.text+0x3c): undefined reference to `ftgiou_'
read_archive_map.f90:(.text+0x58): undefined reference to `ftopen_'
read_archive_map.f90:(.text+0x85): undefined reference to `ftmahd_'
read_archive_map.f90:(.text+0x118): undefined reference to `ftgnrw_'
read_archive_map.f90:(.text+0x28c): undefined reference to `ftgcve_'
read_archive_map.f90:(.text+0x501): undefined reference to `ftgcve_'
read_archive_map.f90:(.text+0x623): undefined reference to `ftclos_'
read_archive_map.f90:(.text+0x637): undefined reference to `ftfiou_'
/packages/wmap_likelihood_v5/libwmap9.a(read_fits.o): In function `read_fits_real_2d_':
read_fits.f90:(.text+0x48): undefined reference to `ftgiou_'
read_fits.f90:(.text+0x65): undefined reference to `ftopen_'
read_fits.f90:(.text+0x77): undefined reference to `ftgidm_'
read_fits.f90:(.text+0x132): undefined reference to `ftgkyj_'
read_fits.f90:(.text+0x160): undefined reference to `ftgkyj_'
read_fits.f90:(.text+0x806): undefined reference to `ftgpve_'
read_fits.f90:(.text+0x94d): undefined reference to `ftclos_'
read_fits.f90:(.text+0x961): undefined reference to `ftfiou_'
/packages/wmap_likelihood_v5/libwmap9.a(read_fits.o): In function `read_fits_double_2d_':
read_fits.f90:(.text+0xb58): undefined reference to `ftgiou_'
read_fits.f90:(.text+0xb75): undefined reference to `ftopen_'
read_fits.f90:(.text+0xb87): undefined reference to `ftgidm_'
read_fits.f90:(.text+0xc42): undefined reference to `ftgkyj_'
read_fits.f90:(.text+0xc70): undefined reference to `ftgkyj_'
read_fits.f90:(.text+0x12fd): undefined reference to `ftgpvd_'
read_fits.f90:(.text+0x1431): undefined reference to `ftclos_'
read_fits.f90:(.text+0x1445): undefined reference to `ftfiou_'
/packages/wmap_likelihood_v5/libwmap9.a(read_fits.o): In function `read_fits_real_3d_':
read_fits.f90:(.text+0x1eff): undefined reference to `ftgiou_'
read_fits.f90:(.text+0x1f1c): undefined reference to `ftopen_'
read_fits.f90:(.text+0x1f2e): undefined reference to `ftgidm_'
read_fits.f90:(.text+0x1fe9): undefined reference to `ftgkyj_'
read_fits.f90:(.text+0x201a): undefined reference to `ftgkyj_'
read_fits.f90:(.text+0x2048): undefined reference to `ftgkyj_'
read_fits.f90:(.text+0x290f): undefined reference to `ftgpve_'
read_fits.f90:(.text+0x292c): undefined reference to `ftclos_'
read_fits.f90:(.text+0x2940): undefined reference to `ftfiou_'
/packages/wmap_likelihood_v5/libwmap9.a(read_fits.o): In function `read_fits_complex_2d_lm_':
read_fits.f90:(.text+0x34ac): undefined reference to `ftgiou_'
read_fits.f90:(.text+0x34d0): undefined reference to `ftopen_'
read_fits.f90:(.text+0x34e4): undefined reference to `ftgidm_'
read_fits.f90:(.text+0x359f): undefined reference to `ftgkyj_'
read_fits.f90:(.text+0x35cf): undefined reference to `ftgkyj_'
read_fits.f90:(.text+0x37c8): undefined reference to `ftgpve_'
read_fits.f90:(.text+0x383e): undefined reference to `ftclos_'
read_fits.f90:(.text+0x3858): undefined reference to `ftfiou_'
/packages/wmap_likelihood_v5/libwmap9.a(br_mod_dist.o): In function `br_mod_dist_mp_read_gibbs_chain_':
br_mod_dist.f90:(.text+0x1234): undefined reference to `ftopen_'
br_mod_dist.f90:(.text+0x1272): undefined reference to `ftgkyj_'
br_mod_dist.f90:(.text+0x12a2): undefined reference to `ftgkyj_'
br_mod_dist.f90:(.text+0x12d2): undefined reference to `ftgkyj_'
br_mod_dist.f90:(.text+0x1306): undefined reference to `ftgkyj_'
br_mod_dist.f90:(.text+0x14fd): undefined reference to `ftgpve_'
br_mod_dist.f90:(.text+0x1525): undefined reference to `ftclos_'
Makefile:286: recipe for target 'cosmomc' failed
make[1]: *** [cosmomc] Error 1
make[1]: Leaving directory '/packages/cosmomc/source'
Makefile:17: recipe for target 'cosmomc' failed
make: *** [cosmomc] Error 2
Do you have any idea to solve this?
Hi~

please try these codes as followed and I think you will slove this problem:

cd $DIR/cfitsio

make clean

make shared

make install


By the way, Mr.Dossett pointed the core of this error, actually it is cause by "linking to cfitsio incorrectly" .

Jisu Kang
Posts: 5
Joined: June 06 2016
Affiliation: SNU

CosmoMC compiling error

Post by Jisu Kang » June 12 2016

Oh, thank you so much!
I compiled cfitsio again and the problem has solved.
Everyone in here seems so kind and smart.
Thank you again, everybody!

Post Reply