git: 39e3b28f5a6d - main - math/octave-forge-mpi: New port.

From: Stephen Montgomery-Smith <stephen_at_FreeBSD.org>
Date: Tue, 08 Nov 2022 05:32:58 UTC
The branch main has been updated by stephen:

URL: https://cgit.FreeBSD.org/ports/commit/?id=39e3b28f5a6da9aa8c39143b003471136eeb2488

commit 39e3b28f5a6da9aa8c39143b003471136eeb2488
Author:     Stephen Montgomery-Smith <stephen@FreeBSD.org>
AuthorDate: 2022-11-08 05:31:59 +0000
Commit:     Stephen Montgomery-Smith <stephen@FreeBSD.org>
CommitDate: 2022-11-08 05:31:59 +0000

    math/octave-forge-mpi: New port.
    
    Octave bindings for basic Message Passing Interface (MPI) functions for
    parallel computing.
---
 math/Makefile                                  |  1 +
 math/octave-forge-mpi/Makefile                 | 34 ++++++++++++++++++++++++++
 math/octave-forge-mpi/distinfo                 |  3 +++
 math/octave-forge-mpi/files/patch-MPI__Recv.cc | 18 ++++++++++++++
 math/octave-forge-mpi/files/patch-MPI__Send.cc | 13 ++++++++++
 math/octave-forge-mpi/files/patch-Makefile     | 12 +++++++++
 math/octave-forge-mpi/pkg-descr                |  9 +++++++
 7 files changed, 90 insertions(+)

diff --git a/math/Makefile b/math/Makefile
index e3dd42b1f730..f6f710b4489b 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -580,6 +580,7 @@
     SUBDIR += octave-forge-mechanics
     SUBDIR += octave-forge-miscellaneous
     SUBDIR += octave-forge-missing-functions
+    SUBDIR += octave-forge-mpi
     SUBDIR += octave-forge-mqtt
     SUBDIR += octave-forge-msh
     SUBDIR += octave-forge-multicore
diff --git a/math/octave-forge-mpi/Makefile b/math/octave-forge-mpi/Makefile
new file mode 100644
index 000000000000..c7ab74bb46ad
--- /dev/null
+++ b/math/octave-forge-mpi/Makefile
@@ -0,0 +1,34 @@
+PORTNAME=	octave-forge-mpi
+DISTVERSIONPREFIX=	v
+DISTVERSION=	3.1.0
+CATEGORIES=	math
+
+MAINTAINER=	stephen@FreeBSD.org
+COMMENT=	Octave-forge package ${OCTAVE_PKGNAME}
+WWW=		https://packages.octave.org/
+
+LICENSE=	GPLv3
+LICENSE_FILE=	${WRKDIR}/${OCTSRC}/COPYING
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	carlodefalco
+GH_PROJECT=	octave-mpi
+
+LIB_DEPENDS+=	libmpi.so:net/mpich
+
+# OCTSRC is the name of the directory of the package.
+# It is usually ${OCTAVE_PKGNAME} or ${DISTNAME}.
+OCTSRC=		${GH_PROJECT}-${DISTVERSION}
+
+WRKSRC=		${WRKDIR}/${OCTSRC}/src
+
+.include "${.CURDIR}/../../Mk/bsd.octave.mk"
+
+post-patch:
+	${REINPLACE_CMD} 's/= NULL/= 0/g' ${WRKSRC}/*.cc ${WRKSRC}/*.h
+
+post-build:
+	${RM} ${WRKSRC}/Makefile ${WRKSRC}/configure
+	cd ${WRKDIR} && ${TAR} cfz ${OCTAVE_DISTNAME}.tar.gz ${OCTSRC}
+
+.include <bsd.port.mk>
diff --git a/math/octave-forge-mpi/distinfo b/math/octave-forge-mpi/distinfo
new file mode 100644
index 000000000000..4dc8a37223ca
--- /dev/null
+++ b/math/octave-forge-mpi/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1667849003
+SHA256 (octave-forge/carlodefalco-octave-mpi-v3.1.0_GH0.tar.gz) = 9029ca699c1103f586d426baf634733d95615b69314fea0db8780bdd48fc91c0
+SIZE (octave-forge/carlodefalco-octave-mpi-v3.1.0_GH0.tar.gz) = 37392
diff --git a/math/octave-forge-mpi/files/patch-MPI__Recv.cc b/math/octave-forge-mpi/files/patch-MPI__Recv.cc
new file mode 100644
index 000000000000..5cac6ad9b424
--- /dev/null
+++ b/math/octave-forge-mpi/files/patch-MPI__Recv.cc
@@ -0,0 +1,18 @@
+--- MPI_Recv.cc.orig	2022-11-08 05:03:32 UTC
++++ MPI_Recv.cc
+@@ -20,13 +20,13 @@
+ 
+ #include <string>
+ #include <sstream>
++#include <iostream>
+ 
+ #include <oct-map.h>
+ #include <octave/load-save.h>
+ #include <octave/ls-oct-binary.h>
+ 
+-using namespace octave;
+-static const load_save_format frmt = load_save_system::BINARY;
++static const octave::load_save_format frmt = octave::load_save_system::BINARY;
+ static octave::mach_info::float_format flt_fmt = octave::mach_info::native_float_format ();
+ static bool swap = false;
+ static const std::ios::openmode imode = std::ios::in | std::ios::binary;
diff --git a/math/octave-forge-mpi/files/patch-MPI__Send.cc b/math/octave-forge-mpi/files/patch-MPI__Send.cc
new file mode 100644
index 000000000000..f8980deb5f6d
--- /dev/null
+++ b/math/octave-forge-mpi/files/patch-MPI__Send.cc
@@ -0,0 +1,13 @@
+--- MPI_Send.cc.orig	2022-11-08 05:02:05 UTC
++++ MPI_Send.cc
+@@ -24,9 +24,8 @@
+ #include <oct-map.h>
+ #include <octave/load-save.h>
+ #include <octave/ls-oct-binary.h>
+-using namespace octave;
+ 
+-static const load_save_format frmt = load_save_system::BINARY;
++static const octave::load_save_format frmt = octave::load_save_system::BINARY;
+ static const octave::mach_info::float_format flt_fmt = octave::mach_info::flt_fmt_unknown;
+ static const bool swap = false;
+ static const std::ios::openmode omode = std::ios::out | std::ios::binary;
diff --git a/math/octave-forge-mpi/files/patch-Makefile b/math/octave-forge-mpi/files/patch-Makefile
new file mode 100644
index 000000000000..3c0b0f293782
--- /dev/null
+++ b/math/octave-forge-mpi/files/patch-Makefile
@@ -0,0 +1,12 @@
+--- Makefile.orig	2019-03-06 23:19:54 UTC
++++ Makefile
+@@ -1,7 +1,7 @@
+ MPICC     ?= mpicxx
+-OFMPIINC  ?= $(shell $(MPICC) -showme:compile | sed -e "s/-pthread/ /g")
++OFMPIINC  ?= $(shell $(MPICC) -compile_info | sed -e "s/c++ //g")
+ MPIINC    := $(OFMPIINC)
+-OFMPILIBS ?= $(shell $(MPICC) -showme:link | sed -e "s/-pthread/ /g")
++OFMPILIBS ?= $(shell $(MPICC) -link_info | sed -e "s/c++ //g")
+ MPILIBS   := $(OFMPILIBS)
+ MKOCTFILE ?= mkoctfile
+ 
diff --git a/math/octave-forge-mpi/pkg-descr b/math/octave-forge-mpi/pkg-descr
new file mode 100644
index 000000000000..defffbed490d
--- /dev/null
+++ b/math/octave-forge-mpi/pkg-descr
@@ -0,0 +1,9 @@
+The octave-forge package is the result of The GNU Octave Repositry project,
+which is intended to be a central location for custom scripts, functions and
+extensions for GNU Octave. contains the source for all the functions plus
+build and install scripts.
+
+This is mpi.
+
+ Octave bindings for basic Message Passing Interface (MPI) functions for
+parallel computing.