aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuri Victorovich <yuri@FreeBSD.org>2022-08-24 20:31:19 +0000
committerYuri Victorovich <yuri@FreeBSD.org>2022-08-24 20:32:26 +0000
commit0b9278ec684ab7923315214fec4171e97e7a021f (patch)
treee40bd81dffbe4761caf59596d37ad5b1117ef89f
parent0a7605444f4fda276ed987daa59754a530aceb19 (diff)
downloadports-0b9278ec684ab7923315214fec4171e97e7a021f.tar.gz
ports-0b9278ec684ab7923315214fec4171e97e7a021f.zip
science/cardioid: New port: Cardiac simulation toolkit
-rw-r--r--science/Makefile1
-rw-r--r--science/cardioid/Makefile52
-rw-r--r--science/cardioid/distinfo5
-rw-r--r--science/cardioid/files/patch-simUtil_src_ddcMalloc.c20
-rw-r--r--science/cardioid/files/patch-simUtil_src_utilities.c22
-rw-r--r--science/cardioid/pkg-descr6
6 files changed, 106 insertions, 0 deletions
diff --git a/science/Makefile b/science/Makefile
index dc6dd9d62a78..75361ae656a0 100644
--- a/science/Makefile
+++ b/science/Makefile
@@ -38,6 +38,7 @@
SUBDIR += bodr
SUBDIR += buddy
SUBDIR += cantera
+ SUBDIR += cardioid
SUBDIR += cdcl
SUBDIR += cdf
SUBDIR += cdk
diff --git a/science/cardioid/Makefile b/science/cardioid/Makefile
new file mode 100644
index 000000000000..d60938ab7143
--- /dev/null
+++ b/science/cardioid/Makefile
@@ -0,0 +1,52 @@
+PORTNAME= cardioid
+PORTVERSION= g20211026
+CATEGORIES= science
+
+MAINTAINER= yuri@FreeBSD.org
+COMMENT= Cardiac simulation toolkit
+
+LICENSE= MIT
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+LIB_DEPENDS= libblas.so:math/blas \
+ liblapack.so:math/lapack
+RUN_DEPENDS= bash:shells/bash
+
+USES= cmake:testing compiler:c++11-lang shebangfix
+
+USE_GITHUB= yes
+GH_ACCOUNT= LLNL
+GH_TAGNAME= 2f66d9f
+GH_TUPLE= mfem:mfem:v4.4:mfem
+
+SHEBANG_FILES= elec/compileReaction.template
+
+CMAKE_TESTING_ON= ENABLE_TESTS
+
+PLIST_FILES= bin/cardioid \
+ bin/compileReaction \
+ bin/singleCell
+
+OPTIONS_DEFINE= MFEM OPENMP
+OPTIONS_SINGLE= MFEM MPI
+OPTIONS_SINGLE_MPI= NOMPI MPICH OPENMPI
+OPTIONS_DEFAULT= MPICH OPENMP
+OPTIONS_SUB= yes
+
+MFEM_DESC= Build with MFEM mesh library
+MFEM_CMAKE_ON= -DMFEM_DIR=${WRKSRC_mfem}
+MFEM_BROKEN= see https://github.com/LLNL/cardioid/issues/15
+
+NOMPI_DESC= Build without parallel processing support
+NOMPI_BROKEN= https://github.com/LLNL/axom/issues/913
+
+MPICH_USES= mpi:mpich
+MPICH_CMAKE_ON= -DENABLE_MPI=ON
+
+OPENMPI_USES= mpi:openmpi
+OPENMPI_CMAKE_ON= -DENABLE_MPI=ON
+
+OPENMP_CMAKE_BOOL= ENABLE_OPENMP
+OPENMP_BROKEN_OFF= https://github.com/LLNL/cardioid/issues/14
+
+.include <bsd.port.mk>
diff --git a/science/cardioid/distinfo b/science/cardioid/distinfo
new file mode 100644
index 000000000000..e951f8b0b77c
--- /dev/null
+++ b/science/cardioid/distinfo
@@ -0,0 +1,5 @@
+TIMESTAMP = 1661371882
+SHA256 (LLNL-cardioid-g20211026-2f66d9f_GH0.tar.gz) = 16bfedb27110170adcf8f3090379a56c8e1637256e2761e85d98c9c043dcf970
+SIZE (LLNL-cardioid-g20211026-2f66d9f_GH0.tar.gz) = 6781832
+SHA256 (mfem-mfem-v4.4_GH0.tar.gz) = 0325a57854d9268dfe3f8d9b03836eb01b00a966d93162e6249857e9fab9c61f
+SIZE (mfem-mfem-v4.4_GH0.tar.gz) = 3078651
diff --git a/science/cardioid/files/patch-simUtil_src_ddcMalloc.c b/science/cardioid/files/patch-simUtil_src_ddcMalloc.c
new file mode 100644
index 000000000000..1fe7184b1200
--- /dev/null
+++ b/science/cardioid/files/patch-simUtil_src_ddcMalloc.c
@@ -0,0 +1,20 @@
+--- simUtil/src/ddcMalloc.c.orig 2022-08-24 19:49:58 UTC
++++ simUtil/src/ddcMalloc.c
+@@ -381,6 +381,8 @@ void printHeapInfo(FILE* file)
+ {
+ #ifdef __APPLE__
+ fprintf(file, "In routine printHeapInfo no mallinfo on OS X. Sorry.\n");
++#elif defined(__FreeBSD__)
++ fprintf(file, "In routine printHeapInfo no mallinfo on FreeBSD. Sorry.\n");
+ #else
+ struct mallinfo minfo;
+ minfo = mallinfo();
+@@ -397,6 +399,8 @@ void printHeapInfo_pio(PFILE* file)
+ {
+ #ifdef __APPLE__
+ Pprintf(file, "No mallinfo on OS X. Sorry.\n");
++#elif defined(__FreeBSD__)
++ Pprintf(file, "No mallinfo on FreeBSD. Sorry.\n");
+ #else
+ struct mallinfo minfo;
+ minfo = mallinfo();
diff --git a/science/cardioid/files/patch-simUtil_src_utilities.c b/science/cardioid/files/patch-simUtil_src_utilities.c
new file mode 100644
index 000000000000..7f058e25dbce
--- /dev/null
+++ b/science/cardioid/files/patch-simUtil_src_utilities.c
@@ -0,0 +1,22 @@
+--- simUtil/src/utilities.c.orig 2022-08-24 19:51:03 UTC
++++ simUtil/src/utilities.c
+@@ -72,6 +72,10 @@ void mem_debug(char *mem_str)
+ static int flag =1;
+ if (flag) printf("No mallinfo on OS X. Sorry no minfo for <%s>.\n",mem_str);
+ flag =0;
++#elif defined(__FreeBSD__)
++ static int flag =1;
++ if (flag) printf("No mallinfo on FreeBSD. Sorry no minfo for <%s>.\n",mem_str);
++ flag =0;
+ #else
+ static struct mallinfo old_minfo, minfo;
+ static int gstep = 0;
+@@ -98,7 +102,7 @@ void mem_debug(char *mem_str)
+ */
+ void CHKMEM(char *string)
+ {
+-#ifndef __APPLE__
++#if !defined(__APPLE__) && !defined(__FreeBSD__)
+ #include <sys/resource.h>
+ static struct mallinfo minfo, minfosave;
+ minfosave = minfo;
diff --git a/science/cardioid/pkg-descr b/science/cardioid/pkg-descr
new file mode 100644
index 000000000000..d8361d2e9d39
--- /dev/null
+++ b/science/cardioid/pkg-descr
@@ -0,0 +1,6 @@
+Cardioid is a cardiac multiscale simulation suite spanning from subcellular
+mechanisms up to simulations of organ-level clinical phenomena. The suite
+contains tools for simulating cardiac electrophysiology, cardiac mechanics,
+torso-ECGs, cardiac meshing and fiber generation tools.
+
+WWW: https://github.com/LLNL/cardioid