2002-03-15 03:53:15 +00:00
|
|
|
# New ports collection makefile for: atlas
|
|
|
|
# Date created: 12 February 2001
|
2003-05-04 01:02:10 +00:00
|
|
|
# Whom: Nakata Maho <maho@FreeBSD.org>
|
2002-03-15 03:53:15 +00:00
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
|
2002-08-19 16:20:09 +00:00
|
|
|
# NOTE: This port purposely ignores the CC and CFLAGS settings.
|
|
|
|
# Program and compiler flags are finetuned to gcc 2.95/3.1.
|
|
|
|
|
2002-03-15 03:53:15 +00:00
|
|
|
PORTNAME= atlas
|
2003-07-29 15:50:39 +00:00
|
|
|
PORTVERSION= 3.5.7
|
2002-03-15 03:53:15 +00:00
|
|
|
CATEGORIES= math
|
|
|
|
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
|
|
|
|
MASTER_SITE_SUBDIR= math-atlas
|
|
|
|
DISTNAME= ${PORTNAME}${PORTVERSION}
|
|
|
|
|
2003-05-04 01:02:10 +00:00
|
|
|
MAINTAINER= maho@FreeBSD.org
|
|
|
|
COMMENT= Automatically Tuned Linear Algebra Software (ATLAS)
|
2002-03-15 03:53:15 +00:00
|
|
|
|
2002-06-22 07:54:16 +00:00
|
|
|
LIB_DEPENDS= lapack:${PORTSDIR}/math/lapack
|
2002-03-15 03:53:15 +00:00
|
|
|
|
|
|
|
USE_BZIP2= yes
|
|
|
|
WRKSRC= ${WRKDIR}/ATLAS
|
2002-06-22 07:54:16 +00:00
|
|
|
INSTALLS_SHLIB= yes
|
2002-08-19 16:20:09 +00:00
|
|
|
USE_REINPLACE= yes
|
|
|
|
|
|
|
|
.if (${MACHINE_ARCH} == "alpha")
|
|
|
|
USE_GCC= 3.1
|
|
|
|
.endif
|
2002-03-15 03:53:15 +00:00
|
|
|
|
2003-06-11 04:17:37 +00:00
|
|
|
post-patch:
|
|
|
|
@${REINPLACE_CMD} -e 's+%%PTHREAD_CFLAGS%%+ ${PTHREAD_CFLAGS}+' \
|
2003-06-30 19:19:43 +00:00
|
|
|
${WRKSRC}/config.c
|
2003-06-11 04:17:37 +00:00
|
|
|
@${REINPLACE_CMD} -e 's+%%PTHREAD_LIBS%%+ ${PTHREAD_LIBS}+' \
|
2003-06-30 19:19:43 +00:00
|
|
|
${WRKSRC}/config.c
|
2003-07-02 21:39:36 +00:00
|
|
|
.if (${MACHINE_ARCH} == "alpha")
|
|
|
|
@(cd ${WRKSRC}; ${PATCH} < ${FILESDIR}/alpha-patch)
|
2003-06-11 04:17:37 +00:00
|
|
|
.endif
|
|
|
|
|
2002-03-15 03:53:15 +00:00
|
|
|
do-configure:
|
2003-07-02 21:39:36 +00:00
|
|
|
@(cd ${WRKSRC}; ${PATCH} < ${FILESDIR}/non-thread-patch)
|
|
|
|
@(cd ${WRKSRC}; ${MAKE_ENV} ${MAKE} config < ${FILESDIR}/answer)
|
|
|
|
@(cd ${WRKSRC}; ${PATCH} < ${FILESDIR}/thread-patch)
|
2002-06-22 07:54:16 +00:00
|
|
|
@(cd ${WRKSRC}; ${MAKE_ENV} ${MAKE} config < ${FILESDIR}/answer)
|
2002-03-15 03:53:15 +00:00
|
|
|
|
2003-07-02 21:39:36 +00:00
|
|
|
NON_THREADED_ATLAS=`cat ${WRKSRC}/ARCHNAME-NON-THREADED`
|
|
|
|
THREADED_ATLAS=`cat ${WRKSRC}/ARCHNAME-THREADED`
|
|
|
|
ATLAS_LIBS1=libatlas libcblas libf77blas libtstatlas libalapack
|
|
|
|
ATLAS_LIBS2=libptcblas libptf77blas
|
|
|
|
|
|
|
|
post-configure:
|
2002-08-19 16:20:09 +00:00
|
|
|
.if (${MACHINE_ARCH} == "alpha") || defined(USE_GCC)
|
2003-07-02 21:39:36 +00:00
|
|
|
@${REINPLACE_CMD} -e 's|/usr/bin/gcc|${CC}|g;' ${WRKSRC}/Make.${NON_THREADED_ATLAS}
|
|
|
|
@${REINPLACE_CMD} -e 's|/usr/bin/gcc|${CC}|g;' ${WRKSRC}/Make.${THREADED_ATLAS}
|
2002-08-19 16:20:09 +00:00
|
|
|
.endif
|
2003-07-02 21:39:36 +00:00
|
|
|
|
|
|
|
do-build:
|
|
|
|
# non thread version
|
|
|
|
(cd ${WRKSRC}; ${MAKE_ENV} ${MAKE} install arch=${NON_THREADED_ATLAS})
|
2003-08-02 16:11:30 +00:00
|
|
|
# (cd ${WRKSRC}; ${MAKE_ENV} ${MAKE} sanity_test arch=${NON_THREADED_ATLAS})
|
2002-03-15 03:53:15 +00:00
|
|
|
(cd ${WRKSRC}; ${MKDIR} tmp ; \
|
2002-06-22 07:54:16 +00:00
|
|
|
${CP} ${LOCALBASE}/lib/liblapack.a tmp ;\
|
|
|
|
cd tmp ;\
|
|
|
|
ar x liblapack.a ;\
|
2003-07-02 21:39:36 +00:00
|
|
|
ar x ../lib/${NON_THREADED_ATLAS}/liblapack.a ;\
|
|
|
|
ar r ../lib/${NON_THREADED_ATLAS}/libalapack.a *.o ;\
|
|
|
|
ranlib ../lib/${NON_THREADED_ATLAS}/libalapack.a )
|
|
|
|
.for i in ${ATLAS_LIBS1}
|
|
|
|
( cd ${WRKSRC}/lib/${NON_THREADED_ATLAS}/ ; \
|
|
|
|
ld -Bshareable -o ${i}.so.1 -x -soname ${i}.so.1 --whole-archive ${i}.a )
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
# thread version
|
|
|
|
(cd ${WRKSRC}; ${MAKE_ENV} ${MAKE} install arch=${THREADED_ATLAS})
|
2003-08-02 16:11:30 +00:00
|
|
|
# (cd ${WRKSRC}; ${MAKE_ENV} ${MAKE} sanity_test arch=${THREADED_ATLAS})
|
2003-07-02 21:39:36 +00:00
|
|
|
(cd ${WRKSRC}; ${MKDIR} tmp2 ; \
|
|
|
|
${CP} ${LOCALBASE}/lib/liblapack.a tmp2 ;\
|
|
|
|
cd tmp2 ;\
|
|
|
|
ar x liblapack.a ;\
|
|
|
|
ar x ../lib/${THREADED_ATLAS}/liblapack.a ;\
|
|
|
|
ar r ../lib/${THREADED_ATLAS}/libalapack.a *.o ;\
|
|
|
|
ranlib ../lib/${THREADED_ATLAS}/libalapack.a )
|
|
|
|
.for i in ${ATLAS_LIBS1} ${ATLAS_LIBS2}
|
|
|
|
( cd ${WRKSRC}/lib/${THREADED_ATLAS}/ ; \
|
2002-06-22 07:54:16 +00:00
|
|
|
ld -Bshareable -o ${i}.so.1 -x -soname ${i}.so.1 --whole-archive ${i}.a )
|
|
|
|
.endfor
|
|
|
|
|
2002-03-15 03:53:15 +00:00
|
|
|
do-install:
|
2003-07-02 21:39:36 +00:00
|
|
|
.for i in ${ATLAS_LIBS1}
|
|
|
|
@${INSTALL_DATA} ${WRKSRC}/lib/${NON_THREADED_ATLAS}/${i}.a ${PREFIX}/lib
|
|
|
|
@${INSTALL_DATA} ${WRKSRC}/lib/${NON_THREADED_ATLAS}/${i}.so.1 ${PREFIX}/lib
|
|
|
|
@${LN} -sf ${i}.so.1 ${PREFIX}/lib/${i}.so
|
|
|
|
.endfor
|
|
|
|
.for i in ${ATLAS_LIBS1}
|
2003-07-02 23:03:38 +00:00
|
|
|
@${INSTALL_DATA} ${WRKSRC}/lib/${THREADED_ATLAS}/${i}.a ${PREFIX}/lib/${i}_r.a
|
|
|
|
@${INSTALL_DATA} ${WRKSRC}/lib/${THREADED_ATLAS}/${i}.so.1 ${PREFIX}/lib/${i}_r.so.1
|
|
|
|
@${LN} -sf ${i}_r.so.1 ${PREFIX}/lib/${i}_r.so
|
2003-07-02 21:39:36 +00:00
|
|
|
.endfor
|
|
|
|
.for i in ${ATLAS_LIBS2}
|
|
|
|
@${INSTALL_DATA} ${WRKSRC}/lib/${THREADED_ATLAS}/${i}.a ${PREFIX}/lib
|
|
|
|
@${INSTALL_DATA} ${WRKSRC}/lib/${THREADED_ATLAS}/${i}.so.1 ${PREFIX}/lib
|
2002-06-22 07:54:16 +00:00
|
|
|
@${LN} -sf ${i}.so.1 ${PREFIX}/lib/${i}.so
|
|
|
|
.endfor
|
|
|
|
@${INSTALL_DATA} ${WRKSRC}/include/cblas.h ${PREFIX}/include
|
|
|
|
@${INSTALL_DATA} ${WRKSRC}/include/clapack.h ${PREFIX}/include
|
|
|
|
@${INSTALL_DATA} ${FILESDIR}/blas.h ${PREFIX}/include
|
|
|
|
@${INSTALL_DATA} ${FILESDIR}/lapack.h ${PREFIX}/include
|
2002-03-26 05:49:54 +00:00
|
|
|
.if !defined(NOPORTDOCS)
|
|
|
|
@${MKDIR} ${DOCSDIR}
|
|
|
|
${INSTALL_DATA} ${WRKSRC}/doc/* ${DOCSDIR}
|
|
|
|
.endif
|
|
|
|
|
2002-03-15 03:53:15 +00:00
|
|
|
.include <bsd.port.mk>
|