Compile errors with Mar2013 CosmoMC

Use of Healpix, camb, CLASS, cosmomc, compilers, etc.
Kyle Helson
Posts: 4
Joined: May 07 2013
Affiliation: Brown University

Compile errors with Mar2013 CosmoMC

Post by Kyle Helson » May 08 2013

Hi All,

I'm trying to install the Mar2013 version of CosmoMC w/ the planck likelihoods. I've successfully installed plc-1.0.

I'm using intel composer xe 2013

I've gone through and made, what I believe, are all the correct modifications to Makefiles in cosmomc/camb and cosmomc/source, mostly just making sure it's using ifort.


Now, when I run make in the cosmomc directory, it starts to build, but then throws this error:
Matrix_utils.F90(2284): error #6404: This name does not have a type, and must have an explicit type. [MPI_INTEGER]
call MPI_BCAST(n,1,MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
-----------------------^
Matrix_utils.F90(2284): error #6404: This name does not have a type, and must have an explicit type. [MPI_COMM_WORLD]
call MPI_BCAST(n,1,MPI_INTEGER, 0, MPI_COMM_WORLD, ierr)
---------------------------------------^
Matrix_utils.F90(2299): error #6404: This name does not have a type, and must have an explicit type. [MPI_DOUBLE_PRECISION]
call MPI_SEND(AM%M,size(AM%M),MPI_DOUBLE_PRECISION, j, 1, MPI_COMM_WORLD, ierr)
----------------------------------------------^
Matrix_utils.F90(2304): error #6404: This name does not have a type, and must have an explicit type. [MPI_STATUS_IGNORE]
call MPI_RECV(AM%M,size(AM%M),MPI_DOUBLE_PRECISION, 0, 1, MPI_COMM_WORLD,MPI_STATUS_IGNORE, ierr)
-----------------------------------------------------------------------------------------^
compilation aborted for Matrix_utils.F90 (code 1)
make[1]: *** [Matrix_utils.o] Error 1
Any idea what could be the error? I've found in the cosmomc/source Makefile the line that says:
LAPACKL = -lmpi
Should I change this line to be a different library?

I admit, I've got very little experience w/ fortran, my only experience coming from using MODTRAN.

Thanks.

_Kyle

Antony Lewis
Posts: 1646
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

Re: Compile errors with Mar2013 CosmoMC

Post by Antony Lewis » May 08 2013

Did the default Makefile settings not work? (note April is the latest version which fixes some bugs in the March version)

Kyle Helson
Posts: 4
Joined: May 07 2013
Affiliation: Brown University

Compile errors with Mar2013 CosmoMC

Post by Kyle Helson » May 09 2013

No, the default settings didn't work. I get lots of gfortran errors.



mpif90 -mkl -openmp -O3 -xHost -no-prec-div -fpp -DMPI -I../camb -DNOWMAP -c Ma trix_utils.F90
gfortran: unrecognized option '-no-prec-div'
gfortran: language Host not recognized
gfortran: language Host not recognized
gfortran: Matrix_utils.F90: linker input file unused because linking not done
mpif90 -mkl -openmp -O3 -xHost -no-prec-div -fpp -DMPI -I../camb -DNOWMAP -c se ttings.f90
gfortran: unrecognized option '-no-prec-div'
gfortran: language Host not recognized
gfortran: language Host not recognized
gfortran: settings.f90: linker input file unused because linking not done
mpif90 -mkl -openmp -O3 -xHost -no-prec-div -fpp -DMPI -I../camb -DNOWMAP -c sa mples.f90
gfortran: unrecognized option '-no-prec-div'
gfortran: language Host not recognized
gfortran: language Host not recognized
gfortran: samples.f90: linker input file unused because linking not done
mpif90 -mkl -openmp -O3 -xHost -no-prec-div -fpp -DMPI -I../camb -DNOWMAP -c IO .f90
gfortran: unrecognized option '-no-prec-div'
gfortran: language Host not recognized
gfortran: language Host not recognized
gfortran: IO.f90: linker input file unused because linking not done
mpif90 -mkl -openmp -O3 -xHost -no-prec-div -fpp -DMPI -I../camb -DNOWMAP -c Ge neralTypes.f90
gfortran: unrecognized option '-no-prec-div'
gfortran: language Host not recognized
gfortran: language Host not recognized
gfortran: GeneralTypes.f90: linker input file unused because linking not done
mpif90 -mkl -openmp -O3 -xHost -no-prec-div -fpp -DMPI -I../camb -DNOWMAP -c li kelihood.f90
gfortran: unrecognized option '-no-prec-div'
gfortran: language Host not recognized
gfortran: language Host not recognized
gfortran: likelihood.f90: linker input file unused because linking not done
mpif90 -mkl -openmp -O3 -xHost -no-prec-div -fpp -DMPI -I../camb -DNOWMAP -c cm btypes.f90
gfortran: unrecognized option '-no-prec-div'
gfortran: language Host not recognized
gfortran: language Host not recognized
gfortran: cmbtypes.f90: linker input file unused because linking not done
mpif90 -mkl -openmp -O3 -xHost -no-prec-div -fpp -DMPI -I../camb -DNOWMAP -c Pl anck_like.f90
gfortran: unrecognized option '-no-prec-div'
gfortran: language Host not recognized
gfortran: language Host not recognized
gfortran: Planck_like.f90: linker input file unused because linking not done
mpif90 -mkl -openmp -O3 -xHost -no-prec-div -fpp -DMPI -I../camb -DNOWMAP -c bb n.f90
gfortran: unrecognized option '-no-prec-div'
gfortran: language Host not recognized
gfortran: language Host not recognized
gfortran: bbn.f90: linker input file unused because linking not done
mpif90 -mkl -openmp -O3 -xHost -no-prec-div -fpp -DMPI -I../camb -DNOWMAP -c lr ggettheory.f90
gfortran: unrecognized option '-no-prec-div'
gfortran: language Host not recognized
gfortran: language Host not recognized
gfortran: lrggettheory.f90: linker input file unused because linking not done
mpif90 -mkl -openmp -O3 -xHost -no-prec-div -fpp -DMPI -I../camb -DNOWMAP -c ba o.f90
gfortran: unrecognized option '-no-prec-div'
gfortran: language Host not recognized
gfortran: language Host not recognized
gfortran: bao.f90: linker input file unused because linking not done
mpif90 -mkl -openmp -O3 -xHost -no-prec-div -fpp -DMPI -I../camb -DNOWMAP -c su pernovae_Union2.f90
gfortran: unrecognized option '-no-prec-div'
gfortran: language Host not recognized
gfortran: language Host not recognized
gfortran: supernovae_Union2.f90: linker input file unused because linking not do ne
mpif90 -mkl -openmp -O3 -xHost -no-prec-div -fpp -DMPI -I../camb -DNOWMAP -c su pernovae_SNLS.f90
gfortran: unrecognized option '-no-prec-div'
gfortran: language Host not recognized
gfortran: language Host not recognized
gfortran: supernovae_SNLS.f90: linker input file unused because linking not done
mpif90 -mkl -openmp -O3 -xHost -no-prec-div -fpp -DMPI -I../camb -DNOWMAP -c su pernovae.f90
gfortran: unrecognized option '-no-prec-div'
gfortran: language Host not recognized
gfortran: language Host not recognized
gfortran: supernovae.f90: linker input file unused because linking not done
mpif90 -mkl -openmp -O3 -xHost -no-prec-div -fpp -DMPI -I../camb -DNOWMAP -c HS T.f90
gfortran: unrecognized option '-no-prec-div'
gfortran: language Host not recognized
gfortran: language Host not recognized
gfortran: HST.f90: linker input file unused because linking not done
mpif90 -mkl -openmp -O3 -xHost -no-prec-div -fpp -DMPI -I../camb -DNOWMAP -c SD SSLy-a-v3.f90
gfortran: unrecognized option '-no-prec-div'
gfortran: language Host not recognized
gfortran: language Host not recognized
gfortran: SDSSLy-a-v3.f90: linker input file unused because linking not done
mpif90 -mkl -openmp -O3 -xHost -no-prec-div -fpp -DMPI -I../camb -DNOWMAP -c CM B_Cls_simple.f90
gfortran: unrecognized option '-no-prec-div'
gfortran: language Host not recognized
gfortran: language Host not recognized
gfortran: CMB_Cls_simple.f90: linker input file unused because linking not done
mpif90 -mkl -openmp -O3 -xHost -no-prec-div -fpp -DMPI -I../camb -DNOWMAP -c cm bdata.F90
gfortran: unrecognized option '-no-prec-div'
gfortran: language Host not recognized
gfortran: language Host not recognized
gfortran: cmbdata.F90: linker input file unused because linking not done
mpif90 -mkl -openmp -O3 -xHost -no-prec-div -fpp -DMPI -I../camb -DNOWMAP -c pr opose.f90
gfortran: unrecognized option '-no-prec-div'
gfortran: language Host not recognized
gfortran: language Host not recognized
gfortran: propose.f90: linker input file unused because linking not done
mpif90 -mkl -openmp -O3 -xHost -no-prec-div -fpp -DMPI -I../camb -DNOWMAP -c pa ramdef.F90
gfortran: unrecognized option '-no-prec-div'
gfortran: language Host not recognized
gfortran: language Host not recognized
gfortran: paramdef.F90: linker input file unused because linking not done
mpif90 -mkl -openmp -O3 -xHost -no-prec-div -fpp -DMPI -I../camb -DNOWMAP -c pa rams_CMB.f90
gfortran: unrecognized option '-no-prec-div'
gfortran: language Host not recognized
gfortran: language Host not recognized
gfortran: params_CMB.f90: linker input file unused because linking not done
mpif90 -mkl -openmp -O3 -xHost -no-prec-div -fpp -DMPI -I../camb -DNOWMAP -c Da taLikelihoods.f90
gfortran: unrecognized option '-no-prec-div'
gfortran: language Host not recognized
gfortran: language Host not recognized
gfortran: DataLikelihoods.f90: linker input file unused because linking not done
mpif90 -mkl -openmp -O3 -xHost -no-prec-div -fpp -DMPI -I../camb -DNOWMAP -c ca lclike.f90
gfortran: unrecognized option '-no-prec-div'
gfortran: language Host not recognized
gfortran: language Host not recognized
gfortran: calclike.f90: linker input file unused because linking not done
mpif90 -mkl -openmp -O3 -xHost -no-prec-div -fpp -DMPI -I../camb -DNOWMAP -c Es tCovmat.f90
gfortran: unrecognized option '-no-prec-div'
gfortran: language Host not recognized
gfortran: language Host not recognized
gfortran: EstCovmat.f90: linker input file unused because linking not done
mpif90 -mkl -openmp -O3 -xHost -no-prec-div -fpp -DMPI -I../camb -DNOWMAP -c Po wellConstrainedMinimize.f90
gfortran: unrecognized option '-no-prec-div'
gfortran: language Host not recognized
gfortran: language Host not recognized
gfortran: PowellConstrainedMinimize.f90: linker input file unused because linkin g not done
mpif90 -mkl -openmp -O3 -xHost -no-prec-div -fpp -DMPI -I../camb -DNOWMAP -c mi nimize.f90
gfortran: unrecognized option '-no-prec-div'
gfortran: language Host not recognized
gfortran: language Host not recognized
gfortran: minimize.f90: linker input file unused because linking not done
mpif90 -mkl -openmp -O3 -xHost -no-prec-div -fpp -DMPI -I../camb -DNOWMAP -c po stprocess.f90
gfortran: unrecognized option '-no-prec-div'
gfortran: language Host not recognized
gfortran: language Host not recognized
gfortran: postprocess.f90: linker input file unused because linking not done
mpif90 -mkl -openmp -O3 -xHost -no-prec-div -fpp -DMPI -I../camb -DNOWMAP -c MC MC.f90
gfortran: unrecognized option '-no-prec-div'
gfortran: language Host not recognized
gfortran: language Host not recognized
gfortran: MCMC.f90: linker input file unused because linking not done
mpif90 -mkl -openmp -O3 -xHost -no-prec-div -fpp -DMPI -I../camb -DNOWMAP -c dr iver.F90
gfortran: unrecognized option '-no-prec-div'
gfortran: language Host not recognized
gfortran: language Host not recognized
gfortran: driver.F90: linker input file unused because linking not done
mpif90 -o ../cosmomc ObjectLists.o ParamNames.o Matrix_utils.o settings.o sample s.o IO.o GeneralTypes.o cmbtypes.o Planck_like.o likelihood.o bbn.o lrggettheor y.o bao.o supernovae_Union2.o supernovae_SNLS.o supernovae.o HST.o SDSSLy-a-v3.o CMB_Cls_simple.o cmbdata.o propose.o paramdef.o params_CMB.o DataLikelihoods.o calclike.o EstCovmat.o PowellConstrainedMinimize.o minimize.o postprocess.o MCM C.o driver.o -L../camb -lcamb_recfast -lmpi -mkl -openmp -O3 -xHost -no-prec-d iv -fpp -DMPI -I../camb -DNOWMAP
gfortran: Matrix_utils.o: No such file or directory
gfortran: settings.o: No such file or directory
gfortran: samples.o: No such file or directory
gfortran: IO.o: No such file or directory
gfortran: GeneralTypes.o: No such file or directory
gfortran: cmbtypes.o: No such file or directory
gfortran: Planck_like.o: No such file or directory
gfortran: likelihood.o: No such file or directory
gfortran: bbn.o: No such file or directory
gfortran: lrggettheory.o: No such file or directory
gfortran: bao.o: No such file or directory
gfortran: supernovae_Union2.o: No such file or directory
gfortran: supernovae_SNLS.o: No such file or directory
gfortran: supernovae.o: No such file or directory
gfortran: HST.o: No such file or directory
gfortran: SDSSLy-a-v3.o: No such file or directory
gfortran: CMB_Cls_simple.o: No such file or directory
gfortran: cmbdata.o: No such file or directory
gfortran: propose.o: No such file or directory
gfortran: paramdef.o: No such file or directory
gfortran: params_CMB.o: No such file or directory
gfortran: DataLikelihoods.o: No such file or directory
gfortran: calclike.o: No such file or directory
gfortran: EstCovmat.o: No such file or directory
gfortran: PowellConstrainedMinimize.o: No such file or directory
gfortran: minimize.o: No such file or directory
gfortran: postprocess.o: No such file or directory
gfortran: MCMC.o: No such file or directory
gfortran: driver.o: No such file or directory
gfortran: unrecognized option '-no-prec-div'
make[1]: *** [cosmomc] Error 1
make[1]: Leaving directory `/home/khelson/school/p2280/cosmomc/source'
make: *** [all] Error 2
is what is produced with the default settings.

Antony Lewis
Posts: 1646
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

Re: Compile errors with Mar2013 CosmoMC

Post by Antony Lewis » May 09 2013

You must have mpif90 pointing at gfortran for some reason rather than ifort.

Kyle Helson
Posts: 4
Joined: May 07 2013
Affiliation: Brown University

Compile errors with Mar2013 CosmoMC

Post by Kyle Helson » May 09 2013

Ah thank you! I will look into that.

Kyle Helson
Posts: 4
Joined: May 07 2013
Affiliation: Brown University

Compile errors with Mar2013 CosmoMC

Post by Kyle Helson » May 10 2013

I've figured it out.

So on my system, mpich2 was installed/compiled against the GNU suite of compilers, regardless of what variables or lines in makefiles I change, it defaults to the GNU suite.

So now I have to uninstall/recompile it against the Intel suite.

Mario Acero
Posts: 28
Joined: November 15 2006
Affiliation: Universidad del Atlantico
Contact:

Compile errors with Mar2013 CosmoMC

Post by Mario Acero » October 15 2013

Hi there,

I am trying to install CosmoMC from October 2013, and I got similar problems to yours.
In particular, I got the following messages when making (the very beginning):

Code: Select all

Workstation:~/cosmomc$ make
cd ./source && make all
make[1]: Entering directory `/home/macero/Documents/CosmoMC_PLANK/cosmomc/source'
cd ../camb && \
	make --file=Makefile_main libcamb_recfast.a \
	RECOMBINATION=recfast EQUATIONS=equations_ppf NONLINEAR=halofit_ppf
make[2]: Entering directory `/home/macero/Documents/CosmoMC_PLANK/cosmomc/camb'
mpif90 -mkl -openmp -O3 -xHost -no-prec-div -fpp -DMPI -DCLIK -c constants.f90
gfortran: error: unrecognized command line option ‘-mkl’
gfortran: error: unrecognized command line option ‘-no-prec-div’
gfortran: error: unrecognized command line option ‘-fpp’
make[2]: *** [constants.o] Error 1
make[2]: Leaving directory `/home/macero/Documents/CosmoMC_PLANK/cosmomc/camb'
make[1]: *** [camb] Error 2
make[1]: Leaving directory `/home/macero/Documents/CosmoMC_PLANK/cosmomc/source'
make: *** [all] Error 2
As Antony said before, it would mean the system (I am) is using gfortran instead if ifort, causing the problems. However, I have no clue how to fix it. Could you (or any one) give me some help, please?

Thanks a lot.

Cheers,

Mario AAO.

Björn Sörgel
Posts: 13
Joined: April 05 2013
Affiliation: Institute of Astronomy/Kavli Institute for Cosmology Cambridge

Compile errors with Mar2013 CosmoMC

Post by Björn Sörgel » October 17 2013

Hi,
First you should check if you have ifort v.13 already installed with ifort -v.
Then try adding -f90=ifort to the FFLAGS in ./source/Makefile . This should force the wrapper (mpif90) to use ifort instead of gfortran.

Cheers,
Bjoern

Mario Acero
Posts: 28
Joined: November 15 2006
Affiliation: Universidad del Atlantico
Contact:

Compile errors with Mar2013 CosmoMC

Post by Mario Acero » October 22 2013

Hi Bjoern, thank you for tour suggestion.

I have checked that I indeed have ifort version 14.0.0, but unfortunately, the other part did not work. So, if I got you right, this is what I have at the beginning of ./source/Makefile:

Code: Select all

#Intel MPI
#these settings for ifort 13 and higher
#Can remove -xHost if your cluster is not uniform, or specify specific processor optimizations -x...
F90C     = mpif90
FFLAGS = -mkl -openmp -O3 -xHost -no-prec-div -fpp -DMPI -f90=ifort
LAPACKL = -lmpi
where I have added -f90=ifort.

Then, when I run make in the cosmomc directory, I get the following:

Code: Select all

cd ./source && make all
make[1]: Entering directory `/home/macero/Documents/CosmoMC_PLANK/cosmomc/source'
cd ../camb && \
	make --file=Makefile_main libcamb_recfast.a \
	RECOMBINATION=recfast EQUATIONS=equations_ppf NONLINEAR=halofit_ppf
make[2]: Entering directory `/home/macero/Documents/CosmoMC_PLANK/cosmomc/camb'
mpif90 -mkl -openmp -O3 -xHost -no-prec-div -fpp -DMPI -f90=ifort -DCLIK -c constants.f90
gfortran: error: unrecognized command line option ‘-mkl’
gfortran: error: unrecognized command line option ‘-no-prec-div’
gfortran: error: unrecognized command line option ‘-fpp’
gfortran: error: unrecognized command line option ‘-f90=ifort’
make[2]: *** [constants.o] Error 1
make[2]: Leaving directory `/home/macero/Documents/CosmoMC_PLANK/cosmomc/camb'
make[1]: *** [camb] Error 2
make[1]: Leaving directory `/home/macero/Documents/CosmoMC_PLANK/cosmomc/source'
make: *** [all] Error 2
Basically the same as before, with the new error for the unrecognized line option -f90=ifort.

Is there any other suggestion for solving this problem? Thank you all,

Mario AAO.

Antony Lewis
Posts: 1646
Joined: September 23 2004
Affiliation: University of Sussex
Contact:

Re: Compile errors with Mar2013 CosmoMC

Post by Antony Lewis » October 22 2013

You could try just using ifort directly rather than mpif90?

Mario Acero
Posts: 28
Joined: November 15 2006
Affiliation: Universidad del Atlantico
Contact:

Compile errors with Mar2013 CosmoMC

Post by Mario Acero » October 22 2013

Hi Antony,
Thanks for your suggestion. I though mpif90 was not exactly a compiler. In any case, I did change it by ifort:

Code: Select all

#Intel MPI
#these settings for ifort 13 and higher
#Can remove -xHost if your cluster is not uniform, or specify specific processor optimizations -x...
F90C    = ifort
FFLAGS  = -mkl -openmp -O3 -xHost -no-prec-div -fpp -DMPI
LAPACKL = -lmpi
and it actually goes further than before, but it does not work yet. This is the message I got:

Code: Select all

cd ./source && make all
make[1]: Entering directory `/home/macero/Documents/CosmoMC_PLANK/cosmomc/source'
cd ../camb && \
	make --file=Makefile_main libcamb_recfast.a \
	RECOMBINATION=recfast EQUATIONS=equations_ppf NONLINEAR=halofit_ppf
make[2]: Entering directory `/home/macero/Documents/CosmoMC_PLANK/cosmomc/camb'
ifort  -mkl -openmp -O3 -xHost -no-prec-div -fpp -DMPI  -DCLIK -c constants.f90
ifort  -mkl -openmp -O3 -xHost -no-prec-div -fpp -DMPI  -DCLIK -c utils.F90
utils.F90(950): error #5102: Cannot open include file 'mpif.h'
    include "mpif.h"
------------^
utils.F90(1033): error #6404: This name does not have a type, and must have an explicit type.   [MPI_COMM_WORLD]
   call mpi_comm_rank(mpi_comm_world,GetMPIrank,ierror)
----------------------^
utils.F90(1072): error #6404: This name does not have a type, and must have an explicit type.   [MPI_SUCCESS]
        if (ierror/=MPI_SUCCESS) stop 'MpiStat: MPI rank'
--------------------^
utils.F90(1089): error #6404: This name does not have a type, and must have an explicit type.   [MPI_STATUS_IGNORE]
       call MPI_IPROBE(0,0,MPI_COMM_WORLD,flag, MPI_STATUS_IGNORE,ierr)
------------------------------------------------^
utils.F90(1091): error #6404: This name does not have a type, and must have an explicit type.   [MPI_INTEGER]
             call MPI_RECV(i,1,MPI_INTEGER, 0,0,MPI_COMM_WORLD,status,ierr)
-------------------------------^
utils.F90(1083): error #6279: A specification expression object must be a dummy argument, a COMMON block object, or an object accessible through host or use association   [MPI_STATUS_SIZE]
     integer flag, ierr, STATUS(MPI_STATUS_SIZE)
--------------------------------^
utils.F90(1083): error #6404: This name does not have a type, and must have an explicit type.   [MPI_STATUS_SIZE]
     integer flag, ierr, STATUS(MPI_STATUS_SIZE)
--------------------------------^
utils.F90(2591): error #7002: Error in opening the compiled module file.  Check INCLUDE paths.   [AMLUTILS]
  use AMLUtils
------^
utils.F90(2631): error #7002: Error in opening the compiled module file.  Check INCLUDE paths.   [AMLUTILS]
   use AMLUtils
-------^
utils.F90(2623): error #6404: This name does not have a type, and must have an explicit type.   [FEEDBACK]
      if (Feedback > 0 ) write(*,'(" Random seeds:",1I6,",",1I6," rand_inst:",1I4)') ij,kl,rand_inst
----------^
compilation aborted for utils.F90 (code 1)
make[2]: *** [utils.o] Error 1
make[2]: Leaving directory `/home/macero/Documents/CosmoMC_PLANK/cosmomc/camb'
make[1]: *** [camb] Error 2
make[1]: Leaving directory `/home/macero/Documents/CosmoMC_PLANK/cosmomc/source'
make: *** [all] Error 2
As far as I understand, there would be a problem with mpi, but I know that the file "mpif.h" actually exists in my system, so what is happening?

On the other hand, let me say that I am using Ubuntu 13.04 and I installed the openMPI libraries by using the Synaptic Package Manager. I wonder if this could have something to do with my cosmomc compilation problem?
So, how can I proceed with the compilation using ifort (as recommended) but also the mpi function?

Thank you all.
Cheers,

Mario AAO.

Björn Sörgel
Posts: 13
Joined: April 05 2013
Affiliation: Institute of Astronomy/Kavli Institute for Cosmology Cambridge

Compile errors with Mar2013 CosmoMC

Post by Björn Sörgel » October 24 2013

Hi,
on our cluster the -f90=ifort option forces mpif90 to use ifort instead of gfortran, this did the job. Since this is not working on your system, you need another way to do this.
option 1) If installed, use mpiifort instead of mpif90
option 2) change the environment variable by

Code: Select all

 export I_MPI_F90=ifort 
(bash shell). If this works, you should add it to your ~/.bashrc .
option 3) force the IT support of your institute to make mpif90 point to ifort.

Here you can find more details for options 1 & 2:
http://software.intel.com/en-us/forums/topic/288354

(I think that's were I originally had the -f90=ifort solution from).

Cheers,
Bjoern

Stefano Gariazzo
Posts: 1
Joined: October 17 2013
Affiliation: University and INFN, Torino

Compile errors with Mar2013 CosmoMC

Post by Stefano Gariazzo » October 24 2013

Hi,
I had the same problem.
In one of the pc I am using to run CosmoMC, I have 3 different executables:

/usr/bin/mpif90
/usr/bin/mpif90.mpich2
/usr/bin/mpif90.openmpi

For some reason, the default selection was not working: I solved changing

Code: Select all

F90C = mpif90
into

Code: Select all

F90C = /usr/bin/mpif90.openmpi
into the original Makefile.

Hope this helps.

Ivan Debono
Posts: 25
Joined: April 17 2007
Affiliation: APC, Paris 7 / OBSPM

Compile errors with Mar2013 CosmoMC

Post by Ivan Debono » October 25 2013

This is weird. I'm getting the same error further down the list of files:
ifort -mkl -openmp -O3 -xHost -no-prec-div -fpp -c cmbmain.f90
cmbmain.f90(1137): error #7002: Error in opening the compiled module file. Check INCLUDE paths. [NONLINEAR]
use NonLinear
--------^
cmbmain.f90(1158): error #6404: This name does not have a type, and must have an explicit type. [MIN_KH_NONLINEAR]
if (Evolve_q%points(ik)/(CP%H0/100) > Min_kh_nonlinear) then
-----------------------------------------------^
compilation aborted for cmbmain.f90 (code 1)
Any suggestions?

Sheng Li
Posts: 57
Joined: May 26 2009
Affiliation: University of Sussex
Contact:

Re: Compile errors with Mar2013 CosmoMC

Post by Sheng Li » October 25 2013

Mario Acero wrote:Hi Antony,
Thanks for your suggestion. I though mpif90 was not exactly a compiler. In any case, I did change it by ifort:

Code: Select all

#Intel MPI
#these settings for ifort 13 and higher
#Can remove -xHost if your cluster is not uniform, or specify specific processor optimizations -x...
F90C    = ifort
FFLAGS  = -mkl -openmp -O3 -xHost -no-prec-div -fpp -DMPI
LAPACKL = -lmpi
and it actually goes further than before, but it does not work yet. This is the message I got:

Code: Select all

cd ./source && make all
make[1]: Entering directory `/home/macero/Documents/CosmoMC_PLANK/cosmomc/source'
cd ../camb && \
	make --file=Makefile_main libcamb_recfast.a \
	RECOMBINATION=recfast EQUATIONS=equations_ppf NONLINEAR=halofit_ppf
make[2]: Entering directory `/home/macero/Documents/CosmoMC_PLANK/cosmomc/camb'
ifort  -mkl -openmp -O3 -xHost -no-prec-div -fpp -DMPI  -DCLIK -c constants.f90
ifort  -mkl -openmp -O3 -xHost -no-prec-div -fpp -DMPI  -DCLIK -c utils.F90
utils.F90(950): error #5102: Cannot open include file 'mpif.h'
    include "mpif.h"
------------^
utils.F90(1033): error #6404: This name does not have a type, and must have an explicit type.   [MPI_COMM_WORLD]
   call mpi_comm_rank(mpi_comm_world,GetMPIrank,ierror)
----------------------^
utils.F90(1072): error #6404: This name does not have a type, and must have an explicit type.   [MPI_SUCCESS]
        if (ierror/=MPI_SUCCESS) stop 'MpiStat: MPI rank'
--------------------^
utils.F90(1089): error #6404: This name does not have a type, and must have an explicit type.   [MPI_STATUS_IGNORE]
       call MPI_IPROBE(0,0,MPI_COMM_WORLD,flag, MPI_STATUS_IGNORE,ierr)
------------------------------------------------^
utils.F90(1091): error #6404: This name does not have a type, and must have an explicit type.   [MPI_INTEGER]
             call MPI_RECV(i,1,MPI_INTEGER, 0,0,MPI_COMM_WORLD,status,ierr)
-------------------------------^
utils.F90(1083): error #6279: A specification expression object must be a dummy argument, a COMMON block object, or an object accessible through host or use association   [MPI_STATUS_SIZE]
     integer flag, ierr, STATUS(MPI_STATUS_SIZE)
--------------------------------^
utils.F90(1083): error #6404: This name does not have a type, and must have an explicit type.   [MPI_STATUS_SIZE]
     integer flag, ierr, STATUS(MPI_STATUS_SIZE)
--------------------------------^
utils.F90(2591): error #7002: Error in opening the compiled module file.  Check INCLUDE paths.   [AMLUTILS]
  use AMLUtils
------^
utils.F90(2631): error #7002: Error in opening the compiled module file.  Check INCLUDE paths.   [AMLUTILS]
   use AMLUtils
-------^
utils.F90(2623): error #6404: This name does not have a type, and must have an explicit type.   [FEEDBACK]
      if (Feedback > 0 ) write(*,'(" Random seeds:",1I6,",",1I6," rand_inst:",1I4)') ij,kl,rand_inst
----------^
compilation aborted for utils.F90 (code 1)
make[2]: *** [utils.o] Error 1
make[2]: Leaving directory `/home/macero/Documents/CosmoMC_PLANK/cosmomc/camb'
make[1]: *** [camb] Error 2
make[1]: Leaving directory `/home/macero/Documents/CosmoMC_PLANK/cosmomc/source'
make: *** [all] Error 2
As far as I understand, there would be a problem with mpi, but I know that the file "mpif.h" actually exists in my system, so what is happening?

On the other hand, let me say that I am using Ubuntu 13.04 and I installed the openMPI libraries by using the Synaptic Package Manager. I wonder if this could have something to do with my cosmomc compilation problem?
So, how can I proceed with the compilation using ifort (as recommended) but also the mpi function?

Thank you all.
Cheers,

Mario AAO.
the error points to include "mpif.h"

Seems you have not had your mpi environment included in your bash/csh env.


Also, I think you need try:

Code: Select all

make clean && make
before a new compilation.

Post Reply