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

Set LIB_INSTALL_DIR for cmake-based projects #18047

Merged
merged 2 commits into from
Aug 18, 2016
Merged

Conversation

staticfloat
Copy link
Sponsor Member

This fixes MULTIARCH_INSTALL=1 installations that place libraries not
into <prefix>/lib but into <prefix>/lib/<host-triplet>, like Debian
and Ubuntu. Without this change, libgit2, libssh2 and mbedtls
would place libraries into <prefix>/lib, silently failing until the
Julia bootstrap process attempted to dlopen one of them.

This is at least one problem that has held up the Ubuntu nightlies.

This fixes `MULTIARCH_INSTALL=1` installations that place libraries not
into `<prefix>/lib` but into `<prefix>/lib/<host-triplet>`, like Debian
and Ubuntu.  Without this change, `libgit2`, `libssh2` and `mbedtls`
would place libraries into `<prefix>/lib`, silently failing until the
Julia bootstrap process attempted to dlopen one of them.
@staticfloat staticfloat added the domain:building Build system, or building Julia or its dependencies label Aug 16, 2016
@staticfloat
Copy link
Sponsor Member Author

staticfloat commented Aug 16, 2016

Confirmed that this has allowed a debuild on a local Ubuntu machine to go through all the relevant tests (it still failed on a numbers test), so that's a good sign.

For reference, the numbers failure was the following:

From worker 9:       * numbers              Error During Test
        From worker 9:    Test threw an exception of type DivideError
        From worker 9:    Expression: powermod(1,-1,big(1)) == 0
        From worker 9:    DivideError: integer division error
        From worker 9:     in powermod(::BigInt, ::BigInt, ::BigInt) at ./gmp.jl:442
        From worker 9:     in powermod(::Int64, ::Int64, ::BigInt) at ./gmp.jl:448
        From worker 9:     in include_string(::String, ::String) at ./loading.jl:380
        From worker 9:     in include_from_node1(::String) at ./loading.jl:429
        From worker 9:     in macro expansion at ./util.jl:226 [inlined]
        From worker 9:     in runtests(::String) at /tmp/julianightlies/test/testdefs.jl:7
        From worker 9:     in (::Base.Serializer.__deserialized_types__.##16#24)(::String)
 at /tmp/julianightlies/test/runtests.jl:44
        From worker 9:     in (::Base.##585#587{Base.CallMsg{:call_fetch}})() at ./multi.j
l:1410
        From worker 9:     in run_work_thunk(::Base.##585#587{Base.CallMsg{:call_fetch}},
::Bool) at ./multi.jl:996
        From worker 9:     in macro expansion at ./multi.jl:1410 [inlined]
        From worker 9:     in (::Base.##584#586{Base.CallMsg{:call_fetch},Base.MsgHeader,T
CPSocket})() at ./event.jl:68

@tkelman
Copy link
Contributor

tkelman commented Aug 16, 2016

We aren't building LLVM with cmake by default yet, but would this be needed there if we did?

@staticfloat
Copy link
Sponsor Member Author

staticfloat commented Aug 16, 2016

Almost certainly.

@tkelman
Copy link
Contributor

tkelman commented Aug 16, 2016

Why not put this in CMAKE_COMMON then?

@staticfloat
Copy link
Sponsor Member Author

One thing to think about before I do that; on Windows we set $(build_shlibdir) to $(build_bindir) because .dll's should live with the .exe's, but we still want the static libraries (e.g. $(build_libdir)) to be separate, right? Should I then be setting -DLIB_INSTALL_DIR=$(build_libdir) and then we hope that our installation rules are smart enough to put the .dll's where they should go?

@tkelman
Copy link
Contributor

tkelman commented Aug 16, 2016

I don't think we want the static libraries at all for any of the libraries that we build using cmake.

@staticfloat
Copy link
Sponsor Member Author

Done and done, let's see if this works, I'll test it with debuild locally as well.

@staticfloat
Copy link
Sponsor Member Author

Same result with this change, so I think it's good to go. numbers failure persists.

@tkelman tkelman merged commit 1af5356 into master Aug 18, 2016
@tkelman tkelman deleted the sf/lib_install_dir branch August 18, 2016 06:43
tkelman pushed a commit that referenced this pull request Aug 20, 2016
* Set LIB_INSTALL_DIR for cmake-based projects

This fixes `MULTIARCH_INSTALL=1` installations that place libraries not
into `<prefix>/lib` but into `<prefix>/lib/<host-triplet>`, like Debian
and Ubuntu.  Without this change, `libgit2`, `libssh2` and `mbedtls`
would place libraries into `<prefix>/lib`, silently failing until the
Julia bootstrap process attempted to dlopen one of them.

* Apply `LIB_INSTALL_DIR` to `CMAKE_COMMON`

(cherry picked from commit 1af5356)
mfasi pushed a commit to mfasi/julia that referenced this pull request Sep 5, 2016
* Set LIB_INSTALL_DIR for cmake-based projects

This fixes `MULTIARCH_INSTALL=1` installations that place libraries not
into `<prefix>/lib` but into `<prefix>/lib/<host-triplet>`, like Debian
and Ubuntu.  Without this change, `libgit2`, `libssh2` and `mbedtls`
would place libraries into `<prefix>/lib`, silently failing until the
Julia bootstrap process attempted to dlopen one of them.

* Apply `LIB_INSTALL_DIR` to `CMAKE_COMMON`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:building Build system, or building Julia or its dependencies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants