From owner-freebsd-questions@FreeBSD.ORG Mon Nov 29 13:57:52 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A4EF1065675 for ; Mon, 29 Nov 2010 13:57:52 +0000 (UTC) (envelope-from igorr@canmos.ru) Received: from sta1.canmos.ru (sta1.canmos.ru [89.107.124.11]) by mx1.freebsd.org (Postfix) with ESMTP id 3803D8FC0A for ; Mon, 29 Nov 2010 13:57:51 +0000 (UTC) Received: from sta1.canmos.ru (sta1.canmos.ru [89.107.124.11]) by sta1.canmos.ru (Postfix) with ESMTP id 7A3201271D6; Mon, 29 Nov 2010 16:57:50 +0300 (MSK) Date: Mon, 29 Nov 2010 16:57:50 +0300 (MSK) From: "Igor V. Ruzanov" To: Anton Shterenlikht In-Reply-To: <20101129135058.GA6756@mech-cluster241.men.bris.ac.uk> Message-ID: References: <20101129135058.GA6756@mech-cluster241.men.bris.ac.uk> X-GPG-PUBLIC-KEY: 1024D/494AF6DC 2008-03-20 Igor V. Ruzanov X-GPG-FINGERPRINT: A723 B6CC 11ED A4E2 1909 C4DC 6EDE 9089 494A F6DC MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: freebsd-questions@freebsd.org Subject: Re: linking against shared libraries not in default 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: Mon, 29 Nov 2010 13:57:52 -0000 On Mon, 29 Nov 2010, Anton Shterenlikht wrote: |I compiled some numerical libraries under my home |directory, including static and shared libs. The |shared lib is | |% ls ./src/libslatec.so.1 |./src/libslatec.so.1 |% | |Now I'd like to test shared libraries, so I do | |% gfortran45 -o test01.x test01.o qc6a.o -L./src/ -lslatec |% ./test01.x |/libexec/ld-elf.so.1: Shared object "libslatec.so.1" not found, required by "test01.x" |% | |How can I tell the executable to look for a shared library |in a specific directory? I tried setting LIBRARY_PATH, but |it didn't help. | |Perhaps I completely misunderstand how shared libraries work.. | |Please advise | ldconfig -m ./src/libslatec.so.1 (in your example) +-------------------------------------------+ ! CANMOS ISP Network ! +-------------------------------------------+ ! Best regards ! ! Igor V. Ruzanov, network operational staff! ! e-Mail: igorr@canmos.ru ! +-------------------------------------------+