C-SAFE Home

Information/Instructions/Mac

From C-SAFE Wiki

Jump to: navigation, search

Contents

Compiling SCIRun on a Mac (Macintosh)

  • The following are the latest step-by-step instructions detailing how to build SCIRun on a Mac running OS X Leopard.
  • These instructions will work on a Mac OS X 10.5.3. They should also work on previous versions of Leopard. If they don't, let me know at daniel.hinckley@utah.edu.

1. Requisite Software

The first step in building SCIRun on to your computer is to download several thirdparty applications. This should be done in the following order:

  • If you already have a working copy of Subversion and shared libraries go to step 2.

Fink

Download and install Fink. As of 6/30/08 there was no binary release for Leopard users. Fink 0.27.8 can be downloaded here.

FinkCommander

Next, download and install the FinkCommander binary. Version 0.5.4 was used for the current build. It can be downloaded from SourceForge here here.

X11

Make sure that you have X11 2.0 installed on your computer. It is one of the optional installations on the Leopard Install disk. After installing that version, download the latest version of X11 (as of 6/30/08 it was 2.2.3) from:

http://trac.macosforge.org/projects/xquartz/wiki/

XCode

From the OS X Install DVD, navigate to the “Optional Installs” folder and double-click on the XCodeTools.mpkg and follow the instructions. This will install the latest version of Xcode.

Fortran Compiler

Download a gfortran compiler. A good one can be found at:

http://hpc.sourceforge.net/

Grab gfortran-bin.tar.gz (PowerPC) or gfortran-intel-bin.tar.gz (Intel) under GCC 4.4. Put the tarball in your root directory at / and when you untar it (tar –xvf gfortran-intel-bin.tar.gz), it goes in all the right places.

SVN

Use Fink Commander to download the latest versions of libpng3-shlibs and Subversion (svn).

2. LAM MPI

Download and install the LAM MPI source (lam-7.1.4.tar.gz) from here. Once the tarball has been downloaded, place it in a directory called “pkg” in your home directory and untar it. Inside of the “pkg” directory create a directory called “installs.” Run the following configure line inside the lam-7.1.4 directory to configure LAM 7.1.4:

./configure \
   --prefix=/Users/<username>/pkg/installs/lam-7.1.4 \
   --enable-shared=yes \
   --with-fc=gfortran

After configuring LAM with the previous command line, type “make” and then “make install” to build LAM in the directory specified by in the "--prefix" line of the configure script.

3. Thirdparty

Check out the latest version of Thirdparty from the svn repository. There is no special version for Mac OS X. As of 6/30/08, the latest version of Thirdpary was 1.25.4.

> svn co https://code.sci.utah.edu/svn/Thirdparty/1.25.4 Thirdparty/1.25.4

After checking out the latest version of Thirdparty and placing it in your “pkg” directory, go into the 1.25.4 directory and use the following command to install Thirdparty. After Thirdparty has been installed command line argument (--with-thirdparty /…) will be displayed. Record this for use in the SCIRun configure line.

./install.sh <destination of Thirdparty build> <Number of bits (32) >

4. PETSc

Download the tarball of latest version of PETSc (petsc-2.3.3-p13.tar.gz) from the link below:

http://www-unix.mcs.anl.gov/petsc/petsc-as/download/index.html

Untar the tarball and place it in the “pkg” dirctory that you created earlier in your home directory. Change directory into the petsc-2.3.3-p13 directory and run the following configure lines, modifying the paths to the destination of the configure directory and the previously installed LAM (ie. /Users/<user name>/pkg/installs/lam-7.1.4).

./config/configure.py \
   --prefix=/Users/<username>/pkg/installs/petsc-2.3.3-p13 \
   --with-matlab=false \
   --with-x=false \
   --with-shared=0 \
   --with-debugging=0 \
   --with-mpi-dir=/Users/<username>/pkg/installs/lam-7.1.4

After running these configure lines set the environment variable as requested at the very end of the compiler output (setenv … (tcsh) or export (bash)). Then turn on LAM with “lamboot” and then type “make all” and then “make install.”

5. Hypre

Install Hypre. Detailed instructions can be found here.

Download the newest 2.x version of Hypre from here: https://computation.llnl.gov/casc/hypre/software.html

  • Note, 2.2.0b should work, but we normally use 2.0.0.

After doing so, configure Hypre with the following commands:

cd hypre-2.0.0/src
./configure \
   --with-MPI-include=/Users/<username>/pkg/installs/lam-7.1.4/include \
   --with-MPI-lib-dirs=/Users/<username>/pkg/installs/lam-7.1.4/lib \
   --with-MPI-libs="mpi lam pmpi util" \
   --prefix=/Users/<username>/pkg/installs/hypre-2.0.0/hypre_install \
   CFLAGS="-DMPIPP_H" \
   CXXFLAGS="-DMPIPP_H"	

The “--prefix" lines is used to specify where hypre will be built. When configuring SCIRun, you will need to point to this directory. After configuring Hypre type “make” and then “make install.” You will see a few errors during the make process but these can be ignored as far as the “make” process is concerned.

6. SCIRun Install and Configure

After you have downloaded and configured all of the aforementioned packages you are ready to build SCIRun. Checkout the latest version of the code using the following command line and place it in a location that is convenient.

svn co https://code.sci.utah.edu/svn/SCIRun/trunk/src SCIRun/src

If you want to revert to prior versions of the tree go to the FAQ to find instructions. It can be found at:

http://code.sci.utah.edu/SCIRunAndSubversionFAQ.html

For an optimized build, change directory into the SCIRun directory that you just created and do the following:

mkdir mac32opt
cd mac32opt
../src/configure \
   --enable-package=Uintah \
   --enable-optimize \
   --with-thirdparty=/Users/<username>/pkg/installs/Thirdparty/1.25.4/Darwin-i386/gcc-4.0.1-32bit \
   --with-png=/Users/<username>/pkg/installs/Thirdparty/1.25.4/Darwin-i386/gcc-4.0.1-32bit \
   --with-mpi=/Users/<username>/pkg/installs/lam-7.1.4 \
   --with-petsc=/Users/<username>/pkg/installs/petsc-2.3.3-p13 \
   --with-hypre=/Users/<username>/pkg/installs/hypre-2.0.0/hypre_install \
   PETSC_ARCH=darwin9.3.0-c-opt \
   F77=gfortran

The paths will need to be modified to point to the configured versions of Thirdparty, png, MPI, PETSc, and Hypre. I had to change my PETSC_ARCH line so that it corresponded with the correct folder inside petsc-2.3.3-p13/lib/. If you have followed the instructions as detailed earlier in this document, all that should have to be modified is your user name in these lines. It may require some trial and error but this configure line does work.

After configuring SCIRun, type “make all” and sus and scirun will compile. You have now completed your own build of the SCIRun problem solving suite on your MAC!





Back to: Main