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

Pkg.add(CoinOptServices) fails: Xubuntu 12.04 #21

Open
samiit opened this issue Jun 22, 2016 · 4 comments
Open

Pkg.add(CoinOptServices) fails: Xubuntu 12.04 #21

samiit opened this issue Jun 22, 2016 · 4 comments

Comments

@samiit
Copy link

samiit commented Jun 22, 2016

I tried to do

> Pkg.add("CoinOptServices")

and I get errors saying the build is not done.
/usr/local/lib/libipopt.so: undefined reference todlopen'
/usr/local/lib/libipopt.so: undefined reference to dlclose' /usr/local/lib/libipopt.so: undefined reference todlerror'
/usr/local/lib/libipopt.so: undefined reference to dlsym' collect2: error: ld returned 1 exit status make[2]: *** [bonmin] Error 1 make[2]: Leaving directory/home/sam/.julia/v0.4/CoinOptServices/deps/src/OS-2.9.2/build/Bonmin/src/Apps'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory /home/sam/.julia/v0.4/CoinOptServices/deps/src/OS-2.9.2/build/Bonmin' make: *** [all-recursive] Error 1

I think it is because of a pre-installed Ipopt.

From this link, I found that I should configure with
LDFLAGS="-Wl,--no-as-needed" or with --enable-dependency-linking
I checked the build.jl file in the folder ~/.julia/v0.4/CoinOptServices/deps/. I'm not sure if I understand correctly, but I found the --enable-dependency-linking already there in the setenv().

Any help?

Sam

@samiit samiit changed the title CoinOptServices fails Pkg.add(CoinOptServices) fails: Xubuntu 12.04 Jun 22, 2016
@tkelman
Copy link
Contributor

tkelman commented Jun 22, 2016

You're trying to use the system packages for ipopt which were certainly nonfunctional in 2012. Can you uninstall them? Otherwise I'll need to come up with a validation function that your library would not pass.

@staticfloat
Copy link
Contributor

staticfloat commented Aug 6, 2016

EDIT

My brain was fuzzled, ignore everything in this post, it assumes you're using Homebrew.jl on OSX.

You could attempt to force Homebrew.jl to override your system-wide ipopt installation by manually running the following:

using Homebrew
Homebrew.add("staticfloat/juliadeps/ipopt")
Pkg.build("CoinOptServices")

Then check the deps.jl file created by CointOptServices (Note that you type ; on an empty julia> command line to write shell commands with interpolation julia expressions):

shell> cat $(joinpath(Pkg.dir("Ipopt"),"deps","deps.jl"))
# This is an auto-generated file; do not edit

# Pre-hooks

# Macro to load a library
macro checked_lib(libname, path)
    ((VERSION >= v"0.4.0-dev+3844" ? Base.Libdl.dlopen_e : Base.dlopen_e)(path) == C_NULL) && error("Unable to load \n\n$libname ($path)\n\nPlease re-run Pkg.build(package), and restart Julia.")
    quote const $(esc(libname)) = $path end
end

# Load dependencies
@checked_lib libipopt "/Users/sabae/.julia/v0.4/Homebrew/deps/usr/lib/libipopt.dylib"

# Load-hooks

If the libipopt path is not pointing at your Homebrew.jl installation directory (which is usually $HOME/.julia/v0.4/Homebrew), then Homebrew.jl didn't get precedence and this won't work. You can try removing/renaming the /usr/local/lib/libipopt.dylib file as @tkelman suggested. If you need that file for something else, removing it, then re-running Pkg.build("Ipopt") should be enough; Julia will latch onto the Homebrew.jl-provided libipopt.dylib, and then you can put the old file back.

It would be nice to have a validation function that can do all this automatically though. It's hard to see from your report what exactly is failing, I'm not sure why we're trying to resolve dlopen() from within libipopt.

On a side note, where did that /usr/local/lib/libipopt.so file come from? It surprises me that it's called libipopt.so and not libipopt.dylib.

@tkelman
Copy link
Contributor

tkelman commented Aug 7, 2016

@staticfloat this issue was xubuntu, not mac?

@tkelman
Copy link
Contributor

tkelman commented Aug 7, 2016

libipopt uses dlopen if it's built with the linear solver loader functionality. I have no idea how debbuntu were building ipopt in 2012 but I do know their builds didn't actually work until several years later, so I'd be surprised if anything else needed the system wide ipopt install. Uninstalling it should be safe.

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

3 participants