11class Scotch < Formula
22 desc "Package for graph partitioning, graph clustering, and sparse matrix ordering"
33 homepage "https://gitlab.inria.fr/scotch/scotch"
4- url "https://gitlab.inria.fr/scotch/scotch/-/archive/v7.0.7 /scotch-v7.0.7 .tar.bz2"
5- sha256 "d88a9005dd05a9b3b86e6d1d7925740a789c975e5a92718ca0070e16b6567893 "
4+ url "https://gitlab.inria.fr/scotch/scotch/-/archive/v7.0.8 /scotch-v7.0.8 .tar.bz2"
5+ sha256 "f4f05f56ad2c3219d9c6118eaa21d07af5c266cdc59db194b5fd47efe1ec1448 "
66 license "CECILL-C"
77 head "https://gitlab.inria.fr/scotch/scotch.git" , branch : "master"
88
@@ -32,17 +32,20 @@ class Scotch < Formula
3232 uses_from_macos "zlib"
3333
3434 def install
35- system "cmake" , "-S" , "." , "-B" , "build" ,
36- "-DBUILD_SHARED_LIBS=ON" ,
37- "-DCMAKE_INSTALL_RPATH=#{ rpath } " ,
38- "-DENABLE_TESTS=OFF" ,
39- "-DINSTALL_METIS_HEADERS=OFF" ,
40- *std_cmake_args
35+ args = %W[
36+ -DBUILD_SHARED_LIBS=ON
37+ -DCMAKE_INSTALL_RPATH=#{ rpath }
38+ -DENABLE_TESTS=OFF
39+ -DINSTALL_METIS_HEADERS=OFF
40+ ]
41+ system "cmake" , "-S" , "." , "-B" , "build" , *args , *std_cmake_args
4142 system "cmake" , "--build" , "build"
4243 system "cmake" , "--install" , "build"
4344
44- pkgshare . install "src/check/test_strat_seq.c"
45- pkgshare . install "src/check/test_strat_par.c"
45+ ( pkgshare /"check" ) . install "src/check/test_strat_seq.c"
46+ ( pkgshare /"check" ) . install "src/check/test_strat_par.c"
47+ ( pkgshare /"libscotch" ) . install "src/libscotch/common.h"
48+ ( pkgshare /"libscotch" ) . install "src/libscotch/module.h"
4649
4750 # License file has a non-standard filename
4851 prefix . install buildpath . glob ( "LICEN[CS]E_*.txt" )
@@ -61,18 +64,17 @@ def install
6164 return 0;
6265 }
6366 C
64- system ENV . cc , "test.c" , "-L#{ lib } " , "-lscotch" , "-lscotcherr" ,
65- "-pthread" , "-L#{ Formula [ "zlib" ] . opt_lib } " , "-lz" , "-lm"
67+
68+ args = %W[ -I#{ include } -L#{ lib } -lscotch -lscotcherr -pthread -lz -lm ]
69+
70+ system ENV . cc , "test.c" , *args
6671 assert_match version . to_s , shell_output ( "./a.out" )
6772
68- system ENV . cc , pkgshare /"test_strat_seq.c" , "-o" , "test_strat_seq" ,
69- "-I#{ include } " , "-L#{ lib } " , "-lscotch" , "-lscotcherr" , "-lm" , "-pthread" ,
70- "-L#{ Formula [ "zlib" ] . opt_lib } " , "-lz"
73+ system ENV . cc , pkgshare /"check/test_strat_seq.c" , "-o" , "test_strat_seq" , *args
7174 assert_match "Sequential mapping strategy, SCOTCH_STRATDEFAULT" , shell_output ( "./test_strat_seq" )
7275
73- system "mpicc" , pkgshare /"test_strat_par.c" , "-o" , "test_strat_par" ,
74- "-I#{ include } " , "-L#{ lib } " , "-lptscotch" , "-lscotch" , "-lptscotcherr" , "-lm" , "-pthread" ,
75- "-L#{ Formula [ "zlib" ] . opt_lib } " , "-lz" , "-Wl,-rpath,#{ lib } "
76+ system "mpicc" , pkgshare /"check/test_strat_par.c" , "-o" , "test_strat_par" ,
77+ "-lptscotch" , "-Wl,-rpath,#{ lib } " , *args
7678 assert_match "Parallel mapping strategy, SCOTCH_STRATDEFAULT" , shell_output ( "./test_strat_par" )
7779 end
7880end
0 commit comments