Skip to content

Instantly share code, notes, and snippets.

@davydden
Forked from dpo/swig208.rb
Last active August 29, 2015 14:08

Revisions

  1. davydden revised this gist Nov 9, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion trilinos.rb
    Original file line number Diff line number Diff line change
    @@ -54,7 +54,7 @@ def install
    -DTrilinos_ENABLE_ALL_PACKAGES=ON
    -DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES=ON
    -DTrilinos_ENABLE_TESTS:BOOL=ON
    -DTrilinos_ENABLE_EXAMPLES:BOOL=ON
    -DTrilinos_ENABLE_EXAMPLES:BOOL=OFF
    -DTrilinos_VERBOSE_CONFIGURE:BOOL=OFF
    -DTrilinos_WARNINGS_AS_ERRORS_FLAGS=\"\"
    -DCMAKE_INSTALL_PREFIX=#{prefix}
  2. davydden revised this gist Nov 9, 2014. 1 changed file with 21 additions and 9 deletions.
    30 changes: 21 additions & 9 deletions trilinos.rb
    Original file line number Diff line number Diff line change
    @@ -9,7 +9,6 @@ class Trilinos < Formula
    option "with-teko", "Enable the Teko secondary-stable package"
    option "with-shylu", "Enable the ShyLU experimental package"
    option "without-check", "Skip build time checks (not recommended)"
    option "with-release", "Compile in Release mode"
    option :cxx11

    depends_on "cmake" => :build
    @@ -42,6 +41,9 @@ class Trilinos < Formula
    def onoff(s, cond)
    s + ((cond) ? "ON" : "OFF")
    end

    # Fix Sacado tests.
    patch :DATA

    def install

    @@ -54,13 +56,10 @@ def install
    -DTrilinos_ENABLE_TESTS:BOOL=ON
    -DTrilinos_ENABLE_EXAMPLES:BOOL=ON
    -DTrilinos_VERBOSE_CONFIGURE:BOOL=OFF
    -DTrilinos_WARNINGS_AS_ERRORS_FLAGS=""]
    if build.with? 'release'
    args << "-DCMAKE_INSTALL_PREFIX=#{prefix}" << "-DCMAKE_BUILD_TYPE=Release"
    else
    args << std_cmake_args
    end

    -DTrilinos_WARNINGS_AS_ERRORS_FLAGS=\"\"
    -DCMAKE_INSTALL_PREFIX=#{prefix}
    -DCMAKE_BUILD_TYPE=Release
    ]
    args << onoff("-DTPL_ENABLE_MPI:BOOL=", (build.with? :mpi))
    args << onoff("-DTrilinos_ENABLE_OpenMP:BOOL=", (ENV.compiler != :clang))
    args << onoff("-DTrilinos_ENABLE_CXX11:BOOL=", (build.cxx11?))
    @@ -102,7 +101,6 @@ def install

    mkdir "build" do
    system "cmake", "..", *args
    #system "false"
    system "make", "VERBOSE=1"
    system "ctest" if build.with? "check"
    system "make install"
    @@ -122,3 +120,17 @@ def install
    # system "#{bin}/Tpetra_GEMMTiming_TPI.exe" # Fails!!
    end
    end

    __END__
    diff --git a/packages/sacado/src/Sacado_MathFunctions.hpp b/packages/sacado/src/Sacado_MathFunctions.hpp
    index 37901d4..7853b5f 100644
    --- a/packages/sacado/src/Sacado_MathFunctions.hpp
    +++ b/packages/sacado/src/Sacado_MathFunctions.hpp
    @@ -30,6 +30,7 @@
    #ifndef SACADO_MATHFUNCTIONS_HPP
    #define SACADO_MATHFUNCTIONS_HPP

    +#include <cmath>
    #include "Sacado_ConfigDefs.h"

    #define UNARYFUNC_MACRO(OP,FADOP) \
  3. davydden revised this gist Nov 5, 2014. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions trilinos.rb
    Original file line number Diff line number Diff line change
    @@ -2,8 +2,8 @@

    class Trilinos < Formula
    homepage 'http://trilinos.sandia.gov'
    url 'http://trilinos.org/oldsite/download/files/trilinos-11.12.1-Source.tar.gz'
    sha1 '84cd7f4fba7946e3d391f03d52902954bb4dcd60'
    url 'http://trilinos.sandia.gov/download/files/trilinos-11.10.2-Source.tar.gz'
    sha1 'f7442cef35c4dea4f3535e0859deda88f68e72fc'
    head 'https://software.sandia.gov/trilinos/repositories/publicTrilinos', :using => :git

    option "with-teko", "Enable the Teko secondary-stable package"
    @@ -54,7 +54,7 @@ def install
    -DTrilinos_ENABLE_TESTS:BOOL=ON
    -DTrilinos_ENABLE_EXAMPLES:BOOL=ON
    -DTrilinos_VERBOSE_CONFIGURE:BOOL=OFF
    -DZoltan_ENABLE_ULLONG_IDS:Bool=ON]
    -DTrilinos_WARNINGS_AS_ERRORS_FLAGS=""]
    if build.with? 'release'
    args << "-DCMAKE_INSTALL_PREFIX=#{prefix}" << "-DCMAKE_BUILD_TYPE=Release"
    else
    @@ -95,7 +95,7 @@ def install
    args << onoff("-DTPL_ENABLE_TBB:BOOL=", (build.with? "tbb"))
    args << onoff("-DTPL_ENABLE_X11:BOOL=", (build.with? :x11))

    args << onoff("-DTrilinos_ENABLE_FORTRAN=", (build.with? :fortran))
    args << onoff("-DTrilinos_ENABLE_Fortran=", (build.with? :fortran))

    args << onoff("-DTrilinos_ENABLE_PyTrilinos:BOOL=", (build.with? :python))
    args << "-DPyTrilinos_INSTALL_PREFIX:PATH=#{prefix}" if build.with? :python
  4. davydden revised this gist Oct 28, 2014. 1 changed file with 18 additions and 13 deletions.
    31 changes: 18 additions & 13 deletions trilinos.rb
    Original file line number Diff line number Diff line change
    @@ -2,13 +2,14 @@

    class Trilinos < Formula
    homepage 'http://trilinos.sandia.gov'
    url 'http://trilinos.sandia.gov/download/files/trilinos-11.8.1-Source.tar.bz2'
    sha1 '867267699f56d70ffeda559f689f5cd43ab0d5f3'
    url 'http://trilinos.org/oldsite/download/files/trilinos-11.12.1-Source.tar.gz'
    sha1 '84cd7f4fba7946e3d391f03d52902954bb4dcd60'
    head 'https://software.sandia.gov/trilinos/repositories/publicTrilinos', :using => :git

    option "with-teko", "Enable the Teko secondary-stable package"
    option "with-shylu", "Enable the ShyLU experimental package"
    option "without-check", "Skip build time checks (not recommended)"
    option "with-release", "Compile in Release mode"
    option :cxx11

    depends_on "cmake" => :build
    @@ -44,17 +45,21 @@ def onoff(s, cond)

    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 = %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]
    if build.with? 'release'
    args << "-DCMAKE_INSTALL_PREFIX=#{prefix}" << "-DCMAKE_BUILD_TYPE=Release"
    else
    args << std_cmake_args
    end

    args << onoff("-DTPL_ENABLE_MPI:BOOL=", (build.with? :mpi))
    args << onoff("-DTrilinos_ENABLE_OpenMP:BOOL=", (ENV.compiler != :clang))
  5. @dpo dpo revised this gist Jul 7, 2014. 1 changed file with 74 additions and 47 deletions.
    121 changes: 74 additions & 47 deletions trilinos.rb
    Original file line number Diff line number Diff line change
    @@ -6,34 +6,41 @@ class Trilinos < Formula
    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 "with-teko", "Enable the Teko secondary-stable package"
    option "with-shylu", "Enable the ShyLU experimental package"
    option "without-check", "Skip build time checks (not recommended)"
    option :cxx11

    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 "cmake" => :build
    depends_on "boost" => :recommended
    depends_on "scotch" => :optional # Build fails with Scotch.
    depends_on "netcdf" => :optional
    depends_on "adol-c" => :optional
    depends_on "suite-sparse" => :recommended
    depends_on "cppunit" => :optional
    depends_on "eigen" => :optional
    depends_on "glpk" => :optional
    depends_on "hdf5" => :optional
    depends_on "hwloc" => :optional
    depends_on "hypre" => :optional
    depends_on "metis" => :optional
    depends_on "mumps" => :optional
    depends_on "petsc" => :optional
    depends_on "parmetis" => :optional
    depends_on "scalapack" => :optional
    depends_on "superlu" => :optional
    depends_on "tbb" => :recommended

    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
    depends_on :python => :recommended
    depends_on "swig208" if build.with? :python

    def onoff(s, cond)
    s + ((cond) ? "ON" : "OFF")
    end

    def install

    @@ -49,44 +56,64 @@ def install
    -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
    args << onoff("-DTPL_ENABLE_MPI:BOOL=", (build.with? :mpi))
    args << onoff("-DTrilinos_ENABLE_OpenMP:BOOL=", (ENV.compiler != :clang))
    args << onoff("-DTrilinos_ENABLE_CXX11:BOOL=", (build.cxx11?))

    # Extra non-default packages
    args << "-DTrilinos_ENABLE_ShyLU:BOOL=ON" if build.with? "shylu"
    args << "-DTrilinos_ENABLE_Teko:BOOL=ON" if build.with? "teko"
    args << onoff("-DTrilinos_ENABLE_ShyLU:BOOL=", (build.with? "shylu"))
    args << onoff("-DTrilinos_ENABLE_Teko:BOOL=", (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 << onoff("-DTPL_ENABLE_Boost:BOOL=", (build.with? "boost"))
    args << onoff("-DTPL_ENABLE_Scotch:BOOL=", (build.with? "scotch"))
    args << onoff("-DTPL_ENABLE_Netcdf:BOOL=", (build.with? "netcdf"))
    args << onoff("-DTPL_ENABLE_ADOLC:BOOL=", (build.with? "adol-c"))
    args << onoff("-DTPL_ENABLE_AMD:BOOL=", (build.with? "suite-sparse"))
    args << onoff("-DTPL_ENABLE_CSPARSE:BOOL=", (build.with? "suite-sparse"))
    args << onoff("-DTPL_ENABLE_CHOLMOD:BOOL=", (build.with? "suite-sparse"))
    args << onoff("-DTPL_ENABLE_UMFPACK:BOOL=", (build.with? "suite-sparse"))
    args << "-DUMFPACK_LIBRARY_NAMES=umfpack;amd;colamd;cholmod;suitesparseconfig" if build.with? "suite-sparse"
    args << onoff("-DTPL_ENABLE_CppUnit:BOOL=", (build.with? "cppunit"))
    args << onoff("-DTPL_ENABLE_Eigen:BOOL=", (build.with? "eigen"))
    args << "-DEigen_INCLUDE_DIRS=#{Formula['eigen'].include}/eigen3" if build.with? "eigen"
    args << onoff("-DTPL_ENABLE_GLPK:BOOL=", (build.with? "glpk"))
    args << onoff("-DTPL_ENABLE_HDF5:BOOL=", (build.with? "hdf5"))
    args << onoff("-DTPL_ENABLE_HWLOC:BOOL=", (build.with? "hwloc"))
    args << onoff("-DTPL_ENABLE_HYPRE:BOOL=", (build.with? "hypre"))
    args << onoff("-DTPL_ENABLE_METIS:BOOL=", (build.with? "metis"))
    args << onoff("-DTPL_ENABLE_MUMPS:BOOL=", (build.with? "mumps"))
    args << onoff("-DTPL_ENABLE_PETSC:BOOL=", (build.with? "petsc"))
    args << onoff("-DTPL_ENABLE_PARMETIS:BOOL=", (build.with? "parmetis"))
    args << onoff("-DTPL_ENABLE_SCALAPACK:BOOL=", (build.with? "scalapack"))
    args << onoff("-DTPL_ENABLE_SuperLU:BOOL=", (build.with? "superlu"))
    args << onoff("-DTPL_ENABLE_TBB:BOOL=", (build.with? "tbb"))
    args << onoff("-DTPL_ENABLE_X11:BOOL=", (build.with? :x11))

    args << "-DTrilinos_ENABLE_FORTRAN=OFF" if build.without? :fortran
    args << onoff("-DTrilinos_ENABLE_FORTRAN=", (build.with? :fortran))

    args << "-DTrilinos_ENABLE_PyTrilinos:BOOL=ON" if build.with? :python
    args << onoff("-DTrilinos_ENABLE_PyTrilinos:BOOL=", (build.with? :python))
    args << "-DPyTrilinos_INSTALL_PREFIX:PATH=#{prefix}" if build.with? :python

    mkdir "build" do
    system "cmake", "..", *args
    system "make"
    #system "false"
    system "make", "VERBOSE=1"
    system "ctest" if build.with? "check"
    system "make install"
    end
    end

    test do
    system "#{bin}/Epetra_BasicPerfTest_test.exe 16 12 1 1 25 -v"
    system "mpirun -np 2 #{bin}/Epetra_BasicPerfTest_test.exe 10 12 1 2 9 -v" if build.with? :mpi
    system "#{bin}/Epetra_BasicPerfTest_test_LL.exe 16 12 1 1 25 -v"
    system "mpirun -np 2 #{bin}/Epetra_BasicPerfTest_test_LL.exe 10 12 1 2 9 -v" if build.with? :mpi
    # system "#{bin}/Ifpack2_BelosTpetraHybridPlatformExample.exe" # Missing library!!
    system "#{bin}/KokkosClassic_SerialNodeTestAndTiming.exe"
    system "#{bin}/KokkosClassic_TPINodeTestAndTiming.exe"
    system "#{bin}/KokkosClassic_TBBNodeTestAndTiming.exe" if build.with? "tbb"
    system "#{bin}/Tpetra_GEMMTiming_TBB.exe" if build.with? "tbb"
    # system "#{bin}/Tpetra_GEMMTiming_TPI.exe" # Fails!!
    end
    end
  6. @dpo dpo revised this gist Jun 19, 2014. 1 changed file with 7 additions and 7 deletions.
    14 changes: 7 additions & 7 deletions trilinos.rb
    Original file line number Diff line number Diff line change
    @@ -2,8 +2,8 @@

    class Trilinos < Formula
    homepage 'http://trilinos.sandia.gov'
    url 'http://trilinos.sandia.gov/download/files/trilinos-11.6.1-Source.tar.bz2'
    sha1 '48713572d6b0972ec7b404c11afe9718c6f493cb'
    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"
    @@ -28,9 +28,9 @@ class Trilinos < Formula
    depends_on 'scalapack' => :optional
    depends_on 'tbb' => :optional

    depends_on :mpi => [:cc, :cxx]
    depends_on :mpi => [:cc, :cxx, :recommended]
    depends_on :fortran => :recommended
    depends_on :x11 => MacOS::X11.installed? ? :recommended : :optional
    depends_on :x11 => :recommended

    depends_on :python => :optional
    depends_on 'swig208' if build.with? :python
    @@ -39,7 +39,6 @@ def install

    args = std_cmake_args
    args += %W[-DBUILD_SHARED_LIBS=ON
    -DTPL_ENABLE_MPI:BOOL=ON
    -DTPL_ENABLE_BLAS=ON
    -DTPL_ENABLE_LAPACK=ON
    -DTPL_ENABLE_Zlib:BOOL=ON
    @@ -50,11 +49,12 @@ def install
    -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"
    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"
  7. @dpo dpo created this gist May 14, 2014.
    92 changes: 92 additions & 0 deletions trilinos.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,92 @@
    require 'formula'

    class Trilinos < Formula
    homepage 'http://trilinos.sandia.gov'
    url 'http://trilinos.sandia.gov/download/files/trilinos-11.6.1-Source.tar.bz2'
    sha1 '48713572d6b0972ec7b404c11afe9718c6f493cb'
    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]
    depends_on :fortran => :recommended
    depends_on :x11 => MacOS::X11.installed? ? :recommended : :optional

    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_MPI:BOOL=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 << "-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