You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Current »

Get your compilers ready

  • Install XCode from Apple App Store
  • Install command-line tools through XCode (see Preferences menu, note that the command-line tools are shipped with recent versions of XCode automatically)
  • Install gfortran for Mac OS X from https://gcc.gnu.org/wiki/GFortranBinaries#MacOS

Get the XBeach dependencies ready

  • Install MacPorts from http://www.macports.org/install.php
  • Install packages using MacPorts
    • Go to Terminal
    • Run "sudo port install subversion autoconf automake libtool pkg-config netcdf netcdf-fortran"

    • Give your password if requested

      Why so many packages?

      You'll need subversion to download the XBeach source code, although you could download the source code as a ZIP file from the http://xbeach.org website. But that is not cool. Then you need autoconf, automake, libtool and pkg-config to prepare the compilation for your system. In theory you can do without it, but nobody knows how. Finally you'll need the netcdf and netcdf-fortran packages to be able to compile XBeach with the self-explanatory netCDF output format rather than the default Fortran binary output. This is optional, but advisable for most applications.

  • Install the mako Python package using easy_install (or pip)
    • Go to Terminal
    • Run "sudo easy_install mako"

      Python packages? I though XBeach was written in Fortran

      XBeach is written in Fortran. But a lot of code is repetitive in XBeach, for example the handling of all input parameters and output variables. Since this is hard to maintain and tedious to code we use a Python preprocessor that writes this repetitive code for us based on templates. These templates depend on the mako package, which you need to install. Python is shipped with all Mac OS X and UNIX distributions and even with the latest Windows versions, so it should be available to you.

Get the source code

  • Register at http://xbeach.org (upper-right corner)
  • Create a directory to store the XBeach source code
  • Download XBeach using subversion

Compile the source code

  • Compile XBeach
    • Go to Terminal
    • Navigate to the "trunk" subdirectory using "cd trunk"
    • Run “./autogen.sh”
    • Run "./configure --with-netcdf"
    • Run "make"

      What did I just bake?

      You baked a netCDF-compatible XBeach executable. You can skip the "--with-netcdf" option to get a ordinary XBeach executable. Make sure to run "make clean" first if you change your configuration options. In addition, you could add the option "--with-mpi" to obtain a parallel version of XBeach. This would require you to install the mpich libraries using "sudo port install mpich".

  • The XBeach executable will be in the "dist" or "src/xbeach" subdirectory
  • No labels