IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changes between Initial Version and Version 1 of IPPInstallStepByStep-2.9-MacOSX


Ignore:
Timestamp:
Jun 8, 2010, 2:00:57 PM (16 years ago)
Author:
Mike Lum
Comment:

First checked in

Legend:

Unmodified
Added
Removed
Modified
  • IPPInstallStepByStep-2.9-MacOSX

    v1 v1  
     1
     2= Building IPP (v2.9) on Mac OS X (v10.6) =
     3[[BR]]
     4The following is a detailed description of the steps I (Mike Lum) have been following to build both the latest "trunk" and certain tagged versions of the IPP on a clean Mac OS X v10.6 "Snow Leopard" build.[[BR]]
     5__Several Important Notes:__
     6 * This is a '''clean''' operating system install, ie: On to a completely blank disk, with no additional packages installed.
     7 * '''[tlsd]''' is the top-level source directory for your ipp source tree.
     8  * In my case, it was: /Users/mikelum/Documents/Sources/ipp
     9  * I also tested using an external hard drive (eg: /Volumes/AstroDrive/Sources/ipp)
     10 * I used the "Terminal" application for my command line interface, launched from the Finder.
     11 * I used c shell, as opposed to the bash shell, which is the default of the Terminal app. Switch shells by entering "csh" at the bash command line.
     12 * Shell commands are delineated by text box offsets, and prefaced by a default command line prompt: %
     13 * My comments are interspersed, and prefaced by a shell comment character: #
     14[[BR]]
     15== System Setup ==
     16
     17 1. This process was developed and tested on recent laptops (2006 !MacBook and !MacBook Pro and 2008 !MacBook Pro), running a fully updated version of Mac OSX 10.6 (Snow Leopard)[[BR]]
     18 1. Download and install the Developer Tools package from Apple, particularly the UNIX tools. You don't really need the iPhone or other specialized tools, unless you are porting the ipp to an iPhone...[[BR]]
     19 1. Remove the "faked" libreadline in /usr/lib. The "faked" (linked dylib) will be replaced by a real libreadline in the build.[[BR]]
     20[[BR]]
     21== Source Checkout ==
     22
     23 1. Check out your desired source code version.
     24{{{
     25%cd [tlsd]
     26%svn co https://svn.pan-starrs.ifa.hawaii.edu/repo/ipp/trunk .
     27}}}
     28# It's also o.k. to use other, stable tags. This process has also been tested with:[[BR]]
     29# !https://svn.pan-starrs.ifa.hawaii.edu/repo/ipp/tags/ipp-20100525 [[BR]]
     30# !https://svn.pan-starrs.ifa.hawaii.edu/repo/ipp/tags/ipp-20100602 [[BR]]
     31[[BR]]
     32== Build Setup ==
     33
     34 1. Configure your system for the IPP build (first time only).
     35{{{
     36%cd psconfig
     37%./psbuild -bootstrap [tlsd]/psconfig
     38}}}
     39
     40# Until you have an alias for psbuild in your .cshrc file, the "./" is required.[[BR]]
     41# Regardless of what the documentation implies, DO NOT attempt to place the[[BR]]
     42# build target directory anywhere but in your [tlsd]/psconfig directory! [[BR]]
     43
     44 2. Copy the output lines, as described, to your ~/.cshrc
     45 3. Re-start your shell (or just "source" the new .cshrc)
     46[[BR]]
     47== External Library Build ==
     48
     49 1. All builds must be done from the "psconfig" sub-directory
     50{{{
     51%cd [tlsd]/psconfig
     52}}}
     53 2. Build the tools and libraries:
     54{{{
     55%pschecklibs -build
     56}}}
     57=== Build Failure !#1 in libjpeg: ===
     58#[[BR]]
     59# __Error Text:__[[BR]]
     60# ./libtool not found[[BR]]
     61#[[BR]]
     62# __Error Cause:__[[BR]]
     63# This is definitely an issue with the libjpeg build. There is absolutely no reason [[BR]]
     64# for this library build to be looking in its local directory for a system tool.[[BR]]
     65# The "./" needs to be removed from the tool call in the Makefile.[[BR]]
     66#[[BR]]
     67# However, instead of modifying the makefile, as we should, we'll just go ahead and[[BR]]
     68# put a link into the library directory.
     69 1. First, make sure that libtool is built:
     70{{{
     71%pschecklibs -force libtool
     72}}}
     73 2. Check to see if there is a libtool in the jpeg-6b directory (there shouldn't be).
     74{{{
     75%cd [tlsd]/extlibs/jpeg-6b/
     76%ls -l libtool
     77}}}
     78 3. If it's not there, add the link to the built libtool:
     79{{{
     80%ln -s [tlsd]/psconfig/default.darwin_x86/bin/libtool
     81}}}
     82# Note: Sometimes, the "wrong" version of libtool (in /usr/bin/libtool) is seen. This is denoted by an[[BR]]
     83# error referring to an unrecognized command following '-' in --merge. This is also corrected by manually[[BR]]
     84# linking to the (psbuild) built version of libtool (wherever it ends up in your build)[[BR]]
     85 4. Continue with the build:
     86{{{
     87cd [tlsd]/psconfig
     88pschecklibs -build
     89}}}
     90=== Build Failure !#2 in libcfitsio: ===
     91#[[BR]]
     92# Note: Does not occur on all builds (eg: not seen w/ tags: ipp-20100525, ipp-20100602)[[BR]]
     93#[[BR]]
     94# __Error Text:__[[BR]]
     95# ld: duplicate symbol _tempfilename in fpackutil.o and fpack.o[[BR]]
     96# There are also a number of warnings regarding integer formats and the size of a (64-bit)[[BR]]
     97# pointer on MacOSX -- ignore these warnings for now.[[BR]]
     98#[[BR]]
     99# __Error Cause:__[[BR]]
     100# tempfilename is defined as a static character array in the fpack.h header. The abort_fpack[[BR]]
     101# function (in fpackutil.c) attempts to do some garbage collection on this static array, which[[BR]]
     102# is...."bad, mmmmmk?" Furthermore, there is no other reference to this global variable (there is a[[BR]]
     103# locally defined tempfilename in one of the other functions).[[BR]]
     104# [[BR]]
     105 1. Fix: Comment out/remove the header definition and the if-statement in abort_fpack:
     106 1. Re-build the cfitsio library manually:
     107{{{
     108%cd [tlsd]/extlibs/cfitsio3100-p2/
     109%autoreconfig
     110%configure
     111%make shared all
     112%make install
     113}}}
     114 3. Continue with the build:
     115{{{
     116%cd [tlsd]/psconfig/
     117%pschecklibs -build
     118}}}
     119 4. Should succeed, but verify with:
     120{{{
     121%pschecklibs
     122}}}
     123[[BR]]
     124=== Perl Libraries Build ===
     125
     126 1. This is an easy one (hopefully!):
     127{{{
     128%pscheckperl -build
     129}}}
     130 2. Should succeed with no alterations (OMGWTFBBQ!!!)
     131[[BR]]
     132=== IPP Build ===
     133
     134 1. Start a clean, developer build.
     135{{{
     136%psbuild -dev -clean
     137}}}
     138=== Build Failure !#3: in Ohana ===
     139#[[BR]]
     140# Note: Does not occur on all builds (eg: not seen w/ tag: ipp-20100525 and later)[[BR]]
     141#[[BR]]
     142# __Error Text:__[[BR]]
     143# tlsd/Ohana/src/opihi/lib.data/svdcmp_bond_raw.c:15:47: error: malloc.h: No such file or directory [[BR]]
     144#[[BR]]
     145# __Error Cause:__[[BR]]
     146# malloc.h is obsolete on most new OSes.[[BR]]
     147#[[BR]]
     148
     149 1. Comment out the #include of malloc.h in: [tlsd]/Ohana/src/opihi/lib.data/svdcmp_bond_raw.c
     150 1. ...and re-start the build:
     151{{{
     152%psbuild -dev -clean
     153}}}
     154=== Build Failure !#4: in Nebulous/nebclient ===
     155#[[BR]]
     156# Note: Does not occur on all builds (eg: not seen w/ tag: ipp-20100602 and later)[[BR]]
     157#[[BR]]
     158# __Error Text:__[[BR]]
     159# You must have libtoolize installed to compile nebclient.[[BR]]
     160# Download the appropriate package for your distribution,[[BR]]
     161# or get the source tarball at !http://ftp.gnu.org/gnu/libtool/ [[BR]]
     162# problem building Nebulous/nebclient : failure in psautogen.[[BR]]
     163# [[BR]]
     164# __Error Cause:__[[BR]]
     165# Don't know what happens hare, but simply re-starting the build at Nebulous with the -rebuild[[BR]]
     166# flag seems to work. Probably a version conflict with the /usr/bin/libtool[[BR]]
     167#[[BR]]
     168# Note: the "trick" of re-starting the build is a good first attempt at "fixing"[[BR]]
     169# any build failure.[[BR]]
     170{{{
     171psbuild -dev -clean -rebuild -start Nebulous
     172}}}
     173=== Build Failure !#5: in psLib ===
     174#[[BR]]
     175# Note: Does not occur on all builds (eg: not seen w/ tag: ipp-20100525 and later)[[BR]]
     176#[[BR]]
     177# __Error Text:__[[BR]]
     178# psFits.c: In function, psFitsOpen‚:[[BR]]
     179# psFits.c:155: warning: assignment makes pointer from integer without a cast[[BR]]
     180# psFits.c:214: warning: assignment makes pointer from integer without a cast[[BR]]
     181#[[BR]]
     182# __Error Cause:__[[BR]]
     183# This is a combination of a bad variable cast to a 64-bit pointer from a 32-bit int,[[BR]]
     184# and the flag set to treat warnings as errors. Mac OSX actually needs to be using the first[[BR]]
     185# part of this #if statement.[[BR]]
     186#[[BR]]
     187# Note: The psLib build is also issuing the link to the ipp config definition of:[[BR]]
     188# IPP_SOMETHING-OR-OTHER -- which can be a build failure later.[[BR]]
     189#[[BR]]
     190 1. Comment out the following:
     191{{{
     192//#if ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && ! _GNU_SOURCE)
     193            strerror_r(thisErrno, errorBuf, MAX_STRING_LENGTH);
     194            errorMsg = errorBuf;
     195//#else
     196//            errorMsg = strerror_r(thisErrno, errorBuf, MAX_STRING_LENGTH);
     197//#endif
     198}}}
     199 2. Same thing with the next one:
     200{{{
     201//# if ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && ! _GNU_SOURCE)
     202                strerror_r (errno, errorBuf, 64);
     203                errorMsg = errorBuf;
     204//# else
     205//                errorMsg = strerror_r (errno, errorBuf, 64);
     206//# endif
     207}}}
     208# Technically, the correct fix is to set the POSIX_C_SOURCE=200112L and _XOPEN_SOURCE >= 600[[BR]]
     209# flags for the Darwin build.[[BR]]
     210 3. Continue with the build.
     211{{{
     212%psbuild -dev -clean -rebuild -start psLib
     213}}}
     214=== Build Failure !#6: in psModules: ===
     215#[[BR]]
     216# Note: Does not occur on all builds (eg: not seen w/ tag: ipp-20100525 and later)[[BR]]
     217#[[BR]]
     218# __Error Text:__[[BR]]
     219# checking for psParseErrorCodes... missing[[BR]]
     220# configure: error: psParseErrorCodes is required[[BR]]
     221#[[BR]]
     222# __Error Cause:__[[BR]]
     223# The psLib build really mucks up where it places things. In this case it puts it in:[[BR]]
     224# [tlsd]/psLib/etc/pslib and [tlsd]/psLib/share/pslib.[[BR]]
     225#[[BR]]
     226 1. Quick fix: Put soft links from the right directory ([tlsd]/psconfig/default.darwin_x86/*) into the build directory.
     227 1. Long-term fix: Figure our where psLib does it's directory stupidity and fix it.
     228{{{
     229%cd default.darwin_x86
     230%mkdir etc
     231%cd etc
     232%ln -s [tlsd]/psLib/etc/* .
     233%cd ..
     234%cd share
     235%ln -s [tlsd]/psLib/share/* .
     236}}}
     237 3. Continue with the build:
     238{{{
     239%cd [tlsd]/psconfig
     240%psbuild -dev -clean -rebuild -start psLib
     241}}}
     242=== Build Failure !#7: in psModules ===
     243#[[BR]]
     244# Note: Does not occur on all builds (eg: not seen w/ tag: ipp-20100525 and later)[[BR]]
     245#[[BR]]
     246# __Error Text:__[[BR]]
     247# psMetadata.c in function 'psMetadataPrint':[[BR]]
     248# psMetadata.c:1372: warning: format '%jd' expects type...[[BR]]
     249#[[BR]]
     250# __Error Cause:__[[BR]]
     251# Basically, the "treat warnings asserts" build flag is turned on, and the compiler[[BR]]
     252# has choked on an attempt to print a 64-bit field, using a "maxint"[[BR]]
     253# (which is larger than 64-bits on MacOSX) format string.[[BR]]
     254#[[BR]]
     255 1. In psMetadata.c, make the following changes:
     256{{{
     257# Lines 1372 and 1487: change the format specifier: '%jd' to: '%qd'
     258# Lines 1384 and 1459: change the format specifier: '%ju' to: '%qu'
     259}}}
     260 2. ...and re-start the build:
     261{{{
     262%psbuild -dev -clean -rebuild -start psModules
     263}}}
     264=== Build Failure !#8: in psModules: ===
     265#[[BR]]
     266# Note: Does not occur on all builds (eg: not seen w/ tag: ipp-20100525 and later)[[BR]]
     267#[[BR]]
     268# __Error Text:__[[BR]]
     269# /usr/X11R6/include/X11/Xosdefs.h:145:1: error" "_DARWIN_C_SOURCE" redefined[[BR]]
     270#[[BR]]
     271# __Error Cause:__[[BR]]
     272# Yay for X11 ugliness! [[BR]]
     273# Maybe updating my X11 would help? It'll be on the to-do list.[[BR]]
     274 1. My ugly "hack" fix was to go into the Xosdefs.h header and bracket the redefinition with:
     275{{{
     276#ifndef _DARWIN_C_SOURCE.
     277...
     278#endif
     279}}}
     280 2. ...and re-start the build:
     281{{{
     282%psbuild -dev -clean -rebuild -start psModules
     283}}}
     284=== Build Failure !#9: in psModules: ===
     285#[[BR]]
     286# Note: Does not occur on all builds (eg: not seen w/ tag: ipp-20100525 and later)[[BR]]
     287#[[BR]]
     288# __Error Text:__[[BR]]
     289# pmDark.c:354: warning: cast from pointer to integer of different size[[BR]]
     290#[[BR]]
     291# __Error Cause:__[[BR]]
     292# Trying to cast a 64-bit address into a 32-bit integer...[[BR]]
     293 1. Change the cast and the format string to support the 64-bit address pointer:
     294{{{
     295...
     296sprintf (name, "%lx", (unsigned long) id);
     297...
     298}}}
     299 2. ...and re-start the build:
     300{{{
     301%psbuild -dev -clean -rebuild -start psModules
     302}}}
     303=== Build Failure !#10: in extsrc/gpcsw: ===
     304#[[BR]]
     305# __Error Text:__[[BR]]
     306# bin/sh: ginstall: command not found[[BR]]
     307#[[BR]]
     308# __Error Cause:__[[BR]]
     309# Guess what? The ginstall tool is not installed, by default, on Mac OSX.[[BR]]
     310 1. In the file: [tlsd]/extsrc/gpcsw/gpcsrc/Make.Common
     311  * Change the line:
     312{{{
     313INSTALL = ginstall
     314}}}
     315  * to read:
     316{{{
     317INSTALL = install
     318}}}
     319 1a. Alternatively, you can install the ginstall tool.
     320 2. ...and re-start the build:
     321{{{
     322%psbuild -dev -clean -rebuild -start extsrc/gpcsw
     323}}}
     324== Build Success!!! ==
     325{{{
     326...
     327*** done with magic/remove ***
     328}}}
     329 1. ...and you're done! Have fun testing and reducing!