Page 1 of 1

Problem building CosmoMC

Posted: July 02 2019
by chien lin
Hello,

I am trying to compile CosmoMC (nov2016) on my laptop running Ubuntu 18.04, and these errors repeatedly show up.

Code: Select all

mpif90 -cpp -O3 -ffast-math -ffree-line-length-none -fopenmp -fmax-errors=4 -march=native -DMPI -I../camb/ReleaseMPI  -JReleaseMPI -IReleaseMPI/ -c szcounts.f90 -o ReleaseMPI/szcounts.o
ifort: command line warning #10006: ignoring unknown option '-ffast-math'
ifort: command line warning #10006: ignoring unknown option '-ffree-line-length-none'
ifort: command line warning #10006: ignoring unknown option '-JReleaseMPI'
And eventually it cannot continue compiling.

Code: Select all

szcounts.f90(41): error #7002: Error in opening the compiled module file.  Check INCLUDE paths.   [PRECISION]
    use PRECISION
--------^
szcounts.f90(43): error #6683: A kind type parameter must be a compile-time constant.   [DL]
    real(dl), PARAMETER :: Mpc = 3.08568025d22 ! Mpc in metres
---------^
szcounts.f90(44): error #6683: A kind type parameter must be a compile-time constant.   [DL]
    real(dl), PARAMETER :: G = 6.67300d-11 ! Newton's constant in m^3kg^-1s^-2
---------^
szcounts.f90(45): error #6683: A kind type parameter must be a compile-time constant.   [DL]
    real(dl), PARAMETER :: c = 3.0d8 ! speed of light in m/s
---------^
/tmp/ifortE4Ye0O.i90(59): catastrophic error: Too many errors, exiting
compilation aborted for szcounts.f90 (code 1)
Makefile:286: recipe for target 'ReleaseMPI/szcounts.o' failed
make: *** [ReleaseMPI/szcounts.o] Error 1

I use 'Make' command with ifort version 19, and the instruction I am following is from this paper : https://arxiv.org/pdf/1808.05080.pdf .

I am completely new to configuring source code. Please could anyone help me? Thank you in advance!

Regards,
Chien Lin

Re: Problem building CosmoMC

Posted: July 03 2019
by Antony Lewis
Check if "mpif90" is actually using ifort and not gfortran.

Re: Problem building CosmoMC

Posted: July 04 2019
by chien lin
Hi,

Thank you for your reply. I've tried the command

Code: Select all

mpif90 --version
, and it returns

Code: Select all

ifort (IFORT) 17.0.8 20180907
Copyright (C) 1985-2018 Intel Corporation.  All rights reserved.
, so I believe the mpif90 is indeed using ifort.

Re: Problem building CosmoMC

Posted: July 04 2019
by Antony Lewis
Try the latest master from github rather than the old 2016 version.