aboutsummaryrefslogtreecommitdiffstats
path: root/math/lapacke/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'math/lapacke/Makefile')
-rw-r--r--math/lapacke/Makefile87
1 files changed, 67 insertions, 20 deletions
diff --git a/math/lapacke/Makefile b/math/lapacke/Makefile
index dc409bbd907e..607ae6c0c822 100644
--- a/math/lapacke/Makefile
+++ b/math/lapacke/Makefile
@@ -6,13 +6,13 @@
#
PORTNAME= lapacke
-PORTVERSION= 1.0.0.009
-PORTREVISION= 1
+PORTVERSION= 3.4.0
CATEGORIES= math
MASTER_SITES= NL
MASTER_SITE_SUBDIR= lapack
-DISTNAME= ${PORTNAME}
-EXTRACT_SUFX= .tgz
+DISTNAME= lapack-${PORTVERSION}
+DISTFILES= ${DISTNAME}.tgz lapacke.tgz
+DIST_SUBDIR= lapack
MAINTAINER= phd_kimberlite@yahoo.co.jp
COMMENT= Standard C language APIs for LAPACK
@@ -24,11 +24,24 @@ USE_LDCONFIG= yes
USE_FORTRAN= yes
MAKE_JOBS_SAFE= yes
-OPTIONS= PROFILE "Build a profiling library" Off
+OPTIONS= PROFILE "Build a profiling library" Off \
+ XLAPACKE "Install interfaces to XLAPACK" Off
.include <bsd.port.pre.mk>
-WRKSRC= ${WRKDIR}/${PORTNAME}
+LAPACKE_SVERSION= 1
+LAPACKE_LIBNAME= lapacke
+LAPACKE_LIBNAME_TMG= lapacke_tmg
+MAKE_ENV+= "SHLIB_MAJOR=${LAPACKE_SVERSION}" \
+ "LAPACKE_LIBNAME=${LAPACKE_LIBNAME}" \
+ "LAPACKE_LIBNAME_TMG=${LAPACKE_LIBNAME_TMG}"
+.if defined (WITH_XLAPACKE)
+XLAPACKE_LIBNAME= xlapacke
+MAKE_ENV+= "XLAPACKE_LIBNAME=${XLAPACKE_LIBNAME}"
+.endif
+
+WRKSRC= ${WRKDIR}/${DISTNAME}/${PORTNAME}
+WRKSRC_LEGACY = ${WRKDIR}/lapacke
.if exists(${LOCALBASE}/lib/libgoto2p.so)
WITH_BLAS?= gotoblas
@@ -49,7 +62,6 @@ LDFLAGS+= ${PTHREAD_LIBS}
LIB_DEPENDS+= goto2p.1:${PORTSDIR}/math/gotoblas
BLAS= -lgoto2p
LAPACK= -lgoto2p
-WITHOUT_LAPACK_LATEST= yes
.elif ${WITH_BLAS} == "atlas"
CFLAGS+= ${PTHREAD_CFLAGS}
LDFLAGS+= ${PTHREAD_LIBS}
@@ -57,20 +69,28 @@ LIB_DEPENDS+= atlas.2:${PORTSDIR}/math/atlas
BLAS= -lptf77blas
LAPACK= -lalapack -lptcblas
.endif
+.if defined (WITH_XLAPACKE)
+LIB_DEPENDS+= xlapack.4:${PORTSDIR}/math/xlapack
+.endif
LDFLAGS+= -L${LOCALBASE}/lib
-.if defined(WITHOUT_LAPACK_LATEST)
-MAKE_ENV+= WITHOUT_LAPACK_LATEST=yes
-.endif
.if !defined(NOPORTDOCS)
PORTDOCS= README
.endif
PLIST_FILES= include/lapacke.h \
include/lapacke_utils.h \
- lib/liblapacke.a \
- lib/liblapacke.so \
- lib/liblapacke.so.1
+ lib/lib${LAPACKE_LIBNAME}.a \
+ lib/lib${LAPACKE_LIBNAME_TMG}.a \
+ lib/lib${LAPACKE_LIBNAME}.so \
+ lib/lib${LAPACKE_LIBNAME_TMG}.so \
+ lib/lib${LAPACKE_LIBNAME}.so.${LAPACKE_SVERSION} \
+ lib/lib${LAPACKE_LIBNAME_TMG}.so.${LAPACKE_SVERSION}
+.if defined (WITH_XLAPACKE)
+PLIST_FILES+= lib/lib${XLAPACKE_LIBNAME}.a \
+ lib/lib${XLAPACKE_LIBNAME}.so \
+ lib/lib${XLAPACKE_LIBNAME}.so.${LAPACKE_SVERSION}
+.endif
.if defined(WITH_PROFILE)
.if defined(NOPROFILE) || defined(NO_PROFILE) || defined(WITHOUT_PROFILE)
@@ -80,12 +100,21 @@ WITHOUT_PROFILE, NOPROFILE, or NO_PROFILE
IGNORE = you have chosen WITH_PROFILE, but have not installed the\
base system profiling libraries
.endif
-PLIST_FILES+= lib/liblapacke_p.a
+PLIST_FILES+= lib/lib${LAPACKE_LIBNAME}_p.a \
+ lib/lib${LAPACKE_LIBNAME_TMG}_p.a
+.if defined (WITH_XLAPACKE)
+PLIST_FILES+= lib/lib${XLAPACKE_LIBNAME}_p.a
+.endif
.else
MAKE_ENV+= NO_PROFILE=
.endif
+post-extract:
+ @${CP} -r ${WRKSRC_LEGACY}/testing ${WRKSRC}/.
+
post-patch:
+ @${FIND} ${WRKSRC} -name "Makefile*" -type f |\
+ ${XARGS} ${REINPLACE_CMD} -e 's;$$(ARCH);$$(ARCH_);g'
@${REINPLACE_CMD} -e 's;%%CC%%;${CC};g' \
-e 's;%%CFLAGS%%;${CFLAGS};g' \
-e 's;%%LDFLAGS%%;${LDFLAGS};g' \
@@ -93,17 +122,28 @@ post-patch:
-e 's;%%RANLIB%%;${RANLIB};g' \
-e 's;%%BLAS%%;${BLAS};g' \
-e 's;%%LAPACK%%;${LAPACK};g' \
+ -e 's;%%LAPACKE_LIBNAME%%;${LAPACKE_LIBNAME};g' \
${WRKSRC}/make.inc
@${MV} ${WRKSRC}/Makefile ${WRKSRC}/Makefile.dist
@${CP} ${FILESDIR}/Makefile ${WRKSRC}/Makefile
@${MKDIR} ${WRKSRC}/lib
@${CP} ${FILESDIR}/Makefile.lib ${WRKSRC}/lib/Makefile
-
-post-build:
-.if !defined(WITHOUT_TESTING)
- @${ECHO_CMD} "Testing static lapacke library"
- @(cd ${WRKSRC}/testing; ${SETENV} ${MAKE_ENV} \
- ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${_MAKE_JOBS} ${MAKE_ARGS})
+ @${MKDIR} ${WRKSRC}/libtmg
+ @${CP} ${FILESDIR}/Makefile.libtmg ${WRKSRC}/libtmg/Makefile
+
+ @${REINPLACE_CMD} -e 's;%%XLAPACKE%%;;g' \
+ -e 's;%%__XLAPACKE%%;\#;g' \
+ ${WRKSRC}/lib/Makefile
+
+.if defined (WITH_XLAPACKE)
+ @${MKDIR} ${WRKSRC}/libx
+ @${CP} ${FILESDIR}/Makefile.lib ${WRKSRC}/libx/Makefile
+ @${REINPLACE_CMD} -e 's;%%__XLAPACKE%%;;g' \
+ ${WRKSRC}/Makefile
+ @${REINPLACE_CMD} -e 's;LAPACKE_LIBNAME;XLAPACKE_LIBNAME;g' \
+ -e 's;%%XLAPACKE%%;\#;g' \
+ -e 's;%%__XLAPACKE%%;;g' \
+ ${WRKSRC}/libx/Makefile
.endif
post-install:
@@ -112,4 +152,11 @@ post-install:
@(cd ${WRKSRC}/ && ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR})
.endif
+check regression-test test: build
+ @${CP} ${WRKSRC}/lib/lib${LAPACKE_LIBNAME}.a ${WRKSRC}/.
+ @${ECHO_CMD} "Testing static lapacke library"
+ @(cd ${WRKSRC}/testing; ${SETENV} ${MAKE_ENV} \
+ ${MAKE} ${MAKE_FLAGS} ${MAKEFILE} ${_MAKE_JOBS} ${MAKE_ARGS})
+ @${CAT} ${WRKSRC}/testing/interface/*.out
+
.include <bsd.port.post.mk>