## Compiling CMBEASY Leopard/intel mac

Use of Healpix, camb, CLASS, cosmomc, compilers, etc.
daan meerburg
Posts: 27
Joined: November 20 2007
Affiliation: Cambridge

### Compiling CMBEASY Leopard/intel mac

Hi,

I am running OSX 10.5.1 on a macbook pro, and I am trying to get CMBEASY to work. I installed gsl lib and qt latest verions from source and adjusted the environment variables in .cshrc according to the locations of both libraries (usr/local/lib and usr/local/qt/lib respectively, which I checked). I also installed lam-mpi from source.
I wanted to use WMAP3 data as well, but I am not sure wether I should install the newest wmap likelihood code, as it is not completely clear from the INSTALL file in CMBEASY directory. Since WMAP3 code is build by default I uncommented the line buildwmap3=true as mentioned in the INSTALL file.

Since I thought everything was set up correctly I ran the Makefile. However, I get the following error [s]:

anisotropy/driver.cc: In function 'void useFile(const char*)':
anisotropy/driver.cc:186: error: 'uint' was not declared in this scope
anisotropy/driver.cc:186: error: expected ;' before 'in'
anisotropy/driver.cc:186: error: no match for 'operator<' in 'in < cosmos.Cosmos::InitialPower.SafeVector<double>::<anonymous>.std::vector<_Tp, _Alloc>::size [with _Tp = double, _Alloc = std::allocator<double>]()'
anisotropy/driver.cc:186: error: no match for 'operator++' in '++in'
anisotropy/driver.cc:186: error: invalid conversion from 'void*' to 'long unsigned int'
anisotropy/driver.cc:186: error: initializing argument 1 of 'typename std::vector<T, std::allocator<_CharT> >::reference SafeVector<T>::operator[](size_t) [with T = double]'
anisotropy/driver.cc:186: error: invalid conversion from 'void*' to 'long unsigned int'
anisotropy/driver.cc:186: error: initializing argument 1 of 'typename std::vector<T, std::allocator<_CharT> >::reference SafeVector<T>::operator[](size_t) [with T = double]'
anisotropy/driver.cc: In function 'void detailed()':
anisotropy/driver.cc:398: error: 'uint' was not declared in this scope
anisotropy/driver.cc:398: error: expected ;' before 'in'
anisotropy/driver.cc:398: error: 'in' was not declared in this scope
make: *** [bin/cmb] Error 1

I am not sure what is wrong here. I checked the driver.cc routine, and indeed the uint is not declared. I can hardly believe that this is a mistake made by the programmers, so I must have done something wrong. At the moment I have no idea what could be wrong.
I red in an earlier post that the lines

extern "C" int isnan(double);
extern "C" int isinf(double);

should be added to some of the routines. I tried to do this, but apparently this was already fixed in a recent version since the lines where already there. However, they are only activated (from what I can understand) when one uses OSX panther. Should I try to change this?

Anybody has an idea. Any help will be greatly appreciated. Thanx
daan

daan meerburg
Posts: 27
Joined: November 20 2007
Affiliation: Cambridge

### Compiling CMBEASY Leopard/intel mac

I have been working to solve this problem for the last week or so but I have not succeeded. Last week I spoke to several people that suggested some ideas.
According to a developer the problem seemed to be related to a missing header file i.e. the make file does not point to the correct includes.
So, i tried to figure out which one, with no luck. Since I got really annoyed of getting the exact same error no matter what includes I modified I threw away the cmbeasy dir and replaced it with a new one to be sure that I did not mess up the dir and it's header files by accident. However, I got the same error when running the make script. I tried to some other stuff, like only trying to run the text version of cmbeasy, no luck either.
I wrote the cmbeasy developers but I have not yet received an answer (I sent it last week). Apparently very few, if none have tried to install cmbeasy on leopard. To check if maybe there is something weird with leopard (some essential c++ includes missing maybe) I installed Tiger on an external disk. I did exactly the same as I did on leopard. I installed dev. tools, x11, lam-mpi, gsl, qt4, cfitsio etc etc, and it ran like a charm!!!!
No errors. So, I have come to the conclusion that the 'uint' problem is likely related to leopard. However, that is still not very satisfying. So my question is, has anyone successfully installed the gui version of cmbeasy on an intel mac running leopard?

kind regards
daan

Georg Robbers
Posts: 5
Joined: May 23 2006
Affiliation: University of Heidelberg

### Compiling CMBEASY Leopard/intel mac

I have tested cmbeasy on an Intel Mac (OSX 10.4.8), but I don't have access to a machine with Leopard. A google search suggests that changing "uint" to "unsigned int" might help - have you tried that?

daan meerburg
Posts: 27
Joined: November 20 2007
Affiliation: Cambridge

### Compiling CMBEASY Leopard/intel mac

No, I did not try that yet. I will try it and tell you what happened. Can I ask you what you searched for in google?
thanx a lot
daan

there are some other details which might be interesting for those who try to compile cmbeasy v4.3 that I experienced compiling on osx 10.4.10 (TIGER). The lines that were added of the form

extern "C" int isnan(double);
extern "C" int isinf(double);

as explained in "cmbeasy: how to compile on osx" should be deleted in the files mentioned. In addition, I installed the latest version of qt from source that can be found on trolltechs website, however that version of qt (qt4) is not backwards compatible so it will not work. one can either download older versions of qt of that same site an install, however using fink (type >fink install qt3 qt3-dev) is probably easier (and much faster).
I also uncommented the line
FLAGS = -Wall -DQT_THREAD_SUPPORT -DPRERELEASE -DMACOSX_PANTHER
in the makefile. To make sure all includes and libs were correct I explicitly pointed to them in the Makefile. after that, no problems.

daan meerburg
Posts: 27
Joined: November 20 2007
Affiliation: Cambridge

### Compiling CMBEASY Leopard/intel mac

Hi, I replaced "uint" with "unsigned int", and it worked! So, you can compile it on leopard as long as you change uint in driver.cc , in xdriver.cc and in mc_general.cc. However, I still get an error trying to build that last program using make bin/mc_general. I did everything according to the manual, but I won't build. It seems that is missing some lib's:

Undefined symbols:
"_op_intercept", referenced from:
_op_intercept$non_lazy_ptr in cc75SgGf.o "PMPI::Comm::mpi_comm_map", referenced from: __ZN4PMPI4Comm12mpi_comm_mapE$non_lazy_ptr in cc75SgGf.o
"PMPI::Comm::mpi_err_map", referenced from:
__ZN4PMPI4Comm11mpi_err_mapE$non_lazy_ptr in cc75SgGf.o "PMPI::Intracomm::current_op", referenced from: __ZN4PMPI9Intracomm10current_opE$non_lazy_ptr in cc75SgGf.o
"MPI::Is_initialized()", referenced from:
PMPI::Intracomm::Intracomm(_comm* const&)in cc75SgGf.o
PMPI::Cartcomm::Cartcomm(_comm* const&)in cc75SgGf.o
PMPI::Graphcomm::Graphcomm(_comm* const&)in cc75SgGf.o
"AnalyzeThis::WMAP3computeLikelihood(CL&)", referenced from:
slave(int, bool)in cc75SgGf.o
collect2: ld returned 1 exit status
make: *** [bin/mc_general] Error 1

I tried to add some other lam-mpi libs but since I am sure which ones, I am not sure if it will work (and it seems a bit odd that it would need more, while not explicitly in the makefile). I installed lam-mpi from source.
anyone ideas how to solve this one last obstacle....That would make my weekend.

By the way, unlike the TIGER case, in leopard you can leave the 'extern''s as mentioned in the previous posts in the routines. It will not complain when running make all.

Thanks georg
daan

daan meerburg
Posts: 27
Joined: November 20 2007
Affiliation: Cambridge

### Compiling CMBEASY Leopard/intel mac succeeded

Hi everyone,
ok, I did some googling and I found that one can add a lib, however it was related to another, though slightly similar problem. I tried and it worked. The lib one should add in the make file is lammpi++ (that is, add -llammpi++ in the line starting with LIB in your makefile). I think that is all there is to say about compiling CMBEASY on leopard. In other words, it is possible, just follow (in the end) minor adjustments to the codes/makefile discussed in these posts.

daan