From owner-freebsd-questions@FreeBSD.ORG Thu Apr 19 17:40:00 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 05F7816A402 for ; Thu, 19 Apr 2007 17:40:00 +0000 (UTC) (envelope-from bsam@ipt.ru) Received: from mail.ipt.ru (mail.ipt.ru [80.253.10.82]) by mx1.freebsd.org (Postfix) with ESMTP id 7AE6F13C457 for ; Thu, 19 Apr 2007 17:39:59 +0000 (UTC) (envelope-from bsam@ipt.ru) Received: from srv.sem.ipt.ru ([192.168.12.1] helo=ipt.ru) by mail.ipt.ru with esmtp (Exim 4.62 (FreeBSD)) (envelope-from ) id 1Heabs-000GMW-Nz; Thu, 19 Apr 2007 21:39:56 +0400 Received: from bsam by ipt.ru with local (Exim 4.63 (FreeBSD)) (envelope-from ) id 1HeacR-000KUk-PY; Thu, 19 Apr 2007 21:40:31 +0400 To: "Henry Lenzi" References: <8b4c81f0704190915i3037133cne52c1986ee851049@mail.gmail.com> From: Boris Samorodov Date: Thu, 19 Apr 2007 21:40:31 +0400 In-Reply-To: <8b4c81f0704190915i3037133cne52c1986ee851049@mail.gmail.com> (Henry Lenzi's message of "Thu, 19 Apr 2007 13:15:28 -0300") Message-ID: <91769984@srv.sem.ipt.ru> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: FreeBSD Subject: Re: Help with running Linux software LD_LIBRARY_PATH X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Apr 2007 17:40:00 -0000 On Thu, 19 Apr 2007 13:15:28 -0300 Henry Lenzi wrote: > I'm trying to install a software package called LINGO for my > operations research class. There's a Linux version (no BSD, though). > http://www.lindo.com/downloads/downloadm.html > I'm hoping I can get this to work with the Linux emulation layer > (other stuff work already, like Maple 8). > I am getting errors related to a shell script a LD_LIBRARY_PATH > There are libraries that need to be loaded in /opt/lingo9 > > ls > LINGO.CNF libcxa.so liblindo.so libmosek.so.3.2 lingovars.sh > libcxa.so.3 liblindo.so.3.0 libunwind.so.5 > libconsub3.so libcxa.so.5 libmosek.so lingo9 > I unpacked it under /opt. > There's a bash shell script you're supposed to run: > ############################## > #! /bin/sh > LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/opt/lingo9/bin/linux32 > export LD_LIBRARY_PATH > LINGO_LICENSE_FILE="$HOME/opt/lingo9/license/lndlng90.lic" > export LINGO_LICENSE_FILE > ############################### > My first question is if the shell script "translation" to tcsh is correct: Why should you convert the script to tcsh? IMHO the best way is to convert it to sh. > ############################### > #!/bin/tcsh > setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:/opt/lingo9/bin/linux32 ^^^^^^^^^^^^^^^ [1] recursive declaration? > setenv LINGO_LICENSE_FILE "/opt/ling9/license/lndlng90.lic" > ############################### > When I try to execute it, I get the error below (BTW, set to 755). > > ls -l bsdlingolic.sh > -rwxr-xr-x 1 root 2527 143 19 Abr 13:00 bsdlingolic.sh > > ./bsdlingolic.sh > LD_LIBRARY_PATH: Undefined variable. Yep, it's not defined at the time [1] occures. Actually, defining LD_LIBRARY_PATH almost always is a Bad Thing. > What suggestions do you have regarding this issue? 1. Create a port (local?) for the software. Don't forget to brand executables (only!). 2. Install it to PREFIX=/usr/local (i.e. libraries to /usr/local/lib etc), linuxulator will make the right thing to find needed libraries. 3. Delete the definition of LD_LIBRARY_PATH. 4. Enjoy you work. ;-) WBR -- Boris Samorodov (bsam) Research Engineer, http://www.ipt.ru Telephone & Internet SP FreeBSD committer, http://www.FreeBSD.org The Power To Serve