Intel Mac
Installing and running BoA on an Intel Mac computer is possible. However, various packages have to be installed in a specific way, compared to the installation on Linux systems. A complete installation was successful on an Intel Mac laptop (MacBook Pro 2 GHz) running OS X 10.4.6. Note: you will need a root password for some steps in the installation. Usually, the first user created had admin rights, and his password is ok when using sudo.
Prerequisites
The version of the OS used for this test installation was 10.4.6. The development tools (XCode) were also installed. This includes:
- python 2.3.5
- gcc 4.0.1
In addition, the Debian-like toolkit fink (including apt-get and other commands) was installed (see the Fink project page). Other ways exist to install the same libraries, but apt-get is one of the easiest ways to do it - as long as the programs/libraries have been compiled for Intel Mac.
Packages installed with apt-get
The following programs/libraries were installed using sudo apt-get install :
Name |
Version |
Install destination |
swig |
1.3.20 |
/sw/bin/swig |
numeric-py23 |
23.1 |
/sw/lib/python2.3/site-packages/Numeric/ |
readline |
|
/sw/lib/python2.3/lib-dynload/*readline.so |
libpng3 |
|
|
Make sure to add numeric to your PYTHONPATH, e.g. in bash with: export PYTHONPATH=/sw/lib/python2.3/site-packages/Numeric/
Programs installed from the Web
No fortran compiler is provided by default with the development tools. Installation was successful when using gfortran (installed in /usr/local/bin/gfortran) version i386-apple-darwin8.7.1 gcc-4.2-20060805. You can get it from HPC.
Some programs (e.g. the Makefile of pgplot) explicitely look for g77 and ifort. Therefore it is necessary to do:
/usr/local/bin> sudo ln -s gfortran g77 and /usr/local/bin> sudo ln -s gfortran ifort
Packages installed using boa-install/install.sh
The following packages have been successfully installed running the install.sh script provided in boa-install
- slalib (provided g77 is a link to gfortran, see above)
- cFITSIO-2.49
F2PY [version included in ExtPkg]
- mpfit
- interactive.py
FitsWriter and related files
- wcslib
The latest version of BoA was also installed from CVS, as proposed by the install.sh script.
Workarounds for non-working packages
Installing the other packages required specific steps, detailed below. It is useful to define your $BOA_HOME variable.
numarray
This package is no longer needed, but the install.sh script fails if you skip this step. To solve this, in install.sh, comment out the if to fi statements starting with # numarray/__init__.py present? and # Importable from Python?
pgplot5.2
after doing makemake linux g77_gcc, the command make may produce:
make: g77: Command not found
unless you have linked g77 to gfortran (see above)
run make again:
make: syntax errors in file /.../tmp/pgplot/drivers/gidriv.f
To solve this, modify drivers.list: keep only NULL, PNG, TPNG, PSDRIV and XWDRIV. In the pgplot installation directory (openboa/tmp/pgplot), run ./makemake . linux g77_gcc_aout (the _aout is important: this prevents make from building shared libraries, which are not supported on Darwin), then make. You will get this error:
- /usr/bin/ld: Undefined symbols: _ _ _dso_handle collect2: ld returned 1 exit status make: *** [grfont.dat] Error 1
... but the file libpgplot.a is there, which means that you can use pgplot. The same error appears when doing make cpg, but the file libcpgplot.a is there.
PGPLOT needs to have the png include files in its own directory, so add the following symbolic links in the openboa/tmp/pgplot/ directory:
ln -s /usr/include/zlib.h .
ln -s /usr/include/zconf.h .
ln -s /sw/include/png.h .
ln -s /sw/include/pngconf.h .
ppgplot1.3
TO DO: clean the text below!
arrayobject.h was missing. Copy that file (here it is: attachment:arrayobject.h) to
/System/Library/Frameworks/Python.framework/Versions/2.3/include/python2.3/
- after pgplot and cpgplot have been compiled, update PGPLOT_DIR and
LD_LIBRARY_PATH. Then: /usr/bin/ld: can't locate file for: -lg2c collect2: ld returned 1 exit status
- in ppgplot-1.3/setup.py, comment out this line:
libraries.append("g2c")
also in ppgplot-1.3/setup.py, add the following line just after library_dirs.append(os.environPGPLOT DIR):
library_dirs.append("/sw/lib")
run python setup.py build: ok, _ppgplot.so is there
sudo python setup.py install --prefix=/System/Library/Frameworks/Python.framework/Versions/2.3
- in python, import ppgplot: OK, then:
>>> ppgplot.pgopen() %PGPLOT, Unable to read font file: grfont.dat %PGPLOT, Use environment variable PGPLOT_FONT to specify the location of the PGPLOT grfont.dat file.
PGPLOT /xw: Couldn't find program "pgxwin_server" in the directory named PGPLOT /xw: in your PGPLOT_DIR environment variable, or in any directory PGPLOT /xw: listed in your PATH environment variable.
- to fix the problem with _dso_handle, get and install a new version of cctools from:
ftp://gcc.gnu.org/pub/gcc/infrastructure/cctools-590.36.dmg Then in /usr/local/pgplot (or $BOA_HOME/lib/pgplot/ if you installed pgplot as part of BoA): --> sudo make grfont.dat ...OK
- to fix the xw error, go back to /usr/local/pgplot (or $BOA_HOME/lib/pgplot/ if you installed pgplot as part of BoA):
--> sudo make pgxwin_server ...OK
pySLALIB-0.4
The slalib module should compile fine with the install script. For the pySLALIB, again you need a Mac-specific compilation:
- in $BOA_HOME/tmp/pySLALIB-0.4:
gcc -fPIC -O -I/sw/include/python2.3/Numeric -I/System/Library/Frameworks/Python.framework/Versions/2.3/include/python2.3 -c slalibmodule.c
ranlib ../../lib/libsla.a
gcc -framework Python -L/usr/local/lib -lgfortran -L$BOA_HOME/lib -lsla -bundle -o slalibmodule.so slalibmodule.o
cp slalibmodule.so $BOA_HOME/lib/python2.3/site-packages
p_CFITSIO
- python setup.py fails: does not find Numeric/arrayobject.h
- edit the $BOA_HOME/setup.cfg file: add /sw/include/python2.3 to include_dirs.
python setup.py build
produces some warnings but compile ok
python setup.py install --prefix=$BOA_HOME
cp src/_cfitsio.so ../../lib/python2.3/site-packages/
dchelper
After unpacking the tar.gz and patching the Makefile (done by the install script), you need again a specific compilation:
gcc -framework Python -bundle -Wl,-framework -Wl,AppKit -L/usr/local/lib dataparcoords.o dchelper_wrap.o -L$BOA_HOME/lib -lwcs -lm -o _dchelper.so
Then copy the file _dchelper.so to $BOA_HOME/lib/python2.3/site-packages/
fitswriter
- mbfits is no longer used. In the install.sh script, comment out the lines starting with patch mbfits.py to the end of the if-fi block. Then re-start the install.sh script.
BoA fortran modules
In $BOA_HOME/boa/fortran/ you will need to re-compile the 6 relavant programmes (fBaseline.f90, fFlag.f90, fMap.f90, fSNF.f90, fStat.f90 and fUtilities.f90). This needs f2py; make sure you have $BOA_HOME/bin in your $PATH (in bash: export PATH=$PATH:$BOA_HOME/bin) and export PYTHONPATH=$PYTHONPATH:$BOA_HOME/lib/python2.3/site-packages.
Then make fBaseline. Gives an error as it does not find g2c and cc_dynamic.
Compile manually: copy the gfortran command, removing the -l cc_dynamic and -l g2c options, e.g. gfortran -Wl,-framework -Wl,Python -bundle /tmp/tmpu-nkSl/tmp/tmpu-nkSl/src/fBaselinemodule.o /tmp/tmpu-nkSl/tmp/tmpu-nkSl/src/fortranobject.o /tmp/tmpu-nkSl/fBaseline.o svdPatch.o -L/usr/local/lib/gcc/i386-apple-darwin8.7.1/4.2.0 -o ./fBaseline.so
- Now do the same for fFlag, fMap, fSNF, fStat and fUtilities
BoA startup files
- complains about sed -. Remove the - in the install.sh script (6 occurrences).
BoA should now work!