Bug 93005 - Minor port enhancement to math/umfpack port
Summary: Minor port enhancement to math/umfpack port
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-08 00:50 UTC by giffunip
Modified: 2006-02-20 12:50 UTC (History)
0 users

See Also:


Attachments
file.diff (2.50 KB, patch)
2006-02-08 00:50 UTC, giffunip
no flags Details | Diff
umfpack.diff (22.71 KB, patch)
2006-02-20 12:45 UTC, Thierry Thomas
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description giffunip 2006-02-08 00:50:02 UTC
              Let the cblas library get overriden from the ports makefile, also implement maintainers mode. 
FWIW, I wanted to activate LP64 for amd64 and ia64 but the author recommended not doing this as unfortunately the current BLAS libraries don't implement 64 bit extensions and this would hit performance very badly.

Fix: Patch follows:
Comment 1 Pedro F. Giffuni 2006-02-20 01:08:14 UTC
The following diff is cleaner, and adds the -fPIC flag for amd64 case to make
it possible to build shared libs with umfpack and libamd.

diff -ruN umfpack.orig/Makefile umfpack/Makefile
--- umfpack.orig/Makefile	Sun Dec 18 16:03:54 2005
+++ umfpack/Makefile	Sun Feb 19 15:33:30 2006
@@ -19,10 +19,19 @@
 WRKSRC=		${WRKDIR}/${DISTNAME}/UMFPACK
 ALL_TARGET=	lib
 
+CBLAS_LIBS?=	-L${LOCALBASE}/lib -lcblas -latlas
+
 post-extract:
 	${CP}	${WRKDIR}/${DISTNAME}/AMD/Make/Make.linux	\
 		${WRKDIR}/${DISTNAME}/AMD/Make/Make.freebsd
 
+pre-build:
+	@${REINPLACE_CMD} -e 's+%%CC%%+${CC}+g ;	\
+	s+%%CFLAGS%%+${CFLAGS}+ ;		\
+	s+%%LOCALBASE%%+${LOCALBASE}+ ;		\
+	s+%%CBLAS_LIBS%%+${CBLAS_LIBS}+ ;'	\
+	 ${WRKDIR}/${DISTNAME}/AMD/Make/Make.freebsd
+
 do-install:
 	${INSTALL_DATA} ${WRKDIR}/${DISTNAME}/AMD/Lib/libamd.a ${PREFIX}/lib
 	${INSTALL_DATA} ${WRKSRC}/Lib/libumfpack.a ${PREFIX}/lib
@@ -47,4 +56,15 @@
 	@${FIND} ${EXAMPLESDIR} -type f | ${XARGS} ${CHMOD} ${SHAREMODE}
 .endif
 
-.include <bsd.port.mk>
+.if defined(MAINTAINER_MODE)
+test:	build
+	@(cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} $(MAKE) hb )
+.endif
+
+.include <bsd.port.pre.mk>
+
+.if ${ARCH} == "amd64"
+CFLAGS+=	-fPIC
+.endif
+
+.include <bsd.port.post.mk>
diff -ruN umfpack.orig/files/patch-Make+Make.freebsd
umfpack/files/patch-Make+Make.freebsd
--- umfpack.orig/files/patch-Make+Make.freebsd	Sun Dec 18 16:03:54 2005
+++ umfpack/files/patch-Make+Make.freebsd	Sun Feb 19 15:30:17 2006
@@ -1,13 +1,13 @@
---- Make/Make.freebsd.orig	Fri Mar 18 22:29:13 2005
-+++ Make/Make.freebsd	Fri Mar 18 22:30:13 2005
+--- Make/Make.freebsd.orig	Sun Feb 19 15:26:42 2006
++++ Make/Make.freebsd	Sun Feb 19 15:29:05 2006
 @@ -6,8 +6,8 @@
  # if you use the Intel compiler and the Fortran BLAS.
  
  # Using GNU gcc and f77 compilers:
 -  CC = gcc
 -  CFLAGS = -O3 -fPIC
-+  CC ?= cc
-+  CFLAGS ?= -O3 -fPIC
++  CC = %%CC%%
++  CFLAGS = %%CFLAGS%% -fPIC
  
  # Using Intel's icc and ifc compilers:
  # F77 = ifc
@@ -17,14 +17,14 @@
  # 2: with the ATLAS C-BLAS (http://www.netlib.org/atlas).
 -# CONFIG = -DCBLAS -I../ATLAS/include
 -# LIB = -lcblas -latlas -lm
-+CONFIG = -DCBLAS -I../ATLAS/include -I${LOCALBASE}/include
-+LIB = -L${LOCALBASE}/lib -lcblas -latlas -lm
++CONFIG = -DGETRUSAGE -DCBLAS -I../ATLAS/include -I%%LOCALBASE%%/include
++LIB = %%CBLAS_LIBS%% -lm
  
  # 3: with Fortran interface to the ATLAS BLAS
 -# CONFIG =
 -# LIB = -lf77blas -latlas -lfrtbegin -lg2c -lm
-+# CONFIG = -I${LOCALBASE}/include
-+# LIB = -L${LOCALBASE}/lib -lf77blas -latlas -lfrtbegin -lg2c -lm
++# CONFIG = -I%%LOCALBASE%%/include
++# LIB = -L%%LOCALBASE%%/lib -lf77blas -latlas -lfrtbegin -lg2c -lm
  
  # 4: with Fortran interface to the BLAS, and Goto's BLAS
 -  CONFIG =


---
     Pedro F. Giffuni
     M. Sc. Industrial Eng. University of Pittsburgh
     Mech. Eng.      Universidad Nacional de Colombia
---
Yahoo is powered by FreeBSD    http://www.FreeBSD.org/


	

	
		
___________________________________ 
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB 
http://mail.yahoo.it
Comment 2 Pedro F. Giffuni 2006-02-20 01:18:35 UTC
ugh..sorry ofr submitting yet another patch, the original port actaully had
-fPIC for everycase. IMHO, this makes sense on amd64 but we shouldn't be adding
it for other architectures. Here is the revised patch:

diff -ruN umfpack.orig/Makefile umfpack/Makefile
--- umfpack.orig/Makefile	Sun Dec 18 16:03:54 2005
+++ umfpack/Makefile	Sun Feb 19 20:11:31 2006
@@ -19,10 +19,19 @@
 WRKSRC=		${WRKDIR}/${DISTNAME}/UMFPACK
 ALL_TARGET=	lib
 
+CBLAS_LIBS?=	-L${LOCALBASE}/lib -lcblas -latlas
+
 post-extract:
 	${CP}	${WRKDIR}/${DISTNAME}/AMD/Make/Make.linux	\
 		${WRKDIR}/${DISTNAME}/AMD/Make/Make.freebsd
 
+pre-build:
+	@${REINPLACE_CMD} -e 's+%%CC%%+${CC}+g ;	\
+	s+%%CFLAGS%%+${CFLAGS}+ ;		\
+	s+%%LOCALBASE%%+${LOCALBASE}+ ;		\
+	s+%%CBLAS_LIBS%%+${CBLAS_LIBS}+ ;'	\
+	 ${WRKDIR}/${DISTNAME}/AMD/Make/Make.freebsd
+
 do-install:
 	${INSTALL_DATA} ${WRKDIR}/${DISTNAME}/AMD/Lib/libamd.a ${PREFIX}/lib
 	${INSTALL_DATA} ${WRKSRC}/Lib/libumfpack.a ${PREFIX}/lib
@@ -47,4 +56,15 @@
 	@${FIND} ${EXAMPLESDIR} -type f | ${XARGS} ${CHMOD} ${SHAREMODE}
 .endif
 
-.include <bsd.port.mk>
+.if defined(MAINTAINER_MODE)
+test:	build
+	@(cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} $(MAKE) hb )
+.endif
+
+.include <bsd.port.pre.mk>
+
+.if ${ARCH} == "amd64"
+CFLAGS+=	-fPIC
+.endif
+
+.include <bsd.port.post.mk>
diff -ruN umfpack.orig/files/patch-Make+Make.freebsd
umfpack/files/patch-Make+Make.freebsd
--- umfpack.orig/files/patch-Make+Make.freebsd	Sun Dec 18 16:03:54 2005
+++ umfpack/files/patch-Make+Make.freebsd	Sun Feb 19 20:12:34 2006
@@ -1,13 +1,13 @@
---- Make/Make.freebsd.orig	Fri Mar 18 22:29:13 2005
-+++ Make/Make.freebsd	Fri Mar 18 22:30:13 2005
+--- Make/Make.freebsd.orig	Sun Feb 19 15:26:42 2006
++++ Make/Make.freebsd	Sun Feb 19 15:29:05 2006
 @@ -6,8 +6,8 @@
  # if you use the Intel compiler and the Fortran BLAS.
  
  # Using GNU gcc and f77 compilers:
 -  CC = gcc
 -  CFLAGS = -O3 -fPIC
-+  CC ?= cc
-+  CFLAGS ?= -O3 -fPIC
++  CC = %%CC%%
++  CFLAGS = %%CFLAGS%%
  
  # Using Intel's icc and ifc compilers:
  # F77 = ifc
@@ -17,14 +17,14 @@
  # 2: with the ATLAS C-BLAS (http://www.netlib.org/atlas).
 -# CONFIG = -DCBLAS -I../ATLAS/include
 -# LIB = -lcblas -latlas -lm
-+CONFIG = -DCBLAS -I../ATLAS/include -I${LOCALBASE}/include
-+LIB = -L${LOCALBASE}/lib -lcblas -latlas -lm
++CONFIG = -DGETRUSAGE -DCBLAS -I../ATLAS/include -I%%LOCALBASE%%/include
++LIB = %%CBLAS_LIBS%% -lm
  
  # 3: with Fortran interface to the ATLAS BLAS
 -# CONFIG =
 -# LIB = -lf77blas -latlas -lfrtbegin -lg2c -lm
-+# CONFIG = -I${LOCALBASE}/include
-+# LIB = -L${LOCALBASE}/lib -lf77blas -latlas -lfrtbegin -lg2c -lm
++# CONFIG = -I%%LOCALBASE%%/include
++# LIB = -L%%LOCALBASE%%/lib -lf77blas -latlas -lfrtbegin -lg2c -lm
  
  # 4: with Fortran interface to the BLAS, and Goto's BLAS
 -  CONFIG =




		
___________________________________ 
Yahoo! Messenger with Voice: chiama da PC a telefono a tariffe esclusive 
http://it.messenger.yahoo.com
Comment 3 Thierry Thomas freebsd_committer freebsd_triage 2006-02-20 08:58:07 UTC
State Changed
From-To: open->closed


Committed, thanks! 

And please consider building shared libs to solve the problem on amd64...
Comment 4 Thierry Thomas freebsd_committer freebsd_triage 2006-02-20 12:45:41 UTC
On Mon 20 feb 06 at 9:59:32 +0100, Thierry Thomas <thierry@FreeBSD.org>
 wrote:
> And please consider building shared libs to solve the problem on amd64...

Well, I did it. Could you please try the attached patch on your amd64
box?

Regards,
-- 
Th. Thomas.