如何在Google Colab中安装库?

huangapple go评论123阅读模式
英文:

How to install libraries in Google Colab?

问题

你需要在Google Colab环境中安装一些库。其中之一是来自此存储库的zimg https://github.com/sekrit-twc/zimg

以下是用于构建该库的脚本,最初取自这里

!git clone https://github.com/sekrit-twc/zimg
%cd /content/zimg
!git submodule update --init --recursive
!./configure
!make
!sudo make install

但问题是,找不到configure脚本**/bin/bash: ./configure: No such file or directory**

如何解决这个问题?谢谢。

英文:

I'd need to install couple of libraries in Google Colab environment. The one of them is zimg coming from this repo https://github.com/sekrit-twc/zimg

I have the following script to build the library originally taken here

!git clone https://github.com/sekrit-twc/zimg
%cd /content/zimg
!git submodule update --init --recursive
!./configure
!make
!sudo make install

..but the problem is that configure script was not found /bin/bash: ./configure: No such file or directory

Cloning into 'zimg'...
remote: Enumerating objects: 13135, done.
remote: Counting objects: 100% (1934/1934), done.
remote: Compressing objects: 100% (718/718), done.
remote: Total 13135 (delta 1317), reused 1715 (delta 1200), pack-reused 11201
Receiving objects: 100% (13135/13135), 3.07 MiB | 8.17 MiB/s, done.
Resolving deltas: 100% (9547/9547), done.
/content/zimg
Submodule 'graphengine' (https://github.com/sekrit-twc/graphengine.git) registered for path 'graphengine'
Submodule 'test/extra/googletest' (https://github.com/google/googletest.git) registered for path 'test/extra/googletest'
Cloning into '/content/zimg/graphengine'...
Cloning into '/content/zimg/test/extra/googletest'...
Submodule path 'graphengine': checked out 'ce722fdea018040bc38bec1c5ade70239455a564'
Submodule 'googletest' (https://github.com/google/googletest.git) registered for path 'graphengine/test/googletest'
Cloning into '/content/zimg/graphengine/test/googletest'...
Submodule path 'graphengine/test/googletest': checked out 'e2239ee6043f73722e7aa812a459f54a28552929'
Submodule path 'test/extra/googletest': checked out 'e2239ee6043f73722e7aa812a459f54a28552929'
/bin/bash: ./configure: No such file or directory
make: *** No targets specified and no makefile found.  Stop.
make: *** No rule to make target 'install'.  Stop.

How could I work around this problem?
Thanks in advance.

答案1

得分: 0

问题已解决,缺失的部分是运行autoreconf命令,它负责自动重建configure脚本。

# 安装libtool包
!apt-get install libtool

# 克隆zimg仓库
!git clone https://github.com/sekrit-twc/zimg
%cd /content/zimg
!git submodule update --init --recursive

# 选项 -i,–install:复制缺失的辅助文件
!autoreconf -i
!./configure
!make
!sudo make install
英文:

Problem resolved, the missing part was run of autoreconf command what is responsible for automatically rebuild configure script.

#Install libtool package
!apt-get install libtool

!git clone https://github.com/sekrit-twc/zimg
%cd /content/zimg
!git submodule update --init --recursive
#option -i, –install: copy missing auxiliary files
!autoreconf -i
!./configure
!make
!sudo make install

huangapple
  • 本文由 发表于 2023年6月5日 06:41:59
  • 转载请务必保留本文链接:https://go.coder-hub.com/76402688.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定