I've just packaged this on sparc64. Parmap.get_default_ncores returns the expected result. If you used devel/coccinelle on, say, armv7 or sparc64, you might be interested.
Comments / ok? Index: Makefile =================================================================== RCS file: /cvs/ports/devel/ocaml-parmap/Makefile,v retrieving revision 1.1.1.1 diff -u -p -r1.1.1.1 Makefile --- Makefile 13 Sep 2015 15:20:19 -0000 1.1.1.1 +++ Makefile 14 Sep 2015 19:20:26 -0000 @@ -1,12 +1,10 @@ # $OpenBSD: Makefile,v 1.1.1.1 2015/09/13 15:20:19 sthen Exp $ -SHARED_ONLY = Yes -ONLY_FOR_ARCHS = ${OCAML_NATIVE_ARCHS} - COMMENT = OCaml parallel map primitive for multicores CATEGORIES = devel V = 1.0-rc6 +REVISION = 0 NAME = ocaml-parmap DISTNAME = ocaml-parmap-$V DISTFILES = ${DISTNAME}{$V}.tar.gz @@ -24,6 +22,18 @@ BUILD_DEPENDS = sysutils/findlib USE_GMAKE = Yes CONFIGURE_STYLE = gnu + +.include <bsd.port.arch.mk> + +.if !${PROPERTIES:Mocaml_native} +CONFIGURE_ENV+= OCAMLOPT=no +.endif + +.if !${PROPERTIES:Mocaml_native_dynlink} +MAKE_FLAGS+= DYNLINK=no +.endif + +FAKE_FLAGS = DESTDIR=${WRKINST}${TRUEPREFIX} TEST_TARGET = tests TEST_DEPENDS = ${BASE_PKGPATH} Index: patches/patch-Makefile_in =================================================================== RCS file: patches/patch-Makefile_in diff -N patches/patch-Makefile_in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-Makefile_in 14 Sep 2015 19:20:26 -0000 @@ -0,0 +1,33 @@ +$OpenBSD$ +--- Makefile.in.orig Mon Feb 9 11:42:28 2015 ++++ Makefile.in Mon Sep 14 21:10:13 2015 +@@ -42,15 +42,18 @@ OBFLAGS = -j 10 -use-ocamlfind #-classic-display + + BYTELIBS = parmap.cma + OPTLIBS= +-CMXSLIBS= + ALIBS= ++DYNLINK= yes ++CMXSLIBS= + + ifeq ("@OCAMLBEST@","opt") + OPTLIBS += $(BYTELIBS:%.cma=%.cmxa) ++ ALIBS = $(BYTELIBS:%.cma=%.a) ++ifeq (${DYNLINK}, yes) + CMXSLIBS += $(BYTELIBS:%.cma=%.cmxs) + endif ++endif + +-ALIBS = $(BYTELIBS:%.cma=%.a) + + all: + $(OCAMLBUILD) $(OBFLAGS) $(BYTELIBS) $(OPTLIBS) $(CMXSLIBS) $(ALIBS) +@@ -86,7 +89,7 @@ install: $(LIBS) META + $(INSTALL) -patch-version $(VERSION) $(NAME) $(INSTALL_STUFF) + (cd _build; ocamldoc -man -man-mini parmap.ml parmap.mli) + test -d $(MANDIR) || mkdir -p $(MANDIR) +- cp -a _build/Parmap.3o $(MANDIR) ++ cp -p _build/Parmap.3o $(MANDIR) + + uninstall: + $(UNINSTALL) $(NAME) Index: patches/patch-configure =================================================================== RCS file: patches/patch-configure diff -N patches/patch-configure --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-configure 14 Sep 2015 19:20:26 -0000 @@ -0,0 +1,14 @@ +$OpenBSD$ +--- configure.orig Mon Sep 14 20:17:21 2015 ++++ configure Mon Sep 14 20:18:32 2015 +@@ -4379,8 +4379,8 @@ _ACEOF + ac_config_headers="$ac_config_headers config.h" + + +-t=`$OCAMLBUILD -use-ocamlfind &> /dev/null; echo $?` +-if test $t == 0 ; then ++t=`$OCAMLBUILD -use-ocamlfind >/dev/null 2>&1; echo $?` ++if test "$t" = 0 ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ocaml version $OCAMLVERSION. Use standard Makefile" >&5 + $as_echo "ocaml version $OCAMLVERSION. Use standard Makefile" >&6; } + ac_config_files="$ac_config_files Makefile" Index: pkg/PFRAG.dynlink-native =================================================================== RCS file: pkg/PFRAG.dynlink-native diff -N pkg/PFRAG.dynlink-native --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ pkg/PFRAG.dynlink-native 14 Sep 2015 19:20:26 -0000 @@ -0,0 +1,2 @@ +@comment $OpenBSD$ +@bin lib/ocaml/parmap/parmap.cmxs Index: pkg/PFRAG.native =================================================================== RCS file: pkg/PFRAG.native diff -N pkg/PFRAG.native --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ pkg/PFRAG.native 14 Sep 2015 19:20:26 -0000 @@ -0,0 +1,4 @@ +@comment $OpenBSD$ +%%dynlink%% +lib/ocaml/parmap/parmap.a +lib/ocaml/parmap/parmap.cmxa Index: pkg/PFRAG.shared =================================================================== RCS file: pkg/PFRAG.shared diff -N pkg/PFRAG.shared --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ pkg/PFRAG.shared 14 Sep 2015 19:20:26 -0000 @@ -0,0 +1,2 @@ +@comment $OpenBSD$ +lib/ocaml/stublibs/dllparmap_stubs.so Index: pkg/PLIST =================================================================== RCS file: /cvs/ports/devel/ocaml-parmap/pkg/PLIST,v retrieving revision 1.1.1.1 diff -u -p -r1.1.1.1 PLIST --- pkg/PLIST 13 Sep 2015 15:20:19 -0000 1.1.1.1 +++ pkg/PLIST 14 Sep 2015 19:20:26 -0000 @@ -1,20 +1,17 @@ -@comment $OpenBSD: PLIST,v 1.1.1.1 2015/09/13 15:20:19 sthen Exp $ +@comment $OpenBSD$ +%%SHARED%% +%%native%% lib/ocaml/parmap/ lib/ocaml/parmap/META lib/ocaml/parmap/bytearray.cmi lib/ocaml/parmap/bytearray.mli -lib/ocaml/parmap/bytearray_stubs.o -lib/ocaml/parmap/libparmap.a -lib/ocaml/parmap/parmap.a +lib/ocaml/parmap/libparmap_stubs.a lib/ocaml/parmap/parmap.cma lib/ocaml/parmap/parmap.cmi -lib/ocaml/parmap/parmap.cmxa -@bin lib/ocaml/parmap/parmap.cmxs lib/ocaml/parmap/parmap.mli lib/ocaml/parmap/parmap_utils.cmi lib/ocaml/parmap/parmap_utils.mli lib/ocaml/parmap/setcore.cmi lib/ocaml/parmap/setcore.mli -lib/ocaml/parmap/setcore_stubs.o -lib/ocaml/stublibs/dllparmap.so -lib/ocaml/stublibs/dllparmap.so.owner +@comment lib/ocaml/stublibs/dllparmap_stubs.so.owner +@man man/man3/Parmap.3o -- jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE