[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pkgsrc-changes
Subject:    CVS commit: pkgsrc/parallel
From:       "Nia Alarie" <nia () netbsd ! org>
Date:       2020-07-11 16:15:09
Message-ID: 20200711161509.46D44FB28 () cvs ! NetBSD ! org
[Download RAW message or body]

This is a multi-part message in MIME format.

--_----------=_15944841098810
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset="US-ASCII"

Module Name:	pkgsrc
Committed By:	nia
Date:		Sat Jul 11 16:15:09 UTC 2020

Modified Files:
	pkgsrc/parallel: Makefile
Added Files:
	pkgsrc/parallel/lua-lanes: DESCR Makefile PLIST distinfo
	pkgsrc/parallel/lua-lanes/patches: patch-src_Makefile
	    patch-src_threading.c patch-src_threading.h

Log Message:
parallel: Add lua-lanes

Lua Lanes is a Lua extension library providing the possibility to run multiple
Lua states in parallel. It is intended to be used for optimizing performance
on multicore CPUs and to study ways to make Lua programs naturally parallel
to begin with.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 pkgsrc/parallel/Makefile
cvs rdiff -u -r0 -r1.1 pkgsrc/parallel/lua-lanes/DESCR \
    pkgsrc/parallel/lua-lanes/Makefile pkgsrc/parallel/lua-lanes/PLIST \
    pkgsrc/parallel/lua-lanes/distinfo
cvs rdiff -u -r0 -r1.1 pkgsrc/parallel/lua-lanes/patches/patch-src_Makefile \
    pkgsrc/parallel/lua-lanes/patches/patch-src_threading.c \
    pkgsrc/parallel/lua-lanes/patches/patch-src_threading.h

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


--_----------=_15944841098810
Content-Disposition: inline
Content-Length: 7517
Content-Transfer-Encoding: binary
Content-Type: text/x-diff; charset=us-ascii

Modified files:

Index: pkgsrc/parallel/Makefile
diff -u pkgsrc/parallel/Makefile:1.27 pkgsrc/parallel/Makefile:1.28
--- pkgsrc/parallel/Makefile:1.27	Fri Aug  9 20:25:29 2019
+++ pkgsrc/parallel/Makefile	Sat Jul 11 16:15:08 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.27 2019/08/09 20:25:29 brook Exp $
+# $NetBSD: Makefile,v 1.28 2020/07/11 16:15:08 nia Exp $
 #
 
 COMMENT=	Applications dealing with parallelism in computing
@@ -11,6 +11,7 @@ SUBDIR+=	ganglia-monitor-core
 SUBDIR+=	gridscheduler
 SUBDIR+=	hwloc
 SUBDIR+=	linda
+SUBDIR+=	lua-lanes
 SUBDIR+=	mpi-ch
 SUBDIR+=	openmp
 SUBDIR+=	openmpi

Added files:

Index: pkgsrc/parallel/lua-lanes/DESCR
diff -u /dev/null pkgsrc/parallel/lua-lanes/DESCR:1.1
--- /dev/null	Sat Jul 11 16:15:09 2020
+++ pkgsrc/parallel/lua-lanes/DESCR	Sat Jul 11 16:15:08 2020
@@ -0,0 +1,4 @@
+Lua Lanes is a Lua extension library providing the possibility to run multiple
+Lua states in parallel. It is intended to be used for optimizing performance
+on multicore CPUs and to study ways to make Lua programs naturally parallel
+to begin with.
Index: pkgsrc/parallel/lua-lanes/Makefile
diff -u /dev/null pkgsrc/parallel/lua-lanes/Makefile:1.1
--- /dev/null	Sat Jul 11 16:15:09 2020
+++ pkgsrc/parallel/lua-lanes/Makefile	Sat Jul 11 16:15:08 2020
@@ -0,0 +1,40 @@
+# $NetBSD: Makefile,v 1.1 2020/07/11 16:15:08 nia Exp $
+
+DISTNAME=	lanes-3.13.0
+PKGNAME=	${LUA_PKGPREFIX}-${DISTNAME}
+CATEGORIES=	parallel lua
+MASTER_SITES=	${MASTER_SITE_GITHUB:=LuaLanes/}
+GITHUB_PROJECT=	lanes
+GITHUB_TAG=	v${PKGVERSION_NOREV}
+
+MAINTAINER=	pkgsrc-users@NetBSD.org
+HOMEPAGE=	https://lualanes.github.io/lanes/
+COMMENT=	Lightweight, native, lazy evaluating multithreading library for Lua
+LICENSE=	mit
+
+USE_TOOLS+=	gmake
+
+BUILD_DIRS+=	src
+
+MAKE_FLAGS+=	LIBFLAG="${LDFLAGS} -shared"
+
+INSTALLATION_DIRS+=	${LUA_DOCDIR}
+INSTALLATION_DIRS+=	${LUA_LDIR}
+INSTALLATION_DIRS+=	${LUA_CDIR}/lanes
+
+do-install:
+	${INSTALL_LIB} ${WRKSRC}/src/lanes/core.so \
+		${DESTDIR}${PREFIX}/${LUA_CDIR}/lanes/core.so
+	${INSTALL_DATA} ${WRKSRC}/src/lanes.lua \
+		${DESTDIR}${PREFIX}/${LUA_LDIR}/lanes.lua
+	${INSTALL_DATA} ${WRKSRC}/docs/*.html ${WRKSRC}/docs/*.png \
+		${DESTDIR}${PREFIX}/${LUA_DOCDIR}
+
+do-test:
+	cd ${WRKSRC}/tests && \
+		LUA_PATH="${WRKSRC}/src/?.lua;${WRKSRC}/tests/?.lua" \
+		LUA_CPATH="${WRKSRC}/src/?.so" \
+		${LUA_INTERPRETER} basic.lua
+
+.include "../../lang/lua/module.mk"
+.include "../../mk/bsd.pkg.mk"
Index: pkgsrc/parallel/lua-lanes/PLIST
diff -u /dev/null pkgsrc/parallel/lua-lanes/PLIST:1.1
--- /dev/null	Sat Jul 11 16:15:09 2020
+++ pkgsrc/parallel/lua-lanes/PLIST	Sat Jul 11 16:15:08 2020
@@ -0,0 +1,6 @@
+@comment $NetBSD: PLIST,v 1.1 2020/07/11 16:15:08 nia Exp $
+${LUA_CDIR}/lanes/core.so
+${LUA_DOCDIR}/comparison.html
+${LUA_DOCDIR}/index.html
+${LUA_DOCDIR}/multi.png
+${LUA_LDIR}/lanes.lua
Index: pkgsrc/parallel/lua-lanes/distinfo
diff -u /dev/null pkgsrc/parallel/lua-lanes/distinfo:1.1
--- /dev/null	Sat Jul 11 16:15:09 2020
+++ pkgsrc/parallel/lua-lanes/distinfo	Sat Jul 11 16:15:08 2020
@@ -0,0 +1,9 @@
+$NetBSD: distinfo,v 1.1 2020/07/11 16:15:08 nia Exp $
+
+SHA1 (lanes-3.13.0.tar.gz) = f9cda1fa99ea042c0645967a4bd573b0ae6762eb
+RMD160 (lanes-3.13.0.tar.gz) = dab59db4717e28e1a248860a9d2441e2bf7e83cc
+SHA512 (lanes-3.13.0.tar.gz) = \
bb509181757fa2b4f07a55962015b35ca6bb867b18ec89dd655f333babe2e12f56479fa85bc98e0dacf5bec2a523265bbc3a978396dc332dc1fdda4df760b2e5
 +Size (lanes-3.13.0.tar.gz) = 247978 bytes
+SHA1 (patch-src_Makefile) = a9f40a821f086574d5debc2ecd434eee1aa93b18
+SHA1 (patch-src_threading.c) = 2daf9d772fbbcd7a04cd41a0b10060c7a97d8b38
+SHA1 (patch-src_threading.h) = 036129d1c9c5e7bf7b6535caff07fbb15f65e23d

Index: pkgsrc/parallel/lua-lanes/patches/patch-src_Makefile
diff -u /dev/null pkgsrc/parallel/lua-lanes/patches/patch-src_Makefile:1.1
--- /dev/null	Sat Jul 11 16:15:09 2020
+++ pkgsrc/parallel/lua-lanes/patches/patch-src_Makefile	Sat Jul 11 16:15:09 2020
@@ -0,0 +1,19 @@
+$NetBSD: patch-src_Makefile,v 1.1 2020/07/11 16:15:09 nia Exp $
+
+Respect CC/CFLAGS.
+
+--- src/Makefile.orig	2018-11-30 12:28:50.000000000 +0000
++++ src/Makefile
+@@ -88,11 +88,10 @@ ifeq "$(LUAROCKS)" ""
+     # Some machines need 'MACOSX_DEPLOYMENT_TARGET=10.3' for using '-undefined \
dynamic_lookup' +     # (at least PowerPC running 10.4.11); does not harm the others
+     #
+-    CC = MACOSX_DEPLOYMENT_TARGET=10.3 gcc
+     LIBFLAG = -bundle -undefined dynamic_lookup
+   endif
+   
+-  CFLAGS=-Wall -Werror $(OPT_FLAGS) $(LUA_FLAGS)
++  CFLAGS+=-fPIC -Wall $(OPT_FLAGS) $(LUA_FLAGS)
+   LIBS=$(LUA_LIBS)
+ endif
+ 
Index: pkgsrc/parallel/lua-lanes/patches/patch-src_threading.c
diff -u /dev/null pkgsrc/parallel/lua-lanes/patches/patch-src_threading.c:1.1
--- /dev/null	Sat Jul 11 16:15:09 2020
+++ pkgsrc/parallel/lua-lanes/patches/patch-src_threading.c	Sat Jul 11 16:15:09 2020
@@ -0,0 +1,46 @@
+$NetBSD: patch-src_threading.c,v 1.1 2020/07/11 16:15:09 nia Exp $
+
+NetBSD support.
+
+--- src/threading.c.orig	2018-11-30 12:28:50.000000000 +0000
++++ src/threading.c
+@@ -886,9 +886,16 @@ void THREAD_SET_PRIORITY( int prio)
+ 
+ void THREAD_SET_AFFINITY( unsigned int aff)
+ {
+-	cpu_set_t cpuset;
+ 	int bit = 0;
++#ifdef __NetBSD__
++	cpuset_t *cpuset = cpuset_create();
++	if( cpuset == NULL)
++		_PT_FAIL( errno, "cpuset_create", __FILE__, __LINE__-2 );
++#define CPU_SET(b, s) cpuset_set(b, *(s))
++#else
++	cpu_set_t cpuset;
+ 	CPU_ZERO( &cpuset);
++#endif
+ 	while( aff != 0)
+ 	{
+ 		if( aff & 1)
+@@ -900,6 +907,9 @@ void THREAD_SET_AFFINITY( unsigned int a
+ 	}
+ #ifdef __ANDROID__
+ 	PT_CALL( sched_setaffinity( pthread_self(), sizeof(cpu_set_t), &cpuset));
++#elif defined(__NetBSD__)
++	PT_CALL( pthread_setaffinity_np( pthread_self(), cpuset_size(cpuset), cpuset));
++	cpuset_destroy( cpuset);
+ #else
+ 	PT_CALL( pthread_setaffinity_np( pthread_self(), sizeof(cpu_set_t), &cpuset));
+ #endif
+@@ -996,8 +1006,10 @@ bool_t THREAD_WAIT( THREAD_T *ref, doubl
+ 	{
+ 		// exact API to set the thread name is platform-dependant
+ 		// if you need to fix the build, or if you know how to fill a hole, tell me \
(bnt.germain@gmail.com) so that I can submit the fix in github. +-#if defined \
PLATFORM_BSD ++#if defined PLATFORM_BSD && !defined __NetBSD__
+ 		pthread_set_name_np( pthread_self(), _name);
++#elif defined PLATFORM_BSD && defined __NetBSD__
++		pthread_setname_np( pthread_self(), "%s", (void *)_name);
+ #elif defined PLATFORM_LINUX
+ 	#if LINUX_USE_PTHREAD_SETNAME_NP
+ 		pthread_setname_np( pthread_self(), _name);
Index: pkgsrc/parallel/lua-lanes/patches/patch-src_threading.h
diff -u /dev/null pkgsrc/parallel/lua-lanes/patches/patch-src_threading.h:1.1
--- /dev/null	Sat Jul 11 16:15:09 2020
+++ pkgsrc/parallel/lua-lanes/patches/patch-src_threading.h	Sat Jul 11 16:15:09 2020
@@ -0,0 +1,15 @@
+$NetBSD: patch-src_threading.h,v 1.1 2020/07/11 16:15:09 nia Exp $
+
+NetBSD support.
+
+--- src/threading.h.orig	2018-11-30 12:28:50.000000000 +0000
++++ src/threading.h
+@@ -143,7 +143,7 @@ enum e_status { PENDING, RUNNING, WAITIN
+   //
+   #if defined( PLATFORM_OSX)
+     #define YIELD() pthread_yield_np()
+-#elif defined( PLATFORM_WIN32) || defined( PLATFORM_POCKETPC) || \
defined(__ANDROID__) // no PTHREAD for PLATFORM_XBOX ++#elif defined( PLATFORM_WIN32) \
|| defined( PLATFORM_POCKETPC) || defined(__ANDROID__) || defined(__NetBSD__) // no \
PTHREAD for PLATFORM_XBOX +     // for some reason win32-pthread doesn't have \
pthread_yield(), but sched_yield() +     #define YIELD() sched_yield()
+   #else


--_----------=_15944841098810--


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic