CMBeasy: why this error when running make

Use of Cobaya. camb, CLASS, cosmomc, compilers, etc.
Post Reply
Jie Ren
Posts: 28
Joined: May 13 2006
Affiliation: Theoretical Physics Division, Chern Institute of Mathematics, Nankai University, Tianjin, China

CMBeasy: why this error when running make

Post by Jie Ren » August 21 2006

Hello, I want to install CMBeasy, but some errors occur when I run make. What is the meaning of these errors and how to solve the problem? Thank you!

[root@localhost cmbeasy]# make
g++ -c -Imathobject -Ianisotropy -Icosmos -Igui -I/root/CMB/cmbeasy/gsl/include -Ichain -Iwmap3 -I/root/CMB/Healpix_2.01/include -Wall -DQT_THREAD_SUPPORT -DPRERELEASE -O2 -fno-unit-at-a-time anisotropy/analyzethis.cc -o anisotropy/analyzethis.o
In file included from wmap3/WMAP_3yr_likelihood.h:30,
from anisotropy/analyzethis.cc:15:
wmap3/port_helper.h:21:46: arr.h: No such file or directory
In file included from wmap3/WMAP_3yr_likelihood.h:30,
from anisotropy/analyzethis.cc:15:
wmap3/port_helper.h:92: error: ISO C++ forbids declaration of `arr' with no type
wmap3/port_helper.h:92: error: expected `;' before '<' token
wmap3/port_helper.h:126: error: expected `)' before '<' token
wmap3/port_helper.h:229: error: ISO C++ forbids declaration of `arr' with no type
wmap3/port_helper.h:229: error: expected `;' before '<' token
wmap3/port_helper.h:233: error: expected `;' before "void"
wmap3/port_helper.h:233: error: expected `,' or `...' before '<' token
wmap3/port_helper.h:234: error: ISO C++ forbids declaration of `arr' with no type
wmap3/port_helper.h: In constructor `Array1D<T>::Array1D(unsigned int)':
wmap3/port_helper.h:101: error: class `Array1D<T>' does not have any field named `mHealpixArray'
wmap3/port_helper.h: In constructor `Array1D<T>::Array1D(Range)':
wmap3/port_helper.h:143: error: class `Array1D<T>' does not have any field named `mHealpixArray'
wmap3/port_helper.h: In destructor `Array1D<T>::~Array1D()':
wmap3/port_helper.h:151: error: `mHealpixArray' undeclared (first use this function)
wmap3/port_helper.h:151: error: (Each undeclared identifier is reported only once for each function it appears in.)
wmap3/port_helper.h: In member function `void Array1D<T>::resize(unsigned int)':
wmap3/port_helper.h:175: error: `mHealpixArray' undeclared (first use this function)
wmap3/port_helper.h: In member function `void Array1D<T>::resize(Range)':
wmap3/port_helper.h:187: error: `mHealpixArray' undeclared (first use this function)
wmap3/port_helper.h: In member function `void Array1D<T>::setHealpixArray(int)':
wmap3/port_helper.h:235: error: `mHealpixArray' undeclared (first use this function)
wmap3/port_helper.h:235: error: `arr' is not a type
wmap3/port_helper.h:235: error: expected `>' before '<' token
wmap3/port_helper.h:235: error: expected `(' before '<' token
wmap3/port_helper.h:235: error: expected primary-expression before '<' token
wmap3/port_helper.h:235: error: expected primary-expression before '>' token
wmap3/port_helper.h:235: error: expected primary-expression before '>' token
wmap3/port_helper.h:235: error: `a' undeclared (first use this function)
wmap3/port_helper.h:235: error: expected `)' before ';' token
wmap3/port_helper.h:236: error: `arr' is not a type
wmap3/port_helper.h:236: error: expected `>' before '<' token
wmap3/port_helper.h:236: error: expected `(' before '<' token
wmap3/port_helper.h:236: error: expected primary-expression before '<' token
wmap3/port_helper.h:236: error: expected primary-expression before '>' token
wmap3/port_helper.h:236: error: expected primary-expression before '>' token
wmap3/port_helper.h:236: error: expected `)' before ';' token
wmap3/port_helper.h: In member function `Array1D<T>& Array1D<T>::operator=(const Array1D<T>&)':
wmap3/port_helper.h:257: error: `mHealpixArray' undeclared (first use this function)
In file included from wmap3/WMAP_3yr_likelihood.h:34,
from anisotropy/analyzethis.cc:15:
wmap3/WMAP_3yr_tt_pixlike.h: At global scope:
wmap3/WMAP_3yr_tt_pixlike.h:20: error: `arr' has not been declared
wmap3/WMAP_3yr_tt_pixlike.h:20: error: expected `,' or `...' before '<' token
wmap3/WMAP_3yr_tt_pixlike.h:20: error: ISO C++ forbids declaration of `parameter' with no type
In file included from wmap3/WMAP_3yr_likelihood.h:35,
from anisotropy/analyzethis.cc:15:
wmap3/WMAP_3yr_teeebb_pixlike.h:20: error: `arr' has not been declared
wmap3/WMAP_3yr_teeebb_pixlike.h:20: error: expected `,' or `...' before '<' token
wmap3/WMAP_3yr_teeebb_pixlike.h:20: error: ISO C++ forbids declaration of `parameter' with no type
anisotropy/analyzethis.cc: In member function `AnalyzeThis::WMAP3Likelihood AnalyzeThis::WMAP3computeLikelihood(CL&)':
anisotropy/analyzethis.cc:247: warning: converting to `unsigned int' from `double'
anisotropy/analyzethis.cc:251:2: warning: #warning have a clean implementation for this ( don't forget the other spectra)
anisotropy/analyzethis.cc:256:2: warning: #warning do this in a clean way...
make: *** [anisotropy/analyzethis.o] Error 1
[root@localhost cmbeasy]#

Martin Reinecke
Posts: 13
Joined: July 26 2006
Affiliation: Max-Planck-Institute for Astrophysics

CMBeasy: why this error when running make

Post by Martin Reinecke » August 22 2006

As the compiler notes at the beginning:

In file included from wmap3/WMAP_3yr_likelihood.h:30,
from anisotropy/analyzethis.cc:15:
wmap3/port_helper.h:21:46: arr.h: No such file or directory

It tries to find the file "arr.h", which is part of Healpix-C++ (which is new to
me since I didn't expect that CMBeasy depended on Healpix), and can't
locate it in the include search path. I expect that the part
"-I/root/CMB/Healpix_2.01/include" needs to be replaced by something else,
since this path typically does not contain the C++ header files for Healpix.

Jie Ren
Posts: 28
Joined: May 13 2006
Affiliation: Theoretical Physics Division, Chern Institute of Mathematics, Nankai University, Tianjin, China

CMBeasy: why this error when running make

Post by Jie Ren » August 22 2006

Thank you! And there is another problem related to this one.
In the original Makefile of cmbeasy 4.2.1:

# comment this line out if you do not want to use the c++ wmap3 likelihood code
BUILDWMAP3=true

# if you do want to use the wmap3 code, you need to have Healpix_cxx installed:
# set this to the path where the c++ version of the Healpix libraries and header
# files is installed; this setting is only
# used when the HEALPIX_CXX environment variable is not set
# note: the wmap3 code also assumes that a directory named "wmap3" exists in the
# resources directory (e.g. a symbolic link) that points to the wmap3 data release
# from http://lambda.gsfc.nasa.gov/
HEALPIXDIR=/opt/Healpix_2.01/src/cxx/generic_gcc

MATHOBJECT=mathobject
ANISOTROPY=anisotropy
COSMOS=cosmos
CHAIN=chain
WMAP=wmap3
GUI=gui

ifeq ($(strip $(HEALPIX_CXX)),)
HEALPIX_CXX=$(HEALPIXDIR)
endif

ifdef BUILDWMAP3
WMAPINC=-I$(WMAP) -I$(HEALPIX_CXX)/include
WMAPLIBFLAGS=-L$(HEALPIX_CXX)/lib/
WMAPLIB= -lhealpix_cxx -lcxxsupport -lfftpack -lcfitsio
...
--------------------------------------------------------------------------------------

There is a line "HEALPIXDIR=/opt/Healpix_2.01/src/cxx/generic_gcc". After I install Healpix 2.01, the directory "Healpix_2.01/src/cxx" exists, but it does not contain a subdirectory "./generic_gcc". The file "arr.h" is in "Healpix_2.01/src/cxx/cxxsupport", so the line "WMAPINC=-I$(WMAP) -I$(HEALPIX_CXX)/include" should be modified to this directory. After I modified this line as
"WMAPINC=-I$(WMAP) -I/root/CMB/Healpix_2.01/src/cxx/cxxsupport -I/root/CMB/Healpix_2.01/src/cxx/Healpix_cxx -I/root/CMB/cfitsio/include",
there was no such error "*.h: No such file or directory".

However, there is another problem. Since the directory "Healpix_2.01/src/cxx/generic_gcc" does not exist, I do not know how to modifiy this line "WMAPLIBFLAGS=-L$(HEALPIX_CXX)/lib/". There seems no lib file in"Healpix_2.01/src/cxx". If I add "-L/root/CMB/Healpix_2.01/lib" to this line, the error occurs:
"usr/bin/ld: cannot find -lhealpix_cxx
collect2: ld returned 1 exit status
make: *** [bin/cmb] error 1".

My question is what directories in Healpix 2.01 should we add to the variable "WMAPLIBFLAGS"?

Martin Reinecke
Posts: 13
Joined: July 26 2006
Affiliation: Max-Planck-Institute for Astrophysics

CMBeasy: why this error when running make

Post by Martin Reinecke » August 23 2006

> There is a line "HEALPIXDIR=/opt/Healpix_2.01/src/cxx/generic_gcc".
> After I install Healpix 2.01, the directory "Healpix_2.01/src/cxx" exists,
> but it does not contain a subdirectory "./generic_gcc".

You have to compile the C++ part of Healpix. This will create the "generic_gcc"
directory. Instructions can be found in src/cxx/README.compilation

Jie Ren
Posts: 28
Joined: May 13 2006
Affiliation: Theoretical Physics Division, Chern Institute of Mathematics, Nankai University, Tianjin, China

CMBeasy: why this error when running make

Post by Jie Ren » August 23 2006

Thank you very much! After I compiled the C++ part of Healpix, there was no error when running make. Another question:

In the file INSTALLATION of cmbeasy:
--------------------------------
To build the monte carlo driver, make sure that you have LAM/MPI set up
on your computer and that the "hcp" command is in your PATH. Then call

> make bin/mc_general
--------------------------------

My system is RedHat Enterprise 4, and the "hcp" command is not available. What should I do?

Jie Ren
Posts: 28
Joined: May 13 2006
Affiliation: Theoretical Physics Division, Chern Institute of Mathematics, Nankai University, Tianjin, China

CMBeasy: why this error when running make

Post by Jie Ren » August 23 2006

It's OK after I install "lam-7.1.2.tar.gz". Thanks all.

Post Reply