CosmoCoffee Forum Index CosmoCoffee

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

Building WMAP likelihood code with gfortran on Mac (Snow Leopard)
 
Post new topic   Reply to topic    CosmoCoffee Forum Index -> Computers and software
View previous topic :: View next topic  
Author Message
Ross O'Connell



Joined: 29 Jun 2011
Posts: 4
Affiliation: Carnegie Mellon University

PostPosted: June 29 2011  Reply with quote

Hi,

I'm trying to build the WMAP Likelihood code (v.4.1, I think, downloaded from here), en route to building cosmomc. I'm on a Mac (running 10.6.8), and am using gfortran instead of buying the Intel compiler. The problem is that the Makefile for the WMAP code doesn't have a set of options for building in gfortran – surprisingly, the only mac build options are for G4 and G5 processors. I commented out the other options and added

Code:
F90=gfortran


which at least got the ball rolling, but eventually throws the following error:

Code:
$ make
gfortran   -c -o read_archive_map.o read_archive_map.f90
gfortran   -c -o read_fits.o read_fits.f90
gfortran   -c -o healpix_types.o healpix_types.f90
gfortran   -c -o br_mod_dist.o br_mod_dist.f90
gfortran   -c -o WMAP_7yr_options.o WMAP_7yr_options.F90
gfortran   -c -o WMAP_7yr_util.o WMAP_7yr_util.f90
gfortran   -c -o WMAP_7yr_gibbs.o WMAP_7yr_gibbs.F90
gfortran   -c -o WMAP_7yr_tt_pixlike.o WMAP_7yr_tt_pixlike.F90
gfortran   -c -o WMAP_7yr_tt_beam_ptsrc_chisq.o WMAP_7yr_tt_beam_ptsrc_chisq.f90
gfortran   -c -o WMAP_7yr_teeebb_pixlike.o WMAP_7yr_teeebb_pixlike.F90
gfortran   -c -o WMAP_7yr_tetbeebbeb_pixlike.o WMAP_7yr_tetbeebbeb_pixlike.F90
WMAP_7yr_tetbeebbeb_pixlike.F90:662.24:

           write(lun,'(I,6ES)') l, cltt(l), clte(l), cltb(l), clee(l), clbb(l),
                        1
Error: Nonnegative width required in format string at (1)
WMAP_7yr_tetbeebbeb_pixlike.F90:663.22:

           write(*,'(I,6ES)') l, cltt(l), clte(l), cltb(l), clee(l), clbb(l), c
                      1
Error: Nonnegative width required in format string at (1)
make: *** [WMAP_7yr_tetbeebbeb_pixlike.o] Error 1


Is there some way to make this work? Thanks for any help,

Ross

p.s. This is the [url=http://cosmocoffee.info/files/Ross_O'Connell/Makefile]Makefile[/url] I'm using.
Back to top
View user's profile  
Ross O'Connell



Joined: 29 Jun 2011
Posts: 4
Affiliation: Carnegie Mellon University

PostPosted: June 29 2011  Reply with quote

As per this old post, I changed the relevant lines in WMAP_7yr_tetbeebbeb_pixlike.F90 from

Code:
write(lun,'(I,6ES)') l, cltt(l), clte(l), cltb(l), clee(l), clbb(l), cleb(l)
write(*,'(I,6ES)') l, cltt(l), clte(l), cltb(l), clee(l), clbb(l), cleb(l)


to:

Code:
write(lun,'(I4,6ES10.2)') l, cltt(l), clte(l), cltb(l), clee(l), clbb(l), cleb(l)
write(*,'(I4,6ES10.2)') l, cltt(l), clte(l), cltb(l), clee(l), clbb(l), cleb(l)


I now have linking problems that may be endemic to Snow Leopard. After running "make clean", I get

Code:


$ make
gfortran   -c -o read_archive_map.o read_archive_map.f90
gfortran   -c -o read_fits.o read_fits.f90
gfortran   -c -o healpix_types.o healpix_types.f90
gfortran   -c -o br_mod_dist.o br_mod_dist.f90
gfortran   -c -o WMAP_7yr_options.o WMAP_7yr_options.F90
gfortran   -c -o WMAP_7yr_util.o WMAP_7yr_util.f90
gfortran   -c -o WMAP_7yr_gibbs.o WMAP_7yr_gibbs.F90
gfortran   -c -o WMAP_7yr_tt_pixlike.o WMAP_7yr_tt_pixlike.F90
gfortran   -c -o WMAP_7yr_tt_beam_ptsrc_chisq.o WMAP_7yr_tt_beam_ptsrc_chisq.f90
gfortran   -c -o WMAP_7yr_teeebb_pixlike.o WMAP_7yr_teeebb_pixlike.F90
gfortran   -c -o WMAP_7yr_tetbeebbeb_pixlike.o WMAP_7yr_tetbeebbeb_pixlike.F90
gfortran   -c -o WMAP_7yr_likelihood.o WMAP_7yr_likelihood.F90
ar r libwmap7.a read_archive_map.o read_fits.o healpix_types.o br_mod_dist.o WMAP_7yr_options.o WMAP_7yr_util.o WMAP_7yr_gibbs.o WMAP_7yr_tt_pixlike.o WMAP_7yr_tt_beam_ptsrc_chisq.o WMAP_7yr_teeebb_pixlike.o WMAP_7yr_tetbeebbeb_pixlike.o WMAP_7yr_likelihood.o
ar: creating archive libwmap7.a
/usr/bin/ranlib: file: libwmap7.a(healpix_types.o) has no symbols
gfortran   -c -o test.o test.F90
gfortran  -o test test.o read_archive_map.o read_fits.o healpix_types.o br_mod_dist.o WMAP_7yr_options.o WMAP_7yr_util.o WMAP_7yr_gibbs.o WMAP_7yr_tt_pixlike.o WMAP_7yr_tt_beam_ptsrc_chisq.o WMAP_7yr_teeebb_pixlike.o WMAP_7yr_tetbeebbeb_pixlike.o WMAP_7yr_likelihood.o
Undefined symbols:
  "_ftgnrw_", referenced from:
      _read_archive_map_ in read_archive_map.o
  "_dpotrf_", referenced from:
      ___wmap_tlike_MOD_compute_tt_pixlike in WMAP_7yr_tt_pixlike.o
      ___wmap_tt_beam_ptsrc_chisq_MOD_compute_tt_beam_and_ptsrc_chisq in WMAP_7yr_tt_beam_ptsrc_chisq.o
      ___wmap_teeebb_lowl_MOD_teeebb_lowl_likelihood in WMAP_7yr_teeebb_pixlike.o
      ___wmap_tetbeebbeb_lowl_MOD_tetbeebbeb_lowl_likelihood in WMAP_7yr_tetbeebbeb_pixlike.o
  "_dpotri_", referenced from:
      ___wmap_teeebb_lowl_MOD_teeebb_lowl_likelihood in WMAP_7yr_teeebb_pixlike.o
      ___wmap_tetbeebbeb_lowl_MOD_tetbeebbeb_lowl_likelihood in WMAP_7yr_tetbeebbeb_pixlike.o
  "_ftgiou_", referenced from:
      _read_archive_map_ in read_archive_map.o
      _read_fits_real_2d_ in read_fits.o
      _read_fits_double_2d_ in read_fits.o
      _read_fits_real_3d_ in read_fits.o
      _read_fits_complex_2d_lm_ in read_fits.o
  "_dpotrs_", referenced from:
      ___wmap_tlike_MOD_compute_tt_pixlike in WMAP_7yr_tt_pixlike.o
      ___wmap_tlike_MOD_compute_tt_pixlike in WMAP_7yr_tt_pixlike.o
      ___wmap_tt_beam_ptsrc_chisq_MOD_compute_tt_beam_and_ptsrc_chisq in WMAP_7yr_tt_beam_ptsrc_chisq.o
      ___wmap_tt_beam_ptsrc_chisq_MOD_compute_tt_beam_and_ptsrc_chisq in WMAP_7yr_tt_beam_ptsrc_chisq.o
  "_ftgkyj_", referenced from:
      _read_fits_real_2d_ in read_fits.o
      _read_fits_real_2d_ in read_fits.o
      _read_fits_double_2d_ in read_fits.o
      _read_fits_double_2d_ in read_fits.o
      _read_fits_real_3d_ in read_fits.o
      _read_fits_real_3d_ in read_fits.o
      _read_fits_real_3d_ in read_fits.o
      _read_fits_complex_2d_lm_ in read_fits.o
      _read_fits_complex_2d_lm_ in read_fits.o
      ___br_mod_dist_MOD_read_gibbs_chain in br_mod_dist.o
      ___br_mod_dist_MOD_read_gibbs_chain in br_mod_dist.o
      ___br_mod_dist_MOD_read_gibbs_chain in br_mod_dist.o
      ___br_mod_dist_MOD_read_gibbs_chain in br_mod_dist.o
  "_ftgidm_", referenced from:
      _read_fits_real_2d_ in read_fits.o
      _read_fits_double_2d_ in read_fits.o
      _read_fits_real_3d_ in read_fits.o
      _read_fits_complex_2d_lm_ in read_fits.o
  "_dsymv_", referenced from:
      ___wmap_teeebb_lowl_MOD_teeebb_lowl_likelihood in WMAP_7yr_teeebb_pixlike.o
      ___wmap_tetbeebbeb_lowl_MOD_tetbeebbeb_lowl_likelihood in WMAP_7yr_tetbeebbeb_pixlike.o
  "_ftgcve_", referenced from:
      _read_archive_map_ in read_archive_map.o
      _read_archive_map_ in read_archive_map.o
  "_ftopen_", referenced from:
      _read_archive_map_ in read_archive_map.o
      _read_fits_real_2d_ in read_fits.o
      _read_fits_double_2d_ in read_fits.o
      _read_fits_real_3d_ in read_fits.o
      _read_fits_complex_2d_lm_ in read_fits.o
      ___br_mod_dist_MOD_read_gibbs_chain in br_mod_dist.o
  "_ftfiou_", referenced from:
      _read_archive_map_ in read_archive_map.o
      _read_fits_real_2d_ in read_fits.o
      _read_fits_double_2d_ in read_fits.o
      _read_fits_real_3d_ in read_fits.o
      _read_fits_complex_2d_lm_ in read_fits.o
  "_ftmahd_", referenced from:
      _read_archive_map_ in read_archive_map.o
  "_ddot_", referenced from:
      ___wmap_teeebb_lowl_MOD_teeebb_lowl_likelihood in WMAP_7yr_teeebb_pixlike.o
      ___wmap_teeebb_lowl_MOD_teeebb_lowl_likelihood in WMAP_7yr_teeebb_pixlike.o
      ___wmap_teeebb_lowl_MOD_teeebb_lowl_likelihood in WMAP_7yr_teeebb_pixlike.o
      ___wmap_teeebb_lowl_MOD_teeebb_lowl_likelihood in WMAP_7yr_teeebb_pixlike.o
      ___wmap_teeebb_lowl_MOD_teeebb_lowl_likelihood in WMAP_7yr_teeebb_pixlike.o
      ___wmap_teeebb_lowl_MOD_teeebb_lowl_likelihood in WMAP_7yr_teeebb_pixlike.o
      ___wmap_teeebb_lowl_MOD_teeebb_lowl_likelihood in WMAP_7yr_teeebb_pixlike.o
      ___wmap_teeebb_lowl_MOD_teeebb_lowl_likelihood in WMAP_7yr_teeebb_pixlike.o
      ___wmap_teeebb_lowl_MOD_teeebb_lowl_likelihood in WMAP_7yr_teeebb_pixlike.o
      ___wmap_tetbeebbeb_lowl_MOD_tetbeebbeb_lowl_likelihood in WMAP_7yr_tetbeebbeb_pixlike.o
      ___wmap_tetbeebbeb_lowl_MOD_tetbeebbeb_lowl_likelihood in WMAP_7yr_tetbeebbeb_pixlike.o
      ___wmap_tetbeebbeb_lowl_MOD_tetbeebbeb_lowl_likelihood in WMAP_7yr_tetbeebbeb_pixlike.o
      ___wmap_tetbeebbeb_lowl_MOD_tetbeebbeb_lowl_likelihood in WMAP_7yr_tetbeebbeb_pixlike.o
      ___wmap_tetbeebbeb_lowl_MOD_tetbeebbeb_lowl_likelihood in WMAP_7yr_tetbeebbeb_pixlike.o
      ___wmap_tetbeebbeb_lowl_MOD_tetbeebbeb_lowl_likelihood in WMAP_7yr_tetbeebbeb_pixlike.o
      ___wmap_tetbeebbeb_lowl_MOD_tetbeebbeb_lowl_likelihood in WMAP_7yr_tetbeebbeb_pixlike.o
      ___wmap_tetbeebbeb_lowl_MOD_tetbeebbeb_lowl_likelihood in WMAP_7yr_tetbeebbeb_pixlike.o
      ___wmap_tetbeebbeb_lowl_MOD_tetbeebbeb_lowl_likelihood in WMAP_7yr_tetbeebbeb_pixlike.o
      ___wmap_tetbeebbeb_lowl_MOD_tetbeebbeb_lowl_likelihood in WMAP_7yr_tetbeebbeb_pixlike.o
      ___wmap_tetbeebbeb_lowl_MOD_tetbeebbeb_lowl_likelihood in WMAP_7yr_tetbeebbeb_pixlike.o
      ___wmap_tetbeebbeb_lowl_MOD_tetbeebbeb_lowl_likelihood in WMAP_7yr_tetbeebbeb_pixlike.o
      ___wmap_tetbeebbeb_lowl_MOD_tetbeebbeb_lowl_likelihood in WMAP_7yr_tetbeebbeb_pixlike.o
      ___wmap_tetbeebbeb_lowl_MOD_tetbeebbeb_lowl_likelihood in WMAP_7yr_tetbeebbeb_pixlike.o
      ___wmap_tetbeebbeb_lowl_MOD_tetbeebbeb_lowl_likelihood in WMAP_7yr_tetbeebbeb_pixlike.o
      ___wmap_tetbeebbeb_lowl_MOD_tetbeebbeb_lowl_likelihood in WMAP_7yr_tetbeebbeb_pixlike.o
      ___wmap_tetbeebbeb_lowl_MOD_tetbeebbeb_lowl_likelihood in WMAP_7yr_tetbeebbeb_pixlike.o
  "_ftgpvd_", referenced from:
      _read_fits_double_2d_ in read_fits.o
  "_ftgpve_", referenced from:
      _read_fits_real_2d_ in read_fits.o
      _read_fits_real_3d_ in read_fits.o
      _read_fits_complex_2d_lm_ in read_fits.o
      ___br_mod_dist_MOD_read_gibbs_chain in br_mod_dist.o
  "_ftclos_", referenced from:
      _read_archive_map_ in read_archive_map.o
      _read_fits_real_2d_ in read_fits.o
      _read_fits_double_2d_ in read_fits.o
      _read_fits_real_3d_ in read_fits.o
      _read_fits_complex_2d_lm_ in read_fits.o
      ___br_mod_dist_MOD_read_gibbs_chain in br_mod_dist.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [test] Error 1


I think the trouble starts when ranlib (actually a link to libtool?) creates something with "no symbols". Compiling CFITSIO led to similar troubles, but the CFITSIO test program seems to work fine.
Back to top
View user's profile  
Ben Gold



Joined: 25 Sep 2004
Posts: 97
Affiliation: University of Minnesota

PostPosted: June 30 2011  Reply with quote

You need to set LIBS (and probably INC) to at least something in the Makefile. All those link errors are for CFITSIO or LAPACK subroutines. The linker needs to know where you've compiled those libraries.
Back to top
View user's profile [ Hidden ] Visit poster's website
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.