From owner-freebsd-ports-bugs@FreeBSD.ORG Wed Aug 13 07:10:10 2003 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4FA5F37B404 for ; Wed, 13 Aug 2003 07:10:09 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id EF1F243FDF for ; Wed, 13 Aug 2003 07:10:06 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h7DEA6Up017838 for ; Wed, 13 Aug 2003 07:10:06 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h7DEA69h017837; Wed, 13 Aug 2003 07:10:06 -0700 (PDT) Resent-Date: Wed, 13 Aug 2003 07:10:06 -0700 (PDT) Resent-Message-Id: <200308131410.h7DEA69h017837@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Thierry Thomas Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 87DEE37B401; Wed, 13 Aug 2003 07:08:26 -0700 (PDT) Received: from ws90bj.pompo.net (lns-th2-2f-81-56-186-139.adsl.proxad.net [81.56.186.139]) by mx1.FreeBSD.org (Postfix) with ESMTP id C0FB443FBD; Wed, 13 Aug 2003 07:08:22 -0700 (PDT) (envelope-from thierry@pompo.net) Received: by ws90bj.pompo.net (Postfix, from userid 1001) id C173222B9B1; Wed, 13 Aug 2003 16:08:03 +0200 (CEST) Message-Id: <20030813140803.C173222B9B1@ws90bj.pompo.net> Date: Wed, 13 Aug 2003 16:08:03 +0200 (CEST) From: Thierry Thomas To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 cc: Oliver Lehmann Subject: ports/55544: cad/metis-edf: unbreaking on Alpha. X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Thierry Thomas List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Aug 2003 14:10:10 -0000 >Number: 55544 >Category: ports >Synopsis: cad/metis-edf: unbreaking on Alpha. >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Aug 13 07:10:06 PDT 2003 >Closed-Date: >Last-Modified: >Originator: Thierry Thomas >Release: FreeBSD 5.1-RELEASE i386 >Organization: Kabbale Eros >Environment: System: FreeBSD ws90bj.pompo.net 5.1-RELEASE FreeBSD 5.1-RELEASE #0: Sat Aug 9 10:48:19 CEST 2003 thierry@ws90bj.pompo.net:/usr/obj/usr/src/sys/WS90BJ-030610 i386 >Description: Noticed by Kris on Bento: cad/metis-edf is broken on Apha. Actually, it builds, then there is a `make test', it eats all the CPU and never launches: there is a kind of loop in /usr/libexec/ld-elf.so.1. This problem has been solved by replacing $LD by $CC (with the flag verbose to check that everything is OK). After that, there was another problem due to the usage of int in the FORTRAN subprograms and long in the C functions. Remark: this program is also broken on other 64 bits platforms; this PR has been tested on i386 & alpha, but if we are lucky, it might unbreak everywhere... Credits: - thanks to Oliver Lehmann for an access to his Alpha machine; - thanks to Marcel Moolenaar on freebsd-alpha list for the LD trick. >How-To-Repeat: See the logs on Bento, e.g. . >Fix: Please apply the following patch. Remark: one new file, patch-Lib::proto.h. --- metis-edf.diff begins here --- diff -urN cad/metis-edf.orig/Makefile cad/metis-edf/Makefile --- cad/metis-edf.orig/Makefile Thu Jul 24 23:08:11 2003 +++ cad/metis-edf/Makefile Wed Aug 13 15:14:05 2003 @@ -7,6 +7,7 @@ PORTNAME= metis-edf PORTVERSION= 3 +PORTREVISION= 1 CATEGORIES= cad MASTER_SITES= http://www.code-aster.org/FICHIERS/metis/ @@ -16,10 +17,22 @@ CONFLICTS= metis-[0-9]* ALL_TARGET= default -MAKE_ENV+= CC="${CC}" AR="${AR}" LD="${LD}" F77="${F77}" +MAKE_ENV+= CC="${CC}" AR="${AR}" F77="${F77}" FFLAGS="${FFLAGS}" USE_REINPLACE= yes +REINPLACE_ARGS= -i "" F77?= f77 +FFLAGS?= -O2 + +post-patch: +.if ${MACHINE_ARCH} != "i386" + @${FIND} ${WRKSRC} -type f -name "*.c" -o -name "*.h" | ${XARGS} \ + ${REINPLACE_CMD} -e "s|long int|int|g" \ + -e "s|long|int|g" \ + -e "s|\(%[[:digit:]]\)ld|\1d|g" \ + -e "s|\(%[[:digit:]]\.[[:digit:]]\)le|\1e|g" \ + -e "s|%ld|%d|g" +.endif do-install: @${CP} ${WRKSRC}/CONFIG/onmetis.in ${WRKSRC}/onmetis diff -urN cad/metis-edf.orig/files/patch-CONFIG::configure cad/metis-edf/files/patch-CONFIG::configure --- cad/metis-edf.orig/files/patch-CONFIG::configure Sun Jun 29 18:39:40 2003 +++ cad/metis-edf/files/patch-CONFIG::configure Wed Aug 13 15:04:47 2003 @@ -1,6 +1,14 @@ --- CONFIG/configure.orig Mon Dec 16 18:11:44 2002 -+++ CONFIG/configure Sun Jun 29 14:58:48 2003 -@@ -18,7 +18,7 @@ ++++ CONFIG/configure Tue Aug 12 22:47:59 2003 +@@ -4,6 +4,7 @@ + # SHELL defined by make (sh) + + OS_TYPE=`uname -s` ++ARCHI=`uname -p` + if [ $OS_TYPE = "SunOS" ]; then + OS_LEVEL=`uname -r` + OS_NIV=`echo $OS_LEVEL | awk -F'.' '{print $2}'` +@@ -18,7 +19,7 @@ if [ -z "$rtn" ] || [ "$rtn" = "y" -o "$rtn" = "Y" ]; then OS_TYPE=SunOS64 fi @@ -9,7 +17,7 @@ echo " Operating system $OS_TYPE unknown on this distribution" echo " Installation failed !" exit 8 -@@ -30,14 +30,23 @@ +@@ -30,14 +31,25 @@ # FOPTIONS : Fortran compiler options, # LDOPTIONS : link options, AR : archiver @@ -24,9 +32,11 @@ +if [ $OS_TYPE = "FreeBSD" ]; then + CC="$CC" + F90="$F77" -+ LD="$LD" ++ LD="$CC -v" + COPTIONS="$CFLAGS" -+ LDOPTIONS="$LDFLAGS -lc -lg2c -L. -L.." ++ OPTFLAGS="" ++ FOPTIONS="$FFLAGS" ++ LDOPTIONS="$LDFLAGS -L. -L.." + AR="$AR rv" +else + CC="cc" diff -urN cad/metis-edf.orig/files/patch-Lib::proto.h cad/metis-edf/files/patch-Lib::proto.h --- cad/metis-edf.orig/files/patch-Lib::proto.h Thu Jan 1 01:00:00 1970 +++ cad/metis-edf/files/patch-Lib::proto.h Tue Aug 12 23:01:41 2003 @@ -0,0 +1,12 @@ +--- Lib/proto.h.orig Thu Dec 12 13:47:59 2002 ++++ Lib/proto.h Tue Aug 12 22:53:22 2003 +@@ -456,7 +456,9 @@ + void saxpy(long, float, float *, long, float *, long); + void RandomPermute(long, idxtype *, long); + double drand48(); ++#if !defined(__FreeBSD__) + void srand48(long); ++#endif + long ispow2(long); + void InitRandom(long); + long log2(long); diff -urN cad/metis-edf.orig/files/patch-Programs::Makefile cad/metis-edf/files/patch-Programs::Makefile --- cad/metis-edf.orig/files/patch-Programs::Makefile Sun Jun 29 18:39:40 2003 +++ cad/metis-edf/files/patch-Programs::Makefile Wed Aug 13 15:10:51 2003 @@ -1,11 +1,11 @@ --- Programs/Makefile.orig Thu Dec 12 13:47:59 2002 -+++ Programs/Makefile Sun Jun 29 15:39:26 2003 -@@ -11,7 +11,7 @@ ++++ Programs/Makefile Wed Aug 13 15:10:19 2003 +@@ -5,7 +5,7 @@ + INCLUDES = -I../Lib + CFLAGS = $(COPTIONS) $(OPTFLAGS) $(INCLUDES) + FFLAGS = $(FOPTIONS) $(OPTFLAGS) $(INCLUDES) +-LIBS = -lmetis -lm ++LIBS = -lmetis -lm -lg2c + METISLIB = ../libmetis.a - - --ONMETISOBJS = onmetis.o io.o smbfactor.o ecri11.o lect11.o lect00.o -+ONMETISOBJS = onmetis.o io.o smbfactor.o ecri11.o lect11.o lect00.o /usr/lib/crt1.o - - --- metis-edf.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: