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

R, Julia and container miscommunication #7088

Open
vladimirovav opened this issue Jan 28, 2025 · 0 comments
Open

R, Julia and container miscommunication #7088

vladimirovav opened this issue Jan 28, 2025 · 0 comments

Comments

@vladimirovav
Copy link

I am using an R script which uses Julia functions to run the code. It works perfectly on my computer, but when I try to set it up in the virtual environment, it gives me an error. I've created a container (ubuntu 22.04) with R and Julia installed inside with all the packages required, and upon testing it worked great. However, once I run a specific code, which calls Julia to interact with R, it gives me this error:

    ERROR: LoadError: InitError: could not load library "/home/v_vl/.julia/artifacts/2829a1f6a9ca59e5b9b53f52fa6519da9c9fd7d3/lib/libhdf5.so"
    /usr/lib/x86_64-linux-gnu/libcurl.so: version `CURL_4' not found (required by /home/v_vl/.julia/artifacts/2829a1f6a9ca59e5b9b53f52fa6519da9c9fd7d3/lib/libhdf5.so)

I've looked online, and it says that the main problem is that the script is using the system's lib* files, as opposed to of that from Julia, which creates this error.

So I am trying to modify the last .def file to fix the problem, so far this is what I've added to it:

    Bootstrap: localimage
    From: ubuntu_R_ResistanceGA.sif
    
    %post
    # Install system dependencies for Julia
    apt-get update && \
    apt-get install -y wget tar gnupg lsb-release \
    software-properties-common libhdf5-dev libnetcdf-dev \
    libcurl4-openssl-dev=7.68.0-1ubuntu2.25 \
    libgconf-2-4 \
    libssl-dev
    
    # Run ldconfig to update the linker cache
      ldconfig
    
     # Set environment variable to include the directory where the artifacts are stored
    echo "export LD_LIBRARY_PATH=/home/v_vl/.julia/artifacts/2829a1f6a9ca59e5b9b53f52fa6519da9c9fd7d3/lib:\$LD_LIBRARY_PATH" >> /etc/profile
  # Clean up the package cache to reduce container size
  apt-get clean

  # Install Julia 1.9.3
  wget https://julialang-s3.julialang.org/bin/linux/x64/1.9/julia-1.9.3-linux-x86_64.tar.gz
  tar -xvzf julia-1.9.3-linux-x86_64.tar.gz
  mv julia-1.9.3 /usr/local/julia
  ln -s /usr/local/julia/bin/julia /usr/local/bin/julia

  # Install Circuitscape
julia -e 'using Pkg; Pkg.add("Circuitscape")'
julia -e 'using Pkg; Pkg.build("NetCDF_jll")'


%environment
  export LD_LIBRARY_PATH=/home/v_vl/.julia/artifacts/2829a1f6a9ca59e5b9b53f52fa6519da9c9fd7d3/lib:$LD_LIBRARY_PATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant