Skip to content

Commit

Permalink
ipopt: migrate to pkgconf
Browse files Browse the repository at this point in the history
  • Loading branch information
cho-m committed Nov 24, 2024
1 parent b5bd8f3 commit 773b03d
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions Formula/i/ipopt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Ipopt < Formula
end

depends_on "openjdk" => :build
depends_on "pkg-config" => [:build, :test]
depends_on "pkgconf" => [:build, :test]
depends_on "ampl-asl"
depends_on "gcc" # for gfortran
depends_on "openblas"
Expand Down Expand Up @@ -76,19 +76,16 @@ def install
end

args = [
"--disable-debug",
"--disable-dependency-tracking",
"--disable-silent-rules",
"--enable-shared",
"--prefix=#{prefix}",
"--with-blas=-L#{Formula["openblas"].opt_lib} -lopenblas",
"--with-mumps-cflags=-I#{buildpath}/mumps_include",
"--with-mumps-lflags=-L#{lib} -ldmumps -lmpiseq -lmumps_common -lopenblas -lpord",
"--with-asl-cflags=-I#{Formula["ampl-asl"].opt_include}/asl",
"--with-asl-lflags=-L#{Formula["ampl-asl"].opt_lib} -lasl",
]

system "./configure", *args
system "./configure", *args, *std_configure_args
system "make"

ENV.deparallelize
Expand All @@ -97,8 +94,8 @@ def install

test do
testpath.install resource("test")
pkg_config_flags = shell_output("pkg-config --cflags --libs ipopt").chomp.split
system ENV.cxx, "examples/hs071_cpp/hs071_main.cpp", "examples/hs071_cpp/hs071_nlp.cpp", *pkg_config_flags
pkgconf_flags = shell_output("pkgconf --cflags --libs ipopt").chomp.split
system ENV.cxx, "examples/hs071_cpp/hs071_main.cpp", "examples/hs071_cpp/hs071_nlp.cpp", *pkgconf_flags
system "./a.out"

resource("miniampl").stage do
Expand Down

0 comments on commit 773b03d

Please sign in to comment.