-
Notifications
You must be signed in to change notification settings - Fork 148
InstallFiPy%2FMacOSX%2FTrilinos
Jonathan Guyer edited this page Sep 26, 2014
·
1 revision
The following steps resulted in a usable MPI build of Trilinos on MacOSX 10.5.7 "Leopard" machine. Not all steps may be necessary and other routes may also work, but given the chronic difficulties in getting Trilinos to work, particularly with MPI, I thought it worth documenting them.
Python:: build and install a "Framework" Python from source. I started with http://www.python.org/ftp/python/2.6.2/Python-2.6.2.tar.bz2. {{{ ./configure --enable-framework make sudo make install }}} The "System" Python available at `/usr/bin/python` is new enough, but it already provides old versions of some libraries, like NumPy, which can make building against it difficult. Modifying it's libraries in-place is *strongly* discouraged. [[BR]] I had been using an earlier-built version of Python 2.5 which caused no end of difficulties with PyTrilinos. I don't remember where I obtained that version or when I built it. It turned out to be that `PY_CFLAGS` was set to build with `-arch ppc -arch i386` and the vendor-supplied OpenMPI libraries were only in Intel format, causing `lipo` to fail. To check that this won't be a problem: {{{ python -c "from distutils import sysconfig; print sysconfig.get_config_vars()['PY_CFLAGS']" }}}
gfortran:: I believe I got `gfortran` from http://r.research.att.com/tools/. I used `gcc` and `g++` installed with the Apple Developer Tools.
NumPy:: Obtain an up-to-date NumPy library. I got it from [http://svn.scipy.org/svn/numpy/trunk SVN trunk] {{{ python setup.py build sudo python setup.py install }}}
OpenMPI:: Obtain [http://www.open-mpi.org/software/ompi/v1.3/downloads/ Open MPI source]. I used version 1.3.2. {{{ ./configure CC=gcc CXX=g++ F77=gfortran FC=gfortran make sudo make install }}} In retrospect, this may not have been necessary, as the Apple Developer Tools (I think) ship with some variant of MPI.
Trilinos:: Obtain and unpack the [http://trilinos.sandia.gov/download/trilinos-9.0.html Trilinos source] (I used Trilinos 9.0.3). The following assumes an environment variable, `TRILINOS`, that points to this source directory. {{{ cd $TRILINOS mkdir MACOSX_MPI cd MACOSX_MPI ../configure --enable-mpi --with-mpi-compilers --prefix=${TRILINOS}/MACOSX_MPI CFLAGS=-O3 CXXFLAGS=-O3 FFLAGS=-O2 --with-libs="-framework vecLib" --disable-default-packages --enable-epetra --enable-epetraext --enable-aztecoo --enable-pytrilinos --enable-ml --enable-ifpack --enable-amesos --enable-galeri --disable-examples --disable-tests --with-gnumake make sudo make install export DYLD_LIBRARY_PATH=${TRILINOS}/MACOSX_MPI/lib export PYTHONPATH=${TRILINOS}/MACOSX_MPI/lib/python2.6/site-packages:${PYTHONPATH} }}} The descriptions in the PyTrilinos documentation for `DYLD_LIBRARY_PATH` and `PYTHONPATH` are, at best, inconsistent.