mpif90 -mkl -openmp -O3 -xHost -no-prec-div -fpp -DMPI -DCLIK -I../camb -I/home/elisa/cosmomc_bicep2/PLC/plc-1.0//include -module ReleaseMPI -IReleaseMPI/ -c cliklike.f90 -o ReleaseMPI/cliklike.o
cliklike.f90&#40;2&#41;&#58; error #7013&#58; This module file was not generated by any release of this compiler. &#91;CLIK&#93;
use clik
--------^
cliklike.f90&#40;13&#41;&#58; error #6457&#58; This derived type name has not been declared. &#91;TCMBLIKELIHOOD&#93;
type, extends&#40;TCMBLikelihood&#41; &#58;&#58; ClikLikelihood
------------------^
cliklike.f90&#40;14&#41;&#58; error #6457&#58; This derived type name has not been declared. &#91;CLIK_OBJECT&#93;
type&#40;clik_object&#41; &#58;&#58; clikid
-------------^
cliklike.f90&#40;39&#41;&#58; error #6457&#58; This derived type name has not been declared. &#91;TLIKELIHOODLIST&#93;
class&#40;TLikelihoodList&#41; &#58;&#58; LikeList
----------^
cliklike.f90&#40;40&#41;&#58; error #6457&#58; This derived type name has not been declared. &#91;TSETTINGINI&#93;
class&#40;TSettingIni&#41; Ini
----------^
cliklike.f90&#40;128&#41;&#58; error #6683&#58; A kind type parameter must be a compile-time constant. &#91;MCP&#93;
real&#40;mcp&#41; function clik_lnlike&#40;this, CMB, Theory, DataParams&#41;
---------^
cliklike.f90&#40;130&#41;&#58; error #6457&#58; This derived type name has not been declared. &#91;CMBPARAMS&#93;
Class &#40;CMBParams&#41; CMB
-----------^
cliklike.f90&#40;131&#41;&#58; error #6457&#58; This derived type name has not been declared. &#91;TCOSMOTHEORYPREDICTIONS&#93;
Class&#40;TCosmoTheoryPredictions&#41;, target &#58;&#58; Theory
----------^
cliklike.f90&#40;132&#41;&#58; error #6683&#58; A kind type parameter must be a compile-time constant. &#91;MCP&#93;
real&#40;mcp&#41; DataParams&#40;&#58;&#41;
---------^
cliklike.f90&#40;218&#41;&#58; error #6683&#58; A kind type parameter must be a compile-time constant. &#91;MCP&#93;
real&#40;mcp&#41; function clik_lensing_lnlike&#40;this, CMB, Theory, DataParams&#41;
---------^
cliklike.f90&#40;220&#41;&#58; error #6457&#58; This derived type name has not been declared. &#91;CMBPARAMS&#93;
Class &#40;CMBParams&#41; CMB
-----------^
cliklike.f90&#40;221&#41;&#58; error #6457&#58; This derived type name has not been declared. &#91;TCOSMOTHEORYPREDICTIONS&#93;
Class&#40;TCosmoTheoryPredictions&#41;, target &#58;&#58; Theory
----------^
cliklike.f90&#40;222&#41;&#58; error #6683&#58; A kind type parameter must be a compile-time constant. &#91;MCP&#93;
real&#40;mcp&#41; DataParams&#40;&#58;&#41;
---------^
cliklike.f90&#40;218&#41;&#58; error #6404&#58; This name does not have a type, and must have an explicit type. &#91;CMB&#93;
real&#40;mcp&#41; function clik_lensing_lnlike&#40;this, CMB, Theory, DataParams&#41;
-------------------------------------------------^
cliklike.f90&#40;128&#41;&#58; error #6404&#58; This name does not have a type, and must have an explicit type. &#91;CMB&#93;
real&#40;mcp&#41; function clik_lnlike&#40;this, CMB, Theory, DataParams&#41;
-----------------------------------------^
cliklike.f90&#40;218&#41;&#58; error #6404&#58; This name does not have a type, and must have an explicit type. &#91;THEORY&#93;
real&#40;mcp&#41; function clik_lensing_lnlike&#40;this, CMB, Theory, DataParams&#41;
------------------------------------------------------^
cliklike.f90&#40;128&#41;&#58; error #6404&#58; This name does not have a type, and must have an explicit type. &#91;THEORY&#93;
real&#40;mcp&#41; function clik_lnlike&#40;this, CMB, Theory, DataParams&#41;
----------------------------------------------^
cliklike.f90&#40;46&#41;&#58; error #6404&#58; This name does not have a type, and must have an explicit type. &#91;INI&#93;
do i=1, Ini%Count
------------^
cliklike.f90&#40;46&#41;&#58; error #6460&#58; This is not a field name that is defined in the encompassing structure. &#91;COUNT&#93;
do i=1, Ini%Count
----------------^
cliklike.f90&#40;47&#41;&#58; error #6460&#58; This is not a field name that is defined in the encompassing structure. &#91;ITEMS&#93;
name = Ini%Items&#40;i&#41;%P%Name
-------------------^
cliklike.f90&#40;47&#41;&#58; error #6460&#58; This is not a field name that is defined in the encompassing structure. &#91;NAME&#93;
name = Ini%Items&#40;i&#41;%P%Name
------------------------------^
cliklike.f90&#40;47&#41;&#58; error #6054&#58; A CHARACTER data type is required in this context. &#91;NAME&#93;
name = Ini%Items&#40;i&#41;%P%Name
------------------------------^
cliklike.f90&#40;48&#41;&#58; error #6404&#58; This name does not have a type, and must have an explicit type. &#91;STRINGSTARTS&#93;
if &#40;StringStarts&#40;name,'clik_data_'&#41;&#41; then
------------^
cliklike.f90&#40;48&#41;&#58; error #6341&#58; A logical data type is required in this context. &#91;STRINGSTARTS&#93;
if &#40;StringStarts&#40;name,'clik_data_'&#41;&#41; then
------------^
cliklike.f90&#40;49&#41;&#58; error #6460&#58; This is not a field name that is defined in the encompassing structure. &#91;READFILENAME&#93;
fname = Ini%ReadFileName&#40;name, NotFoundFail = .false.&#41;
------------------------^
cliklike.f90&#40;49&#41;&#58; error #6054&#58; A CHARACTER data type is required in this context. &#91;INI&#93;
fname = Ini%ReadFileName&#40;name, NotFoundFail = .false.&#41;
--------------------^
cliklike.f90&#40;51&#41;&#58; error #6404&#58; This name does not have a type, and must have an explicit type. &#91;MPIRANK&#93;
if &#40;MpiRank==0 .and. feedback > 0&#41; &
----------------^
cliklike.f90&#40;51&#41;&#58; error #6404&#58; This name does not have a type, and must have an explicit type. &#91;FEEDBACK&#93;
if &#40;MpiRank==0 .and. feedback > 0&#41; &
---------------------------------^
cliklike.f90&#40;59&#41;&#58; error #6404&#58; This name does not have a type, and must have an explicit type. &#91;LIKELIST&#93;
call LikeList%Add&#40;Like&#41;
-----------------^
cliklike.f90&#40;59&#41;&#58; error #6460&#58; This is not a field name that is defined in the encompassing structure. &#91;ADD&#93;
call LikeList%Add&#40;Like&#41;
--------------------------^
/tmp/ifortOf3ET2.i90&#40;267&#41;&#58; catastrophic error&#58; Too many errors, exiting
compilation aborted for cliklike.f90 &#40;code 1&#41;
make&#91;1&#93;&#58; *** &#91;ReleaseMPI/cliklike.o&#93; Error 1
make&#91;1&#93;&#58; Leaving directory `/sb/home/elisa/cosmomc_bicep2/cosmomc/source'
make&#58; *** &#91;cosmomc&#93; Error 2

Maybe it is relevant to say that when I configured the plc file i couldn't put like in the website:
./waf configure --lapack_mkl=${MKLROOT} --lapack_mkl_version=10.3 --install_all_deps

which points the clik directory to one level up from where you have it pointing now.

As far as why CosmoMC doesn't compile, that is a good question. Based upon your error messages when compiling, it looks like clik is not getting built with the intel compilers. You can check plc-1.0/build/config.log and search for ifort and icc to see if CC and FC are getting pointed to them or not when running waf. Finally, double check mpif90 is pointing to the correct version of ifort with

Thank you very much for your help. I corrected the mistakes you pointed and checked the config.log and indeed it is pointing ifort to gfortran, which is weird since I didn't edit anything regarding that.

If that doesn't work it probably indicates that your ifort module on the cluster has not loaded "properly" and assigned the environmental variables as it should.

Also, it is preferable to use mkl for lapack as it is much faster. Check and see if there is an MKL module available on your cluster, loading it should load the environmental variable $MKLROOT (although it should load with your ifort modules). After that you should be able to add

Another thing that I tried was to change the Makefile and put the paths by hand and make after. It works fine until it gets to clik and then it seems it the lapack libraries are not well installed. The error that I get is:

I think the trouble with waf probably has to do with something in your environment not being set up right. Without seeing your environment set up I can't tell you much more on that part. I can however help with your manual makefile set up. Here is mine from a while back when I was compiling without waf:

# to build
# &#36;> make
# to install the core utilities
# &#36;> make install
# to install the optional python utilities
# &#36;> make python_install
# cleanup
# &#36;> make clean
# here are the thing that you should modify
################################################################################################
# set your prefix to where you want to install clik.
# default is to let it in the current directory
PREFIX &#58;= &#36;&#40;shell pwd&#41;
# set the path of the cfitsio lib.
#CFITSIOPATH &#58;= /net/ff/ph/1/dist/cfitsio
#CFITSIOPATH &#58;= /softs/cfitsio/3.24
# you have a CFITSIO lib in a weird location, also set those
#CFITSIO_INCPATH &#58;= &#36;&#40;CFITSIOPATH&#41;/include
#CFITSIO_LIBPATH &#58;= &#36;&#40;CFITSIOPATH&#41;/lib
CFITSIO_INCPATH &#58;= /usr/include/cfitsio
CFITSIO_LIBPATH &#58;= /usr/lib64
#define your compilers and stuff
CC = icc
FC = ifort
# ifort
# if you are using ifort set here where its lib are installed
# and check the runtime libs
# on my mac I got
IFORTLIBPATH = /opt/intel/compiler/lib/intel64
IFORTRUNTIME = -L&#36;&#40;IFORTLIBPATH&#41; -lintlc -limf -lsvml -liomp5 -lifport -lifcoremt -lpthread
# on a linux machine, ifort 11.1
#IFORTLIBPATH = /softs/intel/fce/11.1.075/lib/intel64
#IFORTRUNTIME = -L&#36;&#40;IFORTLIBPATH&#41; -lintlc -limf -lsvml -liomp5 -lifport -lifcoremt -lpthread
# gfortran
# if you are using gfortran set here where the lib are installed
# and check the runtime libs
GFORTRANLIBPATH = /usr/lib
GFORTRANRUNTIME = -L&#36;&#40;GFORTRANLIBPATH&#41; -lgfortran -lgomp
# if you are on linux and using mkl, you need to set this
MKLROOT = /opt/intel/mkl
LAPACKLIBPATHMKL = &#36;&#40;MKLROOT&#41;/lib/intel64
#if you want to point to your own version of lapack set the following variables
#LAPACK = -L/some/path -lsomefortranlapack -lsomedependencyforyourlapack
#LAPACKLIBPATH = /some/path

The major issue I see with what you have used is that you put a $ in front of your MKLROOT when defining it as well as your LAPACKLIBPATHMKL.

Also compiling manually with the makefile causes the intel compilers to complain about where -lm. After a bit of fudging I was able to fix this. I have a modified Makefile at https://www.dropbox.com/s/sl6v4me1uuiny ... ile_planck. I updated it to the paths you have shown above, so it should be plug and go.

Thank you very very much for all your help. I had already tried the path that you put for the MKL and got the same errors. I tried to compile with the Makefile you provided me and also got the same error as before (the -lm error).
Now I contacted the people from the cluster that I am working to see if it is something related to their system, because I really don't know what to do next.
But, again, thank you very much for all your help!!

Just a heads up, those errors are not related to -lm but are rather related to lapack. Most likely your MKL is not linking correctly. The -lm warning is something separate that the compiler is giving a warning about but should not actually keep the program from compiling.

It looks like you are running the latest version of CosmoMC. Note that with the latest version, test.ini is setup to run with action = 4. This is a new option that is there so you can quickly test the code and any new likelihood codes. No chains are produced with action = 4. The code simply calculates and prints the likelihoods at the central parameter value. In order to produce chains you have to run with action = 0.

As far as the warnings you saw. I suggest rewriting your makefile to the following instead:

cliklike.f90(2): error #7013: This module file was not generated by any release of this compiler. [CLIK]
use clik
--------^
cliklike.f90(13): error #6457: This derived type name has not been declared. [TCMBLIKELIHOOD]
type, extends(TCMBLikelihood) :: ClikLikelihood
------------------^
cliklike.f90(14): error #6457: This derived type name has not been declared. [CLIK_OBJECT]
type(clik_object) :: clikid
-------------^
cliklike.f90(39): error #6457: This derived type name has not been declared. [TLIKELIHOODLIST]
class(TLikelihoodList) :: LikeList
----------^
cliklike.f90(40): error #6457: This derived type name has not been declared. [TSETTINGINI]
class(TSettingIni) Ini
----------^
cliklike.f90(129): error #6683: A kind type parameter must be a compile-time constant. [MCP]
real(mcp) function clik_lnlike(this, CMB, Theory, DataParams)
---------^
cliklike.f90(131): error #6457: This derived type name has not been declared. [CMBPARAMS]
Class (CMBParams) CMB
-----------^
cliklike.f90(132): error #6457: This derived type name has not been declared. [TCOSMOTHEORYPREDICTIONS]
Class(TCosmoTheoryPredictions), target :: Theory
----------^
cliklike.f90(133): error #6683: A kind type parameter must be a compile-time constant. [MCP]
real(mcp) DataParams(:)
---------^
cliklike.f90(218): error #6683: A kind type parameter must be a compile-time constant. [MCP]
real(mcp) function clik_lensing_lnlike(this, CMB, Theory, DataParams)
---------^
cliklike.f90(220): error #6457: This derived type name has not been declared. [CMBPARAMS]
Class (CMBParams) CMB
-----------^
cliklike.f90(221): error #6457: This derived type name has not been declared. [TCOSMOTHEORYPREDICTIONS]
Class(TCosmoTheoryPredictions), target :: Theory
----------^
cliklike.f90(222): error #6683: A kind type parameter must be a compile-time constant. [MCP]
real(mcp) DataParams(:)
---------^
cliklike.f90(218): error #6404: This name does not have a type, and must have an explicit type. [CMB]
real(mcp) function clik_lensing_lnlike(this, CMB, Theory, DataParams)
-------------------------------------------------^
cliklike.f90(129): error #6404: This name does not have a type, and must have an explicit type. [CMB]
real(mcp) function clik_lnlike(this, CMB, Theory, DataParams)
-----------------------------------------^
cliklike.f90(218): error #6404: This name does not have a type, and must have an explicit type. [THEORY]
real(mcp) function clik_lensing_lnlike(this, CMB, Theory, DataParams)
------------------------------------------------------^
cliklike.f90(129): error #6404: This name does not have a type, and must have an explicit type. [THEORY]
real(mcp) function clik_lnlike(this, CMB, Theory, DataParams)
----------------------------------------------^
cliklike.f90(47): error #6404: This name does not have a type, and must have an explicit type. [INI]
do i=1, Ini%Count
------------^
cliklike.f90(47): error #6460: This is not a field name that is defined in the encompassing structure. [COUNT]
do i=1, Ini%Count
----------------^
cliklike.f90(48): error #6460: This is not a field name that is defined in the encompassing structure. [ITEMS]
name = Ini%Items(i)%P%Name
-------------------^
cliklike.f90(48): error #6460: This is not a field name that is defined in the encompassing structure. [NAME]
name = Ini%Items(i)%P%Name
------------------------------^
cliklike.f90(48): error #6054: A CHARACTER data type is required in this context. [NAME]
name = Ini%Items(i)%P%Name
------------------------------^
cliklike.f90(49): error #6404: This name does not have a type, and must have an explicit type. [STRINGSTARTS]
if (StringStarts(name,'clik_data_')) then
------------^
cliklike.f90(49): error #6341: A logical data type is required in this context. [STRINGSTARTS]
if (StringStarts(name,'clik_data_')) then
------------^
cliklike.f90(50): error #6460: This is not a field name that is defined in the encompassing structure. [READFILENAME]
fname = Ini%ReadFileName(name, NotFoundFail = .false.)
------------------------^
cliklike.f90(50): error #6054: A CHARACTER data type is required in this context. [INI]
fname = Ini%ReadFileName(name, NotFoundFail = .false.)
--------------------^
cliklike.f90(52): error #6404: This name does not have a type, and must have an explicit type. [MPIRANK]
if (MpiRank==0 .and. feedback > 0) &
----------------^
cliklike.f90(52): error #6404: This name does not have a type, and must have an explicit type. [FEEDBACK]
if (MpiRank==0 .and. feedback > 0) &
---------------------------------^
cliklike.f90(61): error #6404: This name does not have a type, and must have an explicit type. [LIKELIST]
call LikeList%Add(Like)
-----------------^
cliklike.f90(61): error #6460: This is not a field name that is defined in the encompassing structure. [ADD]
call LikeList%Add(Like)
--------------------------^