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

clang compile error on OS X 10.9 #14

Closed
abargh opened this issue Nov 22, 2013 · 5 comments
Closed

clang compile error on OS X 10.9 #14

abargh opened this issue Nov 22, 2013 · 5 comments

Comments

@abargh
Copy link

abargh commented Nov 22, 2013

Hi Peter,

I'm trying to get the zmq3 bindings up and running on a OS X 10.9 but I'm having some problems. I've already got zmq 3.2.4 installed via HomeBrew but I'm getting an error when I try to get the library (with go get ...). I've included the error below.

clang: error: argument unused during compilation: '-fno-eliminate-unused-debug-types'

Any ideas?

Thanks in advance,

Andy

@pebbe
Copy link
Owner

pebbe commented Nov 22, 2013

I don't think this is specific to my package.

Please, try installing like this:

go get -u -v -x github.com/pebbe/zmq3

and post the full output here.

@abargh
Copy link
Author

abargh commented Nov 22, 2013

Hi Peter,

As requested.

Andrews-MacBook-Pro:~ abargh$ go get -u -v -x github.com/pebbe/zmq3
github.com/pebbe/zmq3 (download)
cd /Users/abargh/DropBox/Development/Go/src/github.com/pebbe/zmq3
git fetch
cd /Users/abargh/DropBox/Development/Go/src/github.com/pebbe/zmq3
git show-ref
cd /Users/abargh/DropBox/Development/Go/src/github.com/pebbe/zmq3
git checkout origin/master
WORK=/var/folders/zd/y01tvf6x4rgfz4t_mbvch4180000gn/T/go-build367690124
github.com/pebbe/zmq3
mkdir -p $WORK/github.com/pebbe/zmq3/_obj/
mkdir -p $WORK/github.com/pebbe/
cd /Users/abargh/DropBox/Development/Go/src/github.com/pebbe/zmq3
pkg-config --cflags libzmq
pkg-config --libs libzmq
/usr/local/go/pkg/tool/darwin_amd64/cgo -objdir $WORK/github.com/pebbe/zmq3/_obj/ -- -I/usr/local/Cellar/zeromq/3.2.4/include -I $WORK/github.com/pebbe/zmq3/_obj/ polling.go socketget.go socketget_unix.go socketset.go zmq3.go
# github.com/pebbe/zmq3
clang: error: argument unused during compilation: '-fno-eliminate-unused-debug-types'

@pebbe
Copy link
Owner

pebbe commented Nov 22, 2013

Could you try this before you try to install zmq3?

export CGO_CFLAGS="-Qunused-arguments"

What version of Go are you using? Run:

go version

@pebbe
Copy link
Owner

pebbe commented Nov 22, 2013

I read somewhere that setting this before trying to install a cgo package solves it:

export CC=clang

Anyway, this is not an issue with the current package. It happens when you try to install any Go package that uses C code.

There are some issues raised about this, for instance:
http://llvm.org/bugs/show_bug.cgi?id=11710

Soon, Go 1.2 will be released, and what I read is it will also fix this issue, though it really is a bug in clang, not in Go.

@abargh
Copy link
Author

abargh commented Nov 22, 2013

Agreed... I'd been doing some reading of my own and it does seem to be a problem with clang... the good news though is that the export above does seem to fix the problem! I've included the full log below for completeness but in the mean time, thanks for the help :)

Andrews-MacBook-Pro:Go abargh$ export CC=clang
Andrews-MacBook-Pro:Go abargh$ go get -u -v -x github.com/pebbe/zmq3
github.com/pebbe/zmq3 (download)
cd .
git clone https://github.com/pebbe/zmq3 /Users/abargh/DropBox/Development/Go/src/github.com/pebbe/zmq3
cd /Users/abargh/DropBox/Development/Go/src/github.com/pebbe/zmq3
git show-ref
cd /Users/abargh/DropBox/Development/Go/src/github.com/pebbe/zmq3
git checkout origin/master
WORK=/var/folders/zd/y01tvf6x4rgfz4t_mbvch4180000gn/T/go-build555406381
github.com/pebbe/zmq3
mkdir -p $WORK/github.com/pebbe/zmq3/_obj/
mkdir -p $WORK/github.com/pebbe/
cd /Users/abargh/DropBox/Development/Go/src/github.com/pebbe/zmq3
pkg-config --cflags libzmq
pkg-config --libs libzmq
/usr/local/go/pkg/tool/darwin_amd64/cgo -objdir $WORK/github.com/pebbe/zmq3/_obj/ -- -Qunused-arguments -I/usr/local/Cellar/zeromq/3.2.4/include -I $WORK/github.com/pebbe/zmq3/_obj/ polling.go socketget.go socketget_unix.go socketset.go zmq3.go
/usr/local/go/pkg/tool/darwin_amd64/6c -F -V -w -I $WORK/github.com/pebbe/zmq3/_obj/ -I /usr/local/go/pkg/darwin_amd64 -o $WORK/github.com/pebbe/zmq3/_obj/_cgo_defun.6 -D GOOS_darwin -D GOARCH_amd64 $WORK/github.com/pebbe/zmq3/_obj/_cgo_defun.c
clang -I . -g -O2 -fPIC -m64 -pthread -Qunused-arguments -fno-common -print-libgcc-file-name
clang -I . -g -O2 -fPIC -m64 -pthread -Qunused-arguments -fno-common -Qunused-arguments -I/usr/local/Cellar/zeromq/3.2.4/include -I $WORK/github.com/pebbe/zmq3/_obj/ -o $WORK/github.com/pebbe/zmq3/_obj/_cgo_main.o -c $WORK/github.com/pebbe/zmq3/_obj/_cgo_main.c
clang -I . -g -O2 -fPIC -m64 -pthread -Qunused-arguments -fno-common -Qunused-arguments -I/usr/local/Cellar/zeromq/3.2.4/include -I $WORK/github.com/pebbe/zmq3/_obj/ -o $WORK/github.com/pebbe/zmq3/_obj/_cgo_export.o -c $WORK/github.com/pebbe/zmq3/_obj/_cgo_export.c
clang -I . -g -O2 -fPIC -m64 -pthread -Qunused-arguments -fno-common -Qunused-arguments -I/usr/local/Cellar/zeromq/3.2.4/include -I $WORK/github.com/pebbe/zmq3/_obj/ -o $WORK/github.com/pebbe/zmq3/_obj/polling.cgo2.o -c $WORK/github.com/pebbe/zmq3/_obj/polling.cgo2.c
clang -I . -g -O2 -fPIC -m64 -pthread -Qunused-arguments -fno-common -Qunused-arguments -I/usr/local/Cellar/zeromq/3.2.4/include -I $WORK/github.com/pebbe/zmq3/_obj/ -o $WORK/github.com/pebbe/zmq3/_obj/socketget.cgo2.o -c $WORK/github.com/pebbe/zmq3/_obj/socketget.cgo2.c
clang -I . -g -O2 -fPIC -m64 -pthread -Qunused-arguments -fno-common -Qunused-arguments -I/usr/local/Cellar/zeromq/3.2.4/include -I $WORK/github.com/pebbe/zmq3/_obj/ -o $WORK/github.com/pebbe/zmq3/_obj/socketget_unix.cgo2.o -c $WORK/github.com/pebbe/zmq3/_obj/socketget_unix.cgo2.c
clang -I . -g -O2 -fPIC -m64 -pthread -Qunused-arguments -fno-common -Qunused-arguments -I/usr/local/Cellar/zeromq/3.2.4/include -I $WORK/github.com/pebbe/zmq3/_obj/ -o $WORK/github.com/pebbe/zmq3/_obj/socketset.cgo2.o -c $WORK/github.com/pebbe/zmq3/_obj/socketset.cgo2.c
clang -I . -g -O2 -fPIC -m64 -pthread -Qunused-arguments -fno-common -Qunused-arguments -I/usr/local/Cellar/zeromq/3.2.4/include -I $WORK/github.com/pebbe/zmq3/_obj/ -o $WORK/github.com/pebbe/zmq3/_obj/zmq3.cgo2.o -c $WORK/github.com/pebbe/zmq3/_obj/zmq3.cgo2.c
clang -I . -g -O2 -fPIC -m64 -pthread -Qunused-arguments -fno-common -o $WORK/github.com/pebbe/zmq3/_obj/_cgo_.o $WORK/github.com/pebbe/zmq3/_obj/_cgo_main.o $WORK/github.com/pebbe/zmq3/_obj/_cgo_export.o $WORK/github.com/pebbe/zmq3/_obj/polling.cgo2.o $WORK/github.com/pebbe/zmq3/_obj/socketget.cgo2.o $WORK/github.com/pebbe/zmq3/_obj/socketget_unix.cgo2.o $WORK/github.com/pebbe/zmq3/_obj/socketset.cgo2.o $WORK/github.com/pebbe/zmq3/_obj/zmq3.cgo2.o -L/usr/local/Cellar/zeromq/3.2.4/lib -lzmq
/usr/local/go/pkg/tool/darwin_amd64/cgo -objdir $WORK/github.com/pebbe/zmq3/_obj/ -dynimport $WORK/github.com/pebbe/zmq3/_obj/_cgo_.o -dynout $WORK/github.com/pebbe/zmq3/_obj/_cgo_import.c
/usr/local/go/pkg/tool/darwin_amd64/6c -F -V -w -I $WORK/github.com/pebbe/zmq3/_obj/ -I /usr/local/go/pkg/darwin_amd64 -o $WORK/github.com/pebbe/zmq3/_obj/_cgo_import.6 -D GOOS_darwin -D GOARCH_amd64 $WORK/github.com/pebbe/zmq3/_obj/_cgo_import.c
clang -I . -g -O2 -fPIC -m64 -pthread -Qunused-arguments -fno-common -o $WORK/github.com/pebbe/zmq3/_obj/_all.o $WORK/github.com/pebbe/zmq3/_obj/_cgo_export.o $WORK/github.com/pebbe/zmq3/_obj/polling.cgo2.o $WORK/github.com/pebbe/zmq3/_obj/socketget.cgo2.o $WORK/github.com/pebbe/zmq3/_obj/socketget_unix.cgo2.o $WORK/github.com/pebbe/zmq3/_obj/socketset.cgo2.o $WORK/github.com/pebbe/zmq3/_obj/zmq3.cgo2.o -L/usr/local/Cellar/zeromq/3.2.4/lib -Wl,-r -nostdlib
/usr/local/go/pkg/tool/darwin_amd64/6g -o $WORK/github.com/pebbe/zmq3/_obj/_go_.6 -p github.com/pebbe/zmq3 -D _/Users/abargh/DropBox/Development/Go/src/github.com/pebbe/zmq3 -I $WORK ./reactor.go ./utils.go $WORK/github.com/pebbe/zmq3/_obj/_cgo_gotypes.go $WORK/github.com/pebbe/zmq3/_obj/polling.cgo1.go $WORK/github.com/pebbe/zmq3/_obj/socketget.cgo1.go $WORK/github.com/pebbe/zmq3/_obj/socketget_unix.cgo1.go $WORK/github.com/pebbe/zmq3/_obj/socketset.cgo1.go $WORK/github.com/pebbe/zmq3/_obj/zmq3.cgo1.go
/usr/local/go/pkg/tool/darwin_amd64/pack grcP $WORK $WORK/github.com/pebbe/zmq3.a $WORK/github.com/pebbe/zmq3/_obj/_go_.6 $WORK/github.com/pebbe/zmq3/_obj/_cgo_import.6 $WORK/github.com/pebbe/zmq3/_obj/_cgo_defun.6 $WORK/github.com/pebbe/zmq3/_obj/_all.o
mkdir -p /Users/abargh/DropBox/Development/Go/pkg/darwin_amd64/github.com/pebbe/
cp $WORK/github.com/pebbe/zmq3.a /Users/abargh/DropBox/Development/Go/pkg/darwin_amd64/github.com/pebbe/zmq3.a

@pebbe pebbe closed this as completed Nov 22, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants