Re: git: 71c6c33462ac - main - science/PETSc: Fix build on 32-bit systems

From: Piotr Kubaj <pkubaj_at_anongoth.pl>
Date: Thu, 12 Dec 2024 11:58:57 UTC
This is wrong. E.g. on powerpc64:
pkubaj@talos-powerpc64:$/usr/ports$ uname -m
powerpc
pkubaj@talos-powerpc64:$/usr/ports$ uname -p 
powerpc64

Why not just use ${ARCH}?

On 24-12-12 11:33:35, Yuri Victorovich wrote:
> The branch main has been updated by yuri:
> 
> URL: https://cgit.FreeBSD.org/ports/commit/?id=71c6c33462ac1b7994689da06156f31577fcb774
> 
> commit 71c6c33462ac1b7994689da06156f31577fcb774
> Author:     Yuri Victorovich <yuri@FreeBSD.org>
> AuthorDate: 2024-12-12 11:32:44 +0000
> Commit:     Yuri Victorovich <yuri@FreeBSD.org>
> CommitDate: 2024-12-12 11:32:44 +0000
> 
>     science/PETSc: Fix build on 32-bit systems
>     
>     ... by matching index size with math/metis
>     
>     Reported by:    fallout
> ---
>  science/PETSc/Makefile | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/science/PETSc/Makefile b/science/PETSc/Makefile
> index 160a0029091d..1da1a7f92aec 100644
> --- a/science/PETSc/Makefile
> +++ b/science/PETSc/Makefile
> @@ -1,5 +1,6 @@
>  PORTNAME=	PETSc
>  DISTVERSION=	3.22.1
> +PORTREVISION=	1
>  CATEGORIES=	science devel
>  MASTER_SITES=	https://web.cels.anl.gov/projects/petsc/download/release-snapshots/
>  DISTNAME=	${PORTNAME:tl}-${DISTVERSION}
> @@ -21,6 +22,8 @@ USE_XORG=	x11
>  SHEBANG_FILES=	configure lib/petsc/bin/*.py lib/petsc/bin/saws/SAWs.py lib/petsc/bin/saws/*.bash config/*.py	\
>  		lib/petsc/bin/petscnagfor share/petsc/chkerrconvert.py
>  
> +XARCH!=		uname -m
> +
>  GNU_CONFIGURE=	yes
>  CONFIGURE_LOG=	configure.log
>  CONFIGURE_ARGS=	--with-shared-libraries=1 \
> @@ -32,7 +35,9 @@ CONFIGURE_ARGS=	--with-shared-libraries=1 \
>  		MAKEFLAGS="${MAKEFLAGS}" LDFLAGS="${LDFLAGS}" LIBS=""
>  CONFIGURE_ARGS_amd64=	CFLAGS="${CFLAGS} -msse2" CXXFLAGS="${CXXFLAGS} -msse2"
>  CONFIGURE_ARGS_i386=	CFLAGS="${CFLAGS} -msse2" CXXFLAGS="${CXXFLAGS} -msse2"
> +.if ${XARCH:M*64*} # match IDXTYPEWIDTH being set to 64 in math/metis
>  CONFIGURE_ARGS+=	--with-64-bit-indices # as opposed to 32-bit indices that are default
> +.endif
>  
>  MAKEFILE=	makefile
>  TEST_TARGET=	test # 152 of 11396 tests (1.3%) fail due to missing files like /usr/local/share/petsc/datafiles/meshes/square_periodic.msh (tests expect the packe to be installed)