glMLite icon indicating copy to clipboard operation
glMLite copied to clipboard

Problems installing via OPAM on OSX

Open tmcgilchrist opened this issue 11 years ago • 2 comments

I tried installing via OPAM and I get the following error which looks like some of the deps aren't met on the latest OSX version. Possibly it's not finding the X11 libraries it expects.

➜  ~  opam install glMLite 
The following actions will be performed:
 - install glMLite.0.03.51
1 to install | 0 to reinstall | 0 to upgrade | 0 to downgrade | 0 to remove

=-=-= Installing glMLite.0.03.51 =-=-=
Building glMLite.0.03.51:
  make
  make install PREFIX=/Users/tim/.opam/system/lib/glMLite
[ERROR] The compilation of glMLite.0.03.51 failed.
Removing glMLite.0.03.51.
  ocamlfind remove glMLite


===== ERROR while installing glMLite.0.03.51 =====
# opam-version 1.1.1
# os           darwin
# command      make
# path         /Users/tim/.opam/system/build/glMLite.0.03.51
# compiler     system (4.01.0)
# exit-code    2
# env-file     /Users/tim/.opam/system/build/glMLite.0.03.51/glMLite-65615-ffb3fd.env
# stdout-file  /Users/tim/.opam/system/build/glMLite.0.03.51/glMLite-65615-ffb3fd.out
# stderr-file  /Users/tim/.opam/system/build/glMLite.0.03.51/glMLite-65615-ffb3fd.err
### stdout ###
# ...[truncated]
# ocamlopt.opt -g -c GL.ml
# ocamlopt.opt -g -a -o GL.cmxa -cclib -lgl_stubs -cclib "-framework OpenGL" GL.cmx
# ocamlopt.opt -g -c Glu.ml
# ocamlmklib -o Glu  Glu.cmx  -framework OpenGL
# ocamlopt.opt -g -c Glut.ml
# ocamlmklib  -o  Glut  Glut.cmx  -framework GLUT
# ocamlopt.opt -g -c   vertArray.ml
# ocamlmklib  -o  vertArray  vertArray.cmx -framework OpenGL -L"/usr/local/lib/ocaml" -lbigarray
# ocamlc.opt -c jpeg_loader.ml
# ocamlc.opt  -c  loader-libjpeg.c
### stderr ###
# ...[truncated]
# /usr/include/mach-o/dyld.h:187:21: note: 'NSAddressOfSymbol' declared here
# extern void *       NSAddressOfSymbol(NSSymbol symbol) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_1,__MAC_10_5,__IPHONE_NA,__IPHONE_NA);
#                     ^
#3 warnings generated.
# loader-libjpeg.c:19:10: fatal error: 'jpeglib.h' file not found
# #include <jpeglib.h>
#          ^
#1 error generated.
# make[1]: *** [loader-libjpeg.o] Error 2
# make: *** [all] Error 2

'opam install glMLite' failed.

tmcgilchrist avatar Sep 23 '14 02:09 tmcgilchrist

From this error message: "fatal error: 'jpeglib.h' file not found" it seems that the header files for the jpeg lib are not found in the searched path.

If you don't need the jpeg file loader you can compile only the base module: "GL".

fccm avatar Oct 11 '14 16:10 fccm

For people that will have the same problem :

You can compile by setting

export C_INCLUDE_PATH=/folder/to/jpeglib.h

You will maybe then have an error saying that it does not find -ljpeg :

export LIBRARY_PATH=/folder/to/libjpeg.dylib

I tried to set DYLD_LIBRARY_PATH multiple times without success. LIBRARY_PATH made it work. Compilation should just work fine now.

kube avatar Feb 05 '15 18:02 kube