Code Monkey home page Code Monkey logo

Comments (7)

Clemapfel avatar Clemapfel commented on May 21, 2024

I need to link against the julia shared library during compilation of the C++ to Julia interface mousetrap_julia_binding, unlike the mousetrap C++ component mousetrap, mousetrap_julia_binding depends on libjulia.so which is not part of the basic BinaryBuilder sandbox. mousetrap_julia_binding uses the Julia C-API whose library and headers are provided by libjulia_jll.

Furthermore libcxxwrap_julia_jll also links against libjulia_jll, so I don't see how it could be "always" wrong. I have that jll as a dependency so libjulia_jll would be pulled in either way.

Are you saying having libjulia_jll as a separate dependency is unnecessary because libcxxwrap_julia_jll already pulls it in?

from mousetrap.jl.

Clemapfel avatar Clemapfel commented on May 21, 2024

I just tried removing libjulia_jll from the dependencies, then running the binary builder script again. As I expected, it errors during configuration of mousetrap_julia_binding, because it cannot find the Julia package:

cmake .. -DCMAKE_INSTALL_PREFIX=$prefix -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN}
Re-run cmake no build system arguments
-- The CXX compiler identification is GNU 12.1.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /opt/bin/x86_64-linux-musl-libgfortran5-cxx11/x86_64-linux-musl-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Julia executable: Julia_EXECUTABLE-NOTFOUND
CMake Error at /opt/x86_64-linux-musl/x86_64-linux-musl/sys-root/usr/local/lib/cmake/JlCxx/FindJulia.cmake:32 (file):
  file failed to open for reading (No such file or directory):

    /workspace/srcdir/mousetrap_julia_binding/Julia_VERSION_INCLUDE-NOTFOUND
Call Stack (most recent call first):
  /opt/x86_64-linux-musl/x86_64-linux-musl/sys-root/usr/local/lib/cmake/JlCxx/JlCxxConfig.cmake:3 (find_package)
  CMakeLists.txt:18 (find_package)


CMake Error at /opt/x86_64-linux-musl/x86_64-linux-musl/sys-root/usr/local/lib/cmake/JlCxx/FindJulia.cmake:33 (string):
  string sub-command REGEX, mode MATCH needs at least 5 arguments total to
  command.
Call Stack (most recent call first):
  /opt/x86_64-linux-musl/x86_64-linux-musl/sys-root/usr/local/lib/cmake/JlCxx/JlCxxConfig.cmake:3 (find_package)
  CMakeLists.txt:18 (find_package)


-- Julia_VERSION_STRING: 
CMake Error at /opt/x86_64-linux-musl/x86_64-linux-musl/sys-root/usr/local/lib/cmake/JlCxx/FindJulia.cmake:48 (if):
  if given arguments:

    "VERSION_LESS" "0.7.0"

  Unknown arguments specified
Call Stack (most recent call first):
  /opt/x86_64-linux-musl/x86_64-linux-musl/sys-root/usr/local/lib/cmake/JlCxx/JlCxxConfig.cmake:3 (find_package)
  CMakeLists.txt:18 (find_package)


-- Configuring incomplete, errors occurred!

I realize that it's very rare for a jll to need libjulia, since most of them just provide external libraries that don't have to do anything to do with Julia, but in my specific case of having a shared library that depends on the Julia C-API specifically, this dependency is necessary.

Furthermore, it's incorrect to say that libjulia is only there to build jlls itself. libjulia provides the shared library, the Julia executable which in this case is needed for FindJulia.cmake, as well as the headers for the Julia C-API julia/julia.h, all of which are needed for my case and are not provided by any other jll or the BinaryBuilder sandbox SDK.

from mousetrap.jl.

Clemapfel avatar Clemapfel commented on May 21, 2024

Thank you for the critique, I realize that my jlls are very messy and suspicious since I was forced to split them for each OS, which is bad style. That is also why I didn't upload them to yggrdasil, I really want it to just be one mousetrap_jll, but I have been unable to achieve that.

See here for my reasoning and information on how to contribute.

from mousetrap.jl.

fingolfin avatar fingolfin commented on May 21, 2024

You need libjulia_jll during build time, but not runtime, so it should be a BuildDependency, not a Dependency.

Note that I maintain multiple JLLs using Julia APIs, and am one of the people maintaining libjulia_jll for just that purpose.

I suggest you open a PR for Yggdrasil with your primary JLL, and we can help you merge the three ones into a single one, and give other feedback on it.

from mousetrap.jl.

Clemapfel avatar Clemapfel commented on May 21, 2024

Okay, I understand then, thank you. I will change it to BuildDependency with the next version.

What do you mean with "primary" JLL? My issue is that all three jlls have different dependencies, including non-JLL dependencies. I'm unsure of which of them I should open the PR for.

from mousetrap.jl.

fingolfin avatar fingolfin commented on May 21, 2024

Apologies. I should have said something like: "submit a moustrap_jll based on one of three JLL recipes, plus pointers to the build files for the other two"

from mousetrap.jl.

Clemapfel avatar Clemapfel commented on May 21, 2024

Okay thank you, I will do that.

I'll leave this issue open until the BuildDependency was changed and deployed.

from mousetrap.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.