-
-
Save davydden/3d35ae3e9ae19c12f857 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'formula' | |
class Trilinos < Formula | |
homepage 'http://trilinos.sandia.gov' | |
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 | |
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 => :recommended | |
depends_on "swig208" if build.with? :python | |
def onoff(s, cond) | |
s + ((cond) ? "ON" : "OFF") | |
end | |
def install | |
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)) | |
args << onoff("-DTrilinos_ENABLE_CXX11:BOOL=", (build.cxx11?)) | |
# Extra non-default packages | |
args << onoff("-DTrilinos_ENABLE_ShyLU:BOOL=", (build.with? "shylu")) | |
args << onoff("-DTrilinos_ENABLE_Teko:BOOL=", (build.with? "teko")) | |
# Third-party libraries | |
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 << 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 | |
mkdir "build" do | |
system "cmake", "..", *args | |
#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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment