Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation issue on Mac #101

Open
ebellussi opened this issue Jan 14, 2025 · 6 comments
Open

Installation issue on Mac #101

ebellussi opened this issue Jan 14, 2025 · 6 comments

Comments

@ebellussi
Copy link

OS: 15.2 (24C101)
Processor: M1 Pro

Log:

==> Installing coin-or-tools/coinor/cbc dependency: coin-or-tools/coinor/clp
==> ./configure --datadir=/opt/homebrew/Cellar/clp/1.17.7/share/clp --includedir=/opt/homebrew/Cellar/clp/1.17.7/include/clp --with-s
==> make
Last 15 lines from /Users/eliabellussi/Library/Logs/Homebrew/clp/02.make:
Clp_ampl.cpp:48:10: fatal error: 'getstub.h' file not found
48 | #include "getstub.h"
| ^~~~~~~~~~~
1 error generated.
make[3]: *** [Clp_ampl.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
clang++ -r -keep_private_externs -nostdlib -o .libs/libClp.1.14.7.dylib-master.o .libs/ClpCholeskyBase.o .libs/ClpCholeskyDense.o .libs/ClpConstraint.o .libs/ClpConstraintLinear.o .libs/ClpConstraintQuadratic.o .libs/Clp_C_Interface.o .libs/ClpDualRowDantzig.o .libs/ClpDualRowPivot.o .libs/ClpDualRowSteepest.o .libs/ClpDummyMatrix.o .libs/ClpDynamicExampleMatrix.o .libs/ClpDynamicMatrix.o .libs/ClpEventHandler.o .libs/ClpFactorization.o .libs/ClpGubDynamicMatrix.o .libs/ClpGubMatrix.o .libs/ClpHelperFunctions.o .libs/ClpInterior.o .libs/ClpLinearObjective.o .libs/ClpMatrixBase.o .libs/ClpMessage.o .libs/ClpModel.o .libs/ClpNetworkBasis.o .libs/ClpNetworkMatrix.o .libs/ClpNonLinearCost.o .libs/ClpNode.o .libs/ClpObjective.o .libs/ClpPackedMatrix.o .libs/ClpPlusMinusOneMatrix.o .libs/ClpPredictorCorrector.o .libs/ClpPdco.o .libs/ClpPdcoBase.o .libs/ClpLsqr.o .libs/ClpPresolve.o .libs/ClpPrimalColumnDantzig.o .libs/ClpPrimalColumnPivot.o .libs/ClpPrimalColumnSteepest.o .libs/ClpQuadraticObjective.o .libs/ClpSimplex.o .libs/ClpSimplexDual.o .libs/ClpSimplexNonlinear.o .libs/ClpSimplexOther.o .libs/ClpSimplexPrimal.o .libs/ClpSolve.o .libs/Idiot.o .libs/IdiSolve.o .libs/ClpCholeskyPardiso.o .libs/ClpPESimplex.o .libs/ClpPEPrimalColumnDantzig.o .libs/ClpPEPrimalColumnSteepest.o .libs/ClpPEDualRowDantzig.o .libs/ClpPEDualRowSteepest.o .libs/ClpCholeskyUfl.o .libs/ClpCholeskyMumps.o
clang++ -dynamiclib -single_module -o .libs/libClp.1.14.7.dylib .libs/libClp.1.14.7.dylib-master.o -L/opt/homebrew/opt/ampl-mp/lib -lasl -L/opt/homebrew/opt/mumps-seq/lib -ldmumps -lmumps_common -lpord -lmpiseq -L/opt/homebrew/opt/glpk@448/lib -L/opt/homebrew/Cellar/coinutils/2.11.11/lib -lCoinUtils -lbz2 -lz -lglpk -L/opt/homebrew/opt/openblas/lib -lopenblas -lm -install_name /opt/homebrew/Cellar/clp/1.17.7/lib/libClp.1.dylib -compatibility_version 16 -current_version 16.7
ld: warning: -single_module is obsolete
ld: library 'asl' not found
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [libClp.la] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1

@lauracosgrove
Copy link

  • 1, I also have this issue.
Last 15 lines from /Users/lcosgrove/Library/Logs/Homebrew/clp/02.make:
 clang++ -DHAVE_CONFIG_H -I. -I. -I/opt/homebrew/opt/ampl-mp/include/asl -I/opt/homebrew/opt/mumps-seq/libexec/include -I/opt/homebrew/opt/glpk@448/include -I/opt/homebrew/Cellar/coinutils/2.11.11/include/coinutils/coin -DCOIN_HAS_CLP -O3 -pipe -DNDEBUG -Wparentheses -Wreturn-type -Wcast-qual -Wall -Wpointer-arith -Wwrite-strings -Wconversion -Wno-unknown-pragmas -Wno-long-long -DCLP_BUILD -c Clp_ampl.cpp  -fno-common -DPIC -o .libs/Clp_ampl.o
 clang++ -DHAVE_CONFIG_H -I. -I. -I/opt/homebrew/opt/ampl-mp/include/asl -I/opt/homebrew/opt/mumps-seq/libexec/include -I/opt/homebrew/opt/glpk@448/include -I/opt/homebrew/Cellar/coinutils/2.11.11/include/coinutils/coin -DCOIN_HAS_CLP -O3 -pipe -DNDEBUG -Wparentheses -Wreturn-type -Wcast-qual -Wall -Wpointer-arith -Wwrite-strings -Wconversion -Wno-unknown-pragmas -Wno-long-long -DCLP_BUILD -c ClpSolver.cpp  -fno-common -DPIC -o .libs/ClpSolver.o
 clang++ -DHAVE_CONFIG_H -I. -I. -I/opt/homebrew/opt/ampl-mp/include/asl -I/opt/homebrew/opt/mumps-seq/libexec/include -I/opt/homebrew/opt/glpk@448/include -I/opt/homebrew/Cellar/coinutils/2.11.11/include/coinutils/coin -DCOIN_HAS_CLP -O3 -pipe -DNDEBUG -Wparentheses -Wreturn-type -Wcast-qual -Wall -Wpointer-arith -Wwrite-strings -Wconversion -Wno-unknown-pragmas -Wno-long-long -DCLP_BUILD -c ClpCholeskyMumps.cpp  -fno-common -DPIC -o .libs/ClpCholeskyMumps.o
 clang++ -DHAVE_CONFIG_H -I. -I. -I/opt/homebrew/opt/ampl-mp/include/asl -I/opt/homebrew/opt/mumps-seq/libexec/include -I/opt/homebrew/opt/glpk@448/include -I/opt/homebrew/Cellar/coinutils/2.11.11/include/coinutils/coin -DCOIN_HAS_CLP -O3 -pipe -DNDEBUG -Wparentheses -Wreturn-type -Wcast-qual -Wall -Wpointer-arith -Wwrite-strings -Wconversion -Wno-unknown-pragmas -Wno-long-long -DCLP_BUILD -c MyMessageHandler.cpp  -fno-common -DPIC -o .libs/MyMessageHandler.o
 clang++ -DHAVE_CONFIG_H -I. -I. -I/opt/homebrew/opt/ampl-mp/include/asl -I/opt/homebrew/opt/mumps-seq/libexec/include -I/opt/homebrew/opt/glpk@448/include -I/opt/homebrew/Cellar/coinutils/2.11.11/include/coinutils/coin -DCOIN_HAS_CLP -O3 -pipe -DNDEBUG -Wparentheses -Wreturn-type -Wcast-qual -Wall -Wpointer-arith -Wwrite-strings -Wconversion -Wno-unknown-pragmas -Wno-long-long -DCLP_BUILD -c CbcOrClpParam.cpp  -fno-common -DPIC -o .libs/CbcOrClpParam.o
 clang++ -DHAVE_CONFIG_H -I. -I. -I/opt/homebrew/opt/ampl-mp/include/asl -I/opt/homebrew/opt/mumps-seq/libexec/include -I/opt/homebrew/opt/glpk@448/include -I/opt/homebrew/Cellar/coinutils/2.11.11/include/coinutils/coin -DCOIN_HAS_CLP -O3 -pipe -DNDEBUG -Wparentheses -Wreturn-type -Wcast-qual -Wall -Wpointer-arith -Wwrite-strings -Wconversion -Wno-unknown-pragmas -Wno-long-long -DCLP_BUILD -c MyEventHandler.cpp  -fno-common -DPIC -o .libs/MyEventHandler.o
Clp_ampl.cpp:48:10: fatal error: 'getstub.h' file not found
   48 | #include "getstub.h"
      |          ^~~~~~~~~~~
1 error generated.
make[3]: *** [Clp_ampl.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1

@tkralphs
Copy link
Member

Hmm, looks like maybe a version incompatibility issue. I suppose that the ampl-mp package got updated and in now incompatible. Let me look into it a bit.

@tkralphs
Copy link
Member

I guess I should have asked whether you are really installing clp from this tap or whether you are installing the version in homebrew-core. If the latter, then this is not the place to report the issue. We do not maintain the recipe in homebrew-core.

In any case, it appears that version 4.0.0 of ampl-mp was released recently and that is incompatible. I was able to install clp on linuxbrew just now, but maybe that's because it has bottles and there must not be any for Apple Silicon. Can you try editing the recipe (brew edit clp) and changing

  depends_on "ampl-mp"

to

  depends_on "[email protected]"

I guess that will fix it.

@lauracosgrove
Copy link

Hi, thanks for the guidance. I am installing clp from this tap.

In addition to the change in clp, I needed to set up the 3.1.0 pin for ampl-mp as follows:

class AmplMpAT310 < Formula
  desc "Open-source library for mathematical programming"
  homepage "https://ampl.com/"
  url "https://github.com/ampl/mp/archive/refs/tags/3.1.0.tar.gz"
  sha256 "587c1a88f4c8f57bef95b58a8586956145417c8039f59b1758365ccc5a309ae9"
  license "MIT"

  livecheck do
    url :stable
    regex(/^v?(\d+(?:\.\d+)+)$/i)
  end

  depends_on "cmake" => :build

  def install
    args = %W[
      -DAMPL_LIBRARY_DIR=#{libexec}/bin
      -DBUILD_SHARED_LIBS=ON
      -DBUILD_TESTS=OFF
      -DCMAKE_INSTALL_RPATH=#{rpath};#{rpath(source: libexec/"bin")}
    ]

    system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args
    system "cmake", "--build", "build"
    system "cmake", "--install", "build"
  end

  test do
    (testpath/"test.c").write <<~C
      #include <stdio.h>
      #include <stdlib.h>
      #include "mp/ampls-c-api.h"

      int main() {
          AMPLS_MP_Solver* solver = (AMPLS_MP_Solver*)malloc(sizeof(AMPLS_MP_Solver));
          free(solver);
          return 0;
      }
    C

    system ENV.cc, "test.c", "-I#{include}/mp", "-L#{lib}", "-lmp", "-o", "test"
    system "./test"
  end
end

And on lines 52 and 53 in clp.rb I updated the formula reference:

    args << "--with-asl-incdir=#{Formula["[email protected]"].opt_include}/asl"
    args << "--with-asl-lib=-L#{Formula["[email protected]"].opt_lib} -lasl"

@tkralphs
Copy link
Member

Thank you very much for this solution, @lauracosgrove!

@tkralphs
Copy link
Member

@lauracosgrove, would you mind submitting a PR to fix this issue? I can of course copy-paste your solution, but I would prefer for you to be an author of the commit. You deserve the credit. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants