I want to post my way to install cosmomc step by step with two aims:
1.- Looking for feedback in equivalent or more efficient ways to do it and
2.- help other dummies like me to gain time in installation process
(I write informal, hope don't bother you)
1.To avoid confusion in paths of shell, it is extremely recommended to install the intel compilers from the same release and have installed only one version. If this is done, the icc and ifort compileres and libraries will be located by default all in the same directory. e.g., /opt/intel/Compiler/11.1/072. Each of these compilers include the MKL libraries. I stress that it is not necessary to install ifort and MKL apart.
2.Follow the install instructions in the intel web page (there is an evaluation licence supplied by intel). By default it would be installed 'static' (see openMPI below) in the root folder /opt/intel. Once installed, it is only necessary to add some lines to the file /home/myuser/.bashrc in order let know the shell the paths to the compilers and MKL libraries. These lines should look more or less like
source /opt/intel/Compiler/11.1/072/bin/ifortvars.sh ia32
source /opt/intel/Compiler/11.1/072/bin/iccvars.sh ia32
source /opt/intel/Compiler/11.1/072/bin/ia32/idbvars.sh
source /opt/intel/Compiler/11.1/072/mkl/tools/environment/mklvars32.sh
3.Intel also provides MPI libraries, but the installation resulted awkward to my devian based system. (The install scripts are oriented to red hat systems, using .rpm instead of .deb; alien did not work efficiently either. If you know how to install intel MPI on Ubuntu do not doubt in show me.) On the other hand, openMPI installation is straight.
4.You can find the current version of OpenMPI in http://www.open-mpi.org/. Read the FAQ section if you want to learn useful options before installation. You can install openMPI either as static or dynamic. Static points to some directory specified by the 'prefix' option, it is usually chosen to point to some super-user location. Dynamic does not require the 'prefix' option and will be installed directlly in the untared directory. I rather prefer the former, so I use the option “prefix”. Moreover, in my case we want to use the intel compilers. Thus, after decompress the tar file I go into the created directory and type in shell as super-user (you edit the path to your intel compilers)
Code: Select all
> ./configure --prefix=/usr/local CC=/opt/intel/Compiler/11.1/072/bin/icc CXX=/opt/intel/Compiler/11.1/072/bin/icpc F77=/opt/intel/Compiler/11.1/072/bin/ifort FC=/opt/intel/Compiler/11.1/072/bin/ifort
> make all install
5. I create two files and save them at home. A file named mpd.hosts and write in it the name of all the host on your system. For example, my lap-top only has one host, in the shell I see this: ivan@ivan-laptop:, then in my mpd.hosts file I wrote
ivan-laptop
You can find your own hardware features with
Code: Select all
sudo lshw -html > ~/Desktop/hardware.html
MPD_SECRETWORD=secreto-de-ivan
(change 'secreto-de-ivan' for your own secret)
6.you can now test with some test.f90 code written for MPI. Solve errors if any.
Code: Select all
mpif90 test.f90
Code: Select all
MKLPATH=/opt/intel/Compiler/11.1/072/mkl/lib/32
MKLINCLUDE=/opt/intel/Compiler/11.1/072/mkl/include
WMAP =
CFITSIO =
INCLUDE= -I$(MKLINCLUDE)
F90C = /usr/local/bin/mpif90
FFLAGS = -O2 -ip -W0 -WB -openmp -fpp -DMPI -vec_report0
-mkl=parallel
LAPACKL = -L$(MKLPATH) $(MKLPATH)/libmkl_lapack95.a \
-Wl,--start-group $(MKLPATH)/libmkl_intel.a \
$(MKLPATH)/libmkl_sequential.a \
$(MKLPATH)/libmkl_core.a -Wl,--end-group \
-liomp5 -lpthread
8.You can download cfitsio from http://heasarc.gsfc.nasa.gov/docs/software/fitsio/fitsio.html. Pick the Unix.tar file. As in the step of openMPI you can type
Code: Select all
> ./configure - -help
9.The WMAP Likelihood software can be downloaded from http://lambda.gsfc.nasa.gov/product/map/current/likelihood_get.cfm. See the Detailed Product Description and pick wmap_likelihood_full_v4p1.tar.gz if you want the full product. Create a directory named something like WMAP and place the compressed file. Uncompress it and in your terminal go to ~/likelihood_v4p1. Edit the Makefile in analogy with that of COSMOMC. You should have lines more or less like
Code: Select all
CFITSIO=/usr/local/cfitsio
MKLPATH=/opt/intel/Compiler/11.1/072/mkl/lib/32
MKLINCLUDE=/opt/intel/Compiler/11.1/072/mkl/include
F90 = /opt/intel/Compiler/11.1/072/bin/ia32/ifort
FFLAGS = -O $(WMAPFLAGS)
INCS = -I. -I$(CFITSIO)/include -I$(MKLINCLUDE)
INCS = -I. -I$(CFITSIO)/include -I$(MKLINCLUDE)
LIBS = -L. -L$(CFITSIO)/lib -lcfitsio -L$(MKLPATH) \
-Wl,--start-group $(MKLPATH)/libmkl_intel.a \
$(MKLPATH)/libmkl_sequential.a \
$(MKLPATH)/libmkl_core.a -Wl,--end-group -lpthread
11.In your terminal run
Code: Select all
make all
12.Edit again the Makefile of COSMOMC to include WMAP, by setting lines more or less like
Code: Select all
WMAP = /home/ivan/Documentos/Cinvestav/cmb/WMAP/likelihood_v4p1
CFITSIO=/usr/local/cfitsio
INCLUDE= -I$(WMAP) -I$(CFITSIO)/include -I$(MKLINCLUDE)
Code: Select all
make clean
make all
14.Run the test supplied
Thanks in advance for your comments.