Source code of all required dependency packages can be fund at /home/casa-dev-09-2/hye/casa-ext-libs. The step-by-step instructions listed here are for building dependency packages on 32b mac i386. (On a linux machine, the arch flag should be elliminated.)

Preparation:
-- mkdir /opt/casa-extlib  
-- export THIRDPARTY=/opt/casa-extlib  
-- gcc -v; g++ -v; gfortran -v  
-- uname -a 

pgplot

1. cd /opt/casa-extlib/src  
2. tar -xvf pgplot-whatever.tar  
3. cd pgplot-whatever  
4. cp -r sys_unix sys_macosx  
5. ./makemake . macosx gfortran_gcc  
6. make  
7. make cpg  
8. make pgxwin_server  
9. cp cpgplot.h   libcpgplot.a libpgplot.dylib rgb.txt grfont.dat libpgplot.a pgxwin_server ../../pgplot
10. export PGPLOT_DIR=/opt/casa-extlib/pgplot          
    export PGPLOT_DEV=/xwin  
11. open another window, cd /opt/casa-extlib/src/pgplot  
12. ./pgdemo1  
13. ./cpgdemo  
14. edit makehtml to have correct perl  
15. make pgplot.html  
16. mv -r pgplot.html ../../pgplot  
17. firefox file:///opt/casa-extlib/pgplot/pgplot.html  
18. cd /opt/casa-extlib/pgplot  
19. mkdir include lib  
20. cd include  
21. ln -s ../cpgplot.h cpgplot.h  
22. cd ../lib  
23. ln -s ../libpgplot.a libpgplot.a  
24. ln -s ../libpgplot.dylib libpgplot.dylib  
25. ln -s ../libcpgplot.a libcpgplot.a  

cfitsio

1. cd /opt/casa-extlib/src  
2. tar -xvf cfitsio-whatever.tar  
3. cd cfitsio-whatever  
4. ./configure --prefix=/opt/casa-extlib/cfitsio CC=gcc  
5. make  
6. make testprog  
7. testprog > testprog.lis  
8. diff testprog.lis testprog.out  
9. cmp testprog.fit testprog.std  
10. make shared  
11. make install  

wcslib

1. cd /opt/casa-extlib/src  
2. tar -xvf wcs-whatever.tar  
3. cd wcslib-whatever  
4. ./configure --prefix=/opt/casa-extlib/wcslib --with-pgplotinc=/opt/casa-extlib/pgplot --with-pgplotlib=/opt/casa-extlib/pgplot --with-cfitsioinc=/opt/casa-extlib --with-cfitsiolib=/opt/casa-extlib F77=gfortran  
5. make  
6. make install  
7. make check 

fftw3

1. cd /opt/casa-extlib/src/  
2. tar -xvf fftw3-whatever.tar  
3. cd fftw3-whatever  
4. ./configure --prefix=/opt/casa-extlib/fftw3 CC="/usr/bin/gcc -arch i386 -arch x86_64" CXX="/usr/bin/g++ -arch i386 -arch x86_64" CPP="/usr/bin/gcc -E" CXXCPP="/usr/bin/g++ -E" F77=/usr/bin/gfortran --enable-threads --enable-shared --enable-fortran --enable-float  
5. make  
6. make install  
7. make check  
8. make clean  
9. ./configure --prefix=/opt/casa-extlib/fftw3 CC="/usr/bin/gcc -arch i386 -arch x86_64" CXX="/usr/bin/g++ -arch i386 -arch x86_64" CPP="/usr/bin/gcc -E" CXXCPP="/usr/bin/g++ -E" F77=/usr/bin/gfortran --enable-threads --enable-shared --enable-fortran  
10. make  
11. make install  
12. make check 

dbus

1. cd /opt/casa-extlib/src/  
2. tar -xvf dbus-1.2.26.tar  
3. cd dbus-1.2.26  
4. vim tools/dbus-launch-x11.c line 146 to have: if (*p = ':' || *p = '/')  
5. vim dbus/dbus-address.c line 91~92 to add: (b) == '+' ||  
6. ./configure --prefix=/opt/casa-extlib/dbus-1.2.26  
7. make  
8. make install  
9. make check  
10. DBUS=/opt/casa-extlib/dbus-1.2.26  
11. export PATH=${DBUS}/bin:${PATH}  
12. export DYLD_LIBRARY_PATH=${DBUS}/lib:$DYLD_LIBRARY_PATH  
13. `which dbus-daemon` --session &  
14. ps -ef | grep dbus 

dbus-c++

1. cd /opt/casa-extlib/src/  
2. tar -xvf dbus-c++-whatever.tar  
3. cd dbus-c++-whatever  
4. ./configure --prefix=/opt/casa-extlib/dbus-c++ dbus_LIBS="-L/opt/casa-extlib/dbus/lib -ldbus-1" dbus_CFLAGS="-I/opt/casa-extlib/dbus/lib/dbus-1.0/include -I/opt/casa-extlib/dbus/include/dbus-1.0 -lposix" 
5. make  
6. make install  
7. make check 

boost

1. cd /opt/casa-extlib/src/  
2. tar -xvf boost-whatever.tar  
3. cd boost-whatever  
4. ./bootstrap.sh --prefix=/opt/casa-extlib/boost  
5. ./bjam  
6. ./bjam install 

aatm

1. cd /opt/casa-extlib/src/  
2. tar -xvf aatm-whatever.tar  
3. cd aatm-whatever  
4. ./configure --prefix=/opt/casa-extlib/aatm --with-boost=/opt/casa-extlib/boost  
5. make  
6. make install 

ccmtools

1. cd /opt/casa-extlib/src/  
2. cvs -d :pserver:anonymous@ccmtools.cvs.sf.net:/cvsroot/ccmtools login  
3. cvs -d :pserver:anonymous@ccmtools.cvs.sf.net:/cvsroot/ccmtools co ccmtools  
4. cd ccmtools  
5. ant install -Dprefix=/opt/casa-extlib/ccmtools 

java-environment

1. cd /opt/casa-extlib/src/  
2. cvs -d :pserver:anonymous@ccmtools.cvs.sf.net:/cvsroot/ccmtools co java-environment  
3. cd java-environment/  
4. ant install -Dprefix=/opt/casa-extlib/ccmtools  
5. export CLASSPATH=/opt/casa-extlib/ccmtools/lib/Components.java:$CLASSPATH 

confix

1. cd /opt/casa-extlib/src/  
2. tar -xvf Confix-2.3.7.tar  
3. cd Confix-2.3.7/  
4. python setup.py install --prefix=/opt/casa-extlib/confix  
5. export CONFIX=/opt/casa-extlib/confix  
6. export PYTHONPATH=${PYTHONPATH}:${CONFIX}/lib/python2.6/site-packages  
7. export PATH=${PATH}:${CONFIX}/bin  
8. /opt/casa-extlib/confix/bin/confix2.py --help 

qt

1. cd /opt/casa-extlib/src/  
2. tar -xvf qt-whatever.tar  
3. cd qt-whatever  
4. ./configure --prefix=/opt/casa-extlib/qt-4.7.2  
5. gmake  
6. gmake install  
7. export PATH=/opt/casa-extlib/qt-4.7.2/bin:$PATH 

qwt

1. cd /opt/casa-extlib/src/  
2. tar -xvf qwt-5.2.1.tar  
3. cd qwt-5.2.1  
4. INSTALLBASE = /opt/casa-extlib/qwt-5.2.1  
5. qmake  
6. make install  
7. DYLD_LIBRARY_PATH=/opt/casa-extlib/qwt-5.2.1/lib:$DYLD_LIBRARY_PATH  
8. export DYLD_LIBRARY_PATH 

xerces

1. cd /opt/casa-extlib/src  
2. tar -xvf xerces-c-src_2_8_0.tar  
3. export XERCESCROOT=/opt/casa-extlib/src/xerces-c-src_2_8_0  
4. cd xerces-c-src_2_8_0/src/xercesc/  
5. ./runConfigure -pmacosx -cgcc -xg++ -P /opt/casa-extlib/xerces-2.8.0  
6. gmake  
7. gmake install  
8. export DYLD_LIBRARY_PATH=/opt/casa-extlib/xerces-2.8.0/lib 

rpfits

1. ftp://ftp.atnf.csiro.au/pub/software/rpfits/rpfits.tar.gz  
2. cd /opt/casa-extlib/src  
3. tar -xvf rpfits.tar  
4. cd rpfits/darwin  
5. edit GNUmakefile (arch, prefix, gcc)  
6. make  
7. make install 

readline

1. cd /opt/casa-extlib/src  
2. tar -xvf readline-6.1.tar  
3. cd readline-6.1/  
4. ./configure --prefix=/opt/casa-extlib/readline-6.1  
5. gmake  
6. gmake install alternatively: easy_install -a readline 

xerces-j

1. cd /opt/casa-extlib/src  
2. tar -xvf xerces-src-2_9_0.tar  
3. cd xerces-2_9_0  
4. tar -xvf xerces-tools-2_9_0.tar  
5. ./build.sh jars  
6. mv build /opt/casa-extlib/xerces-2.9.0  
7. export CLASSPATH=/opt/casa-extlib/xerces-2.9.0/xercesImpl.jar:$CLASSPATH 

ipython

1. cd /opt/casa-extlib/src  
2. tar -xvf ipython-0.10.tar  
3. cd ipython-0.10  
4. python setup.py install --prefix=/opt/casa-extlib/ipython-0.10  
5. IPYTH=/opt/casa-extlib/ipython-0.10 
6. export PYTHONPATH=${PYTHONPATH}:${IPYTH}/lib/python2.6/site-packages  
7. export PATH=${PATH}:${IPYTH}/bin 

libpng

1. cd /opt/casa-extlib/src  
2. tar -xvf libpng-1.2.44.tar  
3. cd matplotlib-1.2.44/  
4. ./configure --prefix=/opt/casa-extlib/libpng  
5. make check  
6. make install 

freetype

1. cd /opt/casa-extlib/src  
2. tar -xvf freetype-2.4.4.tar  
3. cd freetype-2.3.4  
4. ./configure --prefix=/opt/casa-extlib/freetype  
5. make  
6. make install 

zlib

1. cd /opt/casa-extlib/src  
2. tar -xvf ~/Downloads/zlib-1.2.5.tar  
3. cd zlib-1.2.5/  
4. ./configure --prefix=/opt/casa-extlib/zlib  
5. make check  
6. make install 

tkinter

1. python  
2. >>> import _tkinter  
3. >>> import Tkinter  
4. >>> Tkinter._test() 

matplotlib

1. cd /opt/casa-extlib/src  
2. tar -xvf matplotlib-1.0.0.tar  
3. cd matplotlib-1.0.0/  
4. python setup.py build  
5. python setup.py install  
6. python -pylab  
7. x=randn(1000)  
8. hist(x) 

Twisted

1. cd /opt/casa-extlib/src  
2. tar -xvf ~/Downloads/Twisted-11.0.0.tar  
3. cd Twisted-11.0.0/  
4. sudo python setup.py install  
5. cd bin  
6. trial twisted 

foolscap

1. cd /opt/casa-extlib/src  
2. tar -xvf ~/Downloads/foolscap-0.6.1.tar  
3. cd follscap-0.6.1/  
4. sudo python setup.py install  
5. cd bin 

nose

1. sudo easy-install nose  
2. nosetests 

pgplot late binding

1. cd /opt/casa-extlib/src/pgplot  
2. cp lbdriv.c .  
3. edit makefile to have:    $ lbdriv.o: lbdriv.c $(CCOMPL) -c $(CFLAGC) $(XINCL) lbdriv.c 
4. also add lbdriv.o to lib target  
5. make 
6. nm libpgplot.a | grep add_late  
7. nm libpgplot.dylib | grep add_late  
8. cp libcpgplot.a libpgplot.dylib /opt/casa-extlib/pgplot 

numpy

1. cd /opt/casa-extlib/src  
2. tar -xvf numpy-1.6.0.tar  
3. cd numpy-1.6.0  
4. python setup.py build --fcompiler /usr/bin/gfortran  
5. python setup.py install --prefix /opt/casa-extlib/numpy  
6. NUMPY=/opt/casa-extlib/numpy  
7. export PYTHONPATH=${NUMPY}/lib/python2.6/site-packages:${PYTHONPATH} 
8. export PATH=${NUMPY}/bin:${PATH}  
9. python -c 'import numpy; numpy.test()'  
10. python  
11. >>> import numpy  
12. >>> numpy.__version__  
13. >>> numpy.test() 

SuiteSparse

1. cd /opt/casa-extlib/src  
2. tar -xvf SuiteSparse-3.6.1.tar  
3. cd SuiteSparse/  
4. tar -xvf metis-4.0.3.tar  
5. vim UFconfig/UFconfig.mk  
6. make install 

scipy

1. cd /opt/casa-extlib/src  
2. tar -xvf scipy-0.9.0.tar  
3. cd scipy-0.9.0/  
4. vim scipy/sparse/linalg/dsolve/umfpack/umfpack.i (add %{ and %} to all #include <ssss.h>)  
5. cd /System/Library/Frameworks/Python.framework/Versions/2.6  
6. cd Extras/lib/python  
7. sudo mv numpy numpy-1.2 
8. sudo cp -r /opt/casa-extlib/numpy .  
9. sudo python setup.py build config_fc --f77exec /usr/bin/gfortran  
10. sudo python setup.py install --prefix /opt/casa-extlib/scipy  
11. SCIPY=/opt/casa-extlib/scipy  
12. export PYTHONPATH=${SCIPY}/lib/python2.6/site-packages:${PYTHONPATH}  
13. python  
14. >>> import scipy  
15. >>> scipy.__version__  
16. >>> scipy.test()  
17. >>> import numpy  
18. >>> numpy.test('1', '10')  
19. >>> scipy.test('1', '10') 

pkg-config

1. cd /opt/casa-extlib/src  
2. tar -xvf pkg_config-0.26.tar  
3. cd pkg-config-0.26  
4. ./configure --prefix=/opt/casa-extlib/pkgcfg 
5. make 
6. make install 
7. PKGCFG=/opt/casa-extlib/pkgcfg-0.26  
8. export PATH=${PKGCFG}/bin:${PATH} 

gettext

1. cd /opt/casa-extlib/src  
2. tar -xvf ~/Downloads/gettext-0.18.1.1.tar  
3. cd gettext-0.18.1.1/  
4. ./configure --prefix=/opt/casa-extlib/gettext-0.18  
5. make  
6. make install  
7. GETTEXT=/opt/casa-extlib/gettext-0.18  
8. export PATH=${GETTEXT}/bin:${PATH}  
9. export DYLD_LIBRARY_PATH=${GETTEXT}/lib:$DYLD_LIBRARY_PATH 

git

1. download install git-1.7.5.tar.gz or 
2. git-1.7.5.4-i386-leopard.dmg 

libffi

1. cd /opt/casa-extlib/src  
2. tar -xvf libffi-3.0.9.tar  
3. cd libffi-3.0.9  
4. ./configure --prefix=/opt/casa-extlib/libffi  
5. make  
6. make install 

glib2

1. cd /opt/casa-extlib/src  
2. tar glib-2.29.4.tar  
3. cd glib-2.29.4  
4. ./configure CPPFLAGS="-I/opt/casa-extlib/glib-2.29.4/include -I/opt/casa-extlib/gettext-0.18/include" LDFLAGS="-L/opt/casa-extlib/glib-2.29.4/lib -L/opt/casa-extlib/gettext-0.18/lib" PKG_CONFIG_PATH="/opt/casa-extlib/libffi/lib/pkgconfig/" --prefix=/opt/casa-extlib/glib  
5. make  
6. make install 

openssl

1. cd /opt/casa-extlib/src  
2. tar -xvf openssl-1.0.0d.tar  
3. cd openssl-1.0.0d  
4. ./config --prefix=/opt/casa-extlib/openssl  
5. make  
6. make install 

dbus-cplusplus

1. cd /opt/casa-extlib/src  
2. /opt/local/bin/git clone git://gitorious.org/dbus-cplusplus/mainline.git  
3. cd mainline  
4. vim configure.ac add m4_include([/opt/casa-extlib/pkgcfg-0.23/share/aclocal/pkg.m4]) before    PKG_PROG_PKG_CONFIG  
5. autoconf  
6. ./configure --prefix=/opt/casa-extlib/dbus-c++-mainline dbus_LIBS="-L/opt/casa-extlib/dbus-1.2.26/lib -ldbus-1.dylib" dbus_CFLAGS="-I/opt/casa-extlib/dbus-1.2.26/lib/dbus-1.0/include -I/opt/casa-extlib/dbus-1.2.26/include/dbus-1.0 -lposix"  
7. vim src/eventloop.cpp pthread_mutex_t recmutex ;//= PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; 
8. vim tools/generate_proxy.cpp: # include <sys/types.h>  
9. make  
10. make install  
11. make check 

gobject

1. export PKG_CONFIG_PATH=/opt/casa-extlib/glib-2.29/lib/pkgconfig ; 
2. ./configure --prefix=/opt/casa-extlib/gob2-2.0.18 LIBS="-L/opt/casa-extlib/gettext-0.18/lib"  
3. make  
4. make install 

glib

1. cd /opt/casa-extlib/src  
2. tar -xvf glib-2.29.4.tar  
3. ./configure PKG_CONFIG_PATH=/opt/casa-extlib/libffi/lib/pkgconfig LDFLAGS=-L/opt/casa-extlib/gettext-0.18/lib LIBS="-lgettextlib" CFLAGS="-I/opt/casa-extlib/gettext-0.18/include"  
4. make  
5. make install 

dbus-glib

1. cd /opt/casa-extlib/src  
2. tar -xvf dbus-glib-0.94.tar  
3. ./configure PKG_CONFIG_PATH=/opt/casa-extlib/libffi/lib/pkgconfig:/opt/casa-extlib/dbus-c++-mainline/lib/pkgconfig:/opt/casa-extlib/glib-2.29/lib/pkgconfig:/opt/casa-extlib/gettext --prefix=/opt/casa-extlib/dbus-glib-0.94 LDFLAGS=-L/opt/casa-extlib/gettext-0.18/lib LIBS="-lgettextlib" CFLAGS="-I/opt/casa-extlib/gettext-0.18/include"  
4. make  
5. make install  
6. make check 

dbus-python

1. cd /opt/casa-extlib/src  
2. tar -xvf  
3. ./configure PKG_CONFIG_PATH=/opt/casa-extlib/dbus-glib-0.94/lib/pkgconfig:/opt/casa-extlib/dbus-c++-mainline/lib/pkgconfig:/opt/casa-extlib/glib-2.29/lib/pkgconfig/ --prefix=/opt/casa-extlib/dbus-python-0.84  
4. make  
5. make install 

uuid

vim /opt/casa-extlib/dbus-1.2.26/var/lib/dbus/machine-id to have one line of some thing like the following  
96b1c926176876200211cb834a569f35  
05bba6dc409496bd86c8e3184c251243 

test dbus-python

1. cd test  
2. python  
3. import dbus  
4. dbs=dbus.SessionBus()  
5. dbs.list_names() 
6. dbs.close() 

doxygen

1. cd /opt/casa-extlib/src  
2. tar -xvf doxygen-1.7.4.tar  
3. ./configure --prefix /opt/casa-extlib/doxygen-1.7.4  
4. make  
5. make install  
6. export DOXYGEN=/opt/casa-extlib/doxygen-1.7.4  
7. export PATH=$DOXYGEN/bin:$PATH 

-- HonglinYe - 2011-07-07
Topic revision: r1 - 2011-07-07, HonglinYe
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding NRAO Public Wiki? Send feedback