Navigation Menu

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

go get fails #228

Closed
lattice0 opened this issue Feb 7, 2017 · 12 comments
Closed

go get fails #228

lattice0 opened this issue Feb 7, 2017 · 12 comments

Comments

@lattice0
Copy link

lattice0 commented Feb 7, 2017

Hi, I'm doing go get gopkg.in/zeromq/goczmq.v4 and I get the following:

# pkg-config --cflags libczmq libzmq libsodium
Package libczmq was not found in the pkg-config search path.
Perhaps you should add the directory containing `libczmq.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libczmq' found
Package libsodium was not found in the pkg-config search path.
Perhaps you should add the directory containing `libsodium.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libsodium' found
pkg-config: exit status 1

But when I do apt-get install libzmq-dev I see that the package already exists. Should this fail and I fix it manually or this is a real issue? Sorry if not, but I think it should be automatic.

@bluca
Copy link
Member

bluca commented Feb 7, 2017

It's complaining about libczmq, not libzmq
If you are on Ubuntu 16.04 or greater or Debian Stretch just apt-get install libczmq-dev

@lattice0
Copy link
Author

lattice0 commented Feb 7, 2017

@bluca it worked, but what about libsodium? It's still complaining about that. Also, could you tell me why they're necessary? And is this for development only? I'd like to understand what's going on. Because I installed go get github.com/alecthomas/gozmq and it didn't ask for these, but I prefer to stick with the official library

@lattice0
Copy link
Author

lattice0 commented Feb 7, 2017

Ok, I randomly tried sudo apt-get install libsodium-dev and it worked, but now I get:

go get github.com/zeromq/goczmq
# github.com/zeromq/goczmq
could not determine kind of name for C.ZMQ_GATHER
could not determine kind of name for C.ZMQ_SCATTER

this one I have no idea what to do :(

@bluca
Copy link
Member

bluca commented Feb 7, 2017

I assume that's because this repository needs the DRAFT APIs, but the builds in Debian/Ubuntu don't ship with them since they are not stable.
You can uninstall libczmq-dev and libczmq4 and build manually czmq from the github repo and install it, and it should work

@bluca
Copy link
Member

bluca commented Feb 7, 2017

You can also add the repository that builds packages with DRAFT APIs enabled from our OBS page:

https://build.opensuse.org/project/show/home:zeromq:git-draft

For example for Ubuntu 16.04 you want to add to /etc/apt/sources.list:

deb http://download.opensuse.org/repositories/home:/zeromq:/git-stable/xUbuntu_16.04/ ./

@taotetek
Copy link
Contributor

taotetek commented Feb 8, 2017

@bluca @LucasZanella that's correct - current v4 needs the DRAFT APIs enabled. Go unfortunately doesn't have support for conditional compilation via macros. goczmq.v3 will work without draft apis enabled.

There may be a way to make this more pleasant with go build flags - go doesn't seem to have very much in the way of conditional compilation, and I wanted to start adding support for the draft socket types. Open to better ways of handling this but for now if you want to use the standard ubuntu packages, v3 should work for you.

@taotetek
Copy link
Contributor

@bluca @LucasZanella I moved things that depend on a czmq built with DRAFT enabled to their own files, and guarded them with a build flag of "draft".

go get / go build will now default to not requiring a DRAFT enabled CZMQ. go build -tag=draft will build with the new experimental features.

@holisticode
Copy link

I am having the same issue. Unfortunately I am on manjaro linux, and I could not find any package libczmq-dev on arch linux / manjaro, nor any libczmq. It looks like this should be already available in the main zeromq package.

So go get fails for me. Any suggestion?

@taotetek
Copy link
Contributor

taotetek commented Apr 9, 2020 via email

@holisticode
Copy link

Thanks @taotetek,

what I do not understand though is that I have this entry in the go.mod file:

 github.com/zeromq/goczmq v4.1.0+incompatible

which seems to run

# pkg-config --cflags  -- libczmq libzmq libsodium
Package libczmq was not found in the pkg-config search path.
Perhaps you should add the directory containing `libczmq.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libczmq', required by 'virtual:world', not found
pkg-config: exit status 1

This worries me. This should be some generic mod file which should be working for all platform. Why is pkg-config trying to load packages which are not available everywhere? I don't even know where this pkg-config comes from, and frankly, I am not understanding...

@bluca
Copy link
Member

bluca commented Apr 9, 2020

it's czmq, not libczmq

@holisticode
Copy link

Oh, yes, that worked!

yay -S czmq installed the missing dependencies, and my binary compiled.
Thank you!

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

4 participants