CosmoCoffee Forum Index CosmoCoffee

 
 FAQFAQ   SearchSearch  MemberlistSmartFeed   MemberlistMemberlist    RegisterRegister 
   ProfileProfile   Log inLog in 
Arxiv New Filter | Bookmarks & clubs | Arxiv ref/author:

CosmoMC compiling error
 
Post new topic   Reply to topic    CosmoCoffee Forum Index -> Computers and software
View previous topic :: View next topic  
Author Message
Jisu Kang



Joined: 06 Jun 2016
Posts: 5
Affiliation: SNU

PostPosted: June 06 2016  Reply with quote

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:

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:

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:

FITSDIR       = /packages/cfitsio
FITSLIB       = /packages/cfitsio/lib
HEALPIXDIR    = /packages/Healpix_3.30

What should I do?
Back to top
View user's profile  
Jason Dossett



Joined: 19 Mar 2010
Posts: 97
Affiliation: The University of Texas at Dallas

PostPosted: June 06 2016  Reply with quote

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:
-f90=ifort
Back to top
View user's profile [ Hidden ] Visit poster's website
Jisu Kang



Joined: 06 Jun 2016
Posts: 5
Affiliation: SNU

PostPosted: June 07 2016  Reply with quote

Thank you for your reply!
I edit the source/Makefile as follows
Code:
MPIF90C = mpif90 -f90=ifort

and add the openmpi/lib path to LD_LIBRARY_PATH.
Code:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/packages/openmpi/lib


But I met another error like this.
Code:

/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?
Back to top
View user's profile  
Antony Lewis



Joined: 23 Sep 2004
Posts: 1293
Affiliation: University of Sussex

PostPosted: June 07 2016  Reply with quote

Make sure WMAP etc are compiled with the same compiler.
Back to top
View user's profile [ Hidden ] Visit poster's website
Jisu Kang



Joined: 06 Jun 2016
Posts: 5
Affiliation: SNU

PostPosted: June 08 2016  Reply with quote

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!
Back to top
View user's profile  
Jason Dossett



Joined: 19 Mar 2010
Posts: 97
Affiliation: The University of Texas at Dallas

PostPosted: June 08 2016  Reply with quote

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.
Back to top
View user's profile [ Hidden ] Visit poster's website
Jisu Kang



Joined: 06 Jun 2016
Posts: 5
Affiliation: SNU

PostPosted: June 09 2016  Reply with quote

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!
Back to top
View user's profile  
Yutong Wang



Joined: 06 May 2014
Posts: 9
Affiliation: UCAS

PostPosted: June 10 2016  Reply with quote

Jisu Kang wrote:
Thank you for your reply!
I edit the source/Makefile as follows
Code:
MPIF90C = mpif90 -f90=ifort

and add the openmpi/lib path to LD_LIBRARY_PATH.
Code:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/packages/openmpi/lib


But I met another error like this.
Code:

/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" .
Back to top
View user's profile  
Jisu Kang



Joined: 06 Jun 2016
Posts: 5
Affiliation: SNU

PostPosted: June 12 2016  Reply with quote

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!
Back to top
View user's profile  
Display posts from previous:   
Post new topic   Reply to topic    CosmoCoffee Forum Index -> Computers and software All times are GMT + 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group. Sponsored by WordWeb online dictionary and dictionary software.