From owner-freebsd-questions Wed Dec 2 15:16:33 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id PAA18086 for freebsd-questions-outgoing; Wed, 2 Dec 1998 15:16:33 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from SCIENCE-GUY.npt.nuwc.navy.mil (relay.npt.nuwc.navy.mil [164.223.71.1]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id PAA18077 for ; Wed, 2 Dec 1998 15:16:29 -0800 (PST) (envelope-from tod@science-guy.npt.nuwc.navy.mil) Received: from science-guy.npt.nuwc.navy.mil (LOCALHOST [127.0.0.1]) by SCIENCE-GUY.npt.nuwc.navy.mil (8.8.8/8.8.7) with ESMTP id SAA14864; Wed, 2 Dec 1998 18:16:15 -0500 (EST) Message-ID: <3665CA3F.259C3CB@science-guy.npt.nuwc.navy.mil> Date: Wed, 02 Dec 1998 18:16:15 -0500 From: Tod Luginbuhl Reply-To: t.e.luginbuhl@ieee.org Organization: Code 2121, Naval Undersea Warfare Center X-Mailer: Mozilla 4.05 [en] (X11; I; FreeBSD 2.2.7-STABLE i386) MIME-Version: 1.0 To: questions@FreeBSD.ORG Subject: Calling LAPACK library from C in 3.0-RELEASE Content-Type: multipart/mixed; boundary="------------8B5D41F2AA025F36B7C1DB63" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG This is a multi-part message in MIME format. --------------8B5D41F2AA025F36B7C1DB63 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi, I have one machine running 2.2.7-STABLE (last installworld on 25 Sept), and on this maching, I have no problem calling the LAPACK library from C (LAPACK etc built using ports). I recently built a two processor system using the ASUS P2B-DS mother board which runs 3.0-RELEASE from the Walnut Creek CDs. When I try to compile a program that works in STABLE under 3.0-RELEASE, I get the following error message: cc -g -L/usr/local/lib -o stupid stupid.o -lm -lblas -llapack -lf2c /usr/lib/libf2c.so: undefined reference to `MAIN__' *** Error code 1 Does anyone have any ideas why this is happening and how I might correct it? A source list for simple C program that demonstrates the problem is given below. I've also included the makefile. Please email me directly because I stopped subscribing to this list (when I finish my dissertation, I'll subscribe again). Thanks! - ------------------------------------------------------------------------ Tod Luginbuhl email: t.e.luginbuhl@ieee.org Code 2121 luginbuhl@npt.nuwc.navy.mil Naval Undersea Warfare Center 1176 Howell Street Telephone: (401) 832-8241 Newport, Rhode Island FAX: (401) 832-7453 02841-1708 USA "Don't argue with drunks and fanatics!" -- Sun Wolf (Barbara Hambly) ------------------------------------------------------------------------ --------------8B5D41F2AA025F36B7C1DB63 Content-Type: text/plain; charset=us-ascii; name="stupid.c" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="stupid.c" #include #include #include #include #include #define N 3 #define NSQR N*N void main(int argc, char **argv) { int i, j, n, info; int pivot[N]; double matrix[NSQR]; double inverse[NSQR]; void dgesv(int *, int *,double *,int *,int *,double *,int *,int *); for (i=0;i