diff options
author | Maho Nakata <maho@FreeBSD.org> | 2007-12-19 22:47:57 +0000 |
---|---|---|
committer | Maho Nakata <maho@FreeBSD.org> | 2007-12-19 22:47:57 +0000 |
commit | 311264a24fd8c37f9ac75b7d73c911f61e8c4e71 (patch) | |
tree | 543718ba71a3aa08c4fab4525c9c32a82fedcd48 /math/atlas/Makefile | |
parent | 85127e0d2718010020f0c0704bcc664ac8859b5b (diff) | |
download | ports-311264a24fd8c37f9ac75b7d73c911f61e8c4e71.tar.gz ports-311264a24fd8c37f9ac75b7d73c911f61e8c4e71.zip |
Notes
Diffstat (limited to 'math/atlas/Makefile')
-rw-r--r-- | math/atlas/Makefile | 250 |
1 files changed, 134 insertions, 116 deletions
diff --git a/math/atlas/Makefile b/math/atlas/Makefile index e8d487c94226..1979b5c394d2 100644 --- a/math/atlas/Makefile +++ b/math/atlas/Makefile @@ -5,12 +5,8 @@ # $FreeBSD$ # -# NOTE: This port purposely ignores the CC and CFLAGS settings. -# Program and compiler flags are finetuned to gcc. - PORTNAME= atlas -PORTVERSION= 3.6.0 -PORTREVISION= 4 +PORTVERSION= 3.8.0 PORTEPOCH= 1 CATEGORIES= math MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} @@ -29,112 +25,137 @@ USE_LDCONFIG= yes .include <bsd.port.pre.mk> +NOT_FOR_ARCHS= alpha + USE_FORTRAN= yes CCOMPILER= ${CC} LIB_DEPENDS+= blas.2:${PORTSDIR}/math/blas LIB_DEPENDS+= lapack.4:${PORTSDIR}/math/lapack -LIB_DEPENDS+= f2c:${PORTSDIR}/lang/f2c -# only affects for lapack sub project -.if defined(WITH_OPTIMIZED_FLAGS) -.if defined(CPUTYPE) -FFLAGS+= -mtune=${CPUTYPE} -pipe -O2 -ffast-math +.if ${ARCH} == "sparc64" +PICFLAG?= -fPIC .else -FFLAGS+= -pipe -O2 -ffast-math -.endif +PICFLAG?= -fpic .endif -post-patch: -.if !defined(WITH_OPTIMIZED_FLAGS) - @${ECHO_CMD} "You can optimize lapack sub project by setting WITH_OPTIMIZED_FLAGS=yes." +.if ${ARCH} == "i386" +POINTER= 32 .endif - @${REINPLACE_CMD} -e 's+%%PTHREAD_CFLAGS%%+${PTHREAD_CFLAGS}+g' \ - -e 's+%%PTHREAD_LIBS%%+${PTHREAD_LIBS}+g' \ - -e 's+%%LOCALBASE%%+${LOCALBASE}+g' \ - ${WRKSRC}/config.c -.if defined(PORTS_ARCH) - @${REINPLACE_CMD} -e 's+%%PORTS_ARCH%%+${PORTS_ARCH}+g' \ - -e 's+%%HAVE_ARCH%%+1+g' ${WRKSRC}/config.c -.else - @${REINPLACE_CMD} -e 's+%%PORTS_ARCH%%+0+g' \ - -e 's+%%HAVE_ARCH%%+0+g' ${WRKSRC}/config.c +.if ${ARCH} == "amd64" +POINTER= 64 .endif -.if (${ARCH} == "alpha") -EXTRA_PATCHES+= ${FILESDIR}/alpha-patch +.if ${ARCH} == "sparc64" +POINTER= 64 .endif -.if ${ARCH} == "sparc64" -PICFLAG?= -fPIC +.if (${OSVERSION} < 700000) && defined(WITH_GCC42KERNEL) +BUILD_DEPENDS+= gcc42:${PORTSDIR}/lang/gcc42 +KERNELFLAG= -Ss kern gcc42 .else -PICFLAG?= -fpic +KERNELFLAG= "" .endif -ANSWER_i386?= ${PRINTF} "\n\n\n\n\n\n\n\n\n\n" -ANSWER_ia64?= ${PRINTF} "\n\n\n2\n\n\n\n\nf77\n-O2 -static\n\n" - -.if defined(PACKAGE_BUILDING) && (${ARCH} == "i386") -PORTS_ARCH=IntP5 +.if defined(WITH_WALL_TIMER) +. if defined(MHZ) && ( ${ARCH} == "i386" || ${ARCH} == "amd64" ) +TIMEFLAG= -D c -DPentiumCPS=${MHZ} +. else +TIMEFLAG= -D c -DWALL +. endif +.else +TIMEFLAG= "" .endif -.if !defined(ANSWER_${ARCH}) -ANSWER= ${ANSWER_i386} +# only used for lapack sub-project +.if defined(WITH_OPTIMIZED_FLAGS) +.if defined(CPUTYPE) +FFLAGS+= -march=${CPUTYPE} -pipe -O2 -ffast-math .else -ANSWER= ${ANSWER_${ARCH}} +FFLAGS+= -pipe -O2 -ffast-math .endif - -.if defined(TIMING_TOLERANCE) -EXTRA_PATCHES+= ${FILESDIR}/timing_tolerance-patch .endif - .if defined(WITH_STATICLIB) PLIST_SUB+= WITH_STATICLIB="" .else PLIST_SUB+= WITH_STATICLIB="@comment " .endif -pre-configure: - @${ECHO_MSG} "Warning:" - @${ECHO_MSG} "Building this port can take long time" - @${ECHO_MSG} "for slow computers (over 1 day)." - @${ECHO_MSG} "And sometimes stop building for Athlon." - @${ECHO_MSG} "In this case please retype make or rebuild whole atlas." +post-extract: + @${ECHO_MSG} 'This port engages in a long, computationally-demanding tuning process.' + @${ECHO_MSG} 'Builds can take a day or more on older hardware, and temporarily occupy' + @${ECHO_MSG} 'several hundred megabytes of disk space. You are advised to disable' + @${ECHO_MSG} 'all forms of power management or CPU throttling (APM, ACPI, Intel' + @${ECHO_MSG} 'SpeedStep, AMD PowerNow, AMD Cool and Quiet, p4tcc, powerd, etc.)' + @${ECHO_MSG} 'that may change the disk I/O or CPU behavior during the build, and' + @${ECHO_MSG} 'to set operating parameters to static values at which you ultimately' + @${ECHO_MSG} 'intend to use the software. You should also avoid placing heavy loads' + @${ECHO_MSG} 'on the system during the build, and temporarily disable any automatons' + @${ECHO_MSG} 'that may do so. If you fail to follow these guidelines, you may prolong' + @${ECHO_MSG} 'the build, perhaps indefinitely, and you may obtain libraries with' + @${ECHO_MSG} 'sub-optimal performance.' @${ECHO_MSG} -.if !defined(PORTS_ARCH) - @${ECHO_MSG} "Warning:" - @${ECHO_MSG} "If your arch is not correctly detected, you can specify" - @${ECHO_MSG} "by yourself." - @${ECHO_MSG} "for example : make PORTS_ARCH=P5Int" - @${ECHO_MSG} "Available architectures for x86 are:" - @${ECHO_MSG} "IntP5, IntP5MMX, IntPPRO, IntPII, IntPIII, IntP4, IntP4E" - @${ECHO_MSG} "IntP4E64, TMEff, AmdAthlon,AmdHammer32, AmdHammer64" + @${ECHO_MSG} 'Occasionally the autoconfiguration may fail for certain platforms, and' + @${ECHO_MSG} 'you may have to override the architecture, compiler flags, assembly' + @${ECHO_MSG} 'language dialect, or pointer bit-width by issuing additional configure' + @${ECHO_MSG} 'arguments. Consult the FAQ, installation guide, and errata page at' + @${ECHO_MSG} 'the project website for help if this is necessary, and notify the' + @${ECHO_MSG} 'port maintainer.' @${ECHO_MSG} -.endif -.if !defined(TIMING_TOLERANCE) - @${ECHO_MSG} "If your install dies with unable to get timings in tolerance" - @${ECHO_MSG} "First please refer http://math-atlas.sourceforge.net/errata.html#tol" - @${ECHO_MSG} "and you can build with" - @${ECHO_MSG} "make clean; make -DTIMING_TOLERANCE" - @${ECHO_MSG} "if your build still dies, you can type make again, (and again...)" + @${ECHO_MSG} "This port purposely ignores the CC and CFLAGS settings" + @${ECHO_MSG} "Program and compiler flags are fine-tuned to the gcc 4.2.x" + @${ECHO_MSG} "compiler, although other gcc versions may be used; gcc 4.1.x" + @${ECHO_MSG} "is NOT recommended" @${ECHO_MSG} -.endif .if !defined(WITH_STATICLIB) @${ECHO_MSG} "You can build static libraries with" @${ECHO_MSG} "make -DWITH_STATICLIB" @${ECHO_MSG} .endif +.if !defined(WITH_WALL_TIMER) + @${ECHO_MSG} "If your machine will be solely dedicated to" + @${ECHO_MSG} "building atlas with gcc during the lengthy optimization" + @${ECHO_MSG} "process, and not subjected to other loads, you" + @${ECHO_MSG} "may enable the more accurate wall timer (instead of" + @${ECHO_MSG} "the default CPU-time timer) with make -DWITH_WALL_TIMER" + @${ECHO_MSG} "If, in addition, you are on i386 or amd64, you may set MHZ" + @${ECHO_MSG} "to your CPU clock frequency in MHz (rounded to the nearest" + @${ECHO_MSG} "integer value) in the build environment for cycle-to-time" + @${ECHO_MSG} "conversion" + @${ECHO_MSG} +.endif +.if (${OSVERSION} < 700000) +.if !defined(WITH_GCC42KERNEL) + @${ECHO_MSG} "If you don't want to make gcc 4.2.x your default compiler (CC)," + @${ECHO_MSG} "but you want to have ATLAS use it to compile all the kernel" + @${ECHO_MSG} "routines (this usually results in superior performance, and a" + @${ECHO_MSG} "slightly faster build), while compiling interface routines and" + @${ECHO_MSG} "doing any linking with gcc 3.x, make a hybrid build with" + @${ECHO_MSG} "make -DWITH_GCC42KERNEL" + @${ECHO_MSG} +.endif +.endif + +pre-configure: + @${REINPLACE_CMD} -e "s|%%CC%%|${CCOMPILER}|g" \ + -e "s|%%FC%%|${FC}|g" ${WRKSRC}/CONFIG/src/atlcomp.txt + @${REINPLACE_CMD} -e "s|%%PTHREAD_LIBS%%|${PTHREAD_LIBS}|g" \ + -e "s|%%PTHREAD_CFLAGS%%|${PTHREAD_CFLAGS}|g" \ + -e "s|%%LOCALBASE%%|${LOCALBASE}|g" \ + ${WRKSRC}/CONFIG/src/SpewMakeInc.c do-configure: - @(cd ${WRKSRC}; ${MAKE_ENV} ${MAKE} xconfig && \ - ${ANSWER} | ./xconfig -N 1 -c ${CCOMPILER} -f ${FC} -m ${CCOMPILER} -g ${CCOMPILER} -x ${CCOMPILER} -a NON_THREADED && \ - ${ANSWER} | ./xconfig -N 1 -c ${CCOMPILER} -f ${FC} -m ${CCOMPILER} -g ${CCOMPILER} -x ${CCOMPILER} -a NON_THREADED_PIC -C '${PICFLAG} -DPIC' -F f '${PICFLAG} -DPIC -O' ) - @(cd ${WRKSRC}; ${PATCH} < ${FILESDIR}/thread-patch && \ - ${MAKE_ENV} ${MAKE} xconfig && \ - ${ANSWER} | ./xconfig -c ${CCOMPILER} -f ${FC} -m ${CCOMPILER} -g ${CCOMPILER} -x ${CCOMPILER} -a THREADED && \ - ${ANSWER} | ./xconfig -c ${CCOMPILER} -f ${FC} -m ${CCOMPILER} -g ${CCOMPILER} -x ${CCOMPILER} -a THREADED_PIC -C '${PICFLAG} -DPIC' -F f '${PICFLAG} -DPIC -O' ) - -ATLAS_LIBS1=libalapack libatlas libcblas libf77blas libtstatlas -ATLAS_LIBS2=libptcblas libptf77blas -LAPACKWRKSRC=`cd ${WRKDIR}/lapack; ${MAKE} -V WRKSRC` +#non-threaded +#dummy f77lib, it is not used. + ${MKDIR} ${WRKSRC}/NON_THREADED ; cd ${WRKSRC}/NON_THREADED ; \ + ../configure -v 2 -t 0 ${TIMEFLAG} -b ${POINTER} -Si cputhrchk 0 ${KERNELFLAG} -Ss f77lib " " + ${MKDIR} ${WRKSRC}/NON_THREADED_PIC ; cd ${WRKSRC}/NON_THREADED_PIC ; \ + ../configure -v 2 -t 0 -b ${POINTER} -Fa alg '${PICFLAG} -DPIC' ${TIMEFLAG} -Si cputhrchk 0 ${KERNELFLAG} -Ss f77lib " " +#threaded +#dummy f77lib, it is not used. + cd ${WRKSRC}; ${PATCH} < ${FILESDIR}/thread-patch + ${MKDIR} ${WRKSRC}/THREADED ; cd ${WRKSRC}/THREADED ; \ + ../configure -v 2 -b ${POINTER} -Fa alg '${PTHREAD_CFLAGS} ' ${TIMEFLAG} -Si cputhrchk 0 ${KERNELFLAG} -Ss f77lib " " + ${MKDIR} ${WRKSRC}/THREADED_PIC ; cd ${WRKSRC}/THREADED_PIC ; \ + ../configure -v 2 -b ${POINTER} -Fa alg '${PTHREAD_CFLAGS} ${PICFLAG} -DPIC' ${TIMEFLAG} -Si cputhrchk 0 ${KERNELFLAG} -Ss f77lib " " do-build: # make lapack @@ -147,102 +168,99 @@ do-build: @${CP} ${PORTSDIR}/math/lapack/pkg-descr ${WRKDIR}/lapack @cd ${WRKDIR}/lapack ; ${MAKE} "FFLAGS=${FFLAGS}" FC="${FC}" build WRKDIRPREFIX="" .endif - @(cd ${WRKSRC}; ${MAKE} ${.MAKEFLAGS} "ARCH=NON_THREADED_PIC" install arch=NON_THREADED_PIC) - @(cd ${WRKSRC}; ${MAKE} ${.MAKEFLAGS} "ARCH=THREADED_PIC" install arch=THREADED_PIC) .if defined(WITH_STATICLIB) - @(cd ${WRKSRC}; ${MAKE} ${.MAKEFLAGS} "ARCH=NON_THREADED" install arch=NON_THREADED) - @(cd ${WRKSRC}; ${MAKE} ${.MAKEFLAGS} "ARCH=THREADED" install arch=THREADED) + (cd ${WRKSRC}/NON_THREADED ; ${MAKE}) + (cd ${WRKSRC}/THREADED ; ${MAKE}) .endif - @${MAKE} test + (cd ${WRKSRC}/NON_THREADED_PIC ; ${MAKE}) + (cd ${WRKSRC}/THREADED_PIC ; ${MAKE}) +test: + @${MAKE} do-test + +ATLAS_LIBS1=libalapack libatlas libcblas libf77blas #libtstatlas +ATLAS_LIBS2=libptcblas libptf77blas +LAPACKWRKSRC=`cd ${WRKDIR}/lapack; ${MAKE} -V WRKSRC WRKDIRPREFIX=""` post-build: .if defined(WITH_STATICLIB) -# make atlas enhanced lapack (static ver) +# make atlas-enhanced lapack (static ver) (cd ${WRKSRC}; ${MKDIR} tmp1 ; \ ${CP} ${LAPACKWRKSRC}/liblapack.a tmp1 ;\ cd tmp1 ;\ ar x liblapack.a ;\ - ar x ../lib/NON_THREADED/liblapack.a ;\ - ar r ../lib/NON_THREADED/libalapack.a *.o ;\ - ranlib ../lib/NON_THREADED/libalapack.a ) -# make atlas enhanced lapack (static and thread safe ver) + ar x ../NON_THREADED/lib/liblapack.a ;\ + ar r ../NON_THREADED/lib/libalapack.a *.o ;\ + ranlib ../NON_THREADED/lib/libalapack.a ) +# make atlas-enhanced lapack (static and thread-safe ver) (cd ${WRKSRC}; ${MKDIR} tmp2 ; \ ${CP} ${LAPACKWRKSRC}/liblapack.a tmp2 ;\ cd tmp2 ;\ ar x liblapack.a ;\ - ar x ../lib/THREADED/liblapack.a ;\ - ar r ../lib/THREADED/libalapack.a *.o ;\ - ranlib ../lib/THREADED/libalapack.a ) + ar x ../THREADED/lib/liblapack.a ;\ + ar r ../THREADED/lib/libalapack.a *.o ;\ + ranlib ../THREADED/lib/libalapack.a ) .endif -# make atlas enhanced lapack (shared ver) +# make atlas-enhanced lapack (shared ver) ( cd ${WRKSRC}; ${MKDIR} tmp3 ;\ ${CP} ${LAPACKWRKSRC}_shared/liblapack.a tmp3 ;\ cd tmp3 ;\ ar x liblapack.a ;\ - ar x ../lib/NON_THREADED_PIC/liblapack.a ;\ - ar r ../lib/NON_THREADED_PIC/libalapack.a *.o ;\ - ranlib ../lib/NON_THREADED_PIC/libalapack.a ) -# make atlas enhanced lapack (shared and thread safe ver) + ar x ../NON_THREADED_PIC/lib/liblapack.a ;\ + ar r ../NON_THREADED_PIC/lib/libalapack.a *.o ;\ + ranlib ../NON_THREADED_PIC/lib/libalapack.a ) +# make atlas-enhanced lapack (shared and thread-safe ver) ( cd ${WRKSRC}; ${MKDIR} tmp4 ;\ ${CP} ${LAPACKWRKSRC}_shared/liblapack.a tmp4 ;\ cd tmp4 ;\ ar x liblapack.a ;\ - ar x ../lib/THREADED_PIC/liblapack.a ;\ - ar r ../lib/THREADED_PIC/libalapack.a *.o ;\ - ranlib ../lib/THREADED_PIC/libalapack.a ) + ar x ../THREADED_PIC/lib/liblapack.a ;\ + ar r ../THREADED_PIC/lib/libalapack.a *.o ;\ + ranlib ../THREADED_PIC/lib/libalapack.a ) # make atlas shared library .for i in ${ATLAS_LIBS1} - ( cd ${WRKSRC}/lib/NON_THREADED_PIC/ ; \ + ( cd ${WRKSRC}/NON_THREADED_PIC/lib ; \ ld -Bshareable -o ${i}.so.2 -x -soname ${i}.so.2 --whole-archive ${i}.a ) .endfor -# make atlas shared (thread safe) library +# make atlas shared (thread-safe) library .for i in ${ATLAS_LIBS1} - ( cd ${WRKSRC}/lib/THREADED_PIC/ ; \ + ( cd ${WRKSRC}/THREADED_PIC/lib ; \ ld -Bshareable -o ${i}_r.so.2 -x -soname ${i}_r.so.2 --whole-archive ${i}.a ) .endfor .for i in ${ATLAS_LIBS2} - ( cd ${WRKSRC}/lib/THREADED_PIC/ ; \ + ( cd ${WRKSRC}/THREADED_PIC/lib ; \ ld -Bshareable -o ${i}.so.2 -x -soname ${i}.so.2 --whole-archive ${i}.a ) .endfor - do-install: .for i in ${ATLAS_LIBS1} .if defined(WITH_STATICLIB) - @${INSTALL_DATA} ${WRKSRC}/lib/NON_THREADED/${i}.a ${PREFIX}/lib + @${INSTALL_DATA} ${WRKSRC}/NON_THREADED/lib/${i}.a ${PREFIX}/lib .endif - @${INSTALL_DATA} ${WRKSRC}/lib/NON_THREADED_PIC/${i}.so.2 ${PREFIX}/lib + @${INSTALL_DATA} ${WRKSRC}/NON_THREADED_PIC/lib/${i}.so.2 ${PREFIX}/lib @${LN} -sf ${i}.so.2 ${PREFIX}/lib/${i}.so .endfor .for i in ${ATLAS_LIBS1} .if defined(WITH_STATICLIB) - @${INSTALL_DATA} ${WRKSRC}/lib/THREADED/${i}.a ${PREFIX}/lib/${i}_r.a + @${INSTALL_DATA} ${WRKSRC}/THREADED/lib/${i}.a ${PREFIX}/lib/${i}_r.a .endif - @${INSTALL_DATA} ${WRKSRC}/lib/THREADED_PIC/${i}_r.so.2 ${PREFIX}/lib/${i}_r.so.2 + @${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 .endfor .for i in ${ATLAS_LIBS2} .if defined(WITH_STATICLIB) - @${INSTALL_DATA} ${WRKSRC}/lib/THREADED/${i}.a ${PREFIX}/lib + @${INSTALL_DATA} ${WRKSRC}/THREADED/lib/${i}.a ${PREFIX}/lib .endif - @${INSTALL_DATA} ${WRKSRC}/lib/THREADED_PIC/${i}.so.2 ${PREFIX}/lib + @${INSTALL_DATA} ${WRKSRC}/THREADED_PIC/lib/${i}.so.2 ${PREFIX}/lib @${LN} -sf ${i}.so.2 ${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 .if !defined(NOPORTDOCS) @${MKDIR} ${DOCSDIR} ${INSTALL_DATA} ${WRKSRC}/doc/* ${DOCSDIR} .endif - ${MKDIR} ${EXAMPLESDIR} - @for i in ${ALLTESTS} ; do \ - cd ${WRKDIR}/ATLAS/bin/NON_THREADED_PIC ; ${INSTALL_PROGRAM} $${i} ${EXAMPLESDIR} ; \ - done - @for i in ${ALLTESTS_PT} ; do \ - cd ${WRKDIR}/ATLAS/bin/THREADED_PIC ; ${INSTALL_PROGRAM} $${i} ${EXAMPLESDIR} ; \ - done + .include <${FILESDIR}/Makefile.test> .include <bsd.port.post.mk> |