pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

canu: Fix build on Darwin aarch64



Module Name:	pkgsrc-wip
Committed By:	Jason Bacon <bacon%NetBSD.org@localhost>
Pushed By:	outpaddling
Date:		Sat May 20 08:07:54 2023 -0500
Changeset:	d564e3cd462925040c101038247ad239cdf3bc31

Modified Files:
	canu/Makefile
	canu/distinfo
Added Files:
	canu/files/cpuid_arm.c
	canu/files/cpuid_ppc.c
Removed Files:
	canu/patches/patch-utility_src_parasail_internal__sse.h
	canu/patches/patch-utility_src_utility_align-ssw.H

Log Message:
canu: Fix build on Darwin aarch64

Import hacked parasail cpuid.c from FreeBSD
Remove unnecessary simde dep and patches

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=d564e3cd462925040c101038247ad239cdf3bc31

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 canu/Makefile                                      | 12 +++--
 canu/distinfo                                      |  2 -
 canu/files/cpuid_arm.c                             | 57 ++++++++++++++++++++++
 canu/files/cpuid_ppc.c                             | 57 ++++++++++++++++++++++
 .../patch-utility_src_parasail_internal__sse.h     | 16 ------
 canu/patches/patch-utility_src_utility_align-ssw.H | 16 ------
 6 files changed, 122 insertions(+), 38 deletions(-)

diffs:
diff --git a/canu/Makefile b/canu/Makefile
index 3ccc7f684d..321273d8ba 100644
--- a/canu/Makefile
+++ b/canu/Makefile
@@ -31,7 +31,7 @@ REPLACE_PERL+=	fastq-utilities/*.pl
 REPLACE_PERL+=	*.pl
 
 # May work on other 64-bit processors, but untested
-ONLY_FOR_PLATFORM=	*-*-x86_64 *-*-aarch64
+ONLY_FOR_PLATFORM=	*-*-x86_64 *-*-aarch64 *-*-powerpc64
 
 USE_LANGUAGES=	c c++
 USE_JAVA=	run
@@ -46,8 +46,15 @@ SITE_PERL_REL=		lib/perl5/site_perl
 JAVAJARDIR=		share/java/classes
 INSTALLATION_DIRS=	bin lib/perl5 ${JAVAJARDIR}
 
+.include "../../mk/bsd.prefs.mk"
+
 post-extract:
 	${CHMOD} -R g-w ${WRKDIR}
+.if ${MACHINE_ARCH} == "aarch64"
+	${CP} ${FILESDIR}/cpuid_arm.c ${WRKSRC}/utility/src/parasail/cpuid.c
+.elif ${MACHINE_ARCH} == "powerpc64"
+	${CP} ${FILESDIR}/cpuid_ppc.c ${WRKSRC}/utility/src/parasail/cpuid.c
+.endif
 
 # Upstream does not want to use lib/perl5/site_perl
 post-build:
@@ -59,8 +66,6 @@ do-install:
 	cd ${TMP_INST}/lib/perl5 && ${PAX} -wr * ${DESTDIR}${PREFIX}/lib/perl5
 	cd ${TMP_INST}/share && ${PAX} -wr * ${DESTDIR}${PREFIX}/share
 
-.include "../../mk/bsd.prefs.mk"
-
 # Xcode supports -Xpreprocessor -fopenmp, but does not supply OpenMP libs
 # parallel/openmp installs an entire llvm
 # Maybe a libomp package would suffice?
@@ -69,6 +74,5 @@ do-install:
 .endif
 
 .include "../../devel/boost-libs/buildlink3.mk"
-.include "../../devel/simde/buildlink3.mk"
 .include "../../lang/perl5/module.mk"
 .include "../../mk/bsd.pkg.mk"
diff --git a/canu/distinfo b/canu/distinfo
index 231b1b15f8..f042cebd21 100644
--- a/canu/distinfo
+++ b/canu/distinfo
@@ -7,8 +7,6 @@ SHA1 (patch-Makefile) = 54a3a216948fea81cfeb6ce91458126adc2ad8da
 SHA1 (patch-pipelines_canu_Defaults.pm) = 5ecea8ebac667499916b0243f34dc25838992444
 SHA1 (patch-pipelines_canu_Execution.pm) = 75c019a93f5b6a4491191b4f32931ac0b8435421
 SHA1 (patch-utgcns_libboost_boost_smart__ptr_detail_shared__count.hpp) = fd219645141ebe9d6f23153a2a2b0f56abc103af
-SHA1 (patch-utility_src_parasail_internal__sse.h) = 3eca097b64273ada2df6f9be895823980ea79902
-SHA1 (patch-utility_src_utility_align-ssw.H) = 146e1959207dfe1deaae7f8f9809ed72be116841
 SHA1 (patch-utility_src_utility_files.H) = bc28dfd6957a2e2928b5df6a0e1d08c8ba5b2c27
 SHA1 (patch-utility_src_utility_logging.H) = 13e9ced966710cef4a2d38fd2b752f8a726ba07b
 SHA1 (patch-utility_src_utility_system.H) = e0bab7ed20431948845fac907584215c0b891406
diff --git a/canu/files/cpuid_arm.c b/canu/files/cpuid_arm.c
new file mode 100644
index 0000000000..3b35be06c0
--- /dev/null
+++ b/canu/files/cpuid_arm.c
@@ -0,0 +1,57 @@
+/**
+ * @file
+ *
+ * @author jeffrey.daily%gmail.com@localhost
+ *
+ * Copyright (c) 2015 Battelle Memorial Institute.
+ *
+ * For non-intel platforms, stub out the intel feature tests.
+ */
+#include "config.h"
+
+#include "parasail/cpuid.h"
+
+int parasail_can_use_avx512vbmi()
+{
+    return 0;
+}
+
+int parasail_can_use_avx512bw()
+{
+    return 0;
+}
+
+int parasail_can_use_avx512f()
+{
+    return 0;
+}
+
+int parasail_can_use_avx2()
+{
+    return 0;
+}
+
+int parasail_can_use_sse41()
+{
+    return 0;
+}
+
+int parasail_can_use_sse2()
+{
+    return 0;
+}
+
+int parasail_can_use_altivec()
+{
+    return 0;
+}
+
+int parasail_can_use_neon()
+{
+#if HAVE_NEON
+    return 1;
+#else
+    return 0;
+#endif
+}
+
diff --git a/canu/files/cpuid_ppc.c b/canu/files/cpuid_ppc.c
new file mode 100644
index 0000000000..4a832a90a3
--- /dev/null
+++ b/canu/files/cpuid_ppc.c
@@ -0,0 +1,57 @@
+/**
+ * @file
+ *
+ * @author jeffrey.daily%gmail.com@localhost
+ *
+ * Copyright (c) 2015 Battelle Memorial Institute.
+ *
+ * For non-intel platforms, stub out the intel feature tests.
+ */
+#include "config.h"
+
+#include "parasail/cpuid.h"
+
+int parasail_can_use_avx512vbmi()
+{
+    return 0;
+}
+
+int parasail_can_use_avx512bw()
+{
+    return 0;
+}
+
+int parasail_can_use_avx512f()
+{
+    return 0;
+}
+
+int parasail_can_use_avx2()
+{
+    return 0;
+}
+
+int parasail_can_use_sse41()
+{
+    return 0;
+}
+
+int parasail_can_use_sse2()
+{
+    return 0;
+}
+
+int parasail_can_use_altivec()
+{
+#if HAVE_ALTIVEC
+    return 1;
+#else
+    return 0;
+#endif
+}
+
+int parasail_can_use_neon()
+{
+    return 0;
+}
+
diff --git a/canu/patches/patch-utility_src_parasail_internal__sse.h b/canu/patches/patch-utility_src_parasail_internal__sse.h
deleted file mode 100644
index 28e550e08a..0000000000
--- a/canu/patches/patch-utility_src_parasail_internal__sse.h
+++ /dev/null
@@ -1,16 +0,0 @@
-$NetBSD$
-
-# Portability
-
---- utility/src/parasail/internal_sse.h.orig	2021-12-17 22:10:09 UTC
-+++ utility/src/parasail/internal_sse.h
-@@ -10,7 +10,8 @@
- 
- #include <stdint.h>
- 
--#include <emmintrin.h>
-+#define SIMDE_ENABLE_NATIVE_ALIASES
-+#include <simde.h>
- 
- #include "parasail.h"
- 
diff --git a/canu/patches/patch-utility_src_utility_align-ssw.H b/canu/patches/patch-utility_src_utility_align-ssw.H
deleted file mode 100644
index e0cf210ade..0000000000
--- a/canu/patches/patch-utility_src_utility_align-ssw.H
+++ /dev/null
@@ -1,16 +0,0 @@
-$NetBSD$
-
-# Portability
-
---- utility/src/utility/align-ssw.H.orig	2021-12-17 22:12:23 UTC
-+++ utility/src/utility/align-ssw.H
-@@ -33,7 +33,8 @@
- #include <stdio.h>
- #include <stdint.h>
- #include <string.h>
--#include <emmintrin.h>
-+#define SIMDE_ENABLE_NATIVE_ALIASES
-+#include <simde.h.h>
- 
- 
- #define MAPSTR "MIDNSHP=X"


Home | Main Index | Thread Index | Old Index