caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Philippe Strauss <philou@philou.ch>
To: caml-list@inria.fr
Subject: Re: [Caml-list] ocamlmklib OSX/OpenGL weirdness
Date: Fri, 13 Jan 2012 22:26:23 +0100	[thread overview]
Message-ID: <53AB84F5-72B7-4390-9425-5565058DB032@philou.ch> (raw)
In-Reply-To: <4758C5C2-5444-4C24-99CB-7AD010D06C6E@polytechnique.org>

[-- Attachment #1: Type: text/plain, Size: 2127 bytes --]

Thanks Alan, it does works fine now !

I attach another patch, very straight to the point, but not of the most refineds aesthetics, still to the same makefile, about paths to libjpeg and it's headers files.

(so in one thread on the ML archive we have all patches to build glMlite on OSX)

sorry, I was mixing the GL.o of glMlite and some kind of /usr/lib/libGL.so in my previous email.

would have spent half a day on it or more without yours. Thanks !

Le 13 janv. 2012 à 21:48, Alan Schmitt a écrit :

> 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
> 
> 
> -- 
> Caml-list mailing list.  Subscription management and archives:
> https://sympa-roc.inria.fr/wws/info/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
> 
> <patch_commit_2737d71a16b7.patch>


[-- Attachment #2: glmlite-make-libjpeg-paths.diff --]
[-- Type: application/octet-stream, Size: 1224 bytes --]

--- Makefile.orig	2012-01-13 15:23:23.000000000 +0100
+++ Makefile	2012-01-13 22:07:20.000000000 +0100
@@ -425,6 +425,9 @@
 jpeg_opt: jpeg_loader.cmxa
 jpeg: jpeg_byte jpeg_opt
 
+LDPATH=/opt/local/lib
+CCOPTS=-ccopt "-I/opt/local/include" -ccopt "-L$(LDPATH)"
+
 jpeg_loader.cmi jpeg_loader.cmo: jpeg_loader.ml  GL.cmi
 	$(OCAMLC) -c $<
 
@@ -432,16 +435,16 @@
 	$(OCAMLOPT) -c $<
 
 loader-libjpeg.o: loader-libjpeg.c  loader-libjpeg-mem.c  loader-texure.h
-	$(OCAMLC)  -c  $<
+	$(OCAMLC) $(CCOPTS) -c  $<
 
 dlljpeg_loader.so libjpeg_loader.a: loader-libjpeg.o
-	$(OCAMLMKLIB) -o jpeg_loader $< $(GL_LIBS) -L"$(OCAML_PATH)" -lbigarray -ljpeg
+	$(OCAMLMKLIB) -L$(LDPATH) -o jpeg_loader $< $(GL_LIBS) -L"$(OCAML_PATH)" -lbigarray -ljpeg
 
 jpeg_loader.cmxa jpeg_loader.a:  jpeg_loader.cmx  dlljpeg_loader.so
-	$(OCAMLMKLIB) -o jpeg_loader $< $(GL_LIBS) -L"$(OCAML_PATH)" -lbigarray -ljpeg
+	$(OCAMLMKLIB) -L$(LDPATH) -o jpeg_loader $< $(GL_LIBS) -L"$(OCAML_PATH)" -lbigarray -ljpeg
 
 jpeg_loader.cma:  jpeg_loader.cmo  dlljpeg_loader.so
-	$(OCAMLMKLIB) -o jpeg_loader $< $(GL_LIBS) -L"$(OCAML_PATH)" -lbigarray -ljpeg
+	$(OCAMLMKLIB) -L$(LDPATH) -o jpeg_loader $< $(GL_LIBS) -L"$(OCAML_PATH)" -lbigarray -ljpeg
 
 # }}}
 

[-- Attachment #3: Type: text/plain, Size: 48 bytes --]



--
Philippe Strauss
http://www.philou.ch/





      reply	other threads:[~2012-01-13 21:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-13 19:41 Philippe Strauss
2012-01-13 20:48 ` Alan Schmitt
2012-01-13 21:26   ` Philippe Strauss [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53AB84F5-72B7-4390-9425-5565058DB032@philou.ch \
    --to=philou@philou.ch \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).