Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Jul 2021 16:03:02 GMT
From:      Thierry Thomas <thierry@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-branches@FreeBSD.org
Subject:   git: 7e1d6c0f6c1b - 2021Q3 - math/atlas: unbreak after math/lapack + various fixes
Message-ID:  <202107251603.16PG32gk068095@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch 2021Q3 has been updated by thierry:

URL: https://cgit.FreeBSD.org/ports/commit/?id=7e1d6c0f6c1b935413eb5ecc689a60a5d236af80

commit 7e1d6c0f6c1b935413eb5ecc689a60a5d236af80
Author:     Thierry Thomas <thierry@FreeBSD.org>
AuthorDate: 2021-07-21 20:48:14 +0000
Commit:     Thierry Thomas <thierry@FreeBSD.org>
CommitDate: 2021-07-25 16:02:35 +0000

    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
    
    (cherry picked from commit 75752cd50be8de2ff11026bf3a536bcad6245a8f)
---
 math/atlas/Makefile | 29 ++++++++++++++---------------
 1 file changed, 14 insertions(+), 15 deletions(-)

diff --git a/math/atlas/Makefile b/math/atlas/Makefile
index 31ace6456ff2..f5f9bd6f0ac1 100644
--- a/math/atlas/Makefile
+++ b/math/atlas/Makefile
@@ -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 ; \



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202107251603.16PG32gk068095>