You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
package hdf5
// #cgo LDFLAGS: -lhdf5 -lhdf5_hl// #cgo linux CFLAGS: -I/usr/include/hdf5/serial/// #cgo linux LDFLAGS: -L/usr/lib/x86_64-linux-gnu/hdf5/serial/// #cgo darwin CFLAGS: -I/usr/local/include// #cgo darwin LDFLAGS: -L/usr/local/lib// #include "hdf5.h"import"C"
or, alternatively, if you have installed pkg-config:
package hdf5
// #cgo pkg-config: hdf5// #cgo LDFLAGS: -lhdf5 -lhdf5_hl// #cgo darwin CFLAGS: -I/usr/local/include// #cgo darwin LDFLAGS: -L/usr/local/lib// #include "hdf5.h"import"C"
not all linux distributions have a pkg-config file for hdf5... (I know mine doesn't, hence my mild reluctance to use the admittedly easier pkg-config way to configure the cgoflags...)
Package libhdf5-dev installed, edited cgoflags.go to look as:
package hdf5
// #cgo LDFLAGS: -lhdf5 -lhdf5_hl
// #cgo darwin CFLAGS: -I/usr/include/hdf5/serial/
// #cgo darwin LDFLAGS: -L/usr/lib/x86_64-linux-gnu/hdf5/serial/
// #include "hdf5.h"
import "C"
build it with:
go build github.com/sbinet/go-hdf5
output:
github.com/sbinet/go-hdf5
w/go/src/github.com/sbinet/go-hdf5/cgoflags.go:6:19: fatal error: hdf5.h: No such file or directory
// #include "hdf5.h"
^
compilation terminated.
The text was updated successfully, but these errors were encountered: