2004-08-29 07:49:57 +00:00
|
|
|
# New ports collection makefile for: lapack95
|
|
|
|
# Date created: 5 Feb 2003
|
|
|
|
# Whom: NAKATA, Maho <maho@FreeBSD.org>
|
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
|
|
|
|
PORTNAME= lapack95
|
|
|
|
PORTVERSION= 1.0
|
2007-01-12 06:33:18 +00:00
|
|
|
PORTREVISION= 2
|
2004-08-29 07:49:57 +00:00
|
|
|
CATEGORIES= math
|
|
|
|
MASTER_SITES= ftp://ftp.netlib.org/lapack95/
|
|
|
|
DISTNAME= ${PORTNAME}
|
|
|
|
EXTRACT_SUFX= .tgz
|
|
|
|
DIST_SUBDIR= lapack95
|
|
|
|
|
|
|
|
MAINTAINER= maho@FreeBSD.org
|
|
|
|
COMMENT= LAPACK95, Fortran90/95 wrapper for LAPACK
|
|
|
|
|
2007-01-10 01:41:21 +00:00
|
|
|
.include <bsd.port.pre.mk>
|
|
|
|
.if ${ARCH} == "sparc64"
|
|
|
|
PICFLAG?= -fPIC
|
|
|
|
.else
|
|
|
|
PICFLAG?= -fpic
|
|
|
|
.endif
|
2004-08-29 07:49:57 +00:00
|
|
|
|
2007-01-10 01:41:21 +00:00
|
|
|
.if exists(${LOCALBASE}/lib/libatlas_r.so) && !defined(WITH_BLAS)
|
|
|
|
WITH_ATLAS= yes
|
|
|
|
.endif
|
|
|
|
.if defined(WITH_ATLAS)
|
|
|
|
LIB_DEPENDS+= atlas.2:${PORTSDIR}/math/atlas
|
|
|
|
BLAS= -lf77blas -latlas
|
|
|
|
LAPACK= -lalapack
|
|
|
|
.else
|
|
|
|
LIB_DEPENDS+= blas.2:${PORTSDIR}/math/blas
|
|
|
|
LIB_DEPENDS+= lapack.4:${PORTSDIR}/math/lapack
|
|
|
|
BLAS= -lblas
|
|
|
|
LAPACK= -llapack
|
|
|
|
.endif
|
|
|
|
|
2007-01-12 06:33:18 +00:00
|
|
|
WANT_FORTRAN= yes #dummy but future use
|
|
|
|
BUILD_DEPENDS+= gfortran42:${PORTSDIR}/lang/gcc42
|
|
|
|
FC= gfortran42
|
|
|
|
F77= gfortran42
|
2004-08-29 07:49:57 +00:00
|
|
|
WRKSRC= ${WRKDIR}/LAPACK95
|
|
|
|
FORTRAN_FIXED=
|
2007-01-10 01:41:21 +00:00
|
|
|
FORTRAN_FREE=# -free
|
|
|
|
FFLAGS=# -O3 -tpp7 -xKW -Vaxlib #for ifc
|
2004-08-29 07:49:57 +00:00
|
|
|
|
|
|
|
post-patch:
|
2007-01-10 01:41:21 +00:00
|
|
|
@${MKDIR} ${WRKSRC}_SHARED ; ${CP} -r ${WRKSRC}/* ${WRKSRC}_SHARED
|
|
|
|
|
|
|
|
pre-build:
|
2004-08-29 07:49:57 +00:00
|
|
|
@${REINPLACE_CMD} -e 's,%%FC%%,${FC},g ; \
|
|
|
|
s,%%FORTRAN_FIXED%%,${FORTRAN_FIXED},g ; \
|
|
|
|
s,%%FORTRAN_FREE%%,${FORTRAN_FREE},g ; \
|
2007-01-10 01:41:21 +00:00
|
|
|
s,%%FFLAGS%%,${FFLAGS},g ; \
|
2004-08-29 07:49:57 +00:00
|
|
|
s,%%LOCALBASE%%,${LOCALBASE},g' \
|
|
|
|
${WRKSRC}/make.inc
|
2007-01-10 01:41:21 +00:00
|
|
|
@${REINPLACE_CMD} -e 's,%%FC%%,${FC},g ; \
|
|
|
|
s,%%FORTRAN_FIXED%%,${FORTRAN_FIXED},g ; \
|
|
|
|
s,%%FORTRAN_FREE%%,${FORTRAN_FREE},g ; \
|
|
|
|
s,%%FFLAGS%%,${FFLAGS} ${PICFLAG},g ; \
|
|
|
|
s,%%LOCALBASE%%,${LOCALBASE},g' \
|
|
|
|
${WRKSRC}_SHARED/make.inc
|
2004-08-29 07:49:57 +00:00
|
|
|
do-build:
|
|
|
|
cd ${WRKSRC}/SRC; ${MAKE} single_double_complex_dcomplex
|
2007-01-10 01:41:21 +00:00
|
|
|
cd ${WRKSRC}_SHARED/SRC; ${MAKE} single_double_complex_dcomplex
|
|
|
|
cd ${WRKSRC}_SHARED ; ld -Bshareable -o liblapack95.so.1 -x -soname liblapack95.so.1 --whole-archive lapack95.a
|
2004-08-29 07:49:57 +00:00
|
|
|
do-install:
|
|
|
|
${INSTALL_DATA} ${WRKSRC}/lapack95.a ${PREFIX}/lib/liblapack95.a
|
2007-01-10 01:41:21 +00:00
|
|
|
${INSTALL_DATA} ${WRKSRC}_SHARED/liblapack95.so.1 ${PREFIX}/lib
|
|
|
|
${LN} -sf liblapack95.so.1 ${PREFIX}/lib/liblapack95.so
|
|
|
|
|
2004-08-29 07:49:57 +00:00
|
|
|
@${MKDIR} ${EXAMPLESDIR}
|
|
|
|
@${MKDIR} ${EXAMPLESDIR}/EXAMPLES1
|
|
|
|
@${MKDIR} ${EXAMPLESDIR}/EXAMPLES2
|
|
|
|
${CP} ${WRKSRC}/make.inc ${EXAMPLESDIR}
|
|
|
|
${TAR} cf - -C ${WRKSRC}/EXAMPLES1 . | ${TAR} xf - -C ${EXAMPLESDIR}/EXAMPLES1
|
|
|
|
${TAR} cf - -C ${WRKSRC}/EXAMPLES2 . | ${TAR} xf - -C ${EXAMPLESDIR}/EXAMPLES2
|
2007-01-10 01:41:21 +00:00
|
|
|
${FIND} ${EXAMPLESDIR}/EXAMPLES1 | ${XARGS} ${CHOWN} ${SHAREOWN}:${SHAREGRP}
|
|
|
|
${FIND} ${EXAMPLESDIR}/EXAMPLES1 -type f | ${XARGS} ${CHMOD} ${SHAREMODE}
|
|
|
|
${FIND} ${EXAMPLESDIR}/EXAMPLES2 | ${XARGS} ${CHOWN} ${SHAREOWN}:${SHAREGRP}
|
|
|
|
${FIND} ${EXAMPLESDIR}/EXAMPLES2 -type f | ${XARGS} ${CHMOD} ${SHAREMODE}
|
2004-08-29 07:49:57 +00:00
|
|
|
|
2007-01-10 01:41:21 +00:00
|
|
|
.include <bsd.port.post.mk>
|