Skip to content

Commit

Permalink
math/elpa: Update 2019.05.002 -> 2021.11.001
Browse files Browse the repository at this point in the history
A special hack is used to build this port because
GNU Makefiles don't build components in proper order by default,
and .mod files are built only after they are used.

It was broken for a long while for this reason.
  • Loading branch information
yurivict committed Jul 17, 2022
1 parent a818c4a commit 935ebd1
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 30 deletions.
26 changes: 19 additions & 7 deletions math/elpa/Makefile
@@ -1,8 +1,7 @@
PORTNAME= elpa
DISTVERSION= 2019.05.002
PORTREVISION= 2
DISTVERSION= 2021.11.001
CATEGORIES= math
MASTER_SITES= http://elpa.mpcdf.mpg.de/html/Releases/${DISTVERSION}/
MASTER_SITES= https://elpa.mpcdf.mpg.de/software/tarball-archive/Releases/${DISTVERSION}/

MAINTAINER= yuri@FreeBSD.org
COMMENT= Eigenvalue soLver for Petaflop Applications
Expand All @@ -12,8 +11,6 @@ LICENSE_COMB= dual
LICENSE_FILE_GPLv3= ${WRKSRC}/COPYING/gpl.txt
LICENSE_FILE_LGPL3= ${WRKSRC}/COPYING/lgpl.txt

BROKEN_aarch64= fails to build: Fatal Error: config-f90.h: No such file or directory

LIB_DEPENDS= libopenblas.so:math/openblas

USES= compiler:c11 fortran gmake libtool localbase perl5 shebangfix
Expand All @@ -22,14 +19,26 @@ USE_LDCONFIG= yes
SHEBANG_GLOB= *.pl

GNU_CONFIGURE= yes
CONFIGURE_ARGS= --disable-avx --disable-avx2 --disable-static \
CONFIGURE_ARGS= --disable-avx --disable-avx2 --disable-avx512 --disable-static \
--disable-c-tests

CFLAGS+= -I${WRKSRC} -I${WRKSRC}/private_modules
FCFLAGS+= -I${WRKSRC} -I${WRKSRC}/private_modules
LDFLAGS+= -lutil

# ugly workaround for missing .mod files: some targets are added before 'all' that force rebuild of missing .mod files
ALL_TARGET= src/general/libelpa_private_la-elpa_utilities.lo \
src/libelpa_private_la-elpa_generated_fortran_interfaces.lo \
src/elpa1/libelpa_private_la-elpa1_compute_private.lo \
src/elpa2/libelpa_private_la-elpa2_compute.lo \
all
INSTALL_TARGET= install-strip

BINARY_ALIAS= make=gmake gcc=gcc${GCC_DEFAULT} g++=g++${GCC_DEFAULT} # build fails with clang: recursively calls cc
FCFLAGS+= -std=legacy -I${LOCALBASE}/include

MAKE_JOBS_UNSAFE= yes # part of the workaround for .mod files

OPTIONS_DEFINE= OPENMP MPI DOCS
OPTIONS_DEFINE_amd64= SSE
OPTIONS_DEFAULT_amd64= SSE
Expand All @@ -42,8 +51,11 @@ MPI_LIB_DEPENDS= libmpich.so:net/mpich \

PORTDOCS= *

post-patch: # workaround for: https://github.com/marekandreas/elpa/issues/6
post-patch:
# workaround for: https://github.com/marekandreas/elpa/issues/6
@${FIND} ${WRKSRC} -name "*.mk" | ${XARGS} ${REINPLACE_CMD} -e 's|-Werror| |'
# patch in the full path name of config-f90.h
@${FIND} ${WRKSRC} -name *.F90 -o -name *.c | ${XARGS} ${REINPLACE_CMD} -e 's|#include "config-f90.h"|#include "${WRKSRC}/config-f90.h"|'

.include <bsd.port.options.mk>

Expand Down
6 changes: 3 additions & 3 deletions math/elpa/distinfo
@@ -1,3 +1,3 @@
TIMESTAMP = 1570675365
SHA256 (elpa-2019.05.002.tar.gz) = d2eab5e5d74f53601220b00d18185670da8c00c13e1c1559ecfb0cd7cb2c4e8d
SIZE (elpa-2019.05.002.tar.gz) = 1239916
TIMESTAMP = 1642194690
SHA256 (elpa-2021.11.001.tar.gz) = fb361da6c59946661b73e51538d419028f763d7cb9dacf9d8cd5c9cd3fb7802f
SIZE (elpa-2021.11.001.tar.gz) = 1388817
32 changes: 32 additions & 0 deletions math/elpa/files/patch-src_helpers_check__thread__affinity.c
@@ -0,0 +1,32 @@
--- src/helpers/check_thread_affinity.c.orig 2021-11-16 11:26:03 UTC
+++ src/helpers/check_thread_affinity.c
@@ -47,11 +47,14 @@
//
// Author: Andreas Marek, MPCDF

-#define _GNU_SOURCE
+//#define _GNU_SOURCE
+#define __BSD_VISIBLE
#include <stdio.h>
#include <stdlib.h>
#include <sched.h>
#include <sys/types.h>
+#include <sys/_cpuset.h>
+#include <sys/cpuset.h>
#include <unistd.h>


@@ -60,11 +63,11 @@ void get_thread_affinity(int *cpu_id) {
}

void get_process_affinity(int cpu_id) {
- cpu_set_t set;
+ cpuset_t set;
int ret, i;
int cpu;
cpu_id = 9999999 ;
- ret = sched_getaffinity(0, sizeof(cpu_set_t), &set);
+ ret = sched_getaffinity(0, sizeof(cpuset_t), &set);
for (i=0; i < CPU_SETSIZE; i++)
{
cpu = CPU_ISSET(i, &set);
49 changes: 29 additions & 20 deletions math/elpa/pkg-plist
@@ -1,34 +1,41 @@
bin/elpa2_print_kernels
include/elpa-2019.05.002/elpa/elpa.h
include/elpa-2019.05.002/elpa/elpa_constants.h
include/elpa-2019.05.002/elpa/elpa_generated.h
include/elpa-2019.05.002/elpa/elpa_generated_c_api.h
include/elpa-2019.05.002/elpa/elpa_generated_legacy.h
include/elpa-2019.05.002/elpa/elpa_generic.h
include/elpa-2019.05.002/elpa/elpa_legacy.h
include/elpa-2019.05.002/elpa/elpa_version.h
include/elpa-2019.05.002/modules/elpa.mod
include/elpa-2019.05.002/modules/elpa_api.mod
include/elpa-2019.05.002/modules/elpa_constants.mod
include/elpa-2019.05.002/modules/elpa1.mod
include/elpa-2019.05.002/modules/elpa1_auxiliary.mod
include/elpa-2019.05.002/modules/elpa2.mod
include/elpa-2019.05.002/modules/elpa2_utilities.mod
include/elpa-2019.05.002/modules/elpa_driver.mod
include/elpa-2019.05.002/modules/elpa_utilities.mod
include/elpa-2021.11.001/elpa/elpa.h
include/elpa-2021.11.001/elpa/elpa_constants.h
include/elpa-2021.11.001/elpa/elpa_generated.h
include/elpa-2021.11.001/elpa/elpa_generated_c_api.h
include/elpa-2021.11.001/elpa/elpa_generic.h
include/elpa-2021.11.001/elpa/elpa_simd_constants.h
include/elpa-2021.11.001/elpa/elpa_version.h
include/elpa-2021.11.001/modules/elpa.mod
include/elpa-2021.11.001/modules/elpa_api.mod
include/elpa-2021.11.001/modules/elpa_constants.mod
include/elpa-2021.11.001/src/helpers/lapack_interfaces.h
include/elpa-2021.11.001/src/helpers/scalapack_interfaces.h
lib/libelpa.so
lib/libelpa.so.14
lib/libelpa.so.14.0.0
libdata/pkgconfig/elpa-2019.05.002.pc
lib/libelpa.so.17
lib/libelpa.so.17.0.0
libdata/pkgconfig/elpa.pc
man/man1/elpa2_print_kernels.1.gz
man/man3/elpa_allocate.3.gz
man/man3/elpa_autotune_deallocate.3.gz
man/man3/elpa_autotune_load_state.3.gz
man/man3/elpa_autotune_print_state.3.gz
man/man3/elpa_autotune_save_state.3.gz
man/man3/elpa_autotune_set_best.3.gz
man/man3/elpa_autotune_setup.3.gz
man/man3/elpa_autotune_step.3.gz
man/man3/elpa_cholesky.3.gz
man/man3/elpa_deallocate.3.gz
man/man3/elpa_eigenvalues.3.gz
man/man3/elpa_eigenvalues_double.3.gz
man/man3/elpa_eigenvalues_double_complex.3.gz
man/man3/elpa_eigenvalues_float.3.gz
man/man3/elpa_eigenvalues_float_complex.3.gz
man/man3/elpa_eigenvectors.3.gz
man/man3/elpa_eigenvectors_double.3.gz
man/man3/elpa_eigenvectors_double_complex.3.gz
man/man3/elpa_eigenvectors_float.3.gz
man/man3/elpa_eigenvectors_float_complex.3.gz
man/man3/elpa_generalized_eigenvalues.3.gz
man/man3/elpa_generalized_eigenvectors.3.gz
man/man3/elpa_hermitian_multiply.3.gz
Expand All @@ -38,6 +45,8 @@ man/man3/elpa_load_settings.3.gz
man/man3/elpa_print_settings.3.gz
man/man3/elpa_set.3.gz
man/man3/elpa_setup.3.gz
man/man3/elpa_skew_eigenvalues.3.gz
man/man3/elpa_skew_eigenvectors.3.gz
man/man3/elpa_solve_tridiagonal.3.gz
man/man3/elpa_store_settings.3.gz
man/man3/elpa_uninit.3.gz

0 comments on commit 935ebd1

Please sign in to comment.