gocv
gocv copied to clipboard
Missing vtk dependency on Manjaro (Archlinux)
Description
On on Manjaro french install gocv need installation of opencv AND vtk
Steps to Reproduce
- Fresh install Manjaro (with 21.2.5 ISO)
- Update system
pacman -Suy
- Reboot
- Install Go
pacman -S go
- Install OpenCV
pacman -S opencv
- Use a tmp directory
mkdir -p ~/tmp/gocv-test && cd ~/tmp/gocv-test
- Init a go module
go mod init gocv-test
- Copy/paste the hello world sample in
main.go
file - Run
go mod tidy
- Run
go run main.go
then got ton of errors like :
/usr/bin/ld : warning : libvtkFiltersTexture.so.1, required by /usr/lib/gcc/x86_64-pc-linux-gnu/11.2.0/../../../../lib/libopencv_viz.so, not found
Your Environment
- Operating System and version: Manjaro fresh install from 21.2.5 ISO then updated
- OpenCV version used: 4.5.5
- How did you install OpenCV? Distro package manager
- GoCV version used: 0.30.0
- Go version: 1.18
- Did you run the
env.sh
orenv.cmd
script before trying togo run
orgo build
? No, the script is deprecated.
Workarround / Solution :
From what I understood from the errors I looked about libvtk then installed it pacman -S vtk
. Once done, retried step 9 successfully.
It seems it also needs pacman -S hdf5
at the time of this comment.
Also, I don't know if it's normal but the first time it takes a extra long time to run.
Also, I don't know if it's normal but the first time it takes a extra long time to run.
Compiling CGo like GoCV requires compiling and linking both the Go code and the C code. As a result, until the CGo is cached it takes longer to run.