admin管理员组文章数量:1418610
I am using an R script with Julia functions to run the code. It works perfectly on my computer, but when I try to set it up in the apptainer, 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 .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
PS I need to run it in an apptainer because my goal is to use it on a supercomputer (ComputeCanada).
So far, I am trying to use LD_LIBRARY_PATH as a way to fix the problem, but it doesn't seem to work at all
本文标签: dockerLoad library directory error (RJulia and container)Stack Overflow
版权声明:本文标题:docker - Load library directory error (R, Julia and container) - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745297685a2652176.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论