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

Problem installing on OS X 10.9 "zmq.h not found" #26

Open
wtyneb opened this issue Oct 16, 2014 · 9 comments
Open

Problem installing on OS X 10.9 "zmq.h not found" #26

wtyneb opened this issue Oct 16, 2014 · 9 comments

Comments

@wtyneb
Copy link

wtyneb commented Oct 16, 2014

sudo opam install iocaml fails with the following:

The following actions will be performed:

  • install iocaml-kernel.0.4.6 [required by iocaml]
  • install iocaml.0.4.6
    2 to install | 0 to reinstall | 0 to upgrade | 0 to downgrade | 0 to remove
    Do you want to continue ? [Y/n] y

=-=-= Installing iocaml-kernel.0.4.6 =-=-=
Applying 4.00.1.patch.
Building iocaml-kernel.0.4.6:
make all
make install
[ERROR] The compilation of iocaml-kernel.0.4.6 failed.
Removing iocaml-kernel.0.4.6.
make uninstall

[ERROR] Due to some errors while processing iocaml-kernel.0.4.6, the following actions will NOT proceed:

  • install iocaml.0.4.6

===== ERROR while installing iocaml-kernel.0.4.6 =====

opam-version 1.1.2

os darwin

command make all

path /Users/wtnebel/.opam/system/build/iocaml-kernel.0.4.6

compiler system (4.01.0)

exit-code 2

env-file /Users/wtnebel/.opam/system/build/iocaml-kernel.0.4.6/iocaml-kernel-78019-c61e7b.env

stdout-file /Users/wtnebel/.opam/system/build/iocaml-kernel.0.4.6/iocaml-kernel-78019-c61e7b.out

stderr-file /Users/wtnebel/.opam/system/build/iocaml-kernel.0.4.6/iocaml-kernel-78019-c61e7b.err

stdout

atdgen -t Ipython_json.atd

atdgen -j Ipython_json.atd

ocamlfind c iocaml_zmq_stubs.c

stderr

iocaml_zmq_stubs.c:1:10: fatal error: 'zmq.h' file not found

#include <zmq.h>

^

#1 error generated.

make: *** [stub] Error 2

'opam install iocaml' failed.

I tried to use homebrew to install zeromq/libzmq but that didn't help.
Any suggestions on how I might resolve this?

Also, apologies for the poor markdown usage, I'm not entirely familiar with it's syntax.

@andrewray
Copy link
Owner

It certainly seems as if zeromq is missing here.

A while ago @avsm posted these instructions https://gist.github.com/avsm/9041133

Note sure they still work - I thought just brew install zeromq did the job these days.

@wtyneb
Copy link
Author

wtyneb commented Oct 16, 2014

Unfortunately that's not doing the trick! Is there a specific location where it's attempting to find zmq.h ?

Also, `opam install zmq' is encountering the same error, "unable to find zmq"

Would you have any advice on installing zmq properly? I've looked into building it from source, but I'm not sure how to proceed with it.

@andrewray
Copy link
Owner

The only advice I can find on google is to add --universal to the brew command to possibly work round any 32/64 bit issues.

Is it possible to check if zmq.h is anywhere on your system?

@wtyneb
Copy link
Author

wtyneb commented Oct 16, 2014

Yes, I did find zmq.h in my python installation (Anaconda), the /anaconda/pkgs/zeromq-4.0.4-0/include directory.

There's another where brew installed it:
/usr/local/Cellar/zeromq32/3.2.4/include

Is there some way I can direct opam to this file?

@andrewray
Copy link
Owner

The one in brew looks about right. I believe symlinks should be set up pointing into /usr/local/Cellar so that they appear in the correct paths (here, in particular, so the include directory is available in C so you can do #include <zmq.h>.

I suspect something to do with your homebrew installation is a bit iffy.

Perhaps try homebrew doctor and see if it complains about anything. Sorry - don't use OSX much but I will try and have a look at how homebrew sets stuff up tomorrow.

@andrewray
Copy link
Owner

I had a bit of a look round on my mac. Homebrew should have set up /usr/local/include to include a link to zmq.h. This is where the c/ocaml compiler expects to find the header file.

unknown-c4-2c-03-10-8d-87:temp andyray$ ls -la /usr/local/include/ 
total 24
drwxr-xr-x   5 andyray  admin  170 21 Mar  2014 .
drwxrwxr-x  16 root     admin  544 21 Mar  2014 ..
lrwxr-xr-x   1 andyray  admin   38 21 Mar  2014 boost -> ../Cellar/boost/1.55.0_1/include/boost
lrwxr-xr-x   1 andyray  admin   38 21 Mar  2014 zmq.h -> ../Cellar/zeromq32/3.2.4/include/zmq.h
lrwxr-xr-x   1 andyray  admin   44 21 Mar  2014 zmq_utils.h -> ../Cellar/zeromq32/3.2.4/include/zmq_utils.h

@brabalan
Copy link

I just gave this a try and brew install zeromq allows me to install iocaml-kernel.

I have had similar issues with gmp before, so I now have the following in my .zshrc. Maybe this is the reason this works for me:

# for gmp to be found by cc (hence opam)
export C_INCLUDE_PATH=$C_INCLUDE_PATH:/usr/local/include
export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/lib

@CBothwell
Copy link

I had this problem with several libraries. Yes, the /usr/local/include headers aren't part of the C_INCLUDE_PATH. You'll want to install the command line dev tools from xcode.

$ xcode-select --install

@greensam
Copy link

Had the same issue, and re-running an xcode-select --install resolved for me.

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

5 participants