Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cgoflags to support raspbian. #42

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cgoflags.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ package hdf5
// #cgo darwin LDFLAGS: -L/usr/local/lib
// #cgo linux CFLAGS: -I/usr/local/include, -I/usr/lib/x86_64-linux-gnu/hdf5/serial/include
// #cgo linux LDFLAGS: -L/usr/local/lib, -L/usr/lib/x86_64-linux-gnu/hdf5/serial/
// #cgo linux arm CFLAGS: -I/usr/local/include, -I/usr/lib/arm-linux-gnueabihf/hdf5/serial/include/
// #cgo linux arm LDFLAGS: -L/usr/local/lib, -L/usr/lib/arm-linux-gnueabihf/hdf5/serial/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok... perhaps add !arm for the other linux directives? or add amd64?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer "amd64". or could we use pkg-config directive? as:

 package hdf5
// #cgo pkg-config: hdf5-serial
// #cgo LDFLAGS: -lhdf5_hl
// #include "hdf5.h"
import "C"

This passed on my laptops but failed on Travis. Travis failed ot execute 'pkg-config hdf5-serial --cflags" .

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The union of build tag must be 𝑈, so please use !arm in conjunction with arm. If pkg-config works though, that would be the best.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The status is:
1, On raspbian stretch, libhdf5-dev provides hdf5.pc.
2, On Ubuntu 18.10, libhdf5-dev proides hdf5.pc.
3, On Mac OS homebrew, hdf5 does not provide hdf5.pc. It is due to hdf5 source code without hdf5.pc.
4, On Ubuntu trusty which travis-ci runs, libhdf5-dev does not provide hdf5.pc.

So I will create a pull request with '!arm' option.

Thanks a lot.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I filed pull request #46 . Please review it.

// #include "hdf5.h"
import "C"