Installing PS1/IPP 2.2

Download the main tarball and associated extras. The accompanying C and Perl libraries/packages are now available as single tarballs.

wget wget wget wget

You don't yet need the last file, which is an astrometric catalog, to compile, but you'll want it later for 'simtest'.

Untar and read the instructions

tar xvzf ipp-2.2.tgz less ipp-2.2/psconfig/INSTALL

Set up your configuration:

echo 'set PSCONFDIR = /Volumes/data/PS1/code' > ~/.psconfigrc echo 'setenv PS1BASE /Volumes/data/PS1/src/ipp-2.2' > ~/.cshrc.ps1 echo 'alias "psconfig source $PS1BASE/psconfig/psconfig.csh"' >> ~/.cshrc.ps1 echo 'psconfig ipp-2.2' >> ~/.cshrc.ps1 echo 'source ~/.cshrc.ps1' >> ~/.cshrc source ~/.cshrc.ps1 mkdir $PSCONFDIR mkdir $PSCONFDIR/ipp-2.2.darwin

The IPP doesn't actually use 'PS1BASE' for anything; I've just included it here for ease of reference to the main IPP installation directory in these instructions. The subdirectory name for the last command will depend on architecture and setup you're running under.


will give you the prefix path (which is what you defined on the first line of the section above with PSCONFDIR), the configuration ('ipp-2.2' is what we specified with the 'psconfig' command), and the architecture ('darwin') separated by colons. Merge the second two together with a period and add that on the prefix path and make sure that directory exists (as done on the last line of the multi-line section above). E.g.,

[wwoodvas@serenity code] psconfig | grep : | sed -e 's/ : /\//' | sed -e 's/ : /./' /Volumes/data/PS1/code/ipp-2.2.darwin

Now let's start compiling things. No need to run 'pschecklibs', we're just going to install everything except for 'openssl' to make it easy for the pipeline to find later. Note that if you do run pschecklib on Mac OS X 10.4 the IPP 2.3 version will not find your shared libraries (".dylib"). A fix has been checked into cvs.

cd $PS1BASE/.. tar xvzf extlibs.tgz tar xvzf extperl.tgz

I then found it useful to explicitly add the latest 'automake', 'autoconf', and 'libtool':

cd $PS1BASE/../extlibs wget wget wget

Now for each of the tarballs in this directory, except for openssl

cd $PS1BASE/../extlibs [wwoodvas@serenity extlibs] ls cfitsio2510.tar.gz libpng-1.2.15.tar.gz doxygen-1.5.1.src.tar.gz mysql-5.0.27.tar.gz fftw-3.0.1.tar.gz openssl-0.9.8d.tar.gz gsl-1.6.tar.gz swig-1.3.24.tar.gz jpegsrc.v6b.tar.gz xpa-2.1.6.tar.gz

added in 2.3 is

zlib.1.2.3.tar.gz ncurses-5.6.tar.gz pkg-config-0.22.tar.gz readline-5.2.tar.gz

untar, 'psconfigure', 'make', 'build', e.g.,

tar xvzf cfitsio2510.tar.gz cd cfitsio psconfigure make make install

  • I skipped installing 'openssl', since that's generally available everywhere and 'psconfigure' doesn't work for it (for trivial, probably easily fixed reasons; but we shouldn't have to).
  • It's not necessary to install 'doxygen' either. If you do want to compile 'doxygen' 'psconfigure' doesn't work, you have to explicitly run the './configure' command, e.g., '/configure --prefix /Volumes/data/PS1/code/ipp-2.1.darwin'.
  • The jpeg library isn't smart enough to create the man pages if you do that one first, so you may have to create depending on the order in which you compile things above.

mkdir -p $PSCONFDIR/ipp-2.2.darwin/man/man1

In addition you have to explicitly 'make install-lib' and 'make install-headers' for the jpeg library. It's not clear to me why the developers of libjpeg didn't think you might want these when you said 'make install'.

  • You have to explicitly tell fftw3 to enable floating-point stuff, so use 'psconfigure --enable-float' for this configuration command and then 'make; make install'.
  • If you don't have 'pkg-config' installed, you have to install that. If you have fink and are lazy, you can just 'fink install pkgconfig'. There should be a package you can download and install as well. Once I figure out those instructions I'll include them here.
  • zlib does not work with psconfigure.

Now on to the Perl modules. From the 'ipp-2.2/psconfig' directory

./pscheckperl -build

will build all of the missing modules, assuming the tarballs have been placed in 'extperl' as they are if you followed the 'tar xvzf extperl.tgz' step above. If that worked, then we can move on to compiling IPP 2.2:

./psbuild ipp-2.2

You may get an error when configuring 'ippdb.src' like the following:

./configure: line 20030: syntax error near unexpected token `PSLIB,' ./configure: line 20030: `PKG_CHECK_MODULES(PSLIB, pslib >= 0.9.0)'

Comment out that line in the ippdb.src/configure file and then run 'psconfigure; make; make install' in that directory. If that works then move on to the next modules with './psbuild ipp-2.2 -start ippTools' back from the 'psconfig' directory.

  • Notes for Mac OS X

I've found the following hacks were needed to get IPP 2.2 installed on a Mac OS X 10.4.10 PowerMac? G5 and PowerBook? G4 systems. Note that there are some additional changes that need to be made to some of the routines to handle byte-order (endian) problems that are not yet detailed here.

  • There are conflicts between GNU and BSD readline in the names of a couple of functions. The easiest way to work around this is to install the GNU version in your local PanStarrs? tree. For simplicity of organization, I would do this from the 'src/extlibs' file where all of the other external C dependencies are.
  • To get Ohana to compile, I suggest the following somewhat silly hack. First, let 'psbuild' crash on building Ohana. It will do this after having compiled 'libohana'. Then modify 'Ohana/Makefile.Common' by replacing the '$(LIB)/%.$(ARCH).dylib:' section with the following


@if [ ! -d $(LIB) ]; then mkdir -p $(LIB); fi rm -f $@ gcc -dynamiclib -single_module -o $@ $ -lc -L/Volumes/data/PS1/code/default.darwin/lib/ -lohana -lFITS $(BASE_LDFLAGS) @echo "compiled shared library $*" @echo ""

Make sure to use TABs instead of spaces when putting the above into your 'Ohana/Makefile.Common' file. Replace '/Volumes/data/PS1/code/default.darwin' with your installation directory. Now run 'psbuild -start Ohana' and it should succeed. The issue is just that for some reason it doesn't find the library without the explict direction of where it is. It may be that the dylib file is only created in the install 'lib' directory and not in the source/compile local directory. I'm not sure.

It's also likely that there will be some warnings about redefined macros (MIN, MAX, and SWAP) in 'ohana.h' (Bug ID 892)

The MIN, MAX, and SWAP macros in 'ohana.h' should be wrapped if 'ifndef's to avoid conflicts with other headers that define these common macros. In the installed and source copies of 'ohana.h', replace lines 39-41 with

/* Some useful macros: MIN, MAX, SWAP

If they're already defined,

we'll just assume they were defined the same way. */

# ifndef MIN # define MIN(X,Y) ((X) < (Y) ? (X) : (Y)) # endif /* MIN */ # ifndef MAX # define MAX(X,Y) ((X) > (Y) ? (X) : (Y)) # endif /* MAX */ # ifndef SWAP # define SWAP(X,Y) {double tmp=(X); (X) = (Y); (Y) = tmp;} # endif /* SWAP */

You also want to fix the 'dvo.h' header (Bug) to define two enums as explicitly extern (Bug ID 895):

Changed lines 17 & 20 in 'Ohana/src/libdvo/include/dvo.h' to put in an 'extern' in front of the two enum definitions and then 'make clean' in Ohana. If you forgot to do this and waited until it failed in 'psphot', then go ahead and make this change and 'make clean; psconfigure; make; make install' in Ohana and in 'psphot' and 'make clean; psconfigure; make; make install'.

It's possible that when you run the build for Ohana, it may fail with a messages like

/usr/bin/ld: table of contents for archive: /Users/Shared/PS1/code/ipp-2.2/default.darwin/lib/libdata.a is out of date; rerun ranlib(1) (can't load from it)

(where '/Users/Shared/PS1/code/ipp-2.2/default.darwin' is replaced by wherever your installation is). To solve this

[wwoodvas@calm default.darwin] pwd /Users/Shared/PS1/code/ipp-2.2/default.darwin [wwoodvas@calm default.darwin] ranlib lib/libdata.a

I similarly had to run 'ranlib' on 'libjpeg.a' to get 'psLib' to compile:

ranlib /Users/Shared/PS1/code/ipp-2.2/default.darwin/lib/ligjpeg.a

  • Nebulous is like to fail. Don't worry about Nebulous for now. To move on to starting with the next module

./psbuild ipp-2.2 -start PS-IPP-Metadata-Config

  • Kapa tends to not succeed. To protect against this, edit 'psModules/configure' and change the 'HAVE_KAPA' line to 'HAVE_KAPA="false"'. Then it should succeed. Kapa is a plotting package that's not vital to the pipeline.
  • The next stage is to make sure the database is setup

If you're using the MySQL installed within the IPP directory, you'll want to run the following to initialize the database.

cd $PSCONFDIR/ipp-2.2/default.darwin bin/mysql_install_db

and then initialize the accounts

[wwoodvas@calm ~] mysql -u root Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 to server version: 5.0.27

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('somedecentpassword'); Query OK, 0 rows affected (0.00 sec)

mysql> select host, user, password from mysql.user; +------------+------+-------------------------------------------+ | host | user | password | +------------+------+-------------------------------------------+ | localhost | root | *2B61093CDF584221C2BAA604531AA14C476BAF04 | | Calm.local | root | | | Calm.local | | | | localhost | | | +------------+------+-------------------------------------------+ 4 rows in set (0.00 sec)

mysql> SET PASSWORD FOR 'root'@'Calm.local' = PASSWORD('somedecentpassword'); Query OK, 0 rows affected (0.00 sec)

mysql> select host, user, password from mysql.user; +------------+------+-------------------------------------------+ | host | user | password | +------------+------+-------------------------------------------+ | localhost | root | *2B61093CDF584221C2BAA604531AA14C476BAF04 | | Calm.local | root | *2B61093CDF584221C2BAA604531AA14C476BAF04 | | Calm.local | | | | localhost | | | +------------+------+-------------------------------------------+ 4 rows in set (0.00 sec)

  • Then there's the issue of making sure the data and catalogs are in good places and telling IPP about them through the configuration files.

I'll detail these steps once I get through them.