From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA17989; Mon, 22 Sep 2003 19:51:02 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA22730 for ; Mon, 22 Sep 2003 19:51:01 +0200 (MET DST) Received: from motgate3.mot.com (motgate3.mot.com [144.189.100.103]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h8MHp0526610 for ; Mon, 22 Sep 2003 19:51:00 +0200 (MET DST) Received: from il06exr04.mot.com (il06exr04.mot.com [129.188.137.134]) by motgate3.mot.com (Motorola/Motgate3) with ESMTP id h8MHovNk002616 for ; Mon, 22 Sep 2003 10:50:57 -0700 (MST) Received: from az33exm32.corp.mot.com (az33exm32.corp.mot.com [10.64.65.146]) by il06exr04.mot.com (Motorola/il06exr04) with ESMTP id h8MHoeDd022984 for ; Mon, 22 Sep 2003 12:50:41 -0500 Received: from motorola.com (hodaka.somerset.sps.mot.com [163.12.105.57]) by az33exm32.corp.mot.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2657.2) id T2HJNSBL; Mon, 22 Sep 2003 10:50:50 -0700 Message-ID: <3F6F367E.C0E7B250@motorola.com> Date: Mon, 22 Sep 2003 12:50:54 -0500 From: Narayanan Krishnamurthy Organization: Motorola Somerset PowerPC Design Center X-Mailer: Mozilla 4.7 [en] (X11; U; SunOS 5.8 sun4u) X-Accept-Language: en MIME-Version: 1.0 To: caml-list@inria.fr Subject: [Caml-list] Having problems with '-rpath' or '-rpath-link' to ocamlopt Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Loop: caml-list@inria.fr X-Spam: no; 0.00; narayanan:01 narayanan:01 ocamlopt:01 sunos:01 gcc:01 2.95.2:01 3.06.:01 pcre:01 libpcre:01 usr:01 libpcre:01 pcre:01 usr:01 ocamlopt:01 -rpath:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi, All the following discussions pertain to SunOS 5.8 the gnu linker 'ld 2.9.1', the gcc compiler 'gcc 2.95.2' and ocaml 3.06. I have two versions of the PCRE "C" libpcre.so libraries. Let us say that the locations of the "C" libraries are as follows. a) v1.0 : /usr/local/lib/libpcre.so b) v2.0 : /mylocal/libpcre.so I've built the ocaml pcre package (5.02: pcre.cmxa and pcre.cma) using the "C" v2.0 shared library /mylocal/libpcre.so. I have pcre.cmxa in my current working directory. With my LD_LIBRARY_PATH set as LD_LIBRARY_PATH = /lib:/usr/lib:/usr/local/lib I now run a) ocamlopt -o myexec pcre.cmxa myexec.o \ -cclib -rpath/mylocal -cclib -lpcre and find that 'myexec' has the /usr/local/lib/libpcre.so as the run-time shared library instead of /mylocal/libpcre.so (I use 'ldd' on 'myexec') I tried the following as well and am unable to get ocamlopt to link in the run-time library /mylocal/libpcre.so. b) ocamlopt -o myexec pcre.cmxa myexec.o \ -cclib -R/mylocal -cclib -lpcre c) ocamlopt -o myexec pcre.cmxa myexec.o \ -cclib -rpath-link/mylocal -cclib -lpcre If I unset my LD_LIBRARY_PATH, everything works fine and the correct library is linked in (I tried 'strings pcre.cmxa' and see the path /mylocal hard-coded in there). If I set LD_LIBRARY_PATH as /lib:/usr/lib:/mylocal:/usr/local/lib it works fine. It seems like I am unable to override the LD_LIBRARY_PATH environment variable using '-rpath' for the linker. So, what am I doing wrong with the '-rpath' or '-rpath-link' commands that I'm passing through 'ocamlopt'? Any information would be greatly appreciated. Thanks. Narayanan Krishnamurthy (Nari) ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners