Error when "make all" in the source subdirectoy of CosmoMC: "/usr/bin/ld: -f may not be used without -shared"

Use of Healpix, camb, CLASS, cosmomc, compilers, etc.
Post Reply
Minghua Li
Posts: 15
Joined: August 25 2009
Affiliation: Institue of High Energy Physics, Chinese Academy of Sciences

Error when \"make all\" in the source subdirectoy

Post by Minghua Li » August 28 2009

Today, after I have successfully compiled the camb, the CFITSIO and WMAP_5yr_likelihood_v3(whchi I have ran "make check" to make sure it was properly compiled) , I ran "make all" in the source subdirectory and an error poped out.

Here is my Makefile in the source subdirectory:

#You may need to edit the library paths for MKL for Intel
#Beware of using optmizations that lose accuracy - may give errors when running
#Edit for CFITSIO directories
cfitsio = /home/limh/mywork/cfitsio_81
#/usr/local/Cluster-Users/cpac/cmb/2.1.0/cfitsio
WMAP = /home/limh/mywork/WMAP5/likelihood_v3
IFLAG = -I
INCLUDE=
#Intel MPI (assuming mpif77 set to point to ifort)
#change -lmkl_ia32 to -lmkl_p3 for MKL versions earlier than 6 (6 needed for ifc 8+)
F90C = gfortran
FFLAGS = -O2 -ffree-form
LAPACKL = -Wl,-framework -Wl,accelerate

...


The feedback was:
gfortran -DMATRIX_SINGLE -O2 -ffree-form -I/home/limh/mywork/cfitsio_81/include -I/home/limh/mywork/WMAP5/
likelihood_v3 -I../camb -c utils.F90
gfortran -DMATRIX_SINGLE -O2 -ffree-form -I/home/limh/mywork/cfitsio_81/include -I/home/limh/mywork/WMAP5/
likelihood_v3 -I../camb -c Matrix_utils.F90
gfortran -DMATRIX_SINGLE -O2 -ffree-form -I/home/limh/mywork/cfitsio_81/include -I/home/limh/mywork/WMAP5/
likelihood_v3 -I../camb -c settings.f90
gfortran -DMATRIX_SINGLE -O2 -ffree-form -I/home/limh/mywork/cfitsio_81/include -I/home/limh/mywork/WMAP5/
likelihood_v3 -I../camb -c cmbtypes.f90
gfortran -DMATRIX_SINGLE -O2 -ffree-form -I/home/limh/mywork/cfitsio_81/include -I/home/limh/mywork/WMAP5/
likelihood_v3 -I../camb -c Planck_like.f90
gfortran -DMATRIX_SINGLE -O2 -ffree-form -I/home/limh/mywork/cfitsio_81/include -I/home/limh/mywork/WMAP5/
likelihood_v3 -I../camb -c cmbdata.F90
gfortran -DMATRIX_SINGLE -O2 -ffree-form -I/home/limh/mywork/cfitsio_81/include -I/home/limh/mywork/WMAP5/
likelihood_v3 -I../camb -c WeakLen.f90
gfortran -DMATRIX_SINGLE -O2 -ffree-form -I/home/limh/mywork/cfitsio_81/include -I/home/limh/mywork/WMAP5/
likelihood_v3 -I../camb -c mpk.f90
gfortran -DMATRIX_SINGLE -O2 -ffree-form -I/home/limh/mywork/cfitsio_81/include -I/home/limh/mywork/WMAP5/
likelihood_v3 -I../camb -c supernovae.f90
gfortran -DMATRIX_SINGLE -O2 -ffree-form -I/home/limh/mywork/cfitsio_81/include -I/home/limh/mywork/WMAP5/
likelihood_v3 -I../camb -c SDSSLy-a-v3.f90
gfortran -DMATRIX_SINGLE -O2 -ffree-form -I/home/limh/mywork/cfitsio_81/include -I/home/limh/mywork/WMAP5/
likelihood_v3 -I../camb -c CMB_Cls_simple.f90
gfortran -DMATRIX_SINGLE -O2 -ffree-form -I/home/limh/mywork/cfitsio_81/include -I/home/limh/mywork/WMAP5/
likelihood_v3 -I../camb -c paramdef.F90
gfortran -DMATRIX_SINGLE -O2 -ffree-form -I/home/limh/mywork/cfitsio_81/include -I/home/limh/mywork/WMAP5/
likelihood_v3 -I../camb -c propose.f90
gfortran -DMATRIX_SINGLE -O2 -ffree-form -I/home/limh/mywork/cfitsio_81/include -I/home/limh/mywork/WMAP5/
likelihood_v3 -I../camb -c params_CMB.f90
gfortran -DMATRIX_SINGLE -O2 -ffree-form -I/home/limh/mywork/cfitsio_81/include -I/home/limh/mywork/WMAP5/likelihood_v3 -I../camb -c calclike.f90
gfortran -DMATRIX_SINGLE -O2 -ffree-form -I/home/limh/mywork/cfitsio_81/include -I/home/limh/mywork/WMAP5/
likelihood_v3 -I../camb -c conjgrad_wrapper.f90
gfortran -DMATRIX_SINGLE -O2 -ffree-form -I/home/limh/mywork/cfitsio_81/include -I/home/limh/mywork/WMAP5/
likelihood_v3 -I../camb -c EstCovmat.f90
gfortran -DMATRIX_SINGLE -O2 -ffree-form -I/home/limh/mywork/cfitsio_81/include -I/home/limh/mywork/WMAP5/
likelihood_v3 -I../camb -c postprocess.f90
gfortran -DMATRIX_SINGLE -O2 -ffree-form -I/home/limh/mywork/cfitsio_81/include -I/home/limh/mywork/WMAP5/
likelihood_v3 -I../camb -c MCMC.f90
gfortran -DMATRIX_SINGLE -O2 -ffree-form -I/home/limh/mywork/cfitsio_81/include -I/home/limh/mywork/WMAP5/
likelihood_v3 -I../camb -c driver.F90
gfortran -o ../cosmomc /home/limh/mywork/WMAP5/likelihood_v3/read_archive_map.o /home/limh/mywork/WMAP5/likeli
hood_v3/read_fits.o /home/limh/mywork/WMAP5/likelihood_v3/WMAP_5yr_options.o /home/limh/mywork/WMAP5/likeliho
od_v3/WMAP_5yr_util.o /home/limh/mywork/WMAP5/likelihood_v3/WMAP_5yr_tt_pixlike.o /home/limh/mywork/WMAP5/li
kelihood_v3/WMAP_5yr_teeebb_pixlike.o /home/limh/mywork/WMAP5/likelihood_v3/WMAP_5yr_likelihood.o /home/limh/
mywork/WMAP5/likelihood_v3/WMAP_5yr_gibbs.o /home/limh/mywork/WMAP5/likelihood_v3/WMAP_5yr_tt_beam_ptsrc_ch
isq.o /home/limh/mywork/WMAP5/likelihood_v3/br_mod_dist.o utils.o Matrix_utils.o settings.o cmbtypes.o Planck_lik
e.o cmbdata.o WeakLen.o mpk.o supernovae.o SDSSLy-a-v3.o CMB_Cls_simple.o paramdef.o propose.o params_CMB.o calclike.o
conjgrad_wrapper.o EstCovmat.o postprocess.o MCMC.o driver.o -L/home/limh/mywork/cfitsio_81/lib -L/home/limh/mywo
rk/WMAP5/likelihood_v3 -lcfitsio -L../camb -lcamb -Wl,-framework -Wl,accelerate -DMATRIX_SINGLE -O2 -ffree-fo
rm -I/home/limh/mywork/cfitsio_81/include -I/home/limh/mywork/WMAP5/likelihood_v3 -I../camb
/usr/bin/ld: -f may not be used without -shared
collect2: ld returned 1
make: *** [cosmomc] Error 1


I am by no means an expert and don't understand the error message, so could you please help me? Any advice is welcome.
Thanks a lot for your help!
A desperate fish

Post Reply