libgsl.so.25:无法打开共享库文件:没有此类文件或目录Google Colab项目

问题描述

我正在使用Google Colab在CUDA和C ++中编译和运行一些代码(主要是因为我没有具有CUDA功能的GPU)。作为参考,我正在尝试复制的项目在这里:

ftp://ftp.gnu.org/gnu/gsl/

对于该项目,我需要安装和配置GSL库,请按照以下步骤操作:

  1. https://tailwindcss.com/docs/plugins#app下载GSL库
  2. 将压缩文件上传到Colab
  3. 在Colab中运行以下代码
# Unzip and change directory
!unzip "gsl-2.6.zip"
%cd "/content/gsl-2.6"

# Gives permissions
!chmod 755 "/content/gsl-2.6/configure"

# Configure
!./configure
!make
!make check
!make install

编译代码可以很好地工作,但是当我尝试在可行的数据集上运行代码时,出现以下错误:

/content/shopper: error while loading shared libraries: 
libgsl.so.25: cannot open shared object file: No such file or directory

我已经尝试过的内容

!export LD_LIBRARY_PATH="/contents/gsl-2.6/.libs"

!export LD_LIBRARY_PATH="/usr/local/lib/"

但是,他们都没有解决此问题。如果有帮助,

!sudo find / -name "libgsl.so.25"

返回

/usr/local/lib/libgsl.so.25
/content/gsl-2.6/.libs/libgsl.so.25

所以我们知道文件存在。我似乎无法正确指向我的代码。

预先感谢

解决方法

我在另一个库中遇到了同样的问题。我也试过export,不行,好像colab里面的python不读取环境变量。

我的解决方案如下

!ln -s /usr/local/lib/<your_shared_library> /usr/lib/<your_shared_library>

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...