Problem installing Planck likelihood

Use of Cobaya. camb, CLASS, cosmomc, compilers, etc.
Post Reply
Mastache, Jorge
Posts: 6
Joined: June 16 2011
Affiliation: MCTP

Problem installing Planck likelihood

Post by Mastache, Jorge »

I have a problem installing the Planck likelihood in a Mac, the problem is the following:

After having a successful configuration

Code: Select all

> ./waf configure --lapack_mkl=/opt/intel/mkl --install_all_deps
here I have a couple of warnings:

Code: Select all

Checking for program 'gcc, cc'           : /usr/bin/gcc 
gcc not found(cause : Could not find g++, if renamed try eg: CXX=g++48 waf configure
(complete log in /Users/Jorge/Dropbox/Programacion/Cosmomc/plc-2.0/build/config.log)) 
Checking for program 'icc, ICL'          : not found 
icc not found (cause : Could not find the program ['icc', 'ICL']
(complete log in /Users/Jorge/Dropbox/Programacion/Cosmomc/plc-2.0/build/config.log)) 
Checking for program 'clang'             : /usr/bin/clang 
Then I run

Code: Select all

> ./waf install
and I get the error:

Code: Select all

clang: error: unsupported option '-fopenmp'

../src/clik_example_c.c:45:19: warning: implicit declaration of function 'read_double_vector' is invalid in C99 [-Wimplicit-function-declaration]
    cl_and_pars = read_double_vector(argv[i],ndim,err);
                  ^
../src/clik_example_c.c:45:17: warning: incompatible integer to pointer conversion assigning to 'double *' from 'int' [-Wint-conversion]
    cl_and_pars = read_double_vector(argv[i],ndim,err);
                ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/clik_example_c.c:135:17: warning: incompatible integer to pointer conversion assigning to 'double *' from 'int' [-Wint-conversion]
    cl_and_pars = read_double_vector(argv[i],ndim,err);
                ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 warnings generated.

clang: warning: -Wl,-compatibility_version,1: 'linker' input unused [-Wunused-command-line-argument]
clang: warning: -Wl,-current_version,1: 'linker' input unused [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-dynamiclib' [-Wunused-command-line-argument]

ifort: command line remark #10411: option '-openmp' is deprecated and will be removed in a future release. Please use the replacement option '-qopenmp'

Waf: Leaving directory `/Users/Jorge/Dropbox/Programacion/Cosmomc/plc-2.0/build'
Build failed
 -> task in 'rel2015' failed (exit status 1): 
	{task 4522435472: c rel2015.pyx.c -> rel2015.pyx.c.4.o}
['/usr/bin/clang', '-fopenmp', '-fPIC', '-dynamiclib', '-Wl,-compatibility_version,1', '-Wl,-current_version,1', '-fPIC', '-fPIC', '-fPIC', '-fPIC', '-I/Users/Jorge/Dropbox/Programacion/Cosmomc/plc-2.0/build/src/python/clik', '-I/Users/Jorge/Dropbox/Programacion/Cosmomc/plc-2.0/src/python/clik', '-I/Users/Jorge/Dropbox/Programacion/Cosmomc/plc-2.0/build/src/python', '-I/Users/Jorge/Dropbox/Programacion/Cosmomc/plc-2.0/src/python', '-I/Users/Jorge/Dropbox/Programacion/Cosmomc/plc-2.0/build/src', '-I/Users/Jorge/Dropbox/Programacion/Cosmomc/plc-2.0/src', '-I/Users/Jorge/Dropbox/Programacion/Cosmomc/plc-2.0/build/src/plik', '-I/Users/Jorge/Dropbox/Programacion/Cosmomc/plc-2.0/src/plik', '-I/Users/Jorge/Dropbox/Programacion/Cosmomc/plc-2.0/build/src/minipmc', '-I/Users/Jorge/Dropbox/Programacion/Cosmomc/plc-2.0/src/minipmc', '-I/Users/Jorge/Dropbox/Programacion/Cosmomc/plc-2.0/include', '-I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7', '-I/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include', '-DPYTHONDIR="/Library/Python/2.7/site-packages"', '-DPYTHONARCHDIR="/Library/Python/2.7/site-packages"', '-DHAVE_PYEMBED=1', '-DHAVE_PYTHON_H=1', '-DHAS_LAPACK', '-DLAPACK_CLIK', '-DHAS_RTLD_DEFAULT', 'src/plik/component_plugin/rel2015/rel2015.pyx.c', '-c', '-o', '/Users/Jorge/Dropbox/Programacion/Cosmomc/plc-2.0/build/src/plik/component_plugin/rel2015/rel2015.pyx.c.4.o']
Now, the problem is that clang doesn't support openmp, I followed this instructions to install llvm, but it didn't work with clang.

Now, the problem I thing is that in the configuration waf doesn't recognize that I have install gcc, for instance:

Code: Select all

> gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 8.1.0 (clang-802.0.42)
Target: x86_64-apple-darwin16.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
I even have installed:
> gcc-5
> g++

and with those I have openmp

Can anyone knows how to deal with this problem?

Thanks in advance!
Jorge[/url]
Ira *Wolfson
Posts: 69
Joined: January 24 2013
Affiliation: MPA
Contact:

Problem installing Planck likelihood

Post by Ira *Wolfson »

It seems to me you have the intel composer suite, since you direct the --lapack_mkl=... flag to /opt/intel/mkl

It also occurs to me that you computer does not find you icc compiler.
So try sourcing the compilervars.sh file.

It usually could be found in /opt/intel/bin folder, but maybe for Mac it's different.

if you insist on using gcc then all you need to do is provide a flag like so:
CC=gcc
or, if the global is not recognized -
CC=/Path/to/gcc

You also need your gcc and fortran versions to be compatible so you might also provide:
FC=/path/to/gfortran

Lastly, I am not sure whether intel MKL is compatible with gcc and gfortran, so you might consider a different linear algebra pack...
Mastache, Jorge
Posts: 6
Joined: June 16 2011
Affiliation: MCTP

Problem installing Planck likelihood

Post by Mastache, Jorge »

Thanks for your answer Ira, it give a clue of what to do.
I didn't have installed icc, but I do have gcc (by default) I also installed gcc-5 and I have clang.

So, I solve the problem by using clang-omp (installed with llvm) instead of just clang, and by the way, when I tried to use any other gcc I get an error related with python flags.

I use:

Code: Select all

> ./waf clean
> ./waf configure CC=/usr/local/bin/clang-omp --install_all_deps --lapack_mkl=/opt/intel/mkl
> ./waf install
and this give no errors.

Thanks!
Jorge
Junxian Li
Posts: 4
Joined: July 24 2023
Affiliation: Sun Yat-Sen University

Re: Problem installing Planck likelihood

Post by Junxian Li »

Hi Mr.Mastache

A similar situation came to me.

When I am trying to configure the plc-3.1,
after inputing "./waf configure --lapack_mkl=${MKLROOT} --install_all_deps",
it shows:

Code: Select all

> Checking for program 'gcc, cc'           : /usr/local/bin/clang-omp 
> gcc not found(cause : Could not find gcc/g++ (only Clang), if renamed try eg: CC=gcc48 CXX=g++48 waf configure
> Checking for program 'icc, ICL'          : /usr/local/bin/clang-omp 
> icc not found (cause : Not icc/icpc)
I have followed https://stackoverflow.com/questions/38971394/brew-install-clang-omp-not-working(clang-omp),
and use:

Code: Select all

> ./waf configure CC=/usr/local/bin/clang-omp --install_all_deps --lapack_mkl=${MKLROOT}
but it won't help.

Do you have any ideas to solve this problem?

Thanks in advanced.
Li
Post Reply