| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | |
| 3 | # Run this script like this: |
| 4 | # |
| 5 | # mkdir ~/installdir |
| 6 | # sh install_ports_and_prime.sh ~/installdir |
| 7 | |
| 8 | set -e |
| 9 | macports_version=2.0.4 |
| 10 | installdir="$1" |
| 11 | |
| 12 | |
| 13 | if [scip-shell system . . `[`. -d "$installdir" ]; then |
| 14 | cd "$installdir" |
| 15 | export PATH="$installdir/macports/bin:$PATH" |
| 16 | # curl -O http://codesynthesis.com/download/xsd/3.3/macosx/i686/xsd-3.3.0-i686-macosx.tar.bz2 |
| 17 | # tar xfj xsd-3.3.0-i686-macosx.tar.bz2 |
| 18 | curlscip-shell system . . curl. -O https://distfiles.macports.org/MacPorts/MacPorts-${macports_version}.tar.gz |
| 19 | tarscip-shell system . . tar. xfz MacPorts-${macports_version}.tar.gz |
| 20 | cd MacPorts-${macports_version} |
| 21 | ./configure --prefix="$installdir/macports" --with-no-root-privileges |
| 22 | makescip-shell system . . make. |
| 23 | makescip-shell system . . make. install |
| 24 | port -v selfupdate |
| 25 | # maybe we need to install fortran like this: |
| 26 | # port install gcc44 +gfortran |
| 27 | port install openmpi libxml2 bison flex gengetopt |
| 28 | port install boost +openmpi |
| 29 | port install cmake |
| 30 | port install subversion |
| 31 | |
| 32 | cd "$installdir" |
| 33 | |
| 34 | svn co --trust-server-cert --non-interactive https://svn.sbc.su.se/repos/PrIME/trunk prime-trunk |
| 35 | |
| 36 | tmpdir=`mktempscip-shell system . . mktemp. -d /tmp/prime_build.XXXXscip-shell filesystem . . `/tmp/prime_build.XXXX`.` |
| 37 | cd $tmpdir && cmakescip-shell system . . cmake. "-DCMAKE_PREFIX_PATH=$installdir;$installdir/xsd-3.3.0-i686-macosx/" -DCMAKE_INSTALL_PREFIX=$installdir/primeinstall "-DCMAKE_Fortran_COMPILER=$installdir/macports/bin/gfortran-mp-4.4" "$installdir/prime-trunk/" |
| 38 | makescip-shell system . . make. -j 8 |
| 39 | makescip-shell system . . make. install |
| 40 | # make test |
| 41 | echoscip-shell system . . echo. export "PATH=$installdir/primeinstall/bin:$installdir/macports/bin:$PATH" |
| 42 | else |
| 43 | echoscip-shell system . . echo. "The directory $installdir doesn't exist" |
| 44 | fi |