Difference between revisions of "ConfiguringMacOSX"

From Einstein Toolkit Documentation
Jump to: navigation, search
(Step 9: Install a good compiler)
(Step 8: Install Visit Carpet plugin)
 
(8 intermediate revisions by 2 users not shown)
Line 5: Line 5:
 
== Step 1: Install Xcode ==
 
== Step 1: Install Xcode ==
  
Download and install the latest version of Xcode from Apple. The version"Xcode for Mac-only Development" is sufficient.
+
Download and install the latest version of [http://developer.apple.com/technology/xcode.html Xcode] from Apple. The version"Xcode for Mac-only Development" is sufficient.
  
 
== Step 2: Install MacPorts ==
 
== Step 2: Install MacPorts ==
  
MacPorts allows you to install extra libraries and tools not included with OS X. Download and install the version for your version of OS X.
+
[http://www.macports.org/ MacPorts] allows you to install extra libraries and tools not included with OS X. [http://www.macports.org/install.php Download] and install the version for your version of OS X.
  
 
== Step 3: Install git ==
 
== Step 3: Install git ==
Line 20: Line 20:
 
  sudo port install gcc45
 
  sudo port install gcc45
  
== Step 10: Configure Cactus ==
+
== Step 5: Configure Cactus ==
  
 
In order for Cactus to find all of the installed libraries, make sure the your optionlist looks like the following (this is based off the version included in simfactory):
 
In order for Cactus to find all of the installed libraries, make sure the your optionlist looks like the following (this is based off the version included in simfactory):
Line 28: Line 28:
 
  # Whenever this version string changes, the application is configured
 
  # Whenever this version string changes, the application is configured
 
  # and rebuilt from scratch
 
  # and rebuilt from scratch
  VERSION = 2009-11-25
+
  VERSION = 2010-09-23
 
   
 
   
 
  CPP = cpp
 
  CPP = cpp
 
  FPP = cpp
 
  FPP = cpp
  CC  = gcc
+
  CC  = gcc-mp-4.5
  CXX = g++
+
  CXX = g++-mp-4.5
  F77 = gfortran-mp-4.3
+
  F77 = gfortran-mp-4.5
  F90 = gfortran-mp-4.3
+
  F90 = gfortran-mp-4.5
 
   
 
   
# -fmudflapth does not work with current gcc 4.2.0
 
# -march=prescott and -march=core2 lead to an ICE
 
# -march=native prevents undefined references to ___sync_fetch_and_add_4
 
# -malign-double may lead to crashes in Fortran I/O
 
 
  CPPFLAGS = -DMPICH_IGNORE_CXX_SEEK
 
  CPPFLAGS = -DMPICH_IGNORE_CXX_SEEK
 
  FPPFLAGS = -traditional
 
  FPPFLAGS = -traditional
 
  CFLAGS  = -g3 -fshow-column -mmacosx-version-min=10.5 -m128bit-long-double -std=gnu99
 
  CFLAGS  = -g3 -fshow-column -mmacosx-version-min=10.5 -m128bit-long-double -std=gnu99
  CXXFLAGS = -g3 -fshow-column -mmacosx-version-min=10.5 -m128bit-long-double -I/opt/local/include
+
  CXXFLAGS = -g3 -fshow-column -mmacosx-version-min=10.5 -m128bit-long-double -std=gnu++0x
 
  F77FLAGS = -g3 -fshow-column -mmacosx-version-min=10.5 -m128bit-long-double -fcray-pointer
 
  F77FLAGS = -g3 -fshow-column -mmacosx-version-min=10.5 -m128bit-long-double -fcray-pointer
 
  F90FLAGS = -g3 -fshow-column -mmacosx-version-min=10.5 -m128bit-long-double -fcray-pointer
 
  F90FLAGS = -g3 -fshow-column -mmacosx-version-min=10.5 -m128bit-long-double -fcray-pointer
 
   
 
   
  LDFLAGS = /System/Library/Frameworks/vecLib.framework/vecLib -L/opt/local/lib/gcc43 -lgfortran
+
  LDFLAGS = /System/Library/Frameworks/vecLib.framework/vecLib -L/opt/local/lib/gcc45 -lgfortran
 
   
 
   
 
  C_LINE_DIRECTIVES = yes
 
  C_LINE_DIRECTIVES = yes
Line 63: Line 59:
 
  F90_DEBUG_FLAGS = -fbounds-check -ftrapv -fstack-protector-all
 
  F90_DEBUG_FLAGS = -fbounds-check -ftrapv -fstack-protector-all
 
   
 
   
# Changing ANSI C semantics:
 
# -funsafe-loop-optimizations -ffast-math-errno -fassociative-math
 
# Graphite optimisations are not implemented:
 
# -floop-interchange -floop-strip-mine -floop-block
 
 
  OPTIMISE          = yes
 
  OPTIMISE          = yes
  CPP_OPTIMISE_FLAGS = # -DCARPET_OPTIMISE -DNDEBUG
+
  CPP_OPTIMISE_FLAGS =
  FPP_OPTIMISE_FLAGS = # -DCARPET_OPTIMISE -DNDEBUG
+
  FPP_OPTIMISE_FLAGS =  
 
  C_OPTIMISE_FLAGS  = -O2
 
  C_OPTIMISE_FLAGS  = -O2
 
  CXX_OPTIMISE_FLAGS = -O2
 
  CXX_OPTIMISE_FLAGS = -O2
Line 83: Line 75:
 
  F90_PROFILE_FLAGS = -pg
 
  F90_PROFILE_FLAGS = -pg
 
   
 
   
  # -Wuninitialized is not supported without -O
+
  OPENMP          = yes
  WARN          = no
+
CPP_OPENMP_FLAGS = -fopenmp
  #CPP_WARN_FLAGS = -Wall
+
FPP_OPENMP_FLAGS = -fopenmp
  #FPP_WARN_FLAGS = -Wall
+
C_OPENMP_FLAGS  = -fopenmp
  #C_WARN_FLAGS  = -Wall
+
CXX_OPENMP_FLAGS = -fopenmp
  #CXX_WARN_FLAGS = -Wall
+
F77_OPENMP_FLAGS = -fopenmp
  #F77_WARN_FLAGS = -Wall
+
F90_OPENMP_FLAGS = -fopenmp
  #F90_WARN_FLAGS = -Wall
+
 +
  WARN          = yes
 +
  CPP_WARN_FLAGS = -Wall
 +
  FPP_WARN_FLAGS = -Wall
 +
  C_WARN_FLAGS  = -Wall
 +
  CXX_WARN_FLAGS = -Wall
 +
  F77_WARN_FLAGS = -Wall
 +
  F90_WARN_FLAGS = -Wall
 
   
 
   
 
   
 
   
Line 97: Line 96:
 
  BLAS_LIBS = gfortran
 
  BLAS_LIBS = gfortran
 
   
 
   
FFTW_DIR  = /opt/local
 
FFTW_LIBS = drfftw dfftw m
 
 
#CURL_DIR = /opt/local
 
 
#FLICKCURL_DIR = /Users/eschnett/flickcurl-1.10
 
 
GSL    = yes
 
GSL_DIR = /opt/local
 
 
HDF5      = yes
 
HDF5_DIR  = /opt/local
 
LIBSZ_DIR = /opt/local
 
 
LAPACK      = yes
 
 
  LAPACK_DIR  = /System/Library/Frameworks/vecLib.framework
 
  LAPACK_DIR  = /System/Library/Frameworks/vecLib.framework
 
  LAPACK_LIBS =
 
  LAPACK_LIBS =
Line 117: Line 101:
 
  MPI              = OpenMPI
 
  MPI              = OpenMPI
 
  MPI_LIBS        = mpi
 
  MPI_LIBS        = mpi
#OPENMPI_DIR      = /opt/local/lib/openmpi
 
#OPENMPI_INC_DIR  = /opt/local/include
 
#OPENMPI_LIB_DIR  = /opt/local/lib
 
 
OPENMP          = yes
 
CPP_OPENMP_FLAGS = -fopenmp
 
FPP_OPENMP_FLAGS = -fopenmp
 
C_OPENMP_FLAGS  = -fopenmp
 
CXX_OPENMP_FLAGS = -fopenmp
 
F77_OPENMP_FLAGS = -fopenmp
 
F90_OPENMP_FLAGS = -fopenmp
 
 
#PETSC          = yes
 
#PETSC_DIR      = /opt/local/lib/petsc
 
#PETSC_ARCH      = macx
 
#PETSC_ARCH_LIBS = X11  mpich  gfortran  dl  pthread
 
 
   
 
   
 
  PTHREADS = yes
 
  PTHREADS = yes
 
SSL_DIR = /opt/local
 
 
   
 
   
 
  X_LIB_DIR = /usr/X11R6/lib
 
  X_LIB_DIR = /usr/X11R6/lib
  
== Step 4: Install gnuplot ==
+
 
 +
 
 +
Congratulations, you can now build and run Cactus. To visualise output and to access other machines, continue.
 +
 
 +
== Step 6: Install gnuplot ==
  
 
gnuplot can be easily installed using MacPorts:
 
gnuplot can be easily installed using MacPorts:
 
  sudo port install gnuplot
 
  sudo port install gnuplot
  
== Step 5: Install Visit ==
+
== Step 7: Install Visit ==
  
Visit is used for visualizing the 3D data produced in simulations. Download the "Mac OS X - Intel" executable and "Visit install script" from here. Make the install script executable:
+
Visit is used for visualizing the 3D data produced in simulations. Download the "Mac OS X - Intel" executable and "Visit install script" from [https://wci.llnl.gov/codes/visit/executables.html here]. Make the install script executable:
 
  chmod +x visit-install
 
  chmod +x visit-install
 
then execute it to install visit
 
then execute it to install visit
Line 154: Line 124:
 
where 1.12.1 is the version of Visit you downloaded. Add /usr/local/visit/bin to your $PATH so that you can run Visit by just typing visit on the command line.
 
where 1.12.1 is the version of Visit you downloaded. Add /usr/local/visit/bin to your $PATH so that you can run Visit by just typing visit on the command line.
  
== Step 6: Install Visit Carpet plugin ==
+
== Step 8: Install Visit Carpet plugin ==
  
To effectively read the data output by Carpet, Visit requires a plugin. The source code for the plugin may be checked out from the Cactus CVS repository (using password 'anon'):
+
To effectively read the data output by Carpet, Visit requires a plugin. The source code for the plugin may be checked out from the Cactus SVN repository
  cvs -d :pserver:cvs_anon@cvs.cactuscode.org:/cactus login
+
  svn co http://svn.cactuscode.org/VizTools/CarpetHDF5/trunk/
cvs -d :pserver:cvs_anon@cvs.cactuscode.org:/cactus checkout VizTools/visitCarpetHDF5
 
  
 
The plugin requires the HDF5 library, but cannot use the previously installed version for two reasons:
 
The plugin requires the HDF5 library, but cannot use the previously installed version for two reasons:
Line 167: Line 136:
 
For this reason, it is best to compile a usable version of HDF5 by hand:
 
For this reason, it is best to compile a usable version of HDF5 by hand:
  
* Download the source for HDF5 1.8.1 into VizTools/visitCarpetHDF5.
+
* Download the source for [http://www.hdfgroup.org/ftp/HDF5/prev-releases/hdf5-1.8.1/src/hdf5-1.8.1.tar.gz HDF5 1.8.1] into VizTools/visitCarpetHDF5.
 
* Extract the source
 
* Extract the source
  cd VizTools/visitCarpetHDF5
+
  cd CarpetHDF5
 
  tar zxvf hdf5-1.8.1.tar.gz
 
  tar zxvf hdf5-1.8.1.tar.gz
  
Line 184: Line 153:
 
In the window that appears, select the Makefile tab. Ensure the CXXFLAGS includes -I./hdf5-1.8.1/hdf5/include -arch i386 and the LDFLAGS include -L./hdf5-1.8.1/hdf5/lib -arch i386, then save and quit. The plugin should now compile and install a location where it can be found by Visit.
 
In the window that appears, select the Makefile tab. Ensure the CXXFLAGS includes -I./hdf5-1.8.1/hdf5/include -arch i386 and the LDFLAGS include -L./hdf5-1.8.1/hdf5/lib -arch i386, then save and quit. The plugin should now compile and install a location where it can be found by Visit.
  
== Step 11: Install Globus Tools (gsissh, GridFTP, myproxy, etc.) ==
+
== Step 9: Install Globus Tools (gsissh, GridFTP, myproxy, etc.) ==
  
 
In order to access any of the TeraGrid machines (eg. Kraken), you will need to first install the Global Tools. These must currently be compiled from source as follows:
 
In order to access any of the TeraGrid machines (eg. Kraken), you will need to first install the Global Tools. These must currently be compiled from source as follows:
  
* Download the source package.
+
* Download the [http://www.globus.org/toolkit/downloads/5.0.0/#source source package].
 
* Extract the files:
 
* Extract the files:
  tar zxvf gt5.0.0-all-source-installer.tar.bz2
+
  tar xjvf gt5.0.0-all-source-installer.tar.bz2
 
* cd to the directory where you extract the files and build gsi-ssh, GridFTP, myproxy
 
* cd to the directory where you extract the files and build gsi-ssh, GridFTP, myproxy
 
  ./configure --prefix=/usr/local
 
  ./configure --prefix=/usr/local

Latest revision as of 09:13, 25 September 2010

Configuring Mac OS X for Cactus

This document explains how to set up a computer running Mac OS X for compiling and running Cactus simulations. These instructions specifically apply to OS X 10.6 (Snow Leopard). Other versions should be similar.

Step 1: Install Xcode

Download and install the latest version of Xcode from Apple. The version"Xcode for Mac-only Development" is sufficient.

Step 2: Install MacPorts

MacPorts allows you to install extra libraries and tools not included with OS X. Download and install the version for your version of OS X.

Step 3: Install git

git can be easily installed using MacPorts:

sudo port install git-core

Step 4: Install a good compiler

sudo port install gcc45

Step 5: Configure Cactus

In order for Cactus to find all of the installed libraries, make sure the your optionlist looks like the following (this is based off the version included in simfactory):

# macbook-gcc

# Whenever this version string changes, the application is configured
# and rebuilt from scratch
VERSION = 2010-09-23

CPP = cpp
FPP = cpp
CC  = gcc-mp-4.5
CXX = g++-mp-4.5
F77 = gfortran-mp-4.5
F90 = gfortran-mp-4.5

CPPFLAGS = -DMPICH_IGNORE_CXX_SEEK
FPPFLAGS = -traditional
CFLAGS   = -g3 -fshow-column -mmacosx-version-min=10.5 -m128bit-long-double -std=gnu99
CXXFLAGS = -g3 -fshow-column -mmacosx-version-min=10.5 -m128bit-long-double -std=gnu++0x
F77FLAGS = -g3 -fshow-column -mmacosx-version-min=10.5 -m128bit-long-double -fcray-pointer
F90FLAGS = -g3 -fshow-column -mmacosx-version-min=10.5 -m128bit-long-double -fcray-pointer

LDFLAGS = /System/Library/Frameworks/vecLib.framework/vecLib -L/opt/local/lib/gcc45 -lgfortran

C_LINE_DIRECTIVES = yes
F_LINE_DIRECTIVES = yes

REAL16_KIND = 10

DEBUG           = no
CPP_DEBUG_FLAGS = -DCARPET_DEBUG
FPP_DEBUG_FLAGS = -DCARPET_DEBUG
C_DEBUG_FLAGS   = -fbounds-check -ftrapv -fstack-protector-all
CXX_DEBUG_FLAGS = -fbounds-check -ftrapv -fstack-protector-all
F77_DEBUG_FLAGS = -fbounds-check -ftrapv -fstack-protector-all
F90_DEBUG_FLAGS = -fbounds-check -ftrapv -fstack-protector-all

OPTIMISE           = yes
CPP_OPTIMISE_FLAGS =
FPP_OPTIMISE_FLAGS = 
C_OPTIMISE_FLAGS   = -O2
CXX_OPTIMISE_FLAGS = -O2
F77_OPTIMISE_FLAGS = -O2
F90_OPTIMISE_FLAGS = -O2

PROFILE           = no
CPP_PROFILE_FLAGS =
FPP_PROFILE_FLAGS =
C_PROFILE_FLAGS   = -pg
CXX_PROFILE_FLAGS = -pg
F77_PROFILE_FLAGS = -pg
F90_PROFILE_FLAGS = -pg

OPENMP           = yes
CPP_OPENMP_FLAGS = -fopenmp
FPP_OPENMP_FLAGS = -fopenmp
C_OPENMP_FLAGS   = -fopenmp
CXX_OPENMP_FLAGS = -fopenmp
F77_OPENMP_FLAGS = -fopenmp
F90_OPENMP_FLAGS = -fopenmp

WARN           = yes
CPP_WARN_FLAGS = -Wall
FPP_WARN_FLAGS = -Wall
C_WARN_FLAGS   = -Wall
CXX_WARN_FLAGS = -Wall
F77_WARN_FLAGS = -Wall
F90_WARN_FLAGS = -Wall



BLAS_DIR  = /System/Library/Frameworks/vecLib.framework
BLAS_LIBS = gfortran

LAPACK_DIR  = /System/Library/Frameworks/vecLib.framework
LAPACK_LIBS =

MPI              = OpenMPI
MPI_LIBS         = mpi

PTHREADS = yes

X_LIB_DIR = /usr/X11R6/lib


Congratulations, you can now build and run Cactus. To visualise output and to access other machines, continue.

Step 6: Install gnuplot

gnuplot can be easily installed using MacPorts:

sudo port install gnuplot

Step 7: Install Visit

Visit is used for visualizing the 3D data produced in simulations. Download the "Mac OS X - Intel" executable and "Visit install script" from here. Make the install script executable:

chmod +x visit-install

then execute it to install visit

sudo ./visit-install 1.12.1 darwin-i386 /usr/local/visit

where 1.12.1 is the version of Visit you downloaded. Add /usr/local/visit/bin to your $PATH so that you can run Visit by just typing visit on the command line.

Step 8: Install Visit Carpet plugin

To effectively read the data output by Carpet, Visit requires a plugin. The source code for the plugin may be checked out from the Cactus SVN repository

svn co http://svn.cactuscode.org/VizTools/CarpetHDF5/trunk/

The plugin requires the HDF5 library, but cannot use the previously installed version for two reasons:

  • It must be the same version of the HDF5 library that is used by Visit. In the case of Visit version 1.12.x, HDF5 library version 1.8.1 is required.
  • The current version of Visit is compiled as 32-bit (i386). However, Snow Leopard compiles as 64-bit by default (x86_64).

For this reason, it is best to compile a usable version of HDF5 by hand:

  • Download the source for HDF5 1.8.1 into VizTools/visitCarpetHDF5.
  • Extract the source
cd CarpetHDF5
tar zxvf hdf5-1.8.1.tar.gz
  • Compile this version of HDF5:
cd hdf5-1.8.1
CFLAGS="-arch i386" CXXFLAGS="-arch i386" LDFLAGS="-arch i386" ./configure --host=i386 --enable-cxx --enable-production --enable-static
make
make install
cd ../

We can now compile the Visit plugin using this version of the hdf5 library. Before doing so, we need to make a small change to one of the files installed by Visit. Edit /usr/local/visit/1.12.1/darwin-i386/include/make-variables and remove the -Wno-long-double from the line starting with PY_CXXFLAGS. Now, compile and install the plugin:

./install

In the window that appears, select the Makefile tab. Ensure the CXXFLAGS includes -I./hdf5-1.8.1/hdf5/include -arch i386 and the LDFLAGS include -L./hdf5-1.8.1/hdf5/lib -arch i386, then save and quit. The plugin should now compile and install a location where it can be found by Visit.

Step 9: Install Globus Tools (gsissh, GridFTP, myproxy, etc.)

In order to access any of the TeraGrid machines (eg. Kraken), you will need to first install the Global Tools. These must currently be compiled from source as follows:

tar xjvf gt5.0.0-all-source-installer.tar.bz2
  • cd to the directory where you extract the files and build gsi-ssh, GridFTP, myproxy
./configure --prefix=/usr/local
sudo make gsi-myproxy gsi-openssh gridftp
sudo make install
  • Add the the following lines your ~/.bash_profile and then run source ~/.bash_profile:
export GLOBUS_LOCATION=/usr/local
export MYPROXY_SERVER=myproxy.teragrid.org
export MYPROXY_SERVER_PORT=7514
source $GLOBUS_LOCATION/etc/globus-user-env.sh