It is currently Sun Jun 22, 2025 3:38 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Galplot on MacIntel
PostPosted: Mon Mar 12, 2007 10:59 am 
Offline

Joined: Wed Feb 21, 2007 10:10 am
Posts: 1
Location: Dark Cosmology Centre, Copenhagen
I have finally made Galplot work on my MacBook Pro with Intel processor and OS-X 10.4.8. Some of the troubles I went through are general and some are Mac specific. Here comes a description of all the steps:

0. Make sure that you have a running version of Root. Otherwise download and install it from root.cern.ch. You will also need the c-version of the slalib libray. One place to get it is the INTEGRAL data centre ISDC which has got the right to distribute slalib http://isdc.unige.ch

1. Download the tar-file.

2. Unpack it. Mac OS-X does not distinguish between upper and lower cases in filenames. If you unpack with the command line "tar xvf ..." any files which are only distuinguishable by upper and lower cases in their filenames will be overwritten so you will only have the latest unpacked file. E.g. Galplot.h will be overwritten by galplot.d. Instead use Macs "Stuffit" to (simply double click on the file). Instead of overwriting files, Stuffit renames the files by inserting a number. This have to be changed in the program files so they are calling the new names (In my case galplot.h had to be changed to galplot.1.h in galprop_classes.h).

3. Headers and libraries. Galplot uses headers from the standard C++ library, the Root library (.../root/include), the cfitsio library (/cfitsio/include) and the slalib C library. When compiling, the paths to the headers can be given with the -I/path/to/include option. The linking to the libraries is done with the -lname where the path of the library (named name) is given as -L/path/to/lib. With the -l option, the compiler will look for libraries with the names libname.a, libname.so (Linux) and libname.dylib (Mac).

4. Magic! Add the -bind_at_load option.

5. Additional problems. I had to add #include "galprop_classes.h" to Galplot.h.

6. My compilation (and linking) command looked like this:

g++ *.cc -o galplot -O3 -bind_at_load -I/local/opt/CFITSIO/cfitsio -I/local/opt/root/include -I/local/opt/slalib_c -L/local/opt/CFITSIO/cfitsio/ -L/local/opt/root/lib -L/local/opt/slalib_c -lgcc -lg2c -lcfitsio -lstdc++ -lsla -lGpad -lHistPainter -lTree -lCint -lFumili -lGraf -lHtml -lNew -lTreePlayer -lCore -lGX11 -lGraf3d -lRootAuth -lKrb5Auth -lPhysics -lTreeViewer -lGX11TTF -lGui -lMLP -lPostscript -lRint -lVMC -lEG -lGeom -lMatrix -lThread -lProof -lTable -lX3d -lGeomPainter -lHist -lMinuit -lProofGui


Signe Riemer-Sørensen
Dark Cosmology Centre, Copenhagen


Top
 Profile  
 
 Post subject: Re: Galplot on MacIntel
PostPosted: Wed Mar 04, 2009 3:30 am 
Offline

Joined: Fri Oct 31, 2008 3:08 am
Posts: 9
Location: Yonsei university, Seoul
Thank you very much for your excellent explanation

This is the first reply of this section.

Now I'm trying to install GALPLOT in my Macbook.

I installed GALPROP, Slalib, root. and I just followed your way. that means I made Makefile by your indication.

First, OK. but after one or two minutes, I encountered an error message, that is,

-----
ld: library not found for -lcfitsio
-----------

Here this is my Makefile

--------

CXX = g++
FC = g77
CFITSIO = /usr/local/cfitsio
SLA = /usr/local/slalib
ROOT = /usr/local/root/include
CPPFLAGS = -O3 -bind_at_load -I${CFITSIO} -I${SLA} -I${ROOT} -L${CFITSIO} -L${SLA} -L${ROOT}
FFLAGS = -fno-second-underscore
LIBS = -lm -lg2c -L/sw/lib/gcc4.2/lib -lgfortran
FITSLIB = -L$(CFITSIO) -lcfitsio -Wl,-rpath,$(CFITSIO)
SLALIB = -L$(SLA) -lslalib -Wl,-rpath,$(SLA)
ROOTLIB = -L$(ROOT) -lroot -Wl,-rpath,$(ROOT)
LDFLAGS = -L$(FITSLIB) -L$(SLALIB) -L$(ROOTLIB) $(LIBS)
FOBJS := $(patsubst %.f,%.o,$(wildcard *.f))
CCOBJS := $(patsubst %.cc,%.o,$(wildcard *.cc))
galplot: ${FOBJS} ${CCOBJS}
$(CXX) *.o -o $@ ${LDFLAGS}

--------------

Anybody know how to solve my problem ?

Please ~ :cry:


Top
 Profile  
 
 Post subject: Re: Galplot on MacIntel
PostPosted: Sun Apr 26, 2009 10:53 am 
Offline

Joined: Fri Oct 31, 2008 3:08 am
Posts: 9
Location: Yonsei university, Seoul
Finally I succeed in compiling GALPLOT

Actually I have had problem about installing "slalib"



I think that "Slalib" of "http://isdcul3.unige.ch/~isdc_lib/delivery/sorted_projects_list.html#sla_c" has problem for Intel Mac at least.

Anyway, I compiled GALPLOT

But, when I did

$ ./galplot

I encountered the message

dyld: Library not loaded: @rpath/libGpad.so
Referenced from: /usr/local/GALPLOT/./galplot
Reason: image not found
Trace/BPT trap

What is that?

Here, as you can see my "Makefile" which was followed by "signe" way (except "-lProofGui", in My case, instead of "-lProofGui" I'm using "-lProofDraw" because there is no "libProofGui.so" in "root/lib".)

CXX = g++
FC = g77
CFITSIO = /usr/local/cfitsio
ROOT = /usr/local/root/include
ROOTL = /usr/local/root/lib
SLA = /usr/local/slalib
CPPFLAGS = -O3 -bind_at_load -I${CFITSIO} -I${ROOT} -I${SLA}
FFLAGS = -fno-second-underscore
LIBS = -lgcc -lg2c -lcfitsio -lstdc++ -lsla -lGpad -lHistPainter -lTree -lCint -lFumili -lGraf -lHtml -lNew -lTreePlayer -lCore -lGX11 -lGraf3d -lRootAuth -lKrb5Auth -lPhysics -lTreeViewer -lGX11TTF -lGui -lMLP -lPostscript -lRint -lVMC -lEG -lGeom -lMatrix -lThread -lProof -lTable -lX3d -lGeomPainter -lHist -lMinuit -lProofDraw
FITSLIB = -L$(CFITSIO)
ROOTLIB = -L$(ROOTL)
SLALIB = -L$(SLA)
LDFLAGS = $(FITSLIB) $(ROOTLIB) $(SLALIB) $(LIBS)
FOBJS := $(patsubst %.f,%.o,$(wildcard *.f))
CCOBJS := $(patsubst %.cc,%.o,$(wildcard *.cc))
galplot: ${FOBJS} ${CCOBJS}
$(CXX) *.cc -o galplot $(CPPFLAGS) ${LDFLAGS}

I surely added "/usr/local/root/lib" and "-lGpad" .

Please would you answer how to solve it? :wink:

Thanks ~


Top
 Profile  
 
 Post subject: Re: Galplot on MacIntel
PostPosted: Mon Apr 27, 2009 6:35 am 
Offline

Joined: Fri Oct 31, 2008 3:08 am
Posts: 9
Location: Yonsei university, Seoul
Today, Finally, I completely succeed in compiling "GALPLOT".

The reason of my problem was that I didn't give a PATH command in .bash_profile

So I read "README/Install" file in "root install package"

I just add

"
export ROOTSYS=/usr/local/root
export PATH=$ROOTSYS/bin:$PATH
export LD_LIBRARY_PATH=$ROOTSYS/lib:$LD_LIBRARY_PATH
export DYLD_LIBRARY_PATH=$ROOTSYS/lib:$DYLD_LIBRARY_PATH
"
to ".bash_profile" file as README file indication.

Now I never encounter with "error message", that is, I could solve my problem.

-------

But

When I entered

$./galplot /usr/local/GALDEF/galdef_50p_599278

../adjunct/
<<<<Configure
../GALDEF/
>>>>galdef read

*** Break *** segmentation violation

I encountered with "*** Break *** segmentation violation"

What is this?

How to solve that problem?

Thanks ~


Top
 Profile  
 
 Post subject: Re: Galplot on MacIntel
PostPosted: Fri May 01, 2009 2:07 am 
Offline

Joined: Fri Oct 31, 2008 3:08 am
Posts: 9
Location: Yonsei university, Seoul
I tried to solve this problem many times..

At last, I can find out the solution.

In fact the reason of this problem was very simple.

In "galplot_linux_20060302", we can find out "galdef_49_6002029RB" and "galplotdef_49_6002029RB"

Usually when I input $ ./galplot

I can see "no galdef file specified!" message .

So I thought that $./galplot galdef_49_6002029RB would be OK.

But this is also wrong command for GALPLOT like GALPROP

We must use $./galplot 6002029RB

So I just move "galplotdef_49_6002029RB" file into "GALDEF" folder.

and then, I changed the name 'galdef_50p_599278" into "galdef_49_599278" because galplot program just can recognize "galdef_49_numbers" as "numbers".

In addition there should be "galplotdef_49_599278", so that I just changed the name "galplotdef_49_6002029RB" into "galplotdef_49_599278".

Lastly, I just made "plots" folder in GALPLOT folder because, in there the result file is saved.

Now

$ ./galplot 599278 enter

I didn't see the "segmentation violation" message .

But I encounter next error message :?

galplot(37635) malloc: *** mmap(size=3425837056) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
Fatal in <operator new>: storage exhausted (failed to allocate -869132279 bytes)
aborting
Abort trap

What is this ?

How to solve it?

Please Could you answer about it ? PLEASE ~~~


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


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 post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group