1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-20 08:27:15 +00:00

math/atlas: unbreak after math/lapack + various fixes

The latest upgrade of math/lapack broke ATLAS, due to the lack of the
post-target, but anyways it was broken in many others ways:

- gmake is required (the fixes ifdef / #ifdef are not sufficient)

- -fPIC is needed everywhere

- fix EXTRA_FFLAGS

- remove a conflict with atlas-devel.

PR:		257122
Reported by:	alt2600 (at) icloud.com
MFH:		2021Q3
This commit is contained in:
Thierry Thomas 2021-07-21 22:48:14 +02:00
parent b7eec409d5
commit 75752cd50b

View File

@ -16,10 +16,10 @@ LICENSE= BSD3CLAUSE
BUILD_DEPENDS= ${NONEXISTENT}:math/lapack:checksum
USES= fortran tar:bzip2
USES= fortran gmake tar:bzip2
USE_GCC= yes
CONFLICTS= atlas-devel-[0-9]* cblas-[0-9]*
CONFLICTS= cblas-[0-9]*
MANUAL_PACKAGE_BUILD= Optimizes for the local machine.
OPTIONS_DEFINE= DOCS DATA ARCHDEF TSC WALL_TIMER
@ -38,12 +38,6 @@ WRKSRC= ${WRKDIR}/ATLAS
# http://math-atlas.sourceforge.net/errata.html#MaxMalloc
ATLAS_MAXMALLOC?= 67108864
.if ${ARCH} == "sparc64"
PICFLAG?= -fPIC
.else
PICFLAG?= -fpic
.endif
.if !empty(ARCH:M*64*)
POINTER?= 64
.else
@ -71,10 +65,14 @@ IGNORE= you have set WITH_ARCHDEF, but have not defined ARCHDEF
USE_LDCONFIG= yes
EXTRA_FLAGS?= -Wl,-rpath=${_GCC_RUNTIME}
EXTRA_FLAGS?= ${PICFLAG} -Wl,-rpath=${_GCC_RUNTIME}
SHARED_FLAGS= ${PICFLAG} -DPIC
SHARED_LAPACK_WRKSRC= WRKSRC_SHARED
SHARED_LAPACK_WRKSRC= WRKSRC
STATIC_LAPACK_WRKSRC= WRKSRC
PICFLAG?= -fPIC
CFLAGS+= ${PICFLAG}
MAKE_ENV+= MAKE=${GMAKE}
BINARY_ALIAS= make=${LOCALBASE}/bin/gmake
post-patch:
@cd ${WRKSRC}/CONFIG/ARCHS ; for t in *.tgz ; do \
@ -134,11 +132,12 @@ post-configure:
do-build:
.for opt in shared static
@${ECHO_CMD} "Building the LAPACK archives with ${opt} ATLAS flags:"
F77FLAGS="`${MAKE} -f ${WRKSRC}/saved_flags -V F77FLAGS` ${EXTRA_FFLAGS}" ; \
F77FLAGS="`${MAKE} -f ${WRKSRC}/saved_flags -V F77FLAGS` ${EXTRA_FLAGS}" ; \
LW=`${MAKE} -C ${PORTSDIR}/math/lapack -V ${${opt:tu}_LAPACK_WRKSRC}` ; \
${MAKE} -C ${PORTSDIR}/math/lapack WITH=${opt:tu} clean patch ; \
cd $${LW} ; ${SETENV} ${MAKE_ENV:NFFLAGS=*} EXTRAFLAGS="${${opt:tu}_FLAGS}" \
FFLAGS="-pipe $${F77FLAGS}" ${MAKE} ${_MAKE_JOBS} ${MAKE_ARGS} \
${REINPLACE_CMD} -e 's|-O0|-O0 ${EXTRA_FLAGS}|' $${LW}/make.inc ; \
cd $${LW} ; ${SETENV} ${MAKE_ENV:NFFLAGS=*} EXTRAFLAGS="${${opt:tu}_FLAGS} ${PICFLAG} " \
FFLAGS="-pipe $${F77FLAGS}" ${MAKE_CMD} ${_MAKE_JOBS} ${MAKE_ARGS} \
ARCH="${AR}" lapacklib ; \
TIMEFLAG=`${MAKE} -f ${WRKSRC}/saved_flags -V TIMEFLAG` ; \
${MKDIR} ${WRKSRC}/${opt} ; cd ${WRKSRC}/${opt} ; \
@ -148,7 +147,7 @@ do-build:
../configure --cc="${CC}" --cflags="${CFLAGS}" \
--with-netlib-lapack="${WRKSRC}/${opt}/liblapack_${opt}.a" \
--prefix="${PREFIX}" -v 2 $${TIMEFLAG} ${ARCHDEFFLAG} \
-Ss f77lib " " -Ss pmake "${MAKE} ${_MAKE_JOBS}" \
-Ss f77lib " " -Ss pmake "${MAKE_CMD} ${_MAKE_JOBS}" \
-Fa alg "${${opt:tu}_FLAGS} " -b ${POINTER} ; \
if [ "x${WITH_ARCHDEF}" != "x" ] ; then \
if [ "x${ARCHDEF}" != "xNONE" ] ; then \
@ -181,7 +180,7 @@ post-build:
${MAKE_CMD} ${MAKE_ARGS} ArchNew tarfile)
.endfor
@${ECHO_CMD} "Building ATLAS shared libraries:"
@F77FLAGS="`${MAKE} -f ${WRKSRC}/saved_flags -V F77FLAGS` ${EXTRA_FFLAGS}" ; \
@F77FLAGS="`${MAKE} -f ${WRKSRC}/saved_flags -V F77FLAGS` ${EXTRA_FLAGS}" ; \
cd ${WRKSRC}/shared/lib ; \
${L1}libatlas.so.2 -o libatlas.so.2 libatlas.a ${L2} ; \
${L1}libf77blas.so.2 -o libf77blas.so.2 libf77blas.a ${L2} libatlas.so.2 ; \