zikichombo / sio

sound I/O
BSD 3-Clause "New" or "Revised" License
25 stars 4 forks source link

travis cgo ubuntu doesn't like c11 #22

Open wsc1 opened 5 years ago

wsc1 commented 5 years ago

despite the fact that the compiler version supports it and CFLAGS are set, we're getting no such file or directory for stdatomic.h

$ gimme version
v1.5.2
$ go version
go version go1.10 linux/amd64
go.env
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/travis/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/travis/gopath"
GORACE=""
GOROOT="/home/travis/.gimme/versions/go1.10.linux.amd64"
GOTMPDIR=""
GOTOOLDIR="/home/travis/.gimme/versions/go1.10.linux.amd64/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build560165872=/tmp/go-build -gno-record-gcc-switches"
5.88s$ sudo apt-get install libasound2-dev && go get -t zikichombo.org/sio/...
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  libasound2-doc
The following NEW packages will be installed:
  libasound2-dev
0 upgraded, 1 newly installed, 0 to remove and 251 not upgraded.
Need to get 59.3 kB of archives.
After this operation, 479 kB of additional disk space will be used.
Get:1 http://us-central1.gce.archive.ubuntu.com/ubuntu trusty/main amd64 libasound2-dev amd64 1.0.27.2-3ubuntu7 [59.3 kB]
Fetched 59.3 kB in 0s (5,570 kB/s)
Selecting previously unselected package libasound2-dev:amd64.
(Reading database ... 93696 files and directories currently installed.)
Preparing to unpack .../libasound2-dev_1.0.27.2-3ubuntu7_amd64.deb ...
Unpacking libasound2-dev:amd64 (1.0.27.2-3ubuntu7) ...
Setting up libasound2-dev:amd64 (1.0.27.2-3ubuntu7) ...
# zikichombo.org/sio/libsio
In file included from ../../../zikichombo.org/sio/libsio/cb.go:6:0:
./cb.h:4:23: fatal error: stdatomic.h: No such file or directory
 #include <stdatomic.h>
                       ^
compilation terminated.
mewmew commented 5 years ago

Perhaps check the GCC version, just to make sure.

If GCC is not installed, or the version is too old, add something along the lines of

before_install:
  - sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
  - sudo apt-get update -q
  - sudo apt-get install gcc-8 -y
wsc1 commented 5 years ago

thanks for the suggestion. tried that, same error :(

mewmew commented 5 years ago

That's a shame. Not sure what else may be wrong. What you could do is to run find /usr/include -type f -name 'stdatomic.h on Travis, and see where the file is located. Perhaps you would have to add an include path for Cgo.