2003-10-03 23:15:36 +00:00
|
|
|
# New ports collection makefile for: atlas-devel
|
|
|
|
# Date created: 14 September 2003
|
|
|
|
# Whom: Nakata Maho <maho@FreeBSD.org>
|
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
|
|
|
|
# NOTE: This port purposely ignores the CC and CFLAGS settings.
|
2004-01-20 01:24:34 +00:00
|
|
|
# Program and compiler flags are finetuned to gcc.
|
2003-10-03 23:15:36 +00:00
|
|
|
|
|
|
|
PORTNAME= atlas
|
2007-03-07 23:26:16 +00:00
|
|
|
PORTVERSION= 3.7.29
|
2003-10-03 23:15:36 +00:00
|
|
|
CATEGORIES= math
|
|
|
|
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
|
|
|
|
MASTER_SITE_SUBDIR= math-atlas
|
2004-05-06 19:49:54 +00:00
|
|
|
PKGNAMESUFFIX= -devel
|
2003-10-03 23:15:36 +00:00
|
|
|
DISTNAME= ${PORTNAME}${PORTVERSION}
|
|
|
|
|
|
|
|
MAINTAINER= maho@FreeBSD.org
|
2004-05-06 19:49:54 +00:00
|
|
|
COMMENT= Development version of math/atlas
|
2003-10-03 23:15:36 +00:00
|
|
|
|
2007-01-06 22:18:51 +00:00
|
|
|
NO_PACKAGE= Optimizes for the local machine, so a package is not generally useful. Set FORCE_PACKAGE to override
|
2006-02-13 05:38:23 +00:00
|
|
|
|
2003-10-03 23:15:36 +00:00
|
|
|
USE_BZIP2= yes
|
2007-01-14 13:26:55 +00:00
|
|
|
USE_GMAKE= yes
|
2003-10-03 23:15:36 +00:00
|
|
|
WRKSRC= ${WRKDIR}/ATLAS
|
2007-01-06 22:18:51 +00:00
|
|
|
USE_LDCONFIG= yes
|
2003-10-03 23:15:36 +00:00
|
|
|
|
2004-01-26 13:25:02 +00:00
|
|
|
.include <bsd.port.pre.mk>
|
|
|
|
|
2006-12-28 05:03:43 +00:00
|
|
|
NOT_FOR_ARCHS= alpha
|
2007-01-06 22:18:51 +00:00
|
|
|
|
|
|
|
#to compile the ATLAS kernel we use gcc3. See ATLAS/INSTALL.txt for details.
|
|
|
|
WANT_FORTRAN= yes
|
2007-01-14 13:26:55 +00:00
|
|
|
BUILD_DEPENDS+= gfortran42:${PORTSDIR}/lang/gcc42
|
2007-01-11 05:26:20 +00:00
|
|
|
FC= gfortran42
|
|
|
|
F77= gfortran42
|
2007-01-06 22:18:51 +00:00
|
|
|
.if ${OSVERSION} > 700000
|
|
|
|
BUILD_DEPENDS+= gcc34:${PORTSDIR}/lang/gcc34
|
|
|
|
CCOMPILER= gcc34
|
|
|
|
.else
|
2007-01-11 05:26:20 +00:00
|
|
|
CCOMPILER= ${CC}
|
2007-01-06 22:18:51 +00:00
|
|
|
.endif
|
2007-01-09 22:39:17 +00:00
|
|
|
LIB_DEPENDS+= blas.2:${PORTSDIR}/math/blas
|
|
|
|
LIB_DEPENDS+= lapack.4:${PORTSDIR}/math/lapack
|
2007-01-15 12:03:27 +00:00
|
|
|
LIB_DEPENDS+= f2c:${PORTSDIR}/lang/f2c
|
2006-12-28 05:03:43 +00:00
|
|
|
|
|
|
|
.if ${ARCH} == "sparc64"
|
|
|
|
PICFLAG?= -fPIC
|
|
|
|
.else
|
|
|
|
PICFLAG?= -fpic
|
2004-01-26 13:25:02 +00:00
|
|
|
.endif
|
|
|
|
|
2004-01-20 01:24:34 +00:00
|
|
|
# only affects for lapack sub project
|
|
|
|
.if defined(WITH_OPTIMIZED_FLAGS)
|
2006-08-07 01:40:52 +00:00
|
|
|
.if defined(CPUTYPE)
|
2007-01-11 05:26:20 +00:00
|
|
|
FFLAGS+= -mtune=${CPUTYPE} -pipe -O2 -ffast-math
|
2006-08-07 01:40:52 +00:00
|
|
|
.else
|
2007-01-11 05:26:20 +00:00
|
|
|
FFLAGS+= -pipe -O2 -ffast-math
|
2006-08-07 01:40:52 +00:00
|
|
|
.endif
|
2004-01-20 01:24:34 +00:00
|
|
|
.endif
|
2006-02-13 05:38:23 +00:00
|
|
|
.if defined(WITH_STATICLIB)
|
2007-01-14 13:26:55 +00:00
|
|
|
PLIST_SUB+= WITH_STATICLIB=""
|
2006-02-13 05:38:23 +00:00
|
|
|
.else
|
2007-01-14 13:26:55 +00:00
|
|
|
PLIST_SUB+= WITH_STATICLIB="@comment "
|
2007-01-06 22:18:51 +00:00
|
|
|
.endif
|
2006-02-13 05:38:23 +00:00
|
|
|
|
2006-12-28 05:03:43 +00:00
|
|
|
post-extract:
|
2006-02-11 09:11:24 +00:00
|
|
|
.if !defined(WITH_STATICLIB)
|
|
|
|
@${ECHO_MSG} "You can build static libraries with"
|
|
|
|
@${ECHO_MSG} "make -DWITH_STATICLIB"
|
|
|
|
@${ECHO_MSG}
|
|
|
|
.endif
|
|
|
|
|
2006-12-28 05:03:43 +00:00
|
|
|
pre-configure:
|
2007-01-06 22:18:51 +00:00
|
|
|
@${REINPLACE_CMD} -e "s|%%CC%%|${CCOMPILER}|g" \
|
2006-12-28 05:03:43 +00:00
|
|
|
-e "s|%%FC%%|${FC}|g" ${WRKSRC}/CONFIG/src/atlcomp.txt
|
|
|
|
@${REINPLACE_CMD} -e "s|%%PTHREAD_LIBS%%|${PTHREAD_LIBS}|g" \
|
2007-01-06 22:18:51 +00:00
|
|
|
-e "s|%%PTHREAD_LIBS%%|${PTHREAD_CFLAGS}|g" \
|
|
|
|
-e "s|%%LOCALBASE%%|${LOCALBASE}|g" \
|
2006-12-28 05:03:43 +00:00
|
|
|
${WRKSRC}/CONFIG/src/SpewMakeInc.c
|
|
|
|
|
2006-02-11 09:11:24 +00:00
|
|
|
do-configure:
|
2007-01-12 05:27:08 +00:00
|
|
|
#non threaded
|
2007-02-16 13:47:59 +00:00
|
|
|
#dummy f77lib, it is not used.
|
2006-12-28 05:03:43 +00:00
|
|
|
${MKDIR} ${WRKSRC}/NON_THREADED ; cd ${WRKSRC}/NON_THREADED ; \
|
2007-02-16 13:47:59 +00:00
|
|
|
../configure -t 0 -Si cputhrchk 0 -Ss f77lib " "
|
2006-12-28 05:03:43 +00:00
|
|
|
${MKDIR} ${WRKSRC}/NON_THREADED_PIC ; cd ${WRKSRC}/NON_THREADED_PIC ; \
|
2007-02-16 13:47:59 +00:00
|
|
|
../configure -t 0 -Fag al '${PICFLAG} -DPIC' -Si cputhrchk 0 -Ss f77lib " "
|
2007-01-12 05:27:08 +00:00
|
|
|
#threaded
|
2007-02-16 13:47:59 +00:00
|
|
|
#dummy f77lib, it is not used.
|
2007-01-12 05:27:08 +00:00
|
|
|
cd ${WRKSRC}; ${PATCH} < ${FILESDIR}/thread-patch
|
|
|
|
${MKDIR} ${WRKSRC}/THREADED ; cd ${WRKSRC}/THREADED ; \
|
2007-02-16 13:47:59 +00:00
|
|
|
../configure -Fag al '${PTHREAD_CFLAGS} ' -Si cputhrchk 0 -Ss f77lib " "
|
2006-12-28 05:03:43 +00:00
|
|
|
${MKDIR} ${WRKSRC}/THREADED_PIC ; cd ${WRKSRC}/THREADED_PIC ; \
|
2007-02-16 13:47:59 +00:00
|
|
|
../configure -Fag al '${PTHREAD_CFLAGS} ${PICFLAG} -DPIC' -Si cputhrchk 0 -Ss f77lib " "
|
2006-12-28 05:03:43 +00:00
|
|
|
|
2003-10-03 23:15:36 +00:00
|
|
|
do-build:
|
2004-01-20 01:24:34 +00:00
|
|
|
# make lapack
|
|
|
|
.if ! exists(${WRKDIR}/lapack/Makefile)
|
|
|
|
@${ECHO_MSG} "===> Extracting lapack sub project"
|
|
|
|
@${MKDIR} ${WRKDIR}/lapack
|
|
|
|
@${CP} -r ${PORTSDIR}/math/lapack/files ${WRKDIR}/lapack
|
|
|
|
@${CP} -r ${PORTSDIR}/math/lapack/scripts ${WRKDIR}/lapack
|
|
|
|
@${CP} ${PORTSDIR}/math/lapack/Makefile ${WRKDIR}/lapack
|
|
|
|
@${CP} ${PORTSDIR}/math/lapack/distinfo ${WRKDIR}/lapack
|
|
|
|
@${CP} ${PORTSDIR}/math/lapack/pkg-descr ${WRKDIR}/lapack
|
|
|
|
@cd ${WRKDIR}/lapack ; ${MAKE} "FFLAGS=${FFLAGS}" FC="${FC}" build WRKDIRPREFIX=""
|
|
|
|
.endif
|
2006-02-11 09:11:24 +00:00
|
|
|
.if defined(WITH_STATICLIB)
|
2006-12-28 05:03:43 +00:00
|
|
|
(cd ${WRKSRC}/NON_THREADED ; ${MAKE})
|
|
|
|
(cd ${WRKSRC}/THREADED ; ${MAKE})
|
2006-02-11 09:11:24 +00:00
|
|
|
.endif
|
2006-12-28 05:03:43 +00:00
|
|
|
(cd ${WRKSRC}/NON_THREADED_PIC ; ${MAKE})
|
|
|
|
(cd ${WRKSRC}/THREADED_PIC ; ${MAKE})
|
2007-01-06 22:18:51 +00:00
|
|
|
@${MAKE} test
|
2006-12-28 05:03:43 +00:00
|
|
|
|
2007-01-11 07:52:29 +00:00
|
|
|
ATLAS_LIBS1=libalapack libatlas libcblas libf77blas #libtstatlas
|
2007-01-06 22:18:51 +00:00
|
|
|
ATLAS_LIBS2=libptcblas libptf77blas
|
2006-02-11 09:11:24 +00:00
|
|
|
|
2004-07-14 04:49:52 +00:00
|
|
|
post-build:
|
2006-02-11 09:11:24 +00:00
|
|
|
.if defined(WITH_STATICLIB)
|
2004-01-20 01:24:34 +00:00
|
|
|
# make atlas enhanced lapack (static ver)
|
|
|
|
(cd ${WRKSRC}; ${MKDIR} tmp1 ; \
|
|
|
|
${CP} ${WRKDIR}/lapack/work/LAPACK/SRC/liblapack.a tmp1 ;\
|
|
|
|
cd tmp1 ;\
|
|
|
|
ar x liblapack.a ;\
|
2006-12-28 05:03:43 +00:00
|
|
|
ar x ../NON_THREADED/lib/liblapack.a ;\
|
|
|
|
ar r ../NON_THREADED/lib/libalapack.a *.o ;\
|
|
|
|
ranlib ../NON_THREADED/lib/libalapack.a )
|
2004-01-20 01:24:34 +00:00
|
|
|
# make atlas enhanced lapack (static and thread safe ver)
|
|
|
|
(cd ${WRKSRC}; ${MKDIR} tmp2 ; \
|
|
|
|
${CP} ${WRKDIR}/lapack/work/LAPACK/SRC/liblapack.a tmp2 ;\
|
|
|
|
cd tmp2 ;\
|
2003-10-03 23:15:36 +00:00
|
|
|
ar x liblapack.a ;\
|
2006-12-28 05:03:43 +00:00
|
|
|
ar x ../THREADED/lib/liblapack.a ;\
|
|
|
|
ar r ../THREADED/lib/libalapack.a *.o ;\
|
|
|
|
ranlib ../THREADED/lib/libalapack.a )
|
2006-02-11 09:11:24 +00:00
|
|
|
.endif
|
2004-01-20 01:24:34 +00:00
|
|
|
# make atlas enhanced lapack (shared ver)
|
|
|
|
( cd ${WRKSRC}; ${MKDIR} tmp3 ;\
|
|
|
|
${TAR} --exclude "*.f" --exclude "*.po" --exclude "*.o" -cf - -C ${WRKDIR}/lapack/work/LAPACK/SRC . | ${TAR} xf - -C tmp3 ;\
|
|
|
|
for object in `${FIND} tmp3 -name "*.So"` ; do \
|
|
|
|
n=`${ECHO_CMD} $${object}|${SED} -e 's#.So##'` ; \
|
|
|
|
${MV} $$n.So $$n.o ; \
|
|
|
|
done ; \
|
|
|
|
cd tmp3 ;\
|
2006-12-28 05:03:43 +00:00
|
|
|
ar x ../NON_THREADED_PIC/lib/liblapack.a ;\
|
|
|
|
ar r ../NON_THREADED_PIC/lib/libalapack.a *.o ;\
|
|
|
|
ranlib ../NON_THREADED_PIC/lib/libalapack.a )
|
2004-01-20 01:24:34 +00:00
|
|
|
# make atlas enhanced lapack (shared and thread safe ver)
|
|
|
|
( cd ${WRKSRC}; ${MKDIR} tmp4 ;\
|
|
|
|
${TAR} --exclude "*.f" --exclude "*.po" --exclude "*.o" -cf - -C ${WRKDIR}/lapack/work/LAPACK/SRC . | ${TAR} xf - -C tmp4 ;\
|
|
|
|
for object in `${FIND} tmp4 -name "*.So"` ; do \
|
|
|
|
n=`${ECHO_CMD} $${object}|${SED} -e 's#.So##'` ; \
|
|
|
|
${MV} $$n.So $$n.o ; \
|
|
|
|
done ; \
|
|
|
|
cd tmp4 ;\
|
2006-12-28 05:03:43 +00:00
|
|
|
ar x ../THREADED_PIC/lib/liblapack.a ;\
|
|
|
|
ar r ../THREADED_PIC/lib/libalapack.a *.o ;\
|
|
|
|
ranlib ../THREADED_PIC/lib/libalapack.a )
|
2004-01-20 01:24:34 +00:00
|
|
|
|
|
|
|
# make atlas shared library
|
2007-01-06 22:18:51 +00:00
|
|
|
.for i in ${ATLAS_LIBS1}
|
2006-12-28 05:03:43 +00:00
|
|
|
( cd ${WRKSRC}/NON_THREADED_PIC/lib ; \
|
2007-01-11 07:52:29 +00:00
|
|
|
ld -Bshareable -o ${i}.so.2 -x -soname ${i}.so.2 --whole-archive ${i}.a )
|
2003-10-03 23:15:36 +00:00
|
|
|
.endfor
|
|
|
|
|
2004-01-20 01:24:34 +00:00
|
|
|
# make atlas shared (thread safe) library
|
2007-01-06 22:18:51 +00:00
|
|
|
.for i in ${ATLAS_LIBS1}
|
2006-12-28 05:03:43 +00:00
|
|
|
( cd ${WRKSRC}/THREADED_PIC/lib ; \
|
2007-01-11 07:52:29 +00:00
|
|
|
ld -Bshareable -o ${i}_r.so.2 -x -soname ${i}_r.so.2 --whole-archive ${i}.a )
|
2003-10-03 23:15:36 +00:00
|
|
|
.endfor
|
2007-01-06 22:18:51 +00:00
|
|
|
.for i in ${ATLAS_LIBS2}
|
|
|
|
( cd ${WRKSRC}/THREADED_PIC/lib ; \
|
2007-01-11 07:52:29 +00:00
|
|
|
ld -Bshareable -o ${i}.so.2 -x -soname ${i}.so.2 --whole-archive ${i}.a )
|
2007-01-06 22:18:51 +00:00
|
|
|
.endfor
|
2003-10-03 23:15:36 +00:00
|
|
|
do-install:
|
2007-01-06 22:18:51 +00:00
|
|
|
.for i in ${ATLAS_LIBS1}
|
2006-02-11 09:11:24 +00:00
|
|
|
.if defined(WITH_STATICLIB)
|
2006-12-28 05:03:43 +00:00
|
|
|
@${INSTALL_DATA} ${WRKSRC}/NON_THREADED/lib/${i}.a ${PREFIX}/lib
|
2006-02-11 09:11:24 +00:00
|
|
|
.endif
|
2007-01-09 22:39:17 +00:00
|
|
|
@${INSTALL_DATA} ${WRKSRC}/NON_THREADED_PIC/lib/${i}.so.2 ${PREFIX}/lib
|
|
|
|
@${LN} -sf ${i}.so.2 ${PREFIX}/lib/${i}.so
|
2003-10-03 23:15:36 +00:00
|
|
|
.endfor
|
2007-01-06 22:18:51 +00:00
|
|
|
.for i in ${ATLAS_LIBS1}
|
2006-02-11 09:11:24 +00:00
|
|
|
.if defined(WITH_STATICLIB)
|
2006-12-28 05:03:43 +00:00
|
|
|
@${INSTALL_DATA} ${WRKSRC}/THREADED/lib/${i}.a ${PREFIX}/lib/${i}_r.a
|
2006-02-11 09:11:24 +00:00
|
|
|
.endif
|
2007-01-09 22:39:17 +00:00
|
|
|
@${INSTALL_DATA} ${WRKSRC}/THREADED_PIC/lib/${i}_r.so.2 ${PREFIX}/lib/${i}_r.so.2
|
|
|
|
@${LN} -sf ${i}_r.so.2 ${PREFIX}/lib/${i}_r.so
|
2003-10-03 23:15:36 +00:00
|
|
|
.endfor
|
2007-01-06 22:18:51 +00:00
|
|
|
.for i in ${ATLAS_LIBS2}
|
|
|
|
.if defined(WITH_STATICLIB)
|
|
|
|
@${INSTALL_DATA} ${WRKSRC}/THREADED/lib/${i}.a ${PREFIX}/lib
|
|
|
|
.endif
|
2007-01-09 22:39:17 +00:00
|
|
|
@${INSTALL_DATA} ${WRKSRC}/THREADED_PIC/lib/${i}.so.2 ${PREFIX}/lib
|
|
|
|
@${LN} -sf ${i}.so.2 ${PREFIX}/lib/${i}.so
|
2007-01-06 22:18:51 +00:00
|
|
|
.endfor
|
|
|
|
|
2003-10-03 23:15:36 +00:00
|
|
|
@${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
|
|
|
|
.if !defined(NOPORTDOCS)
|
|
|
|
@${MKDIR} ${DOCSDIR}
|
|
|
|
${INSTALL_DATA} ${WRKSRC}/doc/* ${DOCSDIR}
|
|
|
|
.endif
|
2007-01-06 22:18:51 +00:00
|
|
|
${MKDIR} ${EXAMPLESDIR}
|
|
|
|
@for i in ${ALLTESTS} ; do \
|
|
|
|
cd ${WRKDIR}/ATLAS/NON_THREADED_PIC/bin ; ${INSTALL_PROGRAM} $${i} ${EXAMPLESDIR} ; \
|
|
|
|
done
|
|
|
|
@for i in ${ALLTESTS_PT} ; do \
|
|
|
|
cd ${WRKDIR}/ATLAS/THREADED_PIC/bin ; ${INSTALL_PROGRAM} $${i} ${EXAMPLESDIR} ; \
|
|
|
|
done
|
2003-10-03 23:15:36 +00:00
|
|
|
|
2007-01-06 22:18:51 +00:00
|
|
|
.include <${FILESDIR}/Makefile.test>
|
2004-01-20 01:24:34 +00:00
|
|
|
.include <bsd.port.post.mk>
|