Wednesday, December 5, 2012

Installing Ocsigen Server with OPAM on OSX 10.7.5

Installing Ocsigen Server with OPAM on OSX 10.7.5

Installing Ocsigen Server with OPAM on OSX 10.7.5

I recently ran into some problems installing Ocsigen Server with OPAM on OSX 10.7.5.

[2]R15B01:prime:~$ eval `opam config -env`
[2]R15B01:prime:~$ 
[2]R15B01:prime:~$ opam install ocsigenserver
The following actions will be performed:
 - install ocamlfind.1.3.3
 - install cryptokit.1.6
 - install dbm.1.0
 - install pcre-ocaml.6.2.5
 - install react.0.9.4
 - install ssl.0.4.6
 - install lwt.2.4.2
 - install ocamlnet.3.6.0
 - install tyxml.2.1
 - install ocsigenserver.2.1
10 to install | 0 to reinstall | 0 to upgrade | 0 to downgrade | 0 to remove
Do you want to continue ? [Y/n] 
...
...
* ld: warning: -read_only_relocs cannot be used with x86_64
* ld: warning: -read_only_relocs cannot be used with x86_64
* ld: warning: -read_only_relocs cannot be used with x86_64
* File "_none_", line 1, characters 0-1:
* Error: Error while linking /usr/local/lib/ocaml/camlp4/camlp4lib.cma(Camlp4):
* Reference to undefined global `Dynlink'
* make[2]: *** [ocsigenserver] Error 2
* make[1]: *** [all] Error 2
* make: *** [all] Error 2
  'opam install ocsigenserver' failed

(The full output of the build is available here)

The solution was proposed in this Github issue:

opam switch 3.12.1+natdynlink-osx

I hope this can help anyone with the same issue.

Dave