I was trying out the godal library and wrote a simple script as follows:
package main
import (
"github.com/airbusgeo/godal"
)
func main() {
godal.RegisterAll()
}
Running go run main.go throws the following error
dyld[19569]: Library not loaded: @rpath/libgdal.30.dylib
Referenced from: /private/var/folders/y5/yh59dj093xn_dz8lm0mhv6lh0000gp/T/go-build1573968352/b001/exe/test
Reason: tried: '/usr/local/lib/libgdal.30.dylib' (no such file), '/usr/lib/libgdal.30.dylib' (no such file)
signal: abort trap
godal has a dependency on gdal and I had installed it via conda. Due to this, the dylib is located under my conda folder - /Users/ash/miniconda3/lib not /usr/local/lib.
How can I have the program search for libgdal.dylib in /Users/ash/miniconda3/lib instead of /usr/local/lib ?