From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by sympa.inria.fr (Postfix) with ESMTPS id BE95E7ED47 for ; Sat, 21 Jul 2012 19:17:03 +0200 (CEST) Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of ml@pulsschlag.net) identity=pra; client-ip=194.95.184.44; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="ml@pulsschlag.net"; x-sender="ml@pulsschlag.net"; x-conformance=sidf_compatible Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of ml@pulsschlag.net) identity=mailfrom; client-ip=194.95.184.44; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="ml@pulsschlag.net"; x-sender="ml@pulsschlag.net"; x-conformance=sidf_compatible Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mailhost.mis.mpg.de) identity=helo; client-ip=194.95.184.44; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="ml@pulsschlag.net"; x-sender="postmaster@mailhost.mis.mpg.de"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhQKAMvjClDCX7gs/2dsb2JhbABFqEGPdAOBJIEHgiABAQQBOjQLBQsLGA0PEkUSBhMSh2wDBgoHtF4DiViLTQVUhRpgA41xiGyOeYJh X-IronPort-AV: E=Sophos;i="4.77,630,1336341600"; d="scan'208";a="151345278" Received: from mailhost.mis.mpg.de ([194.95.184.44]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 21 Jul 2012 19:16:46 +0200 Received: from twww.mis.mpg.de (twww.mis.mpg.de [194.95.185.34]) by mailhost.mis.mpg.de (8.13.8/8.13.8) with ESMTP id q6LHGgQM022692; Sat, 21 Jul 2012 19:16:43 +0200 (MEST) Received: from phoenix.fritz.box (brln-4dbc2c3a.pool.mediaWays.net [77.188.44.58]) (authenticated bits=0) by twww.mis.mpg.de (8.14.4/8.14.4) with ESMTP id q6LHGhgN027805 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NO); Sat, 21 Jul 2012 19:16:44 +0200 (MEST) Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=us-ascii From: Keyan In-Reply-To: <20120721113102.bd7e8914.ygrekheretix@gmail.com> Date: Sat, 21 Jul 2012 19:16:38 +0200 Cc: caml-list@inria.fr Content-Transfer-Encoding: quoted-printable Message-Id: <23488C91-9176-40A9-95C0-7F04BD90A442@pulsschlag.net> References: <6616C34B-0FEC-4031-ABA8-8181D7654533@pulsschlag.net> <20120721113102.bd7e8914.ygrekheretix@gmail.com> To: ygrek X-Mailer: Apple Mail (2.1278) X-MIS-Check-Sender: OK, user zahedi() has authenticated himself with PLAIN. Subject: Re: [Caml-list] libasmrun.a not compatible with dynamic linking on mac os x Hi, thanks for trying. I just recently solved this issue by compiling the code = differently: ocamlopt -o mylib.so ocaml_source.ml -ccopt my_c_source.c -ccopt -shared=20 g++ -dynamiclib -o myfinallib.dylib -L/usr/local/lib/ocaml/ -lasmrun -lnums= -ldl -Wl,-search_paths_first -Wl,-headerpad_max_install_names -fPIC Contro= ller.o mylib.so=20 I haven't even checked yet, if all the options are really required, i.e. -f= PIC, and both -Wl, options. Best, Keyan On 21 Jul 2012, at 10:31, ygrek wrote: > On Mon, 16 Jul 2012 17:05:53 +0200 > Keyan wrote: >=20 >> Hi, >>=20 >> i try to compile a dynamic library on mac os x, from ocaml-code using th= e following lines in my makefile; >>=20 >> camlopt -output-obj -o ocaml_controller.o -I /usr/local/lib/ocaml/site-l= ib/batteries ocaml_controller.ml=20 >> ocamlc -o ocaml_interface.o -c ocaml_interface.c -I /usr/local/lib/ocaml= /=20 >> libtool -static -a -o mylib.a /usr/local/lib/ocaml/libasmrun.a ocaml_con= troller.o ocaml_interface.o >> g++ -o Controller.o -c Controller.cpp=20 >> g++ -v -dynamiclib -o libController.dylib Controller.o mylib.a >=20 > I couldn't fully reproduce these steps (on linux) because libtool doesn't= want to accept such command line. > But still what occurs to me - you probably shouldn't use "ocaml_controlle= r.o" as -output-obj target, because > the file with such name is generated as a .cmx companion. Name it smth li= ke ocaml_controller_obj.o. > I've got ocamlopt errors otherwise. Does it help? >=20 > --=20 > ygrek > http://ygrek.org.ua >=20 > --=20 > 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 >=20