├── .github └── workflows │ ├── build-bottles.yml │ └── upload-bottles.yml ├── Aliases ├── brewsci-metis@5 └── brewsci-scotch@6 ├── Formula ├── brewsci-ceres-solver.rb ├── brewsci-metis.rb ├── brewsci-metis@4.rb ├── brewsci-mumps.rb ├── brewsci-parmetis.rb ├── brewsci-r.rb ├── brewsci-scotch.rb ├── brewsci-scotch@5.rb ├── brewsci-suite-sparse.rb ├── brewsci-superlu-dist.rb ├── brewsci-superlu-mt.rb ├── brewsci-superlu.rb ├── lancelot.rb ├── starpu.rb └── tetgen.rb ├── LICENSE └── README.md /.github/workflows/build-bottles.yml: -------------------------------------------------------------------------------- 1 | name: Build bottles 2 | 3 | on: pull_request 4 | 5 | env: 6 | HOMEBREW_NO_ANALYTICS: 1 7 | HOMEBREW_NO_AUTO_UPDATE: 1 8 | HOMEBREW_NO_INSTALL_CLEANUP: 1 9 | 10 | jobs: 11 | build-linux-bottles: 12 | runs-on: ubuntu-latest 13 | container: 14 | image: homebrew/ubuntu16.04:master 15 | steps: 16 | - name: Update Homebrew 17 | run: brew update-reset 18 | - uses: actions/checkout@master 19 | - name: Build bottles 20 | run: | 21 | mkdir -p "$(dirname $(brew --repo ${{github.repository}}))" 22 | cp -a "$GITHUB_WORKSPACE" "$(brew --repo ${{github.repository}})" 23 | mkdir ~/bottles 24 | cd ~/bottles 25 | brew test-bot --skip-recursive-dependents --bintray-org=linuxbrew --root-url=https://linuxbrew.bintray.com/bottles-num --git-name=LinuxbrewTestBot --git-email=testbot@linuxbrew.sh 26 | cp -a ~/bottles $RUNNER_TEMP/ 27 | - name: Upload bottles 28 | uses: actions/upload-artifact@v1 29 | with: 30 | name: bottles 31 | path: ${{runner.temp}}/bottles 32 | build-macos-bottles: 33 | runs-on: macos-latest 34 | steps: 35 | - name: Update Homebrew 36 | run: brew update-reset 37 | - uses: actions/checkout@master 38 | - name: Build bottles 39 | run: | 40 | mkdir -p "$(dirname $(brew --repo ${{github.repository}}))" 41 | cp -a "$GITHUB_WORKSPACE" "$(brew --repo ${{github.repository}})" 42 | mkdir ~/bottles 43 | cd ~/bottles 44 | brew test-bot --cleanup --root-url=https://linuxbrew.bintray.com/bottles-num 45 | cp -a ~/bottles $RUNNER_TEMP/ 46 | - name: Upload bottles 47 | uses: actions/upload-artifact@v1 48 | with: 49 | name: bottles 50 | path: ${{runner.temp}}/bottles 51 | -------------------------------------------------------------------------------- /.github/workflows/upload-bottles.yml: -------------------------------------------------------------------------------- 1 | name: Upload bottles 2 | 3 | on: 4 | push: 5 | branches: [master] 6 | 7 | jobs: 8 | upload-bottles: 9 | runs-on: ubuntu-latest 10 | if: "!contains(github.event.head_commit.message, '[skip bottles]')" 11 | container: 12 | image: homebrew/ubuntu16.04:master 13 | env: 14 | HOMEBREW_BINTRAY_USER: linuxbrewtestbot 15 | HOMEBREW_BINTRAY_KEY: ${{secrets.HOMEBREW_BINTRAY_KEY}} 16 | HOMEBREW_NO_ANALYTICS: 1 17 | HOMEBREW_NO_AUTO_UPDATE: 1 18 | steps: 19 | - name: Install dependencies 20 | run: | 21 | apt update 22 | apt install -y jq unzip 23 | - uses: actions/checkout@master 24 | with: 25 | fetch-depth: 100 26 | - name: Upload bottles 27 | run: | 28 | set -eu 29 | echo sha1='${{github.event.head_commit.id}}' 30 | echo '${{github.event.head_commit.message}}' 31 | pr="$(echo '${{github.event.head_commit.message}}' | sed 's/^.*#\([0-9]*\).*/\1/;q')" 32 | mkdir -p "$(dirname $(brew --repo ${{github.repository}}))" 33 | cp -a "$GITHUB_WORKSPACE" "$(brew --repo ${{github.repository}})" 34 | rm -rf .git * 35 | git -C "$(brew --repo ${{github.repository}})" fetch origin "pull/$pr/head:pr-head" 36 | sha1="$(git -C "$(brew --repo ${{github.repository}})" rev-parse pr-head)" 37 | echo pr="$pr" sha1="$sha1" 38 | run_id=$(curl -fs -H 'Accept: application/vnd.github.antiope-preview+json' https://api.github.com/repos/${{github.repository}}/actions/workflows/build-bottles.yml/runs \ 39 | | jq ".workflow_runs[] | select(.head_sha == \"$sha1\").id") 40 | artifact_id="$(curl -fs -H 'Accept: application/vnd.github.antiope-preview+json' https://api.github.com/repos/${{github.repository}}/actions/runs/$run_id/artifacts \ 41 | | jq '.artifacts[0].id')" 42 | echo run_id="$run_id" artifact_id="$artifact_id" 43 | curl -fL -o bottles.zip "https://${{secrets.HOMEBREW_GITHUB_API_TOKEN}}@api.github.com/repos/${{github.repository}}/actions/artifacts/$artifact_id/zip" 44 | file bottles.zip 45 | unzip bottles.zip 46 | git -C "$(brew --repo ${{github.repository}})" status 47 | git config --global user.name "LinuxbrewTestBot" 48 | git config --global user.email "testbot@linuxbrew.sh" 49 | brew pr-upload --bintray-org=linuxbrew --root-url=https://linuxbrew.bintray.com/bottles-num 50 | cd "$(brew --repo ${{github.repository}})" 51 | git branch -f "pr$pr" 52 | git fetch origin master 53 | git checkout master 54 | git reset --hard origin/master 55 | git merge -m "Merge pull request #$pr" "pr$pr" 56 | git status 57 | if ! git push "https://LinuxbrewTestBot:${{secrets.HOMEBREW_GITHUB_API_TOKEN}}@github.com/${{github.repository}}" master; then 58 | git push --force origin "pr$pr" 59 | mkdir ~/bin 60 | curl -fsL https://github.com/github/hub/releases/download/v2.14.1/hub-linux-amd64-2.14.1.tgz \ 61 | | tar xzO hub-linux-amd64-2.14.1/bin/hub >~/bin/hub 62 | chmod +x ~/bin/hub 63 | git reset --hard origin/master 64 | GITHUB_TOKEN='${{secrets.HOMEBREW_GITHUB_API_TOKEN}}' ~/bin/hub pull-request -l bottles -b master -h "pr$pr" -m "Bottles for PR $pr" --no-edit 65 | fi 66 | -------------------------------------------------------------------------------- /Aliases/brewsci-metis@5: -------------------------------------------------------------------------------- 1 | ../Formula/brewsci-metis.rb -------------------------------------------------------------------------------- /Aliases/brewsci-scotch@6: -------------------------------------------------------------------------------- 1 | ../Formula/brewsci-scotch.rb -------------------------------------------------------------------------------- /Formula/brewsci-ceres-solver.rb: -------------------------------------------------------------------------------- 1 | class BrewsciCeresSolver < Formula 2 | desc "C++ library for large-scale optimization" 3 | homepage "http://ceres-solver.org/" 4 | url "http://ceres-solver.org/ceres-solver-1.14.0.tar.gz" 5 | sha256 "4744005fc3b902fed886ea418df70690caa8e2ff6b5a90f3dd88a3d291ef8e8e" 6 | head "https://ceres-solver.googlesource.com/ceres-solver.git" 7 | 8 | bottle do 9 | root_url "https://archive.org/download/brewsci/bottles-num" 10 | sha256 cellar: :any, catalina: "843571d1820074da8b077dc422637edceba07c690db7bd0e5ef10ad269aaf614" 11 | sha256 cellar: :any, x86_64_linux: "aea453f8b9b26fc8b9452e53c60974ea97107dae4be11654f177692edaa6adb0" 12 | end 13 | 14 | keg_only "ceres-solver is provided by homebrew/core" 15 | 16 | unless OS.mac? 17 | fails_with gcc: "5" do 18 | cause "Dependency glog is compiled with the GCC 4.8 ABI." 19 | end 20 | end 21 | 22 | depends_on "brewsci/num/brewsci-metis" 23 | depends_on "brewsci/num/brewsci-suite-sparse" 24 | depends_on "cmake" 25 | depends_on "eigen" 26 | depends_on "gflags" 27 | depends_on "glog" 28 | depends_on "openblas" 29 | 30 | def install 31 | so = OS.mac? ? "dylib" : "so" 32 | system "cmake", ".", *std_cmake_args, 33 | "-DBUILD_SHARED_LIBS=ON", 34 | "-DCMAKE_LIBRARY_PATH=#{Formula["openblas"].opt_lib}", 35 | "-DEIGEN_INCLUDE_DIR=#{Formula["eigen"].opt_include}/eigen3", 36 | "-DMETIS_LIBRARY=#{Formula["brewsci-metis"].opt_lib}/libmetis.#{so}" 37 | system "make" 38 | system "make", "install" 39 | rm_r Dir["examples/**/CMakeFiles/"] 40 | pkgshare.install "examples", "data" 41 | doc.install "docs/html" unless build.head? 42 | end 43 | 44 | test do 45 | ENV.prepend_path "LD_LIBRARY_PATH", lib unless OS.mac? 46 | 47 | cp pkgshare/"examples/helloworld.cc", testpath 48 | (testpath/"CMakeLists.txt").write <<~EOS 49 | cmake_minimum_required(VERSION 2.8) 50 | project(helloworld) 51 | find_package(Ceres REQUIRED PATHS #{Formula["brewsci-ceres-solver"].opt_prefix}) 52 | include_directories(${CERES_INCLUDE_DIRS}) 53 | add_executable(helloworld helloworld.cc) 54 | target_link_libraries(helloworld ${CERES_LIBRARIES}) 55 | EOS 56 | 57 | system "cmake", "-DCeres_DIR=#{share}/Ceres", "." 58 | system "make" 59 | assert_match "CONVERGENCE", shell_output("./helloworld") 60 | end 61 | end 62 | -------------------------------------------------------------------------------- /Formula/brewsci-metis.rb: -------------------------------------------------------------------------------- 1 | class BrewsciMetis < Formula 2 | desc "Serial programs that partition graphs and order matrices" 3 | homepage "http://glaros.dtc.umn.edu/gkhome/views/metis" 4 | url "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/metis-5.1.0.tar.gz" 5 | sha256 "76faebe03f6c963127dbb73c13eab58c9a3faeae48779f049066a21c087c5db2" 6 | 7 | bottle do 8 | root_url "https://archive.org/download/brewsci/bottles-num" 9 | sha256 cellar: :any, sierra: "f6cdb521d777b67c283687573de7c6f4771ee3a6cf04a455201dc6801dcb1bce" 10 | sha256 cellar: :any, x86_64_linux: "e6fac202c1e981a49c93a6b8f0b569eea1f8f86ddafc161acb4959d9e4c27c28" 11 | end 12 | 13 | keg_only "metis is provided by homebrew/core" 14 | 15 | depends_on "cmake" => :build 16 | depends_on "gcc" => :optional 17 | 18 | fails_with :clang if build.with? "gcc" 19 | 20 | def install 21 | cmake_args = std_cmake_args 22 | cmake_args << "-DSHARED=ON" << "-DGKLIB_PATH=../GKlib" 23 | if build.with? "gcc" 24 | cmake_args += [ 25 | "-DOPENMP=ON", 26 | "-DOpenMP_C_FLAGS=-fopenmp", 27 | "-DOpenMP_CXX_FLAGS=-fopenmp", 28 | "-DOpenMP_CXX_LIB_NAMES=gomp", 29 | ] 30 | end 31 | cd "build" do 32 | system "cmake", "..", *cmake_args 33 | system "make", "install" 34 | end 35 | 36 | pkgshare.install "graphs" 37 | doc.install "manual" 38 | end 39 | 40 | test do 41 | ["4elt", "copter2", "mdual"].each do |g| 42 | cp pkgshare/"graphs/#{g}.graph", testpath 43 | system "#{bin}/graphchk", "#{g}.graph" 44 | system "#{bin}/gpmetis", "#{g}.graph", "2" 45 | system "#{bin}/ndmetis", "#{g}.graph" 46 | end 47 | cp [pkgshare/"graphs/test.mgraph", pkgshare/"graphs/metis.mesh"], testpath 48 | system "#{bin}/gpmetis", "test.mgraph", "2" 49 | system "#{bin}/mpmetis", "metis.mesh", "2" 50 | end 51 | end 52 | -------------------------------------------------------------------------------- /Formula/brewsci-metis@4.rb: -------------------------------------------------------------------------------- 1 | class BrewsciMetisAT4 < Formula 2 | desc "Serial graph partitioning and fill-reducing ordering" 3 | homepage "http://glaros.dtc.umn.edu/gkhome/views/metis" 4 | url "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/OLD/metis-4.0.3.tar.gz" 5 | sha256 "5efa35de80703c1b2c4d0de080fafbcf4e0d363a21149a1ad2f96e0144841a55" 6 | 7 | bottle do 8 | root_url "https://archive.org/download/brewsci/bottles-num" 9 | sha256 cellar: :any, sierra: "99d2bb2459f17fac6bc108dbba71a96e306dc8d4d9954c972bfa9548e4b3bab7" 10 | sha256 cellar: :any, x86_64_linux: "a4b07714180328ceec706245be033d657fdef2d7abeb35fbc56a76337ff42192" 11 | end 12 | 13 | keg_only "conflicts with metis (5.x)" 14 | 15 | def install 16 | if OS.mac? 17 | so = "dylib" 18 | all_load = "-Wl,-all_load" 19 | noall_load = "" 20 | else 21 | so = "so" 22 | all_load = "-Wl,-whole-archive" 23 | noall_load = "-Wl,-no-whole-archive" 24 | end 25 | cd "Lib" do 26 | system "make", "CC=#{ENV.cc}", "COPTIONS=-fPIC" 27 | end 28 | cd "Programs" do 29 | system "make", "CC=#{ENV.cc}", "COPTIONS=-fPIC" 30 | end 31 | system ENV.cc, "-fPIC", "-shared", all_load.to_s, "libmetis.a", noall_load.to_s, "-o", "libmetis.#{so}" 32 | bin.install %w[pmetis kmetis oemetis onmetis partnmesh partdmesh mesh2nodal mesh2dual graphchk] 33 | lib.install "libmetis.#{so}" 34 | include.install Dir["Lib/*.h"] 35 | pkgshare.install %w[ 36 | Programs/io.c 37 | Test/mtest.c 38 | Graphs/4elt.graph 39 | Graphs/4elt.graph.part.10 40 | Graphs/metis.mesh 41 | Graphs/test.mgraph 42 | ] 43 | end 44 | 45 | test do 46 | cp pkgshare/"io.c", testpath 47 | cp pkgshare/"mtest.c", testpath 48 | cp pkgshare/"4elt.graph", testpath 49 | cp pkgshare/"4elt.graph.part.10", testpath 50 | cp pkgshare/"test.mgraph", testpath 51 | cp pkgshare/"metis.mesh", testpath 52 | ENV["LD_LIBRARY_PATH"] = opt_lib.to_s if OS.linux? 53 | system ENV.cc, "-I#{include}", "-c", "io.c" 54 | system ENV.cc, "-I#{include}", "mtest.c", "io.o", "-o", "mtest", "-L#{opt_lib}", "-lmetis", "-lm" 55 | system "./mtest", "#{opt_pkgshare}/4elt.graph" 56 | system "#{bin}/kmetis", "4elt.graph", "10" 57 | system "#{bin}/onmetis", "4elt.graph" 58 | system "#{bin}/pmetis", "test.mgraph", "2" 59 | system "#{bin}/kmetis", "test.mgraph", "2" 60 | system "#{bin}/kmetis", "test.mgraph", "5" 61 | system "#{bin}/partnmesh", "metis.mesh", "10" 62 | system "#{bin}/partdmesh", "metis.mesh", "10" 63 | system "#{bin}/mesh2dual", "metis.mesh" 64 | end 65 | end 66 | -------------------------------------------------------------------------------- /Formula/brewsci-mumps.rb: -------------------------------------------------------------------------------- 1 | class BrewsciMumps < Formula 2 | desc "Parallel Sparse Direct Solver" 3 | homepage "http://mumps-solver.org" 4 | url "http://mumps.enseeiht.fr/MUMPS_5.3.5.tar.gz" 5 | sha256 "e5d665fdb7043043f0799ae3dbe3b37e5b200d1ab7a6f7b2a4e463fd89507fa4" 6 | 7 | bottle do 8 | root_url "https://archive.org/download/brewsci/bottles-num" 9 | sha256 cellar: :any, catalina: "8e99032961f74428c0ebcbc8712c2347c9598a2d4e1a888743b745397ae3701e" 10 | sha256 cellar: :any, x86_64_linux: "ada4f3010e86b867c4dfc4fafab3028cc8913c349d91d971892d86ece417d9f9" 11 | end 12 | 13 | keg_only "formulae in brewsci/num are keg only" 14 | 15 | depends_on "gcc" 16 | depends_on "openblas" 17 | depends_on "open-mpi" => :recommended 18 | 19 | if build.with? "open-mpi" 20 | depends_on "scalapack" 21 | depends_on "brewsci/num/brewsci-parmetis" => :recommended 22 | else 23 | depends_on "brewsci/num/brewsci-metis" => :recommended 24 | end 25 | 26 | depends_on "brewsci/num/brewsci-scotch" => :optional 27 | depends_on "brewsci/num/brewsci-scotch@5" => :optional 28 | 29 | fails_with :clang # because we use OpenMP 30 | 31 | resource "mumps_simple" do 32 | url "https://github.com/dpo/mumps_simple/archive/v0.4.tar.gz" 33 | sha256 "87d1fc87eb04cfa1cba0ca0a18f051b348a93b0b2c2e97279b23994664ee437e" 34 | end 35 | 36 | def install 37 | # MUMPS 5.3.4 does not compile with gfortran10. Allow some errors to go through. 38 | # see https://listes.ens-lyon.fr/sympa/arc/mumps-users/2020-10/msg00002.html 39 | make_args = ["RANLIB=echo", "CDEFS=-DAdd_"] 40 | optf = ["OPTF=-O"] 41 | gcc_major_ver = Formula["gcc"].any_installed_version.major 42 | optf << "-fallow-argument-mismatch" if gcc_major_ver >= 10 43 | make_args << optf.join(" ") 44 | orderingsf = "-Dpord" 45 | 46 | makefile = build.with?("open-mpi") ? "Makefile.G95.PAR" : "Makefile.G95.SEQ" 47 | cp "Make.inc/" + makefile, "Makefile.inc" 48 | 49 | lib_args = [] 50 | 51 | if build.with? "brewsci-scotch@5" 52 | 53 | scotch_dir = Formula["brewsci-scotch@5"].opt_prefix 54 | make_args += ["SCOTCHDIR=#{scotch_dir}", "ISCOTCH=-I#{Formula["brewsci-scotch@5"].opt_include}"] 55 | 56 | if build.with? "open-mpi" 57 | scotch_libs = "-L$(SCOTCHDIR)/lib -lptesmumps -lptscotch -lptscotcherr" 58 | scotch_libs += " -lptscotchparmetis" if build.with? "brewsci-parmetis" 59 | orderingsf << " -Dptscotch" 60 | else 61 | scotch_libs = "-L$(SCOTCHDIR)/lib -lesmumps -lscotch -lscotcherr" 62 | scotch_libs += " -lscotchmetis" if build.with? "brewsci-metis" 63 | orderingsf << " -Dscotch" 64 | end 65 | make_args << "LSCOTCH=#{scotch_libs}" 66 | lib_args += scotch_libs.split 67 | 68 | elsif build.with? "brewsci-scotch" 69 | 70 | scotch_dir = Formula["brewsci-scotch"].opt_prefix 71 | make_args += ["SCOTCHDIR=#{scotch_dir}", "ISCOTCH=-I#{Formula["brewsci-scotch"].opt_include}"] 72 | 73 | if build.with? "open-mpi" 74 | scotch_libs = "-L$(SCOTCHDIR)/lib -lptscotch -lptscotcherr -lptscotcherrexit -lscotch" 75 | scotch_libs += "-lptscotchparmetis" if build.with? "brewsci-parmetis" 76 | orderingsf << " -Dptscotch" 77 | else 78 | scotch_libs = "-L$(SCOTCHDIR)/lib -lscotch -lscotcherr -lscotcherrexit" 79 | scotch_libs += "-lscotchmetis" if build.with? "brewsci-metis" 80 | orderingsf << " -Dscotch" 81 | end 82 | make_args << "LSCOTCH=#{scotch_libs}" 83 | lib_args += scotch_libs.split 84 | 85 | end 86 | 87 | if build.with? "brewsci-parmetis" 88 | metis_libs = "-L#{Formula["brewsci-parmetis"].opt_lib} -lparmetis -L#{Formula["brewsci-metis"].opt_lib} -lmetis" 89 | make_args += ["LMETISDIR=#{Formula["brewsci-parmetis"].opt_lib}", 90 | "IMETIS=#{Formula["brewsci-parmetis"].opt_include}", 91 | "LMETIS=#{metis_libs}"] 92 | orderingsf << " -Dparmetis" 93 | lib_args += metis_libs.split 94 | elsif build.with? "brewsci-metis" 95 | metis_libs = "-L#{Formula["brewsci-metis"].opt_lib} -lmetis" 96 | make_args += ["LMETISDIR=#{Formula["brewsci-metis"].opt_lib}", 97 | "IMETIS=#{Formula["brewsci-metis"].opt_include}", 98 | "LMETIS=#{metis_libs}"] 99 | orderingsf << " -Dmetis" 100 | lib_args += metis_libs.split 101 | end 102 | 103 | make_args << "ORDERINGSF=#{orderingsf}" 104 | 105 | if build.with? "open-mpi" 106 | scalapack_libs = "-L#{Formula["scalapack"].opt_lib} -lscalapack" 107 | make_args += ["CC=mpicc -fPIC", 108 | "FC=mpif90 -fPIC", 109 | "FL=mpif90 -fPIC", 110 | "SCALAP=#{scalapack_libs}", 111 | "INCPAR=", # Let MPI compilers fill in the blanks. 112 | "LIBPAR=$(SCALAP)"] 113 | lib_args += scalapack_libs.split 114 | else 115 | make_args += ["CC=#{ENV["CC"]} -fPIC", 116 | "FC=gfortran -fPIC -fopenmp", 117 | "FL=gfortran -fPIC -fopenmp"] 118 | lib_args << "-lgomp" 119 | end 120 | 121 | blas_lib = "-L#{Formula["openblas"].opt_lib} -lopenblas" 122 | make_args << "LIBBLAS=#{blas_lib}" 123 | make_args << "LAPACK=#{blas_lib}" 124 | lib_args += blas_lib.split 125 | 126 | ENV.deparallelize # Build fails in parallel on Mavericks. 127 | 128 | system "make", "alllib", *make_args 129 | 130 | # make shared lib 131 | so = OS.mac? ? "dylib" : "so" 132 | all_load = OS.mac? ? "-all_load" : "--whole-archive" 133 | noall_load = OS.mac? ? "-noall_load" : "--no-whole-archive" 134 | compiler = OS.mac? ? "gfortran" : "mpif90" # mpif90 causes segfaults on macOS 135 | shopts = OS.mac? ? ["-undefined", "dynamic_lookup"] : [] 136 | install_name = ->(libname) { OS.mac? ? ["-Wl,-install_name", "-Wl,#{lib}/#{libname}.#{so}"] : [] } 137 | cd "lib" do 138 | libpord_install_name = install_name.call("libpord") 139 | system compiler, "-fPIC", "-shared", "-Wl,#{all_load}", "libpord.a", *lib_args, \ 140 | "-Wl,#{noall_load}", *libpord_install_name, *shopts, "-o", "libpord.#{so}" 141 | lib.install "libpord.#{so}" 142 | libmumps_common_install_name = install_name.call("libmumps_common") 143 | system compiler, "-fPIC", "-shared", "-Wl,#{all_load}", "libmumps_common.a", *lib_args, \ 144 | "-L#{lib}", "-lpord", "-Wl,#{noall_load}", *libmumps_common_install_name, \ 145 | *shopts, "-o", "libmumps_common.#{so}" 146 | lib.install "libmumps_common.#{so}" 147 | %w[libsmumps libdmumps libcmumps libzmumps].each do |l| 148 | libinstall_name = install_name.call(l) 149 | system compiler, "-fPIC", "-shared", "-Wl,#{all_load}", "#{l}.a", *lib_args, \ 150 | "-L#{lib}", "-lpord", "-lmumps_common", "-Wl,#{noall_load}", *libinstall_name, \ 151 | *shopts, "-o", "#{l}.#{so}" 152 | end 153 | end 154 | if build.without? "open-mpi" 155 | cd "libseq" do 156 | libmpiseq_install_name = install_name.call("libmpiseq") 157 | system compiler, "-fPIC", "-shared", "-Wl,#{all_load}", "libmpiseq.a", *lib_args, \ 158 | "-Wl,#{noall_load}", *libmpiseq_install_name, *shopts, "-o", "libmpiseq.#{so}" 159 | end 160 | end 161 | 162 | lib.install Dir["lib/*"] 163 | lib.install "libseq/libmpiseq.#{so}" if build.without? "open-mpi" 164 | 165 | inreplace "examples/Makefile" do |s| 166 | s.change_make_var! "libdir", lib 167 | end 168 | 169 | libexec.install "include" 170 | include.install_symlink Dir[libexec/"include/*"] 171 | # The following .h files may conflict with others related to MPI 172 | # in /usr/local/include. Do not symlink them. 173 | (libexec/"include").install Dir["libseq/*.h"] if build.without? "open-mpi" 174 | 175 | doc.install Dir["doc/*.pdf"] 176 | pkgshare.install "examples" 177 | 178 | prefix.install "Makefile.inc" # For the record. 179 | File.open(prefix/"make_args.txt", "w") do |f| 180 | f.puts(make_args.join(" ")) # Record options passed to make. 181 | end 182 | 183 | if build.with? "open-mpi" 184 | resource("mumps_simple").stage do 185 | simple_args = ["CC=mpicc", "prefix=#{prefix}", "mumps_prefix=#{prefix}", 186 | "scalapack_libdir=#{Formula["scalapack"].opt_lib}"] 187 | if build.with? "brewsci-scotch@5" 188 | simple_args += ["scotch_libdir=#{Formula["brewsci-scotch@5"].opt_lib}", 189 | "scotch_libs=-L$(scotch_libdir) -lptesmumps -lptscotch -lptscotcherr"] 190 | elsif build.with? "brewsci-scotch" 191 | simple_args += ["scotch_libdir=#{Formula["brewsci-scotch"].opt_lib}", 192 | "scotch_libs=-L$(scotch_libdir) -lptscotch -lptscotcherr -lscotch"] 193 | end 194 | simple_args += ["blas_libdir=#{Formula["openblas"].opt_lib}", 195 | "blas_libs=-L$(blas_libdir) -lopenblas"] 196 | system "make", "SHELL=/bin/bash", *simple_args 197 | lib.install ("libmumps_simple." + (OS.mac? ? "dylib" : "so")) 198 | include.install "mumps_simple.h" 199 | end 200 | end 201 | end 202 | 203 | def caveats 204 | s = "" 205 | if build.without? "open-mpi" 206 | s += <<~EOS 207 | You built a sequential MUMPS library. 208 | Please add #{libexec}/include to the include path 209 | when building software that depends on MUMPS. 210 | EOS 211 | end 212 | s 213 | end 214 | 215 | test do 216 | ENV.prepend_path "LD_LIBRARY_PATH", lib unless OS.mac? 217 | cp_r pkgshare/"examples", testpath 218 | opts = ["-fopenmp"] 219 | if Tab.for_name("brewsci-mumps").with?("open-mpi") 220 | mpiopts = "" 221 | if OS.linux? 222 | if ENV["CI"] 223 | mpiopts = "--allow-run-as-root" 224 | ENV["OMPI_ALLOW_RUN_AS_ROOT"] = "1" 225 | ENV["OMPI_ALLOW_RUN_AS_ROOT_CONFIRM"] = "1" 226 | end 227 | ENV.prepend_path "LD_LIBRARY_PATH", Formula["scalapack"].opt_lib 228 | end 229 | f90 = "mpif90" 230 | cc = "mpicc" 231 | mpirun = "mpirun -np 1 #{mpiopts}" 232 | includes = "-I#{opt_include}" 233 | opts << "-L#{Formula["scalapack"].opt_lib}" << "-lscalapack" << "-L#{opt_lib}" 234 | else 235 | ENV.prepend_path "LD_LIBRARY_PATH", "#{opt_libexec}/lib" unless OS.mac? 236 | f90 = "gfortran" 237 | cc = ENV["CC"] 238 | mpirun = "" 239 | includes = "-I#{opt_libexec}/include" 240 | opts << "-L#{opt_libexec}/lib" << "-lmpiseq" 241 | end 242 | if Tab.for_name("brewsci-mumps").with?("brewsci-parmetis") 243 | ENV.prepend_path "LD_LIBRARY_PATH", Formula["brewsci-parmetis"].opt_lib unless OS.mac? 244 | opts << "-L#{Formula["brewsci-parmetis"].opt_lib}" << "-lparmetis" 245 | end 246 | if Tab.for_name("brewsci-mumps").with?("brewsci-metis") 247 | ENV.prepend_path "LD_LIBRARY_PATH", Formula["brewsci-metis"].opt_lib unless OS.mac? 248 | opts << "-L#{Formula["brewsci-metis"].opt_lib}" << "-lmetis" 249 | end 250 | opts << "-lmumps_common" << "-lpord" 251 | opts << "-L#{Formula["openblas"].opt_lib}" << "-lopenblas" 252 | 253 | cd testpath/"examples" do 254 | system f90, "-o", "ssimpletest", "ssimpletest.F", "-lsmumps", includes, *opts 255 | system "#{mpirun} ./ssimpletest < input_simpletest_real" 256 | system f90, "-o", "dsimpletest", "dsimpletest.F", "-ldmumps", includes, *opts 257 | system "#{mpirun} ./dsimpletest < input_simpletest_real" 258 | system f90, "-o", "csimpletest", "csimpletest.F", "-lcmumps", includes, *opts 259 | system "#{mpirun} ./csimpletest < input_simpletest_cmplx" 260 | system f90, "-o", "zsimpletest", "zsimpletest.F", "-lzmumps", includes, *opts 261 | system "#{mpirun} ./zsimpletest < input_simpletest_cmplx" 262 | system cc, "-c", "c_example.c", includes 263 | system f90, "-o", "c_example", "c_example.o", "-ldmumps", *opts 264 | system(*(mpirun.split + ["./c_example"] + opts)) 265 | end 266 | end 267 | end 268 | -------------------------------------------------------------------------------- /Formula/brewsci-parmetis.rb: -------------------------------------------------------------------------------- 1 | class BrewsciParmetis < Formula 2 | desc "MPI library for graph partitioning and fill-reducing orderings" 3 | homepage "http://glaros.dtc.umn.edu/gkhome/metis/parmetis/overview" 4 | url "http://glaros.dtc.umn.edu/gkhome/fetch/sw/parmetis/parmetis-4.0.3.tar.gz" 5 | sha256 "f2d9a231b7cf97f1fee6e8c9663113ebf6c240d407d3c118c55b3633d6be6e5f" 6 | revision 1 7 | 8 | bottle do 9 | root_url "https://archive.org/download/brewsci/bottles-num" 10 | sha256 cellar: :any, sierra: "ab6deec90cfb0c0c4b432f5e27e0f1c74624cdbf65e7d3bc50c438703588ab45" 11 | sha256 cellar: :any, x86_64_linux: "11e90f57b7ffa6201007f5aed5eb747acb5234ed261f6e3fc4c0a2e1f9bb4bf5" 12 | end 13 | 14 | keg_only "formulae in brewsci/num are keg only" 15 | 16 | depends_on "cmake" => :build 17 | 18 | # METIS 5.* is required. It comes bundled with ParMETIS. 19 | # We prefer to brew it ourselves. 20 | depends_on "brewsci/num/brewsci-metis" 21 | 22 | depends_on "open-mpi" 23 | 24 | # Do not build the METIS 5.* that ships with ParMETIS. 25 | patch :DATA 26 | 27 | # Bug fixes from PETSc developers. Mirrored because the SHA-256s get 28 | # invalidated every time Bitbucket updates the Git version they use. 29 | patch do 30 | # From: https://bitbucket.org/petsc/pkg-parmetis/commits/82409d68aa1d6cbc70740d0f35024aae17f7d5cb/raw/ 31 | url "https://raw.githubusercontent.com/Homebrew/patches/f104fbb1e09402798cbbc06d2f695d85398c0c89/parmetis/commit-82409d68.patch" 32 | sha256 "0349f5bc19a2ba9fe9e1b9d385072dabe59262522bd7cf66f26c6bc31bbb1b86" 33 | end 34 | 35 | patch do 36 | # From: https://bitbucket.org/petsc/pkg-parmetis/commits/1c1a9fd0f408dc4d42c57f5c3ee6ace411eb222b/raw/ 37 | url "https://raw.githubusercontent.com/Homebrew/patches/f104fbb1e09402798cbbc06d2f695d85398c0c89/parmetis/commit-1c1a9fd0.patch" 38 | sha256 "baec5e1fa6bb4f6c59e3ede564485e0ad743f58c9875fd65cb715b5c14a491b5" 39 | end 40 | 41 | def install 42 | ENV["LDFLAGS"] = "-L#{Formula["brewsci-metis"].lib} -lmetis -lm" 43 | 44 | system "make", "config", "prefix=#{prefix}", "shared=1" 45 | system "make", "install" 46 | pkgshare.install "Graphs" # Sample data for test 47 | end 48 | 49 | test do 50 | system "mpirun", "#{bin}/ptest", "#{pkgshare}/Graphs/rotor.graph" 51 | end 52 | end 53 | 54 | __END__ 55 | diff --git a/CMakeLists.txt b/CMakeLists.txt 56 | index ca945dd..1bf94e9 100644 57 | --- a/CMakeLists.txt 58 | +++ b/CMakeLists.txt 59 | @@ -33,7 +33,7 @@ include_directories(${GKLIB_PATH}) 60 | include_directories(${METIS_PATH}/include) 61 | 62 | # List of directories that cmake will look for CMakeLists.txt 63 | -add_subdirectory(${METIS_PATH}/libmetis ${CMAKE_BINARY_DIR}/libmetis) 64 | +#add_subdirectory(${METIS_PATH}/libmetis ${CMAKE_BINARY_DIR}/libmetis) 65 | add_subdirectory(include) 66 | add_subdirectory(libparmetis) 67 | add_subdirectory(programs) 68 | 69 | diff --git a/libparmetis/CMakeLists.txt b/libparmetis/CMakeLists.txt 70 | index 9cfc8a7..dfc0125 100644 71 | --- a/libparmetis/CMakeLists.txt 72 | +++ b/libparmetis/CMakeLists.txt 73 | @@ -5,7 +5,7 @@ file(GLOB parmetis_sources *.c) 74 | # Create libparmetis 75 | add_library(parmetis ${ParMETIS_LIBRARY_TYPE} ${parmetis_sources}) 76 | # Link with metis and MPI libraries. 77 | -target_link_libraries(parmetis metis ${MPI_LIBRARIES}) 78 | +target_link_libraries(parmetis metis ${MPI_LIBRARIES} "-lm") 79 | set_target_properties(parmetis PROPERTIES LINK_FLAGS "${MPI_LINK_FLAGS}") 80 | 81 | install(TARGETS parmetis 82 | -------------------------------------------------------------------------------- /Formula/brewsci-r.rb: -------------------------------------------------------------------------------- 1 | class BrewsciR < Formula 2 | desc "Software environment for statistical computing" 3 | homepage "https://www.r-project.org/" 4 | url "https://cran.rstudio.com/src/base/R-3/R-3.4.1.tar.gz" 5 | sha256 "02b1135d15ea969a3582caeb95594a05e830a6debcdb5b85ed2d5836a6a3fc78" 6 | revision 1 7 | 8 | bottle do 9 | root_url "https://archive.org/download/brewsci/bottles-num" 10 | sha256 sierra: "55a0171f09f3f1a9d4ee3f90609f2f0ecdfa0be8207036c20ff86843d86d66e4" 11 | sha256 x86_64_linux: "99203c5f6fcbefb9fce01aec832c2a12102e0effd962331f088b655efb455e1a" 12 | end 13 | 14 | keg_only "r is already provided by homebrew/core" 15 | 16 | depends_on "pkg-config" => :build 17 | depends_on "gcc" 18 | depends_on "gettext" 19 | depends_on "jpeg" 20 | depends_on "libpng" 21 | depends_on "openblas" 22 | depends_on "pcre" 23 | depends_on "readline" 24 | depends_on "xz" 25 | depends_on "openjdk" => :optional 26 | 27 | unless OS.mac? 28 | depends_on "cairo" 29 | depends_on "curl" 30 | depends_on "tcl-tk" => :optional 31 | depends_on "linuxbrew/xorg/xorg" 32 | end 33 | 34 | # needed to preserve executable permissions on files without shebangs 35 | skip_clean "lib/R/bin" 36 | 37 | def install 38 | # Fix dyld: lazy symbol binding failed: Symbol not found: _clock_gettime 39 | if MacOS.version == "10.11" && MacOS::Xcode.installed? && 40 | MacOS::Xcode.version >= "8.0" 41 | ENV["ac_cv_have_decl_clock_gettime"] = "no" 42 | end 43 | 44 | args = [ 45 | "--prefix=#{prefix}", 46 | "--enable-memory-profiling", 47 | "--enable-R-shlib", 48 | ] 49 | 50 | # don't remember Homebrew's sed shim 51 | args << "SED=/usr/bin/sed" if File.exist?("/usr/bin/sed") 52 | 53 | if OS.linux? 54 | args << "--disable-openmp" 55 | args << "--libdir=#{lib}" # avoid using lib64 on CentOS 56 | args << "--with-cairo" 57 | args << "--with-x" if build.with?("x11") 58 | 59 | # If LDFLAGS contains any -L options, configure sets LD_LIBRARY_PATH to 60 | # search those directories. Remove -LHOMEBREW_PREFIX/lib from LDFLAGS. 61 | ENV.remove "LDFLAGS", "-L#{HOMEBREW_PREFIX}/lib" 62 | elsif OS.mac? 63 | args << "--without-cairo" 64 | args << "--with-aqua" 65 | args << "--without-x" 66 | end 67 | 68 | args << "--with-blas=-L#{Formula["openblas"].opt_lib} -lopenblas" 69 | args << "--with-lapack=-L#{Formula["openblas"].opt_lib} -lopenblas" 70 | ENV.append "LDFLAGS", "-L#{Formula["openblas"].opt_lib}" 71 | 72 | args << if build.with? "openjdk" 73 | "--enable-java" 74 | else 75 | "--disable-java" 76 | end 77 | 78 | # Help CRAN packages find gettext and readline 79 | ["gettext", "readline"].each do |f| 80 | ENV.append "CPPFLAGS", "-I#{Formula[f].opt_include}" 81 | ENV.append "LDFLAGS", "-L#{Formula[f].opt_lib}" 82 | end 83 | 84 | system "./configure", *args 85 | system "make" 86 | ENV.deparallelize do 87 | system "make", "install" 88 | end 89 | 90 | cd "src/nmath/standalone" do 91 | system "make" 92 | ENV.deparallelize do 93 | system "make", "install" 94 | end 95 | end 96 | 97 | r_home = lib/"R" 98 | 99 | # make Homebrew packages discoverable for R CMD INSTALL 100 | inreplace r_home/"etc/Makeconf" do |s| 101 | s.gsub!(/^CPPFLAGS =.*/, "\\0 -I#{HOMEBREW_PREFIX}/include") 102 | s.gsub!(/^LDFLAGS =.*/, "\\0 -L#{HOMEBREW_PREFIX}/lib") 103 | s.gsub!(/.LDFLAGS =.*/, "\\0 $(LDFLAGS)") 104 | end 105 | 106 | include.install_symlink Dir[r_home/"include/*"] 107 | lib.install_symlink Dir[r_home/"lib/*"] 108 | end 109 | 110 | def post_install 111 | short_version = 112 | `#{bin}/Rscript -e 'cat(as.character(getRversion()[1,1:2]))'`.strip 113 | site_library = HOMEBREW_PREFIX/"lib/R/#{short_version}/site-library" 114 | site_library.mkpath 115 | ln_s site_library, lib/"R/site-library" 116 | end 117 | 118 | test do 119 | dylib_ext = OS.mac? ? ".dylib" : ".so" 120 | assert_equal "[1] 2", shell_output("#{bin}/Rscript -e 'print(1+1)'").chomp 121 | assert_equal dylib_ext, shell_output("#{bin}/R CMD config DYLIB_EXT").chomp 122 | end 123 | end 124 | -------------------------------------------------------------------------------- /Formula/brewsci-scotch.rb: -------------------------------------------------------------------------------- 1 | class BrewsciScotch < Formula 2 | desc "Graph/mesh partitioning, clustering, sparse matrix ordering" 3 | homepage "https://gforge.inria.fr/projects/scotch" 4 | url "https://gforge.inria.fr/frs/download.php/file/34618/scotch_6.0.4.tar.gz" 5 | sha256 "f53f4d71a8345ba15e2dd4e102a35fd83915abf50ea73e1bf6efe1bc2b4220c7" 6 | 7 | bottle do 8 | root_url "https://archive.org/download/brewsci/bottles-num" 9 | sha256 cellar: :any, sierra: "92eb12d64de82c8a97eadbaaec7f71c1ed734d808d80a953af336e2a64af78bf" 10 | sha256 cellar: :any, x86_64_linux: "62e78f72d3cf9e5a2c6b0b8373a1d30b27c2acdb98e705b62499cf714e4500a0" 11 | end 12 | 13 | keg_only "formulae in brewsci/num are keg only" 14 | 15 | option "without-test", "skip build-time tests (not recommended)" 16 | 17 | depends_on "bzip2" unless OS.mac? 18 | depends_on "open-mpi" 19 | depends_on "xz" => :optional # Provides lzma compression. 20 | 21 | def install 22 | ENV.deparallelize 23 | cd "src" do 24 | ln_s "Make.inc/Makefile.inc.i686_mac_darwin10", "Makefile.inc" 25 | # default CFLAGS: 26 | # -O3 -Drestrict=__restrict -DCOMMON_FILE_COMPRESS_GZ -DCOMMON_PTHREAD 27 | # -DCOMMON_PTHREAD_BARRIER -DCOMMON_RANDOM_FIXED_SEED -DCOMMON_TIMING_OLD 28 | # -DSCOTCH_PTHREAD -DSCOTCH_RENAME 29 | # MPI implementation is not threadsafe, do not use DSCOTCH_PTHREAD 30 | 31 | cflags = %w[-O3 -fPIC -Drestrict=__restrict -DCOMMON_PTHREAD_BARRIER 32 | -DCOMMON_PTHREAD 33 | -DSCOTCH_CHECK_AUTO -DCOMMON_RANDOM_FIXED_SEED 34 | -DCOMMON_TIMING_OLD -DSCOTCH_RENAME 35 | -DCOMMON_FILE_COMPRESS_BZ2 -DCOMMON_FILE_COMPRESS_GZ] 36 | ldflags = %w[-lm -lz -lpthread -lbz2] 37 | 38 | cflags += %w[-DCOMMON_FILE_COMPRESS_LZMA] if build.with? "xz" 39 | ldflags += %W[-L#{Formula["xz"].lib} -llzma] if build.with? "xz" 40 | 41 | make_args = ["CCS=#{ENV["CC"]}", 42 | "CCP=mpicc", 43 | "CCD=mpicc", 44 | "RANLIB=echo", 45 | "CFLAGS=#{cflags.join(" ")}", 46 | "LDFLAGS=#{ldflags.join(" ")}"] 47 | 48 | if OS.mac? 49 | make_args << "LIB=.dylib" 50 | make_args << "AR=libtool" 51 | arflags = ldflags.join(" ") + " -dynamic -install_name #{lib}/$(notdir $@) -undefined dynamic_lookup -o" 52 | make_args << "ARFLAGS=#{arflags}" 53 | else 54 | make_args << "LIB=.so" 55 | make_args << "ARCH=ar" 56 | make_args << "ARCHFLAGS=-ruv" 57 | end 58 | 59 | system "make", "scotch", "VERBOSE=ON", *make_args 60 | system "make", "ptscotch", "VERBOSE=ON", *make_args 61 | system "make", "install", "prefix=#{prefix}", *make_args 62 | system "make", "check", "ptcheck", "EXECP=mpirun -np 2", *make_args if build.with? "test" 63 | end 64 | 65 | # Install documentation + sample graphs and grids. 66 | doc.install Dir["doc/*.pdf"] 67 | pkgshare.install Dir["doc/*.f"], Dir["doc/*.txt"] 68 | pkgshare.install "grf", "tgt" 69 | end 70 | 71 | test do 72 | mktemp do 73 | system "echo cmplt 7 | #{bin}/gmap #{pkgshare}/grf/bump.grf.gz - bump.map" 74 | system "#{bin}/gmk_m2 32 32 | #{bin}/gmap - #{pkgshare}/tgt/h8.tgt brol.map" 75 | system "#{bin}/gout", "-Mn", "-Oi", "#{pkgshare}/grf/4elt.grf.gz", "#{pkgshare}/grf/4elt.xyz.gz", 76 | "-", "graph.iv" 77 | end 78 | end 79 | end 80 | -------------------------------------------------------------------------------- /Formula/brewsci-scotch@5.rb: -------------------------------------------------------------------------------- 1 | class BrewsciScotchAT5 < Formula 2 | desc "Graph/mesh partitioning, clustering, sparse matrix ordering" 3 | homepage "https://gforge.inria.fr/projects/scotch" 4 | url "https://gforge.inria.fr/frs/download.php/28978" 5 | version "5.1.12b" 6 | sha256 "82654e63398529cd3bcc8eefdd51d3b3161c0429bb11770e31f8eb0c3790db6e" 7 | 8 | bottle do 9 | root_url "https://archive.org/download/brewsci/bottles-num" 10 | sha256 sierra: "9136a0ee5df823790d8dfe1f020b9c52ef456e2e0ba2b2b5a83916d1ed147ebe" 11 | sha256 x86_64_linux: "17baf1760d0ffc65f139fa5b5ffcfcb723bc3908985a79df98101c6093f1defb" 12 | end 13 | 14 | keg_only "conflicts with scotch (6.x)" 15 | 16 | depends_on "open-mpi" 17 | 18 | # bugs in makefile: 19 | # - libptesmumps must be built before main_esmumps 20 | # - install should also install the lib*esmumps.a libraries 21 | patch :DATA 22 | 23 | def install 24 | cd "src" do 25 | # Use mpicc to compile the parallelized version 26 | make_args = ["CCS=#{ENV["CC"]}", 27 | "CCP=mpicc", 28 | "CCD=mpicc", 29 | "RANLIB=echo"] 30 | if OS.mac? 31 | ln_s "Make.inc/Makefile.inc.i686_mac_darwin8", "Makefile.inc" 32 | make_args += ["LIB=.dylib", 33 | "AR=libtool", 34 | "ARFLAGS=-dynamic -install_name #{lib}/$(notdir $@) -undefined dynamic_lookup -o "] 35 | else 36 | ln_s "Make.inc/Makefile.inc.x86-64_pc_linux2", "Makefile.inc" 37 | make_args += ["LIB=.so", 38 | "AR=$(CCS)", 39 | "ARFLAGS=-shared -Wl,-soname -Wl,#{lib}/$(notdir $@) -o "] 40 | end 41 | inreplace "Makefile.inc", "-O3", "-O3 -fPIC" 42 | 43 | system "make", "scotch", *make_args 44 | system "make", "ptscotch", *make_args 45 | system "make", "install", "prefix=#{prefix}", *make_args 46 | end 47 | doc.install "doc" 48 | pkgshare.install "grf", "tgt", "examples" 49 | end 50 | 51 | test do 52 | mktemp do 53 | system "#{bin}/gmk_m2 32 32 | #{bin}/gmap - #{pkgshare}/tgt/h8.tgt brol.map" 54 | end 55 | end 56 | end 57 | 58 | __END__ 59 | diff -rupN scotch_5.1.12_esmumps/src/Makefile scotch_5.1.12_esmumps.patched/src/Makefile 60 | --- scotch_5.1.12_esmumps/src/Makefile 2011-02-12 12:06:58.000000000 +0100 61 | +++ scotch_5.1.12_esmumps.patched/src/Makefile 2013-08-07 14:56:06.000000000 +0200 62 | @@ -105,6 +105,7 @@ install : required $(bindir) $(includ 63 | -$(CP) -f ../bin/[agm]*$(EXE) $(bindir) 64 | -$(CP) -f ../include/*scotch*.h $(includedir) 65 | -$(CP) -f ../lib/*scotch*$(LIB) $(libdir) 66 | + -$(CP) -f ../lib/*esmumps*$(LIB) $(libdir) 67 | -$(CP) -Rf ../man/* $(mandir) 68 | 69 | clean : required 70 | diff -rupN scotch_5.1.12_esmumps/src/esmumps/Makefile scotch_5.1.12_esmumps.patched/src/esmumps/Makefile 71 | --- scotch_5.1.12_esmumps/src/esmumps/Makefile 2010-07-02 23:31:06.000000000 +0200 72 | +++ scotch_5.1.12_esmumps.patched/src/esmumps/Makefile 2013-08-07 14:48:30.000000000 +0200 73 | @@ -59,7 +59,8 @@ scotch : clean 74 | 75 | ptscotch : clean 76 | $(MAKE) CFLAGS="$(CFLAGS) -DSCOTCH_PTSCOTCH" CC=$(CCP) SCOTCHLIB=ptscotch ESMUMPSLIB=ptesmumps \ 77 | - libesmumps$(LIB) \ 78 | + libesmumps$(LIB) 79 | + $(MAKE) CFLAGS="$(CFLAGS) -DSCOTCH_PTSCOTCH" CC=$(CCP) SCOTCHLIB=ptscotch ESMUMPSLIB=ptesmumps \ 80 | main_esmumps$(EXE) 81 | 82 | install : 83 | -------------------------------------------------------------------------------- /Formula/brewsci-suite-sparse.rb: -------------------------------------------------------------------------------- 1 | class BrewsciSuiteSparse < Formula 2 | desc "Suite of Sparse Matrix Software" 3 | homepage "http://faculty.cse.tamu.edu/davis/suitesparse.html" 4 | url "http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-4.5.5.tar.gz" 5 | sha256 "b9a98de0ddafe7659adffad8a58ca3911c1afa8b509355e7aa58b02feb35d9b6" 6 | revision 2 7 | 8 | bottle do 9 | root_url "https://archive.org/download/brewsci/bottles-num" 10 | sha256 cellar: :any, catalina: "571a5614ebbf39e1985025a4b189fb0e8d322e44658bdcea5381955941c6add5" 11 | sha256 cellar: :any, x86_64_linux: "e3ca73c5a4d51d88ff85acbd50da0242dd4125dbaa3ac37d3472536f8ef9312d" 12 | end 13 | 14 | keg_only "suite-sparse is provided by homebrew/core" 15 | 16 | depends_on "brewsci/num/brewsci-metis" 17 | depends_on "openblas" 18 | 19 | def install 20 | args = [ 21 | "INSTALL=#{prefix}", 22 | "BLAS=-L#{Formula["openblas"].opt_lib} -lopenblas", 23 | "LAPACK=$(BLAS)", 24 | "MY_METIS_LIB=-L#{Formula["brewsci-metis"].opt_lib} -lmetis", 25 | "MY_METIS_INC=#{Formula["brewsci-metis"].opt_include}", 26 | ] 27 | system "make", "library", *args 28 | system "make", "install", *args 29 | lib.install Dir["**/*.a"] 30 | pkgshare.install "KLU/Demo/klu_simple.c" 31 | end 32 | 33 | test do 34 | ENV.prepend_path "LD_LIBRARY_PATH", lib unless OS.mac? 35 | system ENV.cc, "-o", "test", "-I#{include}", pkgshare/"klu_simple.c", 36 | "-L#{lib}", "-lsuitesparseconfig", "-lklu" 37 | system "./test" 38 | end 39 | end 40 | -------------------------------------------------------------------------------- /Formula/brewsci-superlu-dist.rb: -------------------------------------------------------------------------------- 1 | class BrewsciSuperluDist < Formula 2 | desc "Distributed LU factorization for large linear systems" 3 | homepage "https://portal.nersc.gov/project/sparse/superlu" 4 | url "https://github.com/xiaoyeli/superlu_dist/archive/v6.4.0.tar.gz" 5 | sha256 "cb9c0b2ba4c28e5ed5817718ba19ae1dd63ccd30bc44c8b8252b54f5f04a44cc" 6 | head "https://github.com/xiaoyeli/superlu_dist" 7 | 8 | bottle do 9 | root_url "https://archive.org/download/brewsci/bottles-num" 10 | sha256 catalina: "19de106830a2558b4f5bcc5888b31ba18b1ddb1f55fe898a2c299595dbcc6a5f" 11 | sha256 x86_64_linux: "03113b91f2b248d35cffc252cbfb46dec5261b5c9b4ea85aad25f6395eaaca91" 12 | end 13 | 14 | keg_only "formulae in brewsci/num are keg only" 15 | 16 | depends_on "cmake" => :build 17 | depends_on "brewsci/num/brewsci-parmetis" 18 | depends_on "gcc" 19 | depends_on "open-mpi" 20 | depends_on "openblas" 21 | 22 | def install 23 | # prevent linking errors on linux 24 | ENV.deparallelize 25 | 26 | dylib_ext = OS.mac? ? "dylib" : "so" 27 | 28 | parmetis_libs = [ 29 | "#{Formula["brewsci-parmetis"].opt_lib}/libparmetis.#{dylib_ext}", 30 | "#{Formula["brewsci-metis"].opt_lib}/libmetis.#{dylib_ext}", 31 | ] 32 | parmetis_include_dirs = [ 33 | Formula["brewsci-parmetis"].opt_include.to_s, 34 | Formula["brewsci-metis"].opt_include.to_s, 35 | ] 36 | 37 | cmake_args = std_cmake_args 38 | cmake_args << "-DTPL_PARMETIS_LIBRARIES=#{parmetis_libs.join ";"}" 39 | cmake_args << "-DTPL_PARMETIS_INCLUDE_DIRS=#{parmetis_include_dirs.join ";"}" 40 | cmake_args << "-DCMAKE_C_FLAGS=-fPIC -O2" 41 | cmake_args << "-DBUILD_SHARED_LIBS=ON" 42 | cmake_args << "-DCMAKE_C_COMPILER=mpicc" 43 | cmake_args << "-DCMAKE_Fortran_COMPILER=mpif90" 44 | cmake_args << "-DCMAKE_INSTALL_PREFIX=#{prefix}" 45 | cmake_args << "-DTPL_BLAS_LIBRARIES=-L#{Formula["openblas"].opt_lib} -lopenblas" 46 | 47 | mkdir "build" do 48 | system "cmake", "..", *cmake_args 49 | system "make" 50 | system "make", "install" 51 | # system "make", "test" 52 | end 53 | 54 | doc.install "DOC/ug.pdf" 55 | pkgshare.install "EXAMPLE" 56 | end 57 | 58 | test do 59 | cp pkgshare/"EXAMPLE/dcreate_matrix.c", testpath 60 | cp pkgshare/"EXAMPLE/pddrive.c", testpath 61 | cp pkgshare/"EXAMPLE/g20.rua", testpath 62 | args = [ 63 | "-I#{Formula["brewsci-superlu-dist"].opt_include}", 64 | "-L#{Formula["brewsci-superlu-dist"].opt_lib}", 65 | "-lsuperlu_dist", 66 | ] 67 | ENV.prepend_path "LD_LIBRARY_PATH", opt_lib unless OS.mac? 68 | system "mpicc", "-o", "pddrive", "pddrive.c", "dcreate_matrix.c", *args 69 | return if OS.linux? && ENV["GITHUB_ACTIONS"] 70 | 71 | output = shell_output("mpirun -np 4 ./pddrive -r 2 -c 2 g20.rua") 72 | accuracy = ((output.lines.grep /Sol 0/)[-1]).to_f 73 | assert accuracy < 1.0e-8 74 | end 75 | end 76 | -------------------------------------------------------------------------------- /Formula/brewsci-superlu-mt.rb: -------------------------------------------------------------------------------- 1 | class BrewsciSuperluMt < Formula 2 | desc "Multithreaded solution of large, sparse nonsymmetric systems" 3 | homepage "https://portal.nersc.gov/project/sparse/superlu" 4 | url "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/superlu_mt_3.1.tar.gz" 5 | sha256 "407b544b9a92b2ed536b1e713e80f986824cf3016657a4bfc2f3e7d2a76ecab6" 6 | revision 1 7 | 8 | bottle do 9 | root_url "https://archive.org/download/brewsci/bottles-num" 10 | sha256 cellar: :any_skip_relocation, catalina: "5bb45e9cc3129107c7d0f9956d3b78db5803a0edb9bccaaa81e21f0ebf7259bd" 11 | sha256 cellar: :any_skip_relocation, x86_64_linux: "a3947533b5480853a25f114c7476610b1f1e06764a0065b324ee95893af02550" 12 | end 13 | 14 | keg_only "formulae in brewsci/num are keg only" 15 | 16 | # Accelerate single precision is buggy and causes certain single precision 17 | # tests to fail. 18 | depends_on "openblas" 19 | depends_on "tcsh" if OS.linux? 20 | depends_on "gcc" => :optional 21 | 22 | def install 23 | ENV.deparallelize 24 | make_args = %W[CC=#{ENV.cc} CFLAGS=#{ENV.cflags} FORTRAN= LOADER=#{ENV.cc}] 25 | 26 | if build.with? "gcc" 27 | make_inc = "make.openmp" 28 | libname = "libsuperlu_mt_OPENMP.a" 29 | ENV.append_to_cflags "-D__OPENMP" 30 | make_args << "MPLIB=-fopenmp" 31 | make_args << "PREDEFS=-D__OPENMP -fopenmp" 32 | else 33 | make_inc = "make.pthread" 34 | libname = "libsuperlu_mt_PTHREAD.a" 35 | ENV.append_to_cflags "-D__PTHREAD" 36 | end 37 | cp "MAKE_INC/#{make_inc}", "make.inc" 38 | 39 | make_args << "BLASLIB=-L#{Formula["openblas"].opt_lib} -lopenblas" 40 | 41 | system "make", *make_args 42 | lib.install Dir["lib/*.a"] 43 | ln_s lib/libname, lib/"libsuperlu_mt.a" 44 | (include/"superlu_mt").install Dir["SRC/*.h"] 45 | pkgshare.install "EXAMPLE" 46 | doc.install Dir["DOC/*.pdf"] 47 | prefix.install "make.inc" 48 | File.open(prefix/"make_args.txt", "w") do |f| 49 | make_args.each do |arg| 50 | var, val = arg.split("=") 51 | f.puts "#{var}=\"#{val}\"" # Record options passed to make, preserve spaces. 52 | end 53 | end 54 | end 55 | 56 | def caveats 57 | <<~EOS 58 | Default SuperLU_MT build options are recorded in 59 | 60 | #{opt_prefix}/make.inc 61 | 62 | Specific options for this build are in 63 | 64 | #{opt_prefix}/make_args.txt 65 | EOS 66 | end 67 | 68 | test do 69 | cp_r pkgshare/"EXAMPLE", testpath 70 | cp prefix/"make.inc", testpath 71 | make_args = [] 72 | File.readlines(opt_prefix/"make_args.txt").each do |line| 73 | make_args << line.chomp.delete('\\"') 74 | end 75 | make_args << "HEADER=#{opt_include}/superlu_mt" 76 | make_args << "LOADOPTS=" 77 | make_args << "CC=gcc -Wno-implicit-function-declaration" 78 | 79 | cd "EXAMPLE" do 80 | inreplace "Makefile", "../lib/$(SUPERLULIB)", "#{opt_lib}/libsuperlu_mt.a" 81 | system "make", *make_args 82 | # simple driver 83 | system "./pslinsol -p 2 < big.rua" 84 | system "./pdlinsol -p 2 < big.rua" 85 | system "./pclinsol -p 2 < cmat" 86 | system "./pzlinsol -p 2 < cmat" 87 | # expert driver 88 | system "./pslinsolx -p 2 < big.rua" 89 | system "./pdlinsolx -p 2 < big.rua" 90 | system "./pclinsolx -p 2 < cmat" 91 | system "./pzlinsolx -p 2 < cmat" 92 | # expert driver on several systems with same sparsity pattern 93 | system "./pslinsolx1 -p 2 < big.rua" 94 | system "./pdlinsolx1 -p 2 < big.rua" 95 | system "./pclinsolx1 -p 2 < cmat" 96 | system "./pzlinsolx1 -p 2 < cmat" 97 | # example with symmetric mode 98 | system "./pslinsolx2 -p 2 < big.rua" 99 | system "./pdlinsolx2 -p 2 < big.rua" 100 | # system "./pclinsolx2 -p 2 < cmat" # bus error 101 | # system "./pzlinsolx2 -p 2 < cmat" # bus error 102 | # example with repeated factorization of systems with same sparsity pattern 103 | # system "./psrepeat -p 2 < big.rua" # malloc error 104 | # system "./pdrepeat -p 2 < big.rua" # malloc error 105 | # system "./pcrepeat -p 2 < cmat" # malloc error 106 | # system "./pzrepeat -p 2 < cmat" # malloc error 107 | # example that integrates with other multithreaded application 108 | system "./psspmd -p 2 < big.rua" 109 | system "./pdspmd -p 2 < big.rua" 110 | system "./pcspmd -p 2 < cmat" 111 | system "./pzspmd -p 2 < cmat" 112 | end 113 | end 114 | end 115 | -------------------------------------------------------------------------------- /Formula/brewsci-superlu.rb: -------------------------------------------------------------------------------- 1 | class BrewsciSuperlu < Formula 2 | desc "Solve large, sparse nonsymmetric systems of equations" 3 | homepage "https://portal.nersc.gov/project/sparse/superlu" 4 | url "https://github.com/xiaoyeli/superlu/archive/v5.2.2.tar.gz" 5 | sha256 "470334a72ba637578e34057f46948495e601a5988a602604f5576367e606a28c" 6 | revision 1 7 | head "https://github.com/xiaoyeli/superlu" 8 | 9 | bottle do 10 | root_url "https://archive.org/download/brewsci/bottles-num" 11 | sha256 cellar: :any, catalina: "4c49365defe88dd29069c52c02c6b4b991e94a8e332222e7dd1b05b190f79451" 12 | sha256 cellar: :any, x86_64_linux: "127e3ddaf9fd1566f064c7c47ef57e0bb4095ab0b3002e761a0345506f21c81d" 13 | end 14 | 15 | keg_only "superlu is already provided by homebrew/core" 16 | 17 | option "with-matlab", "Build MEX files for use with Matlab (Set the environment variable HOMEBREW_MATLAB_PATH to "\ 18 | "the directory that contains the MATLAB bin and extern subdirectories)" 19 | 20 | option "without-test", "skip build-time tests (not recommended)" 21 | option "with-openmp", "Enable OpenMP multithreading" 22 | 23 | depends_on "gcc" 24 | depends_on "openblas" 25 | depends_on "tcsh" => :build unless OS.mac? 26 | 27 | patch :DATA 28 | 29 | def install 30 | ENV.deparallelize 31 | cp "MAKE_INC/make.mac-x", "./make.inc" 32 | build_args = ["RANLIB=true", 33 | "SuperLUroot=#{buildpath}", 34 | "SUPERLULIB=$(SuperLUroot)/lib/libsuperlu.a"] 35 | make_args = ["CC=#{ENV.cc}", 36 | "CFLAGS=-fPIC #{ENV.cflags}", 37 | "FORTRAN=#{ENV.fc}", 38 | "FFLAGS=#{ENV.fcflags}", 39 | "NOOPTS=-fPIC", 40 | "BLASLIB=-L#{Formula["openblas"].opt_lib} -lopenblas"] 41 | 42 | make_args << ("LOADOPTS=" + (build.with?("openmp") ? "-fopenmp" : "")) 43 | 44 | all_args = build_args + make_args 45 | mkdir "lib" 46 | system "make", "lib", *all_args 47 | if build.with? "test" 48 | system "make", "testing", *all_args 49 | cd "TESTING" do 50 | system "make", *all_args 51 | %w[stest dtest ctest ztest].each do |tst| 52 | ohai `tail -1 #{tst}.out`.chomp 53 | end 54 | end 55 | end 56 | 57 | cd "EXAMPLE" do 58 | system "make", *all_args 59 | end 60 | 61 | if build.with? "matlab" 62 | matlab = ENV["HOMEBREW_MATLAB_PATH"] || HOMEBREW_PREFIX 63 | cd "MATLAB" do 64 | system "make", "MATLAB=#{matlab}", *all_args 65 | end 66 | end 67 | 68 | prefix.install "make.inc" 69 | File.open(prefix/"make_args.txt", "w") do |f| 70 | make_args.each do |arg| 71 | var, val = arg.split("=", 2) 72 | f.puts "#{var}=\"#{val}\"" # Record options passed to make, preserve spaces. 73 | end 74 | end 75 | lib.install Dir["lib/*"] 76 | (include/"superlu").install Dir["SRC/*.h"] 77 | doc.install Dir["Doc/*"] 78 | (pkgshare/"examples").install Dir["EXAMPLE/*[^.o]"] 79 | (pkgshare/"matlab").install Dir["MATLAB/*"] if build.with? "matlab" 80 | end 81 | 82 | def caveats 83 | s = "" 84 | if build.with? "matlab" 85 | s += <<~EOS 86 | Matlab interfaces are located in 87 | 88 | #{opt_pkgshare}/matlab 89 | EOS 90 | end 91 | s 92 | end 93 | 94 | test do 95 | ENV.fortran 96 | cp_r pkgshare/"examples", testpath 97 | cp prefix/"make.inc", testpath 98 | make_args = ["SuperLUroot=#{opt_prefix}", 99 | "SUPERLULIB=#{opt_lib}/libsuperlu.a", 100 | "INCLUDEDIR=-Wno-implicit-function-declaration -I#{Formula["brewsci-superlu"].opt_include}/superlu", 101 | "HEADER=#{opt_include}/superlu"] 102 | File.readlines(opt_prefix/"make_args.txt").each do |line| 103 | make_args << line.chomp.delete('\\"') 104 | end 105 | 106 | cd "examples" do 107 | system "make", *make_args 108 | 109 | system "./superlu" 110 | system "./slinsol < g20.rua" 111 | system "./slinsolx < g20.rua" 112 | system "./slinsolx1 < g20.rua" 113 | system "./slinsolx2 < g20.rua" 114 | 115 | system "./dlinsol < g20.rua" 116 | system "./dlinsolx < g20.rua" 117 | system "./dlinsolx1 < g20.rua" 118 | system "./dlinsolx2 < g20.rua" 119 | 120 | system "./clinsol < cg20.cua" 121 | system "./clinsolx < cg20.cua" 122 | system "./clinsolx1 < cg20.cua" 123 | system "./clinsolx2 < cg20.cua" 124 | 125 | system "./zlinsol < cg20.cua" 126 | system "./zlinsolx < cg20.cua" 127 | system "./zlinsolx1 < cg20.cua" 128 | system "./zlinsolx2 < cg20.cua" 129 | 130 | system "./sitersol -h < g20.rua" # broken with Accelerate 131 | system "./sitersol1 -h < g20.rua" 132 | system "./ditersol -h < g20.rua" 133 | system "./ditersol1 -h < g20.rua" 134 | system "./citersol -h < g20.rua" 135 | system "./citersol1 -h < g20.rua" 136 | system "./zitersol -h < cg20.cua" 137 | system "./zitersol1 -h < cg20.cua" 138 | end 139 | end 140 | end 141 | 142 | __END__ 143 | diff --git a/SRC/dGetDiagU.c b/SRC/dGetDiagU.c 144 | index 4d7469a..41f1f27 100644 145 | --- a/SRC/dGetDiagU.c 146 | +++ b/SRC/dGetDiagU.c 147 | @@ -29,7 +29,7 @@ 148 | * data structures. 149 | * 150 | */ 151 | -#include 152 | +#include "slu_ddefs.h" 153 | 154 | void dGetDiagU(SuperMatrix *L, double *diagU) 155 | { 156 | 157 | -------------------------------------------------------------------------------- /Formula/lancelot.rb: -------------------------------------------------------------------------------- 1 | class Lancelot < Formula 2 | desc "Large-scale nonlinear optimization" 3 | homepage "http://www.numerical.rl.ac.uk/lancelot/blurb.html" 4 | url "https://github.com/ralna/LANCELOT/archive/v2019.08.09.tar.gz" 5 | sha256 "bf658b0a8ae9ae7bef1dff154b65760415116fb8287082e44661a58daf51d51f" 6 | head "https://github.com/ralna/LANCELOT.git" 7 | 8 | bottle do 9 | sha256 cellar: :any, sierra: "371f5d30bf12c4d8a145349810c622985289b2d3467385461473a20cca1cb69f" 10 | sha256 cellar: :any, x86_64_linux: "2ae28e21e5172371bb09c3ce8f850fffd4b5aab81cd30740bf48b72e7b0a459b" 11 | end 12 | 13 | depends_on "gcc" 14 | depends_on "tcsh" if OS.linux? 15 | 16 | def install 17 | system "make" 18 | system "make", "PRECISION=single" 19 | ["bin/lan", "bin/sdlan"].each { |f| inreplace f, "/bin/csh", "/usr/bin/env csh" } 20 | libexec.install "bin", "objects" 21 | %w[lan sdlan sifdec_single sifdec_double].each { |f| bin.install_symlink libexec/"bin/#{f}" } 22 | doc.install "doc/manual.err" 23 | share.install "sampleproblems", "SPEC.SPC" 24 | end 25 | 26 | def caveats 27 | "Set the LANDIR environment variable to #{opt_libexec}" 28 | end 29 | 30 | test do 31 | ENV.append "LANDIR", opt_libexec 32 | cp opt_share/"sampleproblems/ALLIN.SIF", testpath 33 | system "#{bin}/sdlan", "ALLIN" 34 | system "#{bin}/lan", "-n" 35 | system "#{bin}/sdlan", "-s", "ALLIN" 36 | system "#{bin}/lan", "-s", "-n" 37 | end 38 | end 39 | -------------------------------------------------------------------------------- /Formula/starpu.rb: -------------------------------------------------------------------------------- 1 | class Starpu < Formula 2 | desc "Unified Runtime System for Heterogeneous Multicore Architectures" 3 | homepage "http://starpu.gforge.inria.fr/" 4 | url "http://starpu.gforge.inria.fr/files/starpu-1.2.6/starpu-1.2.6.tar.gz" 5 | sha256 "eb67a7676777b6ed583722aca5a9f63145b842f390ac2f5b3cbc36fe910d964c" 6 | 7 | bottle do 8 | root_url "https://archive.org/download/brewsci/bottles-num" 9 | sha256 sierra: "eb9757a75eeb7f82d1c5baffcfcd6dc6e95a7c23a8f840d47e2e1b91741dd88e" 10 | sha256 x86_64_linux: "7b0450cf223d60fd11bec88cadb77aa12c754168a86bfb5a1c3b8461e9d93d7e" 11 | end 12 | 13 | head do 14 | url "https://scm.gforge.inria.fr/anonscm/git/starpu/starpu.git" 15 | depends_on "autoconf" => :build 16 | depends_on "automake" => :build 17 | depends_on "libtool" => :build 18 | depends_on "openblas" 19 | end 20 | 21 | depends_on "hwloc" 22 | depends_on "pkg-config" 23 | depends_on "gcc" => :optional 24 | 25 | fails_with :clang if build.with? "gcc" 26 | 27 | def install 28 | if build.head? 29 | ENV["LIBTOOL"] = "glibtool" 30 | system "./autogen.sh" 31 | end 32 | 33 | mkdir "build" do 34 | args = ["--disable-debug", 35 | "--disable-dependency-tracking", 36 | "--disable-silent-rules", 37 | "--enable-quick-check", 38 | "--disable-build-examples", 39 | "--bindir=#{libexec}/bin", 40 | "--without-x", 41 | "--enable-blas-lib=openblas", 42 | "--prefix=#{prefix}"] 43 | args << "--enable-openmp" if build.with? "gcc" 44 | 45 | system "../configure", *args 46 | system "make" 47 | system "make", "check" 48 | system "make", "install" 49 | %w[starpu_calibrate_bus starpu_codelet_histo_profile starpu_codelet_profile 50 | starpu_lp2paje starpu_machine_display starpu_paje_state_stats 51 | starpu_perfmodel_display starpu_perfmodel_plot starpu_sched_display 52 | starpu_tasks_rec_complete starpu_temanejo2.sh].each do |f| 53 | bin.install_symlink "#{libexec}/bin/#{f}" 54 | end 55 | end 56 | end 57 | 58 | test do 59 | (testpath/"hello-starpu.c").write <<~EOF 60 | #include 61 | static void my_task (int x) __attribute__ ((task)); 62 | static void my_task (int x) { 63 | printf ("Hello, world! With x = %d\\n", x); 64 | } 65 | int main (void) { 66 | #pragma starpu initialize 67 | my_task (42); 68 | #pragma starpu wait 69 | #pragma starpu shutdown 70 | return 0; 71 | } 72 | EOF 73 | 74 | ENV.prepend_path "PKG_CONFIG_PATH", Formula["hwloc"].opt_prefix 75 | 76 | ver = Formula["starpu"].version.to_f # should be 1.2 77 | cflags = `#{Formula["pkg-config"].opt_bin}/pkg-config starpu-#{ver} --cflags` 78 | libs = `#{Formula["pkg-config"].opt_bin}/pkg-config starpu-#{ver} --libs` 79 | system ENV["CC"], "hello-starpu.c", *(cflags.split + libs.split) 80 | assert_match "x = 42", shell_output("./a.out 2>&1") 81 | end 82 | end 83 | -------------------------------------------------------------------------------- /Formula/tetgen.rb: -------------------------------------------------------------------------------- 1 | class Tetgen < Formula 2 | desc "Quality Tetrahedral Mesh Generator and a 3D Delaunay Triangulator" 3 | homepage "http://tetgen.org/" 4 | url "http://www.tetgen.org/1.5/src/tetgen1.5.1.tar.gz" 5 | sha256 "e46a4434a3e7c00044c8f4f167e18b6f4a85be7d22838c8f948ce8cc8c01b850" 6 | 7 | bottle do 8 | root_url "https://archive.org/download/brewsci/bottles-num" 9 | sha256 cellar: :any_skip_relocation, sierra: "15806b7803730d5ff1e4f62e3c2622cf5125f62d452217d84b730b6f9c24a716" 10 | sha256 cellar: :any_skip_relocation, x86_64_linux: "c3bd89a77769edf75686ccb15ab35bda3b61bd0e64261ce1c86575ebb565578d" 11 | end 12 | 13 | depends_on "cmake" => :build 14 | 15 | resource "manual" do 16 | url "http://www.tetgen.org/1.5/doc/manual/manual.pdf" 17 | sha256 "ce71e755c33dc518b1a3bc376fb860c0659e7e14b18e4d9798edcbda05a24eca" 18 | end 19 | 20 | def install 21 | mkdir "build" do 22 | system "cmake", "..", *std_cmake_args 23 | system "make" 24 | bin.install "tetgen" 25 | lib.install "libtet.a" 26 | include.install buildpath/"tetgen.h" 27 | resource("manual").stage do 28 | doc.install "manual.pdf" 29 | end 30 | pkgshare.install buildpath/"example.poly" 31 | end 32 | end 33 | 34 | test do 35 | cp pkgshare/"example.poly", testpath 36 | output = shell_output("#{bin}/tetgen -pq1.2V example.poly") 37 | assert_match /[Ss]tatistics/, output, "Missing statistics in output" 38 | assert_match /[Hh]istogram/, output, "Missing histogram in output" 39 | assert_match /seconds/, output, "Missing timings in output" 40 | outfile_suffixes = %w[node ele face edge] 41 | outfile_suffixes.each do |suff| 42 | assert_predicate testpath/"example.1.#{suff}", :exist? 43 | rm testpath/"example.1.#{suff}" 44 | end 45 | cp testpath/"example.poly", testpath/"example.node" 46 | system "#{bin}/tetgen", testpath/"example.node" 47 | outfile_suffixes -= ["edge"] 48 | outfile_suffixes.each do |suff| 49 | assert_predicate testpath/"example.1.#{suff}", :exist? 50 | end 51 | end 52 | end 53 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 2-Clause License 2 | 3 | Copyright (c) 2018, Linuxbrew contributors. 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Brewsci/num 2 | 3 | Numerical analysis formulae for the [Linuxbrew](http://linuxbrew.sh) and [Homebrew](https://brew.sh) package managers. 4 | 5 | ## How do I install a formula? 6 | 7 | ```sh 8 | brew tap brewsci/num 9 | brew install FORMULA 10 | ``` 11 | 12 | or 13 | 14 | ```sh 15 | brew install brewsci/num/FORMULA 16 | ``` 17 | 18 | ## Troubleshooting 19 | 20 | First read the [Troubleshooting Checklist](http://docs.brew.sh/Troubleshooting.html). 21 | 22 | Use `brew gist-logs FORMULA` to create a [Gist](https://gist.github.com/) and post the link in your issue. 23 | 24 | Search the [issues](https://github.com/brewsci/homebrew-num/issues?q=). See also Homebrew's [Common Issues](https://docs.brew.sh/Common-Issues.html) and [FAQ](https://docs.brew.sh/FAQ.html). 25 | 26 | ## Documentation 27 | 28 | `brew help`, `man brew`, or check [Homebrew's documentation](https://docs.brew.sh). 29 | 30 | ## Contributing 31 | 32 | Please see the [contributing guide](https://github.com/brewsci/homebrew-num/blob/master/CONTRIBUTING.md). 33 | --------------------------------------------------------------------------------