Skip to content

Instantly share code, notes, and snippets.

@davydden
Forked from dpo/swig208.rb
Last active August 29, 2015 14:08
Show Gist options
  • Save davydden/3d35ae3e9ae19c12f857 to your computer and use it in GitHub Desktop.
Save davydden/3d35ae3e9ae19c12f857 to your computer and use it in GitHub Desktop.
require 'formula'
class Trilinos < Formula
homepage 'http://trilinos.sandia.gov'
url 'http://trilinos.sandia.gov/download/files/trilinos-11.8.1-Source.tar.bz2'
sha1 '867267699f56d70ffeda559f689f5cd43ab0d5f3'
head 'https://software.sandia.gov/trilinos/repositories/publicTrilinos', :using => :git
option "with-teko", "Enable 'Teko' secondary-stable package"
option "with-shylu", "Enable 'ShyLU' experimental package"
option "without-check", "Skip build time checks (not recommended)"
depends_on 'cmake' => :build
depends_on 'boost' => :optional
depends_on 'scotch' => :optional # Build fails with Scotch.
depends_on 'netcdf' => :optional
depends_on 'adol-c' => :optional
depends_on 'suite-sparse' => :optional
depends_on 'cppunit' => :optional
depends_on 'eigen' => :optional
depends_on 'glpk' => :optional
depends_on 'hdf5' => :optional
depends_on 'hwloc' => :optional
depends_on 'metis' => :optional
depends_on 'mumps' => :optional
depends_on 'petsc' => :optional
depends_on 'parmetis' => :optional
depends_on 'scalapack' => :optional
depends_on 'tbb' => :optional
depends_on :mpi => [:cc, :cxx, :recommended]
depends_on :fortran => :recommended
depends_on :x11 => :recommended
depends_on :python => :optional
depends_on 'swig208' if build.with? :python
def install
args = std_cmake_args
args += %W[-DBUILD_SHARED_LIBS=ON
-DTPL_ENABLE_BLAS=ON
-DTPL_ENABLE_LAPACK=ON
-DTPL_ENABLE_Zlib:BOOL=ON
-DTrilinos_ENABLE_ALL_PACKAGES=ON
-DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES=ON
-DTrilinos_ENABLE_TESTS:BOOL=ON
-DTrilinos_ENABLE_EXAMPLES:BOOL=ON
-DTrilinos_VERBOSE_CONFIGURE:BOOL=OFF
-DZoltan_ENABLE_ULLONG_IDS:Bool=ON]
args << "-DTPL_ENABLE_MPI:BOOL=ON" if build.with? :mpi
args << "-DTrilinos_ENABLE_OpenMP:BOOL=ON" unless ENV.compiler == :clang
# Extra non-default packages
args << "-DTrilinos_ENABLE_ShyLU:BOOL=ON" if build.with? "shylu"
args << "-DTrilinos_ENABLE_Teko:BOOL=ON" if build.with? "teko"
# Third-party libraries
args << "-DTPL_ENABLE_Boost:BOOL=ON" if build.with? "boost"
args << "-DTPL_ENABLE_Scotch:BOOL=ON" if build.with? "scotch"
args << "-DTPL_ENABLE_Netcdf:BOOL=ON" if build.with? "netcdf"
args << "-DTPL_ENABLE_ADOLC:BOOL=ON" if build.with? "adol-c"
args << "-DTPL_ENABLE_CSPARSE:BOOL=ON" if build.with? "suite-sparse"
args << "-DTPL_ENABLE_CHOLMOD:BOOL=ON" if build.with? "suite-sparse"
args << "-DTPL_ENABLE_UMFPACK:BOOL=ON" if build.with? "suite-sparse"
args << "-DTPL_ENABLE_CppUnit:BOOL=ON" if build.with? "cppunit"
args << "-DTPL_ENABLE_Eigen:BOOL=ON" if build.with? "eigen"
args << "-DTPL_ENABLE_GLPK:BOOL=ON" if build.with? "glpk"
args << "-DTPL_ENABLE_HDF5:BOOL=ON" if build.with? "hdf5"
args << "-DTPL_ENABLE_HWLOC:BOOL=ON" if build.with? "hwloc"
args << "-DTPL_ENABLE_METIS:BOOL=ON" if build.with? "metis"
args << "-DTPL_ENABLE_MUMPS:BOOL=ON" if build.with? "mumps"
args << "-DTPL_ENABLE_PETSC:BOOL=ON" if build.with? "petsc"
args << "-DTPL_ENABLE_PARMETIS:BOOL=ON" if build.with? "parmetis"
args << "-DTPL_ENABLE_SCALAPACK:BOOL=ON" if build.with? "scalapack"
args << "-DTPL_ENABLE_TBB:BOOL=ON" if build.with? "tbb"
args << "-DTPL_ENABLE_X11:BOOL=ON" if build.with? "x11"
args << "-DTrilinos_ENABLE_FORTRAN=OFF" if build.without? :fortran
args << "-DTrilinos_ENABLE_PyTrilinos:BOOL=ON" if build.with? :python
args << "-DPyTrilinos_INSTALL_PREFIX:PATH=#{prefix}" if build.with? :python
mkdir "build" do
system "cmake", "..", *args
system "make"
system "ctest" if build.with? "check"
system "make install"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment