JuliaOpt / CoinOptServices.jl

Julia interface to COIN-OR Optimization Services https://projects.coin-or.org/OS
Other
16 stars 4 forks source link

CoinOptServices build broken on macOS Sierra #40

Open stumarcus314 opened 6 years ago

stumarcus314 commented 6 years ago

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.

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

jgoldfar commented 6 years ago

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

stumarcus314 commented 6 years ago

Where are the instructions to "build from source"?

shoshievass commented 6 years ago

@stumarcus576 did you figure it out?

stumarcus314 commented 6 years ago

No.

jgoldfar commented 6 years ago

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

stumarcus314 commented 6 years ago

Where is deps/build.jl ?

mlubin commented 6 years ago

The macOS binaries will likely remain broken until we develop BinaryBuilder packages. We just got through this with Ipopt (https://github.com/JuliaOpt/Ipopt.jl/pull/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 commented 6 years ago

We have an updated discussion on the status of the package at https://github.com/JuliaOpt/CoinOptServices.jl/pull/44.

shoshievass commented 6 years ago

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.

2) 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 ../..

3) 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.

4) From the Couenne directory:

mkdir build
cd build
../configure -C
make

5) Details on configuring non-default directory paths are in the INSTALL txt file. For the standard build, run:

../configure --prefix=/usr/local

6) 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.

7) 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 commented 6 years ago

@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 commented 6 years ago

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

stumarcus314 commented 6 years ago

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/.