CosmoCoffee Forum Index CosmoCoffee

 
 FAQFAQ   SearchSearch  MemberlistSmartFeed   MemberlistMemberlist    RegisterRegister 
 BookmarksBookmarks   ProfileProfile   Log inLog in 
Arxiv New Filter | BibTex | Arxiv ref/author:

CMBEASY: How to compile on OS X
 
Post new topic   Reply to topic    CosmoCoffee Forum Index -> Computers and software
View previous topic :: View next topic  
Author Message
Alex Conley



Joined: 08 Feb 2005
Posts: 10

PostPosted: February 08 2005  Reply with quote

I recently compiled CMBEASY on my Mac. Since this required
making a few changes to the source files and Makefile, I
thought it would be worth posting a record of the experience
somewhere so that other people don't have to figure this
out for themselves.

I assume that you want to install everything,
including the Markov-Chain and GUI, so some of
what I describe isn't be necessary if this is not desired.

These comments apply specifically to CMBEASY 3.0.1
and OS X 10.3.7.

First, you need to install LAM/MPI. There is a OS X
version available on the LAM/MPI website, so this
is trivial. Next you need to install qt (for the gui)
and gsl (Gnu Scientific Library). The easiest
way to install these is through fink, which most
of the people who might read this probably already
know about. If you are unfamiliar with fink,
take a look at http://fink.sourceforge.net/
If you prefer to install the GSL and QT3
some other way, good luck to you.

Specifically, the gsl and qt3 can be installed by

fink install qt3 qt3-dev gsl

If you get a complaint about not having gcc 2.95
available, that's because you used the default install
when you installed the xcode tools. Go back to your
xcode cd (or disk image, whatever) and use the
package installer. This time do a custom install,
and add gcc 2.95 to the list of packages you want.

Fink installs the qt3 headers in a slightly unusual
location, so you will have to make some changes
to the Makefile. More on that in a bit.

As indicated in the INSTALLATION file, there are
some environment variables that need to be
set. I'll leave CMBEASYDIR up to you, but assuming
that you put fink in the usual place (/sw), the
other two variables should be set via something
like:

setenv QTCMB /sw
setenv GSLCMBDIR /sw

If you don't use tcsh, modify these appropriately.

Then edit the makefile. Replace $(QTCMB)/include
with $(QTCMB)/include/qt both places that it appears.
That should take care of setting up the libraries.

Next, you need to make some changes to the source code.
There is some bug with the Apple supplied standard c libraries
that causes the isnan and isinf macros to be hidden if
#include<iostream> is used. Hopefully somebody will fix
this someday, but in the meantime there are two ways
to proceed. The first is to add the flag
-D_GLIBCPP_USE_C99 to the compile options. I wouldn't
recommend this, because it interferes with some other things.
The easier solution is to add the following two lines

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

after the #include statements in the following files:

cosmos/quintcosmos.cc
cosmos/perturbation.cc
anisotropy/analyzethis.cc
anisotropy/mc_general.cc
chain/chainshop.cc
chain/lowlevelplot.cc

Finally, one other change. The hcp command
used to make bin/mc_general has to -o 's in it.
hcp doesn't seem to like this. My solution was
to remove the first one ( -o mc_xgeneral ).
hcp only appears once in the makefile, so this
should be easy to find.

Okay, with those changes in place:

make
make bin/mc_general

and everything should compile, and, at least
as far as I can tell, work.
Back to top
View user's profile  
Luis Beça



Joined: 09 Feb 2005
Posts: 1
Affiliation: FCUP

PostPosted: February 09 2005  Reply with quote

Just to add a minor info about installing cmbEasy on Mac OS X. If you happen to have installed LAM-MPI using Fink, the hcp wrapper mentioned in the rule for mc_binary, wont be recognized. You'll have to replace it for mpic++ (NOTE WELL, not mpiCC: this is because Panther's filesystem is case insensitive so it wont distinguish mpicc from mpiCC; this was resolved by adding mpic++ to stand for mpiCC).
Back to top
View user's profile  
Pablo Fosalba



Joined: 25 Sep 2004
Posts: 25
Affiliation: Institut d'Estudis Espacials de Catalunya

PostPosted: March 11 2005  Reply with quote

I followed your suggestions (thanks for those!), but I didn't manage
to compile the DESIGNER files. Any tips about that ?

thanks!
Back to top
View user's profile   Visit poster's website
Alex Conley



Joined: 08 Feb 2005
Posts: 10

PostPosted: March 17 2005  Reply with quote

What version of qt do you have installed, and
by what mechanism?

I installed qt3 with fink, and that seemed to work,
although I had to edit the Makefile as described
in the instructions in the first post in this thread.

My fink list qt3 gives
i qt3 3.2.2−12 Cross-Platform GUI application framework
qt3-bin [virtual package]
i qt3-designer 3.2.2−12 Cross-Platform GUI application framework
i qt3-dev 3.2.2−12 Cross-Platform GUI application framework
i qt3-doc 3.2.2−12 Cross-Platform GUI application framework
i qt3-linguist 3.2.2−12 Cross-Platform GUI application framework
i qt3-shlibs 3.2.2−12 Cross-Platform GUI application framework

Make sure you have qt3-dev installed!

Alex
Back to top
View user's profile  
Pablo Fosalba



Joined: 25 Sep 2004
Posts: 25
Affiliation: Institut d'Estudis Espacials de Catalunya

PostPosted: March 17 2005  Reply with quote

Thanks a lot for the check.
Actually I have the qt3 packages properly
installed (with fink too). I found my gsl were not, so I re-installed them and now it compiles fine.
Is it possible to run the MC chains in single processor mode (like for cosmomc) ?
Back to top
View user's profile   Visit poster's website
Michael Doran



Joined: 22 Nov 2004
Posts: 42
Affiliation: ITP Heidelberg

PostPosted: March 20 2005  Reply with quote

Hi,

you can run as many chains on one machine as you like.
To test, I usually have a hostfile with only one line

localhost

On invoking "mpirun" with that hostfile, the processes
all run on your local machine. For productivity runs,
I use several machines though, cause it's faster.

Cheers, Michael
Back to top
View user's profile   Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    CosmoCoffee Forum Index -> Computers and software All times are GMT + 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group. Sponsored by WordWeb online dictionary and dictionary software.