Skip to content
This repository has been archived by the owner on Dec 14, 2020. It is now read-only.

CoinOptServices build broken on macOS Sierra #40

Open
stumarcus314 opened this issue Dec 27, 2017 · 12 comments
Open

CoinOptServices build broken on macOS Sierra #40

stumarcus314 opened this issue Dec 27, 2017 · 12 comments

Comments

@stumarcus314
Copy link

I have macOS Sierra version 10.12.6. When I try to Pkg.build("CoinOptServices"), I get the error below:

===========================[ ERROR: CoinOptServices ]===========================

LoadError: Provider BinDeps.PackageManager failed to satisfy dependency libOS
while loading /Users/a598124/.julia/v0.6/CoinOptServices/deps/build.jl, in expression starting on line 71

================================================================================

================================[ BUILD ERRORS ]================================

WARNING: CoinOptServices had build errors.

  • packages with build errors remain installed in /Users/a598124/.julia/v0.6
  • build the package(s) and all dependencies with Pkg.build("CoinOptServices")
  • build a single package by running its deps/build.jl script

================================================================================

@jgoldfar
Copy link
Contributor

jgoldfar commented Jan 25, 2018

I ran into what may be the same issue; building from source should work. You may need #37 (comment out the Homebrew provider, then re-run deps/build.jl)

@stumarcus314
Copy link
Author

Where are the instructions to "build from source"?

@shoshievass
Copy link

@stumarcus576 did you figure it out?

@stumarcus314
Copy link
Author

No.

@jgoldfar
Copy link
Contributor

jgoldfar commented Mar 1, 2018

Did you try commenting out the Homebrew provider in deps/build.jl, then try re-running that file as Pkg.build does?

@stumarcus314
Copy link
Author

Where is deps/build.jl ?

@mlubin
Copy link
Member

mlubin commented Mar 1, 2018

The macOS binaries will likely remain broken until we develop BinaryBuilder packages. We just got through this with Ipopt (jump-dev/Ipopt.jl#98). However, I can't even compile the last Optimization Services release (from 2015) locally due to errors with gcc 6.3. I think the BinaryBuilder toolchain uses gcc 7. The most likely way forward would be for us to drop Optimization Services and directly build Couenne and Bonmin for use with AmplNLWriter.

@mlubin
Copy link
Member

mlubin commented Mar 1, 2018

We have an updated discussion on the status of the package at #44.

@shoshievass
Copy link

After getting a bunch of help from the kind folks here, I think I have gotten Couenne to install/work (this was my goal). I will try to detail instructions below:

For reference, I am running v0.6.2 of Julia on MacOS High Sierra v10.13.3.

The overarching plan here is to install Couenne from source, and then direct AmplNLWriter to it.

  1. Download the Couenne source files here: https://projects.coin-or.org/Couenne/

--> If you're having trouble finding it, the INSTALL instructions have a direct download link from subversion so you can just run:
svn co https://projects.coin-or.org/svn/Couenne/trunk Couenne

This creates a directory Couenne/ and downloads most of the necessary
source files that are needed for building Couenne.

  1. Following the INSTALL file in the downloaded folder, install 'ThirdParty' packages. We need 4 of them: ASL, Blas, Lapack and HSL. Each has a subdirectory in the ThirdParty directory inside the Couenne folder. For the first 3, you can just cd to the package's directory and install from there. For example, you can install ASL by:
cd ThirdParty/ASL
./get.ASL
cd ../..
  1. For HSL, you need a more involved process b/c you need to be approved for a use license. Instructions are found in the ThirdParty/HSL/INSTALL.HSL file.
    a. Go here: http://www.hsl.rl.ac.uk/ipopt and click on Coin-HSL Full (Stable) --> Source
    image
    I requested a Personal Academic Licence as this was appropriate for me, and filled out the form. Within a day or so, I was emailed a download link for coinhsl-2014.01.10.tar.gz. Download this file and move it to the Couenne/ThirdParty/HSL directory (I'm not totally sure this is necessary but it can't hurt).

b. Following the INSTALL.HSL instructions:
Unpack this archive via

  gunzip coinhsl-2014.01.10.tar.gz
  tar xf coinhsl-2014.01.10.tar

Note: matching the instructions to this example, coinhsl-x.y.z.tar.gz == coinhsl-2014.01.10.tar.gz, etc.

c. Then rename the directory coinhsl-x.y.z to coinhsl, or set a symbolic link:

ln -s coinhsl-2014.01.10 coinhsl

This should be all you need to do w/ HSL. Now go back to Couenne.

  1. From the Couenne directory:
mkdir build
cd build
../configure -C
make
  1. Details on configuring non-default directory paths are in the INSTALL txt file. For the standard build, run:
../configure --prefix=/usr/local
  1. You might want to check the unit tests before installing. Without moving directories, run
make unitTest

If it works, you should see something like this:

Testing couenne.opt.vt
Global Optimum Test on circle.nl                                OK
Global Optimum Test on cube.nl                                 OK

...

Global Optimum Test on qquad.nl                             OK
Global Optimum Test on sin.nl                                   OK
Global Optimum Test on small2.nl                             OK
Global Optimum Test on toy.nl                                   OK

If all of the tests are passed, you can make install:

make install

This should give you a working Couenne installation.

  1. Install AmplNLWriter:
    In Julia: Pkg.add("AmplNLWriter").

Then whenever you want to use Couenne with JuMP, use something like:

using AmplNLWriter

m = Model(solver=AmplNLSolver("/usr/local/bin/couenne"))

Hope this helps and please post corrections if/when appropriate!

@mlubin
Copy link
Member

mlubin commented Mar 14, 2018

@shoshievass, this is great, thanks for putting it together!
You should note that while HSL improves Couenne's performance significantly, it's not strictly needed. You can replace it with Mumps by running get.Mumps in the ThirdParty/Mumps directory (haven't double checked this).

@stumarcus314
Copy link
Author

I just tried mlubin's instructions for installing and using Mumps instead of HSL, and it works fine.

@stumarcus314
Copy link
Author

BTW, one of the COUENNE installation steps, provided above by @shoshievass, failed because I didn't have a Fortran compiler installed. I followed these instructions (https://www.webmo.net/support/fortran_osx.html) under "gfortran COMPILER ... "GCC Wiki" implementation" to download and install gfortran in /usr/local/.

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

No branches or pull requests

4 participants