================================================================================ Instructions for Compiling CIAO 4.5 December 2012 ================================================================================ Please check the CIAO website: http://cxc.harvard.edu/ciao4.5/ for the most recent updates to this document and further installation assistance. -------------------------------------------------------------------------------- Table of contents -------------------------------------------------------------------------------- I) Rebuilding CIAO source with pre-built OTS binaries A) Overview B) Required Files C) Build Preparation D) Configure Switches E) Build Instructions F) Rebuilding Selected Directories G) AHELP Indexing H) Smoke Tests II) Complete rebuild from source, including OTS A) Overview B) Required Files C) Configure Switches D) Building OTS packages 1) cfitsio 2) DS9 3) fftw 4) jpeg 5) readline 6) GTK 7) vte 8) gtkglext 9) xpa 10) wcssubs 11) xerces-c 12) VTK 13) Python 14) numpy 15) iPython 16) Xspec E) Build Instructions F) AHELP Indexing G) Smoke Tests -------------------------------------------------------------------------------- I) Rebuilding CIAO source with pre-built OTS binaries -------------------------------------------------------------------------------- A) Overview CIAO depends on a number of external software components we refer to as OTS (Off-the-Shelf) software. The following instructions let you build CIAO from source, but assume you are using pre-built binaries for the OTS. B) Required Files Building CIAO from source using the pre-built binary OTS requires the ciao-4.5-src-*.tar.gz packages as well as the platform specific ciao-4.5-bin-.tar.gz packages. Linux, Linux64, osxi, and osx64 are the currently supported values for . First, install CIAO using the ciao-install script. Select Download source on the web page. ciao-install will unpack all the files for you. If you want to unpack the files yourself, use the --download-only switch when running ciao-install and do the following steps by hand: > gunzip -c ciao-4.5-src-core.tar.gz | tar xf - > gunzip -c ciao-4.5-src-obsvis.tar.gz | tar xf - > gunzip -c ciao-4.5-src-tools.tar.gz | tar xf - > gunzip -c ciao-4.5-src-prism.tar.gz | tar xf - > gunzip -c ciao-4.5-src-chips.tar.gz | tar xf - > gunzip -c ciao-4.5-src-sherpa.tar.gz | tar xf - > gunzip -c ciao-4.5-bin-core-.tar.gz | tar xf - > gunzip -c ciao-4.5-bin-tools-.tar.gz | tar xf - > gunzip -c ciao-4.5-bin-prism-.tar.gz | tar xf - > gunzip -c ciao-4.5-bin-chips-.tar.gz | tar xf - > gunzip -c ciao-4.5-bin-sherpa-.tar.gz | tar xf - > gunzip -c ciao-4.5-bin-graphics-.tar.gz | tar xf - Note 1: ciao-4.5-bin-obsvis-.tar.gz is NOT needed as no OTS are packaged in that binary distribution. Note 2: If you have gtk-devel installed on your system and the version is at least 2.16 but not greater the 2.27 you should be able to use the gtk installed on your system. You will most likely need to build or install gtkglext as that in not part of the standard gtk package. C) Build Preparation Untarring the files creates a directory ciao-4.5; cd into it: > cd ciao-4.5 To make sure that libraries and executables are newly created by the source build on your system, delete the lib, bin, and binexe directories: > \rm -rf lib/* bin/* binexe/* CIAO uses GTK for chips and prism. The necessary gtk files are packaged in the graphics binary tarfile. The tool pkg-config is used to find the libraries and header files needed to build parts of CIAO. Mac Note: We discovered that on the Mac we can produce a more stable system by using some of the components of GTK from the systems area. To build with the CIAO gtk you need to set the following variable first: > setenv PKG_CONFIG_PATH `pwd`/ots/lib/pkgconfig:/usr/X11R6/lib/pkgconfig Linux Note: We use some local system libraries to produce a more stable system. You may need to add the location of the pkgconfig libraries to your PKG_CONFIG_PATH. For example if your system pkgconfig directory is in /usr/lib you would need to do the following: > setenv PKG_CONFIG_PATH `pwd`/ots/lib/pkgconfig:/usr/lib/pkgconfig Please note that 64 bit OS's tend to have the 64 bit libraries in /usr/lib64. The package config files included with the CIAO distribution need to be updated to utilize paths local to the installation. From the current directory (ciao-4.5) run the command: > bash src/config/fixpc.sh `pwd` This script will update the configuration files to replace the "prefix=..." lines with the correct path for the current build location. If you are using your local copy of gtk this step is not necessary. D) Configure Switches > ./configure --with-fits --with-ascii Note 1: Info for LINUX builds If you are on 32 or 64 bit Linux we suggest using gfortran. This can be downloaded from http://gcc.gnu.org. You may use g77 or g95 depending on what is installed on your system, but unless you re-build xspec with the same FORTRAN compiler, xspec models will NOT be available in sherpa; > ./configure --with-fits --with-ascii F77=gfortran \ FC=gfortran F95=gfortran Our binary copy of the XSPEC libraries depends on libgfortran.so.1, which may cause a conflict with versions of gcc / gfortran higher then 4.1.x. If you cannot use a copy of gfortran that uses the libgfortran.so.1 library, you will need to re-build XSPEC. Please see the instructions below for rebuilding XSPEC. To see what version of gfortran you are using type: 'gfortran --version' If you are on 32 bit Linux and want to use the default compilers in you path: > ./configure --with-fits --with-ascii Note 2: Info for Intel MAC builds Fortran compilers are NOT part of the default Mac packages and you will need to download gfortran. This can be downloaded from: http://r.research.att.com/tools/. You may use g77 or g95 if you have installed either of these on your system, but unless you re-build xspec with the same FORTRAN compiler, xspec models will NOT be available in sherpa. > ./configure --with-fits --with-ascii F77=gfortran \ FC=gfortran F95=gfortran If you are on a Mac and your fortran compiler is NOT in your path you can: (Assuming gfortran is installed in /usr/local/bin:) > ./configure --with-fits --with-ascii F77=/usr/local/bin/gfortran \ FC=/usr/local/bin/gfortran F95=/usr/local/bin/gfortran \ --x-includes=/usr/X11R6/include \ --x-libraries=/usr/X11R6/lib should work. Sometimes the Mac systems cannot automatically find the X11 libraries and headers so the --x-includes= and --x-libraries= switches are needed. Note 3: Optimization and compilers Optimization is turned on by default, -O3 for gcc. If you wish to use a different optimization level or turn off optimization, use the --with-opt= switch. Even if you specify your compilers, you need to make sure they are in your $PATH variable. Configure will check to make sure you have the proper compilers installed. We have a script that gets installed in the bin directory called ciao_info which can be run to check your environment if you run into problems. After configure runs, the script ciao-python-fix post-processes your configuration, to byte-compile included Python files for your installation, and to ensure all CIAO packages with Python interfaces can be built. > sh src/config/ciao-python-fix E) Build Instructions Now, the source tree should be properly set up to build. To build and install the code, type "make install". CIAO currently requires that "make install" be issued as a single command rather than as separate commands "make; make test; make install". This is due to build dependencies on installed libraries and packages. > make install F) Rebuilding Selected directories Most directories can be rebuilt after running configure by simply stepping into the directory and running 'make install'. There are a few tools that depend on local libs that are not installed and may require rebuilding first. G) AHELP Indexing After installation you will need to generate an index file used by the CIAO help documentation application (ahelp). The ciao.csh script needs to be run to set up dynamic library paths used by ahelp. > source bin/ciao.csh (csh users) or > . bin/ciao.bash (bash users) Then run the ahelp command with the -r (re-index) option. > ahelp -r This will generate the help indexes. If this completes successfully, you can execute the smoke tests. H) Smoke Tests To run the tests, users should do something like: > cd /test > source ../bin/ciao.csh > make -k test |& tee ~/ciao_test.log (tcsh) or > . ../bin/ciao.sh > make -k test 2>&1 | tee ~/ciao_test.log (sh, ksh, bash) A successful test will look like: [1/41] Running test FOO-smoke001 ... PASS where 'FOO' is the name of an individual test. If users see a message that reports: [1/41] Running test FOO-smoke001 ... FAIL then there is an unexpected problem with the tests. Note that if users see additional warnings/errors and the test reports PASS, then the test is good (tests sometimes do test error conditions). All the test outputs are written to $ASCDS_WORK_PATH/smoke.$LOGNAME where $LOGNAME is your system login name. The tests need about 60 Mb to run. The test scripts clean up the disk space upon successful completion. Tests which fail leave their test output so users may check the results. Once users are satisfied with the smoke test results they should remove $ASCDS_WORK_PATH/smoke.$LOGNAME and all its sub-directories. $ASCDS_WORK_PATH is set in the /bin/ciao.*sh setup scripts as /tmp by default. If the machine does not have a /tmp or users don't have write permission, users will need to edit the appropriate ciao.*sh script to change the ASCDS_WORK_PATH location or set that ASCDS_WORK_PATH to a different location. If this variable is set, ciao.*sh will not modify it. Please see the INSTALL_BINARY file for more information -------------------------------------------------------------------------------- II) Complete rebuild from source, including OTS -------------------------------------------------------------------------------- A) Overview CIAO depends on a number of external software components we refer to as OTS (Off-the-Shelf) software. The following instructions let you build CIAO applications and OTS, from source. B) Required Files Building completely from source (including the OTS packages) requires download of six files: ciao-4.5-src-core.tar.gz ciao-4.5-src-obsvis.tar.gz ciao-4.5-src-tools.tar.gz ciao-4.5-src-chips.tar.gz ciao-4.5-src-sherpa.tar.gz ciao-4.5-src-prism.tar.gz CIAO has been tested with gcc 4.0.x, 4.1.2, 4.2, 4.6 There are some known problems with gcc 4.2.1. CIAO also requires C++ and FORTRAN compilers. CIAO had been compiled with gfortran, g77, g95. Note: Fortran compiles are NOT part of the Mac packages and you will need to download the fortran compiler of you choice. CIAO has been tested with gfortran. C) Configure Switches Set the following variable to compile CIAO with compilers other than those in current path: CC - Name and location of the c compiler CXX - name and location of c++ compiler F77 - Name and location of FORTRAN compiler FC - Name and location of FORTRAN compiler F95 - Name and location of FORTRAN compiler Here is the list of configure options available for CIAO: To specify the FORTRAN compiler, set BOTH the FC and F77 variables. If you are using gcc or g95 both variables (FC and F77) must be the same. --prefix= Directory to install CIAO. Default location will be . --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR --with-debug Compile with debug enabled --with-opt= Set optimization level (default=-O3) --with-fits Include FITS kernel when building CXC DataModel Note: This switch is required to build the DataModel. It indicates to configure that the setup is for a compile and not just a binary install. --with-ascii Include the ASCII kernel when building the CXC DataModel. This switch is required if you need to read ASCII files into chips. --with-cfitsio Link against libcfitsio instead of libcxccfitsio --with-g2cloc=DIR Location of libg2c (if using g2c) --with-f95loc=DIR Location of libf95 (if using g95) --with-gfortranloc=DIR Location of libgfortran (if using gfortran) --with-imagerdir=saord path to directory/tree containing DS9 The switches --with-g2cloc=DIR, --with-f95loc=DIR --with-gfortranloc are needed depending on the compiler used to help CIAO find the FORTRAN libraries (see the examples below). Generally they are only needed if g95 or the fink g77 compilers are used. If they are rooted in the same tree as the fortran compiler (for example /usr/bin/gfortran would look for libgfortran in /usr/lib) Mac g95 Note: If you are using g95 on the Mac systems you WILL need to re-compile the f95 (libf95.a) library. 1) Download the g95 source from http://g95.org/src.shtml 2) Unpack the tar file, in that tarfile is libf95.a-0.92.tar.gz 3) Run configure as instructed. You do not need to build, configure creates the files needed by libf95.a 4) Unpack libf95.a-0.92.tgz 5) Go to the libf95.a-0.92 directory and run configure as instructed by the web page. 6) After running configure edit Makefile. On the line that defines CFLAGS add "-fno-common" 7) Continue as instructed. For more information please see: http://g95.sourceforge.net/src.shtml You may use the pre-built binary compiler but you do need to re-build libf95.a from source to avoid build problems with CIAO. D) Building OTS (Off-The-Shelf) packages It is recommended that the OTS packages are installed in same directory and that directory is located in $ASCDS_INSTALL/ots (where $ASCDS_INSTALL is the final install area for the CIAO binaries. All packages that accept the configure option --prefix= should run configure with that switch where = $ASCDS_INSTALL/ots directory. All packages below require the following steps have been completed: - unpack the source tar file. For example for g-zipped files: > gunzip -c | tar xf - - cd into the package directory > cd 1) cfitsio http://heasarc.gsfc.nasa.gov/docs/software/fitsio/fitsio.html CIAO has been tested with version 3.280 ./configure --prefix= make shared make shared install 2) DS9 http://hea-www.harvard.edu/saord/ds9/ CIAO has been tested with version 7.1 If building from source follow the instructions in the package and copy the final executables to /ots/saord directory. If using the pre-compiled binary version unpack the executable in the /OTS/saord directory. [recommended] If installing DS9 in a different location, use the configure switch --with-imagerdir= when running configure CIAO (both source and binary builds). User needs to create the ots/saord directory > mkdir saord 3) fftw http://www.fftw.org/ CIAO has been tested with fftw 3.3.1 CIAO requires fftw to be installed with both the standard (double) and float configurations. This requires building fftw twice with different configure options. ./configure --prefix= --with-pic --enable-float make make install make clean ./configure --prefix= --with-pic make make install 4) jpeg ftp://ftp.uu.net/graphics/jpeg/ CIAO has been tested with jpeg 7 If you have not built jpeg already, please see the instructions above. 5) readline ftp://ftp.gnu.org/pub/gnu/readline/ CIAO has been tested with version 6.2 ./configure --prefix= make make install 6) GTK http://www.gtk.org/ CIAO has been tested with GTK 2.24.10 GTK consists of several sub-packages listed below in the order they need to be compiled: Note: As that packages are dependent on each other setting the following variables can be useful: setenv CFLAGS "${CFLAGS} -L$/lib -I$/include" setenv CXXFLAGS "${CXXFLAGS} -L$/lib -I$/include" setenv PKG_CONFIG_PATH "/lib/pkgconfig $PKG_CONFIG_PATH" setenv LD_LIBRARY_PATH "/lib" * pkg-config (http://www.freedesktop.org/wiki/Software/pkgconfig) CIAO has been tested with version 0.18.0 ./configure --prefix= make make check make install * gettext (http://www.gnu.org/software/gettext/) CIAO has been tested with version 0.18.1.1 ./configure --prefix= --disable-csharp make make check make install * glib (ftp://ftp.gtk.org/pub/glib) CIAO has been tested with version 2.27.93 ./configure --prefix= \ CFLAGS="-I/include -L/lib" \ CPPFLAGS="-I/include -L/lib" make make check make install * ATK - (http://www.icewalkers.com/Linux/Software/514330/ATK.html) CIAO has been tested with version 1.91.92 ./configure --prefix= make make check make install * pixman - (http://www.cairographics.org/releases/) CIAO has been tested with version 0.24.4 ./configure --prefix= make make check make install * ffi - (http://sourceware.org/libffi/) CIAO has been tested with version 3.0.10 ./configure --prefix= make make check make install * FreeType - (http://www.freetype.org/) CIAO has been tested with version 2.4.4 ./configure --prefix= make make check make install * expat - (http://sourceforge.net/projects/expat/) CIAO has been tested with version 2.0.1 ./configure --prefix= make make check make install * tiff - CIAO has been tested with version 3.9.6 Configure switches for Linux: ./configure --prefix= \ --with-jpeg-lib-dir=/lib \ --with-jpeg-include-dir=/include Configure switches for Mac builds: ./configure --prefix= --enable-static \ --disable-shared \ --with-jpeg-lib-dir=/lib \ --with-jpeg-include-dir=/include make make check make install * png - (http://www.libpng.org/pub/png/libpng.html) CIAO has been tested with version 1.5.10 Configure switches for Linux: ./configure --prefix= Configure switches for Mac builds: ./configure --prefix= --enable-static \ --disable-shared make make check make install * fontconfig - (http://www.fontconfig.org/) CIAO has been tested with version 2.8.0 ./configure --prefix= make make install * cairo - (http://www.cairographics.org/releases/) Ciao has been tested with version 1.12.0 ./configure --prefix= make make install * Pango (ftp://ftp.gtk.org/pub/pango) CIAO has been tested with version 1.26.0 ./configure --prefix= \ CFLAGS="-I/include -L/lib" \ CPPFLAGS="-I/include -L/lib" \ --disable-glibtest make make install * GTK+ - (ftp://ftp.gtk.org/ CIAO has been tested with version 2.24.10 ./configure --prefix= \ CFLAGS="-I/include -L/lib" \ CPPFLAGS="-I/include -L/lib" \ --disable-glibtest make make install 7) vte http://www.icewalkers.com/Linux/Software/528670/vte.html CIAO has been tested with vte 0.25.1 Note: vte requires inittool and Perl with the the XML:: extensions installed. Also newer versions of vte require a newer version of GTK which might not be compatible with CIAO. Lion Note: There is an issue with setting a file mode to BLOCK on Mac Lion if it is already set. You need to modify the code: vte 0.25.1/src/pty.c as follows. Change: rv = fcntl(fd, F_SETFL, flags); if (rv < 0) { int errsv = errno; g_set_error(error, VTE_PTY_ERROR, VTE_PTY_ERROR_PTY98_FAILED, "%s failed: %s", "fcntl(F_SETFL)", g_strerror(errno)); close(fd); errno = errsv; return -1; } To: if (flags != rv) { rv = fcntl(fd, F_SETFL, flags); if (rv < 0) { int errsv = errno; g_set_error(error, VTE_PTY_ERROR, VTE_PTY_ERROR_PTY98_FAILED, "%s failed: %s", "fcntl(F_SETFL)", g_strerror(errno)); close(fd); errno = errsv; return -1; } } This will avoid to call to fcntl that will fail on Mac Lion. ./configure --prefix= --disable-Bsymbolic make make install 8) gtkglext http://gtkglext.sourceforge.net/ CIAO has been tested with version 1.2.0 setenv CFLAGS "${CFLAGS} -L$/lib -I$/include \ -I/usr/X11R6/include" setenv CXXFLAGS "${CXXFLAGS} ${CFLAGS}" setenv CPPFLAGS="-I$/include -I/usr/X11R6/include" setenv LDFLAGS "${LDFLAGS} -L$/lib" ./configure --prefix= make make install 9) xpa http://hea-www.harvard.edu/saord/xpa/ Note: GTK needs to be build before xpa CIAO has been tested with xpa 2.1.13 ./configure --prefix= with-gtk= --enable-threaded-xpans make make install 10) wcssubs http://tdc-www.harvard.edu/software/wcstools/wcssubs.tar.gz or: ftp://cfa-ftp.harvard.edu/pub/gsc/WCSTools/wcssubs.tar.gz CIAO has been tested with wcssubs version 3.8.3 make cp libwcs.a /lib cp *.h /include 11) xerces-c http://xml.apache.org/xerces-c/ CIAO has been tested with xerces-c 3.1.1 ./configure --prefix= make make install 12) VTK http://public.kitware.com/VTK/ Note: Requires cmake CIAO has been tested with a modified version 5.6.1 Please see src/pkg/chips/src/vtk/vtk/README for details of the changes made to VTK to support CIAO. Before building the following changes need to be made to the software: 1. modify VTK-5.6.1-Installation/Utilities/vtkfreetype/CMakeLists.txt by adding the following line into SET (FREETYPE_SRCS) macro: src/base/fttype1.c 2. Copy from source tree src/pkg/hips/src/vtk/vtk/Common/* into VTKinstallation/Common 3. Copy from source tree src/pkg/hips/src/vtk/vtk/Rendering/* into VTKinstallation/Rendering 4. Copy from source src/pkg/chips/src/vtk/vtk/Rendering/fonts/* into VTKinstallation/Rendering/fonts 5. Edit in VTKinstallation/Rendering CMakeList.txt as follows add to the macro Kit_FT_SRCS the file fonts/face_greek.cxx fonts/face_helvetica.cxx fonts/face_helvetica_italic.cxx fonts/face_helvetica_bold.cxx fonts/face_helvetica_bold_italic.cxx 6. Add the following lines to vtkinstallation/Rendering/fonts/vtkEmbeddedFonts.h // Desc: Greek // Type: postscript Type1 // Used ghostscript fonts: // s050000l.pfa extern size_t face_greek_buffer_length; extern unsigned char face_greek_buffer[]; // VTK: Helvetica // Type: postscript Type1 // Used ghostscript fonts: // n019003l.pfa // n019023l.pfa // n019004l.pfa // n019024l.pfa extern size_t face_helvetica_buffer_length; extern unsigned char face_helvetica_buffer[]; extern size_t face_helvetica_italic_buffer_length; extern unsigned char face_helvetica_italic_buffer[]; extern size_t face_helvetica_bold_buffer_length; extern unsigned char face_helvetica_bold_buffer[]; extern size_t face_helvetica_bold_italic_buffer_length; extern unsigned char face_helvetica_bold_italic_buffer[]; 7. To the following definitions in VTKinstallation/Common/vtkSystemIncludes.h: // These types define different text properties #define VTK_ARIAL 0 #define VTK_COURIER 1 #define VTK_TIMES 2 Add #define VTK_GREEK 3 #define VTK_HELVETICA 4 8. Add the following lines to vtkinstallation/Rendering/fonts/vtkEmbeddedFonts.h // Desc: Greek // Type: postscript Type1 // Used ChipsSymbol.ttf (derived from STIXGeneral.ttf via SIL Open Font License) extern size_t face_greek_buffer_length; extern unsigned char face_greek_buffer[]; // VTK: Helvetica // Type: postscript Type1 // Used ghostscript fonts: // n019003l.pfa // n019023l.pfa // n019004l.pfa // n019024l.pfa extern size_t face_helvetica_buffer_length; extern unsigned char face_helvetica_buffer[]; extern size_t face_helvetica_italic_buffer_length; extern unsigned char face_helvetica_italic_buffer[]; extern size_t face_helvetica_bold_buffer_length; extern unsigned char face_helvetica_bold_buffer[]; extern size_t face_helvetica_bold_italic_buffer_length; extern unsigned char face_helvetica_bold_italic_buffer[]; 9. Copy from source src/pkg/chips/src/vtk/vtk/Utilities/ftgl/src/* into VTKinstallation/Utilities/ftgl/src 10. Edit file VTKinstallation/Utilities/ftgl/CMakeLists.txt Add to macro SET (FTGL_SRCS the following files src/FTFontExtra.cc src/FTGLPixmapFontExtra.cc src/FTGLPixmapFontExtraRenderOpenGL.cc src/FTGLBitmapFontExtra.cc src/FTGLBitmapFontExtraRenderOpenGL.cc 11. Copy from source src/pkg/chips/src/vtk/vtk/Utilities/gl2ps/* into VTKinstallation/Utilities/gl2ps 12 This step is only needed for gcc 4.5.x or newer users: Add the line: #include after #include "DICOMCMakeConfig.h" in file Utilities/DICOMParser/DICOMConfig.h In file Rendering/vtkOpenGLExtensionManager.cxx change: glXGetProcAddressARB to glXGetProcAddress Now you are ready to prepare to build using the command: cmake -DBUILD_SHARED_LIBS:BOOL=ON \ -DVTK_USE_GCC_VISIBILITY:BOOL=OFF \ -DCMAKE_BUILD_TYPE:STRING=RELEASE \ -DCMAKE_INSTALL_PREFIX:STRING=/VTK/TEST/INSTALL \ -DCMAKE_CXX_COMPILER:STRING=$CXX \ -DCMAKE_C_COMPILER:STRING=$CC \ -DCMAKE_CXX_FLAGS:STRING=-DCXC_USE_CHIPS-DVTK_USE_X=ON \ -DCMAKE_C_FLAGS:STRING=-DCXC_USE_CHIPS \ -DVTK_USE_RPATH:BOOL=OFF -DVTK_USE_GL2PS:BOOL=ON make install Where $CC is the cc compiler and $CXX is the c++ compiler (with the path specified). 13) Python http://www.python.org/ Note: Requires readline CIAO has been tested with version 2.7.2 Mac users will need to make the following edit: Edit file Makefile.pre.in to include a target for line 442 From: -current_version $(VERSION); \ To: -current_version $(VERSION) \ $(OTHER_LIBTOOL_OPT); \ Linux: ./configure --prefix= --enable-shared Mac: ./configure --prefix= --enable-shared \ --enable-framework=/Library/Frameworks ln -s /include/readline . All Macs: Create a Modules/Setup.local file with the following line: readline readline.c "-I${INSTALL_DIR}/include -L${INSTALL_DIR}/lib -lreadline -lncurses" make OTHER_LIBTOOL_OPT="-L/lib -lreadline -lncurses" make DESTDIR= frameworkinstall cd /Library/Frameworks/Python.framework/Versions/2.7 tar cf - bin lib | (cd ; tar xf -) cd /bin rm -f python python2.7 pythonw pythonw2.7 ln -s \ /Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7 python2.5 ln -s \ /Library/Frameworks/Python.framework/Versions/2.7/bin/pythonw2.7 pythonw2.4 ln -s python2.7 python ln -s pythonw2.7 pythonw All other systems: make make install 14) numpy http://numpy.scipy.org/ Note: Requires Python CIAO has been tested with version 1.5.1 If you are NOT using g2c: /bin/python setup.py install If you are using g2c (g77 on Linux) /bin/python setup.py build build_ext -lg2c install 15) iPython http://ipython.scipy.org/moin/ Note: Requires Python CIAO has been tested with version 0.13 /bin/python setup.py install Mac note: On OSX system you may need to do: /bin/python setup.py install --install-dir=/bin and then copy: > cp -rf \ /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/IPython \ /lib/python2.7/site-packages/ 16) Xspec http://heasarc.gsfc.nasa.gov/docs/software.html CIAO has been tested with version 12.7.1 Select the packages needed to build the Xspec libraries and follow the HEASOFT build instructions. Once the build is complete, copy libCCfits.so libXS.a, libXSFunctions.so, libXSUtil.so, and libXSModels to the ots/lib directory. Also you will need to find the file 'fitsio.h' and copy that file from the version of cfitsio that you plan on using when building CIAO. E) Build Instructions To prepare for a source build OTS needs to be installed in a location visible for CIAO and have an install area setup (this can be in the same tree the source files unpack in). Here is the nomenclature and definitions used in this section: = CIAO install area = Location of CIAO source. This can be the same location as but need not be. = Location of root where OTS packages are installed > cd to directory to unpack CIAO sources > gunzip -c ciao-4.5-src.tar.gz | tar xf - > cd ciao-4.5 <= move location to Create install directory (if different) > cd > ln -s ots Set up environment variables CC, CXX, F77, and FC if needed and run configure. For example: > ./configure --with-fits --with-ascii F77=gfortran FC=gfortran You will need at least the switch --with-fits to force compilation. See configure switches above for further options. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Note: The binary CIAO builds were compiled as follows: Linux: (gcc-4.1.2) CC=gcc CXX=g++ F77=gfortran FC=gfortran ./configure --with-fits --with-ascii Intel Mac 32 and 64 bit (with Apple gcc 4.2.1 and gfortran) CC=/usr/bin/cc CXX=/usr/bin/c++ FC= /usr/local/bin/gfortran F77=/usr/local/bin/gfortran ./configure --with-fits --with-ascii --x-includes=/usr/X11R6/include - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Now you are ready to run make > make install CIAO currently requires you install as you make rather then running 'make ; make install' as many packages do. This is because parts of CIAO depend on prior parts to be installed before they can build. We will be looking into changing this in the future. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Note: 64 bit builds As of CIAO 4.5 we now provide support of 64 bit builds. If you build on a 64 bit system, but want to compile in 32 bit mode. With gcc this can be done by adding the -m32 switch to you compiler selection. CC="gcc -m32" CXX="g++ -m32" F77="g77 -m32" FC="g77 -m32" Notice that it must be done for ALL 4 compiler variables. Also when compiling you need to make sure you are picking up 32 bit versions of the system libraries. In our test builds we found that we needed to add the configure switch: --x-libraries=/usr/X11R6/lib To build 64-bit builds on the Mac you can set the variables as follows: CC="gcc -arch x86_64" CXX="g++ -arch x86_64" CPP="gcc -E" \ FC="gfortran -arch x86_64" F77=$FC F95=$FC to not pick up the the libraries in /usr/X11R6/lib64. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Note: Identification and workarounds to some common build problems o Undefined symbols For undefined symbols such as: s_rsfe, s_cmp, f_inqu, do_fio, f_open... You need to: 1) locate the libg2c.so library on your system. 2) cd src/libdev 3) make -k clean 4) cd ../.. 5) re-run configure and add the switch --with-g2cloc= where is the directory where libg2c.so lives. 6) re-run 'make install' from the top directory. For undefined symbols such as: __g95_compare_string, __g95_concat_string, __g95_copy_string, __g95_index3, ... You need to: 1) locate the libf95.a library on your system. 2) cd src/libdev 3) make -k clean 4) cd ../.. 5) re-run configure and add the switch --with-f95loc= where is the directory libf95.a lives. 6) re-run 'make install' from the top directory. For the undefined symbol glXGetProcAddress() you are likely to have a version of Open GL < 1.4 installed on your system. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - F) AHELP Indexing After installation you will need to generate an index file used by the CIAO help documentation application (ahelp). The ciao.csh script needs to be run to set up dynamic library paths used by ahelp. csh users: > source bin/ciao.csh bash users: > . bin/ciao.bash Then run the ahelp command with the -r (re-index) option. > ahelp -r This will generate the help indexes. If this completes successfully, you can execute the smoke tests. G) Smoke Tests To run the tests, users should do something like: > cd /test > make |& tee ~/ciao_test.log (csh) or > make 2>&1 | tee ~/ciao_test.log (sh) Users must be setup for CIAO to run the smoke tests. A successful test will look like: [2/41] Running test prism-smoke001 ... PASS whereas failed tests will look like: [2/41] Running test prism-smoke001 ... FAIL All the test outputs are written to $ASCDS_WORK_PATH/smoke.$LOGNAME where $LOGNAME is your system login name. The tests need about 60 Mb to run. The test scripts clean up the disk space upon successful completion. Tests which fail leave their test output so users may check the results. Once users are satisfied with the smoke test results they should remove $ASCDS_WORK_PATH/smoke.$LOGNAME and all its sub-directories. $ASCDS_WORK_PATH is set in the /bin/ciao.*sh setup scripts as /tmp by default. If the machine does not have a /tmp or users don't have write permission, users will need to edit the appropriate ciao.*sh script to change the ASCDS_WORK_PATH location or set that ASCDS_WORK_PATH to a different location. If this variable is set, ciao.*sh will not modify it. Please see the INSTALL_BINARY file for more information