-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add pinned suite-sparse, depend on pinned suite-sparse in ceres (#41)
- Loading branch information
1 parent
a0b5118
commit db2d5d8
Showing
2 changed files
with
66 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
class SuiteSparseAT71 < Formula | ||
desc "Suite of Sparse Matrix Software" | ||
homepage "https://people.engr.tamu.edu/davis/suitesparse.html" | ||
url "https://github.com/DrTimothyAldenDavis/SuiteSparse/archive/refs/tags/v7.1.0.tar.gz" | ||
sha256 "4cd3d161f9aa4f98ec5fa725ee5dc27bca960a3714a707a7d12b3d0abb504679" | ||
license all_of: [ | ||
"BSD-3-Clause", | ||
"LGPL-2.1-or-later", | ||
"GPL-2.0-or-later", | ||
"Apache-2.0", | ||
"GPL-3.0-only", | ||
any_of: ["LGPL-3.0-or-later", "GPL-2.0-or-later"], | ||
] | ||
|
||
livecheck do | ||
skip "intentionally held back" | ||
end | ||
|
||
depends_on "cmake" => :build | ||
depends_on "metis" | ||
depends_on "openblas" | ||
|
||
uses_from_macos "m4" | ||
|
||
conflicts_with "mongoose", because: "suite-sparse vendors libmongoose.dylib" | ||
|
||
def install | ||
# Force cmake to use our compiler shims | ||
if OS.mac? | ||
inreplace "GraphBLAS/cmake_modules/GraphBLAS_JIT_configure.cmake", | ||
"GB_C_COMPILER \"${CMAKE_C_COMPILER}\"", "GB_C_COMPILER \"#{ENV.cc}\"" | ||
end | ||
|
||
cmake_args = *std_cmake_args, "-DCMAKE_INSTALL_RPATH=#{rpath}" | ||
args = [ | ||
"INSTALL=#{prefix}", | ||
"BLAS=-L#{Formula["openblas"].opt_lib} -lopenblas", | ||
"LAPACK=$(BLAS)", | ||
"MY_METIS_LIB=-L#{Formula["metis"].opt_lib} -lmetis", | ||
"MY_METIS_INC=#{Formula["metis"].opt_include}", | ||
"CMAKE_OPTIONS=#{cmake_args.join(" ")}", | ||
"JOBS=#{ENV.make_jobs}", | ||
] | ||
|
||
# Parallelism is managed through the `JOBS` make variable and not with `-j`. | ||
ENV.deparallelize | ||
system "make", "library", *args | ||
system "make", "install", *args | ||
lib.install Dir["**/*.a"] | ||
pkgshare.install "KLU/Demo/klu_simple.c" | ||
end | ||
|
||
test do | ||
system ENV.cc, "-o", "test", pkgshare/"klu_simple.c", | ||
"-L#{lib}", "-lsuitesparseconfig", "-lklu" | ||
assert_predicate testpath/"test", :exist? | ||
assert_match "x [0] = 1", shell_output("./test") | ||
end | ||
end |