Page 1 of 1

Problem when compiling wmap_likelihood_v3: cannot find -lcfi

Posted: August 25 2009
by Minghua Li
Hi, everyone!~^-^
I encountered a problem when installing the wmap_likelihood_v3
The following codes are my editon of the 'Makefile'

#Makefile --- WMAP Likelihood code...
#CFITSIO=/usr/local
#CFITSIO=/usr/local/cfitsio
CFITSIO=/home/limh/mywork/cfitsio/cfitsio
LAPDIR =/usr/local/Intel/mkl/lib/32
#

...
F90 = gfortran
FFLAGS = -O3 [tex](WMAPFLAGS)
INCS = -I.
LIBS = -L. -L[/tex](LAPDIR) -lcfitsio -lmkl_intel -lmkl_intel_thread -lmkl_lapack -lmkl_core -liomp5 -lpthread
...


When I ran 'make' in the directory 'likelihood_v3', I got the following message:
gfortran -O3 -DOPTIMIZE -I. -c -o read_archive_map.o read_archive_map.f90
gfortran -O3 -DOPTIMIZE -I. -c -o read_fits.o read_fits.f90
gfortran -O3 -DOPTIMIZE -I. -c -o healpix_types.o healpix_types.f90
gfortran -O3 -DOPTIMIZE -I. -c -o br_mod_dist.o br_mod_dist.f90
gfortran -O3 -DOPTIMIZE -I. -c -o WMAP_5yr_options.o WMAP_5yr_options.F90
gfortran -O3 -DOPTIMIZE -I. -c -o WMAP_5yr_util.o WMAP_5yr_util.f90
gfortran -O3 -DOPTIMIZE -I. -c -o WMAP_5yr_gibbs.o WMAP_5yr_gibbs.F90
gfortran -O3 -DOPTIMIZE -I. -c -o WMAP_5yr_tt_pixlike.o WMAP_5yr_tt_pixlike.F90
gfortran -O3 -DOPTIMIZE -I. -c -o WMAP_5yr_tt_beam_ptsrc_chisq.o WMAP_5yr_tt_beam_ptsrc_chisq.f90
gfortran -O3 -DOPTIMIZE -I. -c -o WMAP_5yr_teeebb_pixlike.o WMAP_5yr_teeebb_pixlike.F90
gfortran -O3 -DOPTIMIZE -I. -c -o WMAP_5yr_tetbeebbeb_pixlike.o WMAP_5yr_tetbeebbeb_pixlike.F90
gfortran -O3 -DOPTIMIZE -I. -c -o WMAP_5yr_likelihood.o WMAP_5yr_likelihood.F90
ar r libwmap5.a read_archive_map.o read_fits.o healpix_types.o br_mod_dist.o WMAP_5yr_options.o WMAP_5yr_ut
MAP_5yr_gibbs.o WMAP_5yr_tt_pixlike.o WMAP_5yr_tt_beam_ptsrc_chisq.o WMAP_5yr_teeebb_pixlike.o WMAP_5yr_
ebbeb_pixlike.o WMAP_5yr_likelihood.o
ar: creating libwmap5.a
gfortran -O3 -DOPTIMIZE -I. -c -o test.o test.F90
gfortran -O3 -DOPTIMIZE -o test test.o read_archive_map.o read_fits.o healpix_types.o br_mod_dist.o WMAP
options.o WMAP_5yr_util.o WMAP_5yr_gibbs.o WMAP_5yr_tt_pixlike.o WMAP_5yr_tt_beam_ptsrc_chisq.o WMAP_5yr_
b_pixlike.o WMAP_5yr_tetbeebbeb_pixlike.o WMAP_5yr_likelihood.o -L. -L/usr/local/Intel/mkl/lib/32 -lcfitsio
l_intel -lmkl_intel_thread -lmkl_lapack -lmkl_core -liomp5 -lpthread
/usr/bin/ld: cannot find -lcfitsio
collect2: ld return 1
make: *** [test] Error 1




My working environment is:
(1)I'm using a GFortran compiler (of the edition 'GNU Fortran (GCC) 4.3.0 20080428 (Red Hat 4.3.0-8)
Copyright © 2008 Free Software Foundation, Inc.') on Linux Fedora 9 system.
(2)I had already ran "make all" in the camb subdirectory of cosmomc.
(3)The 'wmap_likelihood_v3' is located in '/home/limh/mywork/WMAP5/likelihood_v3/'.
And the CFITIO is located in 'CFITSIO=/home/limh/mywork/cfitsio/cfitsio', which has already been 'make'.


I had tried deleting the code "CFITSIO=/home/limh/mywork/cfitsio/cfitsio" in the Makefile of likehood_v3, but it didn't make any difference. So I doubt that may be I didn't have the CFITSIO properly installed...but when I ran "make" in the cfitsio directory, everything seemed to be fine.
All help is welcome! Thanks!~^-^

Problem when compiling wmap_likelihood_v3: cannot find -lcfi

Posted: August 28 2009
by Minghua Li
I think I have figured it out.
The problem is I didn't give the right path for the libcfitsio.a, whicn was located in the "/home/limh/mywork/cfitsio_81/lib". That was the path I give when run "./configure --prefix= /home/limh/mywork/cfitsio_81" ,you should add the "/lib" at the end of the path, because the libcfitsio was in the lib subdirectory.
I think it may help some others, so I posted my solution. Thanks for your attention.