From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id q0DKmvVj005294 for ; Fri, 13 Jan 2012 21:48:58 +0100 X-IronPort-AV: E=Sophos;i="4.71,506,1320620400"; d="scan'208";a="126846935" Received: from cbg35-2-78-242-14-140.fbx.proxad.net (HELO [192.168.0.145]) ([78.242.14.140]) by mail4-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 13 Jan 2012 21:48:51 +0100 From: "Alan Schmitt" To: caml-list@inria.fr Date: Fri, 13 Jan 2012 21:48:49 +0100 Message-ID: <4758C5C2-5444-4C24-99CB-7AD010D06C6E@polytechnique.org> In-Reply-To: References: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=_MailMate_671468A9-696E-4531-B40F-C6E20CD99EF9_=" Content-Transfer-Encoding: 8bit X-Mailer: MailMate Trial (1.4r2690) Subject: Re: [Caml-list] ocamlmklib OSX/OpenGL weirdness --=_MailMate_671468A9-696E-4531-B40F-C6E20CD99EF9_= Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 13 Jan 2012, at 20:41, Philippe Strauss wrote: > I'm running 3.12.1 plus Jérémie Dimino gprint patch, and an up to > date godi setup. > Trying to build Florent Monnier glMlite, I'm finding this singularity: > > ocamlopt.opt -verbose -g -c GL.ml > + as -arch x86_64 -o 'GL.o' > '/var/folders/Yj/YjSPq8kWEbucqe1B6qhw4E+++TI/-Tmp-/camlasm11ff8f.s' > > ocamlmklib -verbose -o GL GL.cmx -framework OpenGL -lgl_stubs > + /opt/godi312/bin/ocamlopt -a -o GL.cmxa GL.cmx -cclib -lGL -ccopt > -L/opt/godi312/lib -ccopt -framework -ccopt OpenGL -cclib -lgl_stubs > > it seems (or I missed something) that ocamlmklib add -lGL when it > invokes ocamlopt, it should not on OSX, which requires "-framework > OpenGL". > > BTW, the two -ccopt -framework -ccopt OpenGL is a trickery for > whitespace containing linker arguments ? Yes. About the main question, I asked this a while back. This thread should explain what is going on. https://sympa-roc.inria.fr/wws/arc/caml-list/2011-02/msg00144.html This lead me to write a small patch to glMlite, which I attach. As this patch is OS X specific (the current build system is targeted for Linux), it has not been incorporated upstream. I have not have found the time to do a "universal" patch yet. Hope this helps, Alan --=_MailMate_671468A9-696E-4531-B40F-C6E20CD99EF9_= Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=patch_commit_2737d71a16b7.patch diff --git a/SRC/Makefile b/SRC/Makefile index 010f77661bfe37767259cb3f64e2262a678de457..cf06e20b7d97dfe2e1073adaf63= 509b393f87b22 100644 --- a/SRC/Makefile +++ b/SRC/Makefile @@ -184,8 +184,8 @@ dllgl_stubs.so libgl_stubs.a: gl.wrap.o $(OCAMLMKLIB) -oc gl_stubs $< $(GL_LIBS) endif =20 -GL.cmxa GL.a: GL.cmx dllgl_stubs.so - $(OCAMLMKLIB) -o GL $< $(GL_LIBS) -lgl_stubs +GL.cmxa GL.a: GL.cmx + $(OCAMLMKLIB) -o GL -oc gl_stubs $^ $(GL_LIBS) =20 GL.cma: GL.cmo dllgl_stubs.so $(OCAMLC) -a -o $@ -ccopt "$(GL_LIBS)" -dllib -lgl_stubs $< @@ -229,8 +229,11 @@ glu.wrap.o: glu.wrap.c $(C_GLU_INCS) dllGlu.so libGlu.a: glu.wrap.o $(OCAMLMKLIB) -o Glu $< $(GLU_LIBS) =20 -Glu.cmxa Glu.a: Glu.cmx dllGlu.so - $(OCAMLMKLIB) -o Glu $< $(GLU_LIBS) +libglu_stubs.a: glu.wrap.o + $(OCAMLMKLIB) -oc glu_stubs $< $(GLU_LIBS) + +Glu.cmxa Glu.a: Glu.cmx glu.wrap.o + $(OCAMLMKLIB) -o Glu -oc glu_stubs $^ $(GLU_LIBS) =20 Glu.cma: Glu.cmo dllGlu.so $(OCAMLMKLIB) -o Glu $< $(GLU_LIBS) @@ -279,8 +282,8 @@ glut.wrap.o: glut.wrap.c $(C_GLUT_INCS) dllGlut.so libGlut.a: glut.wrap.o $(OCAMLMKLIB) -o Glut $< $(GLUT_LIBS) =20 -Glut.cmxa Glut.a: Glut.cmx dllGlut.so - $(OCAMLMKLIB) -o Glut $< $(GLUT_LIBS) +Glut.cmxa Glut.a: Glut.cmx glut.wrap.o + $(OCAMLMKLIB) -o Glut $^ $(GLUT_LIBS) =20 Glut.cma: Glut.cmo dllGlut.so $(OCAMLMKLIB) -o Glut $< $(GLUT_LIBS) @@ -484,7 +487,7 @@ DIST_FILES_CORE=3D\ GL.a GL.cmi GL.cmxa GL.cmx \ Glu.a Glu.cmi Glu.cmxa Glu.cmx \ Glut.a Glut.cmi Glut.cmxa Glut.cmx \ - libgl_stubs.a \ + libgl_stubs.a libglu_stubs.a \ libGlu.a \ libGlut.a \ GL.o Glu.o Glut.o \ --=_MailMate_671468A9-696E-4531-B40F-C6E20CD99EF9_=--