Date: Sun, 9 Sep 2018 20:57:26 +0000 (UTC) From: Yuri Victorovich <yuri@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r479335 - in head/science: . lm lm/files Message-ID: <201809092057.w89KvQ43038342@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: yuri Date: Sun Sep 9 20:57:26 2018 New Revision: 479335 URL: https://svnweb.freebsd.org/changeset/ports/479335 Log: New port: science/lm: Software for sampling trajectories of the reaction-diffusion equations Added: head/science/lm/ head/science/lm/Makefile (contents, props changed) head/science/lm/distinfo (contents, props changed) head/science/lm/files/ head/science/lm/files/patch-Makefile (contents, props changed) head/science/lm/files/patch-src_c_lm_main_Main.cpp (contents, props changed) head/science/lm/files/patch-src_c_lm_main_runSimulation.cpp (contents, props changed) head/science/lm/files/patch-src_c_lm_rng_XORShift.cpp (contents, props changed) head/science/lm/files/patch-src_c_lm_thread_Thread.cpp (contents, props changed) head/science/lm/files/patch-src_swig_lm.i (contents, props changed) head/science/lm/pkg-descr (contents, props changed) head/science/lm/pkg-plist (contents, props changed) Modified: head/science/Makefile Modified: head/science/Makefile ============================================================================== --- head/science/Makefile Sun Sep 9 20:54:29 2018 (r479334) +++ head/science/Makefile Sun Sep 9 20:57:26 2018 (r479335) @@ -118,6 +118,7 @@ SUBDIR += libsvm-python SUBDIR += libxc SUBDIR += linsmith + SUBDIR += lm SUBDIR += madness SUBDIR += massxpert SUBDIR += mbdyn Added: head/science/lm/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/science/lm/Makefile Sun Sep 9 20:57:26 2018 (r479335) @@ -0,0 +1,79 @@ +# $FreeBSD$ + +PORTNAME= lm +DISTVERSION= 2.3.0 +DISTVERSIONSUFFIX= -src +CATEGORIES= science +MASTER_SITES= http://scs.illinois.edu/schulten/${PORTNAME}/download/${PORTNAME}${DISTVERSION:R:S/.//}/ +PKGNAMESUFFIX= -uiuc + +MAINTAINER= yuri@FreeBSD.org +COMMENT= Software for sampling trajectories of the reaction-diffusion equations + +LICENSE= UIUC_OPEN_SOURCE_LICENSE +LICENSE_NAME= University of Illinois Open Source License +LICENSE_FILE= ${WRKSRC}/LICENSE +LICENSE_PERMS= auto-accept dist-mirror dist-sell pkg-mirror pkg-sell + +BUILD_DEPENDS= swig3.0:devel/swig30 +LIB_DEPENDS= libhdf5.so:science/hdf5 \ + libprotobuf.so:devel/protobuf \ + libsz.so:science/szip + +USES= gettext-runtime gmake localbase python + +WRKSRC= ${WRKDIR}/${PORTNAME}-${DISTVERSION} +CXXFLAGS+= -DLINUX +MAKE_ENV= BUILD_DIR=${WRKSRC} PROTOBUF_DIR=${LOCALBASE} + +OPTIONS_DEFINE= MPI PYTHON VMD +OPTIONS_DEFAULT= MPI PYTHON # VMD can't be default because VMD requires manual tarball fetch +OPTIONS_SUB= yes + +MPI_USES= fortran +MPI_VARS= XUSE_MPI=1 +MPI_VARS_OFF= XUSE_MPI=0 +MPI_LIB_DEPENDS= libmpich.so:net/mpich2 + +PYTHON_VARS= XUSE_PYTHON=1 +PYTHON_VARS_OFF= XUSE_PYTHON=0 +PYTHON_CXXFLAGS= -I${PYTHON_SITELIBDIR}/numpy/core/include +PYTHON_BUILD_DEPENDS= ${PYTHON_SITELIBDIR}/numpy/core/include/numpy/arrayobject.h:math/py-numpy@${PY_FLAVOR} + +VMD_DESC= Build the VMD plugin +VMD_VARS= XUSE_VMD=1 +VMD_VARS_OFF= XUSE_VMD=0 +VMD_VARS= VMD_ARCH=${ARCH:S/amd64/FREEBSDAMD64/:S/${ARCH}/FREEBSD/} +VMD_BUILD_DEPENDS= ${LOCALBASE}/vmd/plugins/${VMD_ARCH}/molfile/libmolfile_plugin.h:science/vmd +VMD_PLIST_SUB= VMD_ARCH=${VMD_ARCH} + +post-patch: + @${CP} ${WRKSRC}/docs/config/local.mk.linux ${WRKSRC}/local.mk + @${REINPLACE_CMD} -i '' ' \ + s|USE_MPI := 0|USE_MPI := ${XUSE_MPI}|; \ + s|USE_PYTHON := 1|USE_PYTHON := ${XUSE_PYTHON}|; \ + s|USE_VMD := 1|USE_VMD := ${XUSE_VMD}|; \ + s|USE_CUDA := 1|USE_CUDA := 0|; \ + s|swig|swig3.0|; \ + s|/usr/local|${LOCALBASE}|; \ + s|INSTALL_PREFIX := /opt/lm|INSTALL_PREFIX := ${STAGEDIR}${PREFIX}|; \ + s|BUILD_DIR := Build-linux|BUILD_DIR := Build-freebsd|; \ + s|CCFLAGS := -m64 -O2|CCFLAGS := $$(CXXFLAGS)|; \ + s|gcc|${CC}|; \ + s|g++|${CXX}|; \ + s| -lrt||' \ + ${WRKSRC}/local.mk + +post-patch-MPI-on: + @${REINPLACE_CMD} -i '' ' \ + s|MPI_COMPILE_FLAGS = .*|MPI_COMPILE_FLAGS =|; \ + s|MPI_LINK_FLAGS = .*|MPI_LINK_FLAGS = -lmpich ${LOCALBASE}/lib/gcc${GCC_DEFAULT}/libgcc_s.so|' \ + ${WRKSRC}/local.mk + +post-patch-PYTHON-on: + @${REINPLACE_CMD} -i '' 's|python-config|${PYTHON_CMD}-config|' ${WRKSRC}/local.mk + +post-patch-VMD-on: + @${REINPLACE_CMD} -i '' 's|LINUXAMD64|${VMD_ARCH}|' ${WRKSRC}/local.mk + +.include <bsd.port.mk> Added: head/science/lm/distinfo ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/science/lm/distinfo Sun Sep 9 20:57:26 2018 (r479335) @@ -0,0 +1,3 @@ +TIMESTAMP = 1536517852 +SHA256 (lm-2.3.0-src.tar.gz) = c1a7908997e46c6590e179a4a269cbaddaab8533c7b9b3c9ff2297f5fd6dbe0c +SIZE (lm-2.3.0-src.tar.gz) = 7657245 Added: head/science/lm/files/patch-Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/science/lm/files/patch-Makefile Sun Sep 9 20:57:26 2018 (r479335) @@ -0,0 +1,29 @@ +--- Makefile.orig 2016-12-06 05:23:11 UTC ++++ Makefile +@@ -282,21 +282,23 @@ installlm: + install -d $(INSTALL_PREFIX)/bin + install -m 0755 $(MAIN) $(UTIL_BINS) $(INSTALL_PREFIX)/bin + @echo 'Installing LM libraries' ++ifeq ($(USE_PYTHON),1) + install -d $(INSTALL_PREFIX)/lib/lm + install -m 0644 $(INSTALL_LIBS) $(INSTALL_PREFIX)/lib/lm + install -d $(INSTALL_PREFIX)/lib/python/pySTDLM + install -d $(INSTALL_PREFIX)/lib/python/pyLM + install -m 0644 ./src/python/pyLM/* $(INSTALL_PREFIX)/lib/python/pyLM + install -m 0644 ./src/python/pySTDLM/* $(INSTALL_PREFIX)/lib/python/pySTDLM ++endif + ifeq ($(USE_MPI),1) +- install -m 0755 lm-mpmpd $(INSTALL_PREFIX)/bin ++ install -m 0755 ./$(BUILD_DIR)/lm-mpmpd $(INSTALL_PREFIX)/bin + endif + + + installvmd: + @echo 'Installing VMD plugin' +- install -d $(VMD_INSTALL_DIR) +- install -m 0644 $(VMD_PLUGIN) $(VMD_INSTALL_DIR) ++ install -d $(DESTDIR)$(VMD_INSTALL_DIR) ++ install -m 0644 $(VMD_PLUGIN) $(DESTDIR)$(VMD_INSTALL_DIR) + + # Build a distribution package. + dist: Added: head/science/lm/files/patch-src_c_lm_main_Main.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/science/lm/files/patch-src_c_lm_main_Main.cpp Sun Sep 9 20:57:26 2018 (r479335) @@ -0,0 +1,24 @@ +--- src/c/lm/main/Main.cpp.orig 2018-09-09 19:24:07 UTC ++++ src/c/lm/main/Main.cpp +@@ -49,6 +49,9 @@ + #include <sys/stat.h> + #if defined(MACOSX) + #include <sys/sysctl.h> ++#elif defined(__FreeBSD__) ++#include <sys/types.h> ++#include <sys/sysctl.h> + #elif defined(LINUX) + #include <sys/sysinfo.h> + #endif +@@ -110,6 +113,11 @@ int getPhysicalCpuCores() + size_t physicalCpuCoresSize=sizeof(physicalCpuCores); + sysctlbyname("hw.activecpu",&physicalCpuCores,&physicalCpuCoresSize,NULL,0); + return physicalCpuCores; ++ #elif defined(__FreeBSD__) ++ int np = 0; ++ size_t len = sizeof(np); ++ sysctlbyname("hw.ncpu",&np,&len,NULL,0); ++ return np; + #elif defined(LINUX) + #ifdef ARM + return get_nprocs_conf(); Added: head/science/lm/files/patch-src_c_lm_main_runSimulation.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/science/lm/files/patch-src_c_lm_main_runSimulation.cpp Sun Sep 9 20:57:26 2018 (r479335) @@ -0,0 +1,22 @@ +--- src/c/lm/main/runSimulation.cpp.orig 2018-09-09 19:31:22 UTC ++++ src/c/lm/main/runSimulation.cpp +@@ -45,6 +45,9 @@ + */ + #if defined(MACOSX) + #include <sys/sysctl.h> ++#elif defined(__FreeBSD__) ++#include <sys/types.h> ++#include <sys/sysctl.h> + #elif defined(LINUX) + #include <sys/sysinfo.h> + #endif +@@ -149,6 +152,9 @@ void runSolver(char *simulationFilename, + size_t physicalCpuCoresSize=sizeof(physicalCpuCores); + sysctlbyname("hw.activecpu",&physicalCpuCores,&physicalCpuCoresSize,NULL,0); + numberCpuCores = physicalCpuCores; ++#elif defined(__FreeBSD__) ++ size_t len = sizeof(numberCpuCores); ++ sysctlbyname("hw.ncpu",&numberCpuCores,&len,NULL,0); + #elif defined(LINUX) + #ifdef ARM + numberCpuCores = get_nprocs_conf(); Added: head/science/lm/files/patch-src_c_lm_rng_XORShift.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/science/lm/files/patch-src_c_lm_rng_XORShift.cpp Sun Sep 9 20:57:26 2018 (r479335) @@ -0,0 +1,14 @@ +--- src/c/lm/rng/XORShift.cpp.orig 2018-09-09 20:03:05 UTC ++++ src/c/lm/rng/XORShift.cpp +@@ -42,6 +42,11 @@ + #include "lm/rng/RandomGenerator.h" + #include "lm/rng/XORShift.h" + ++// sincos doesn't exist on all current (2018-08) FreeBSD versions ++#if defined(__FreeBSD__) ++# define sincos(x,s,c) *s = sin(x); *c = cos(x); ++#endif ++ + namespace lm { + namespace rng { + Added: head/science/lm/files/patch-src_c_lm_thread_Thread.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/science/lm/files/patch-src_c_lm_thread_Thread.cpp Sun Sep 9 20:57:26 2018 (r479335) @@ -0,0 +1,36 @@ +--- src/c/lm/thread/Thread.cpp.orig 2018-09-09 19:28:35 UTC ++++ src/c/lm/thread/Thread.cpp +@@ -40,6 +40,7 @@ + #include <pthread.h> + #include "lm/Print.h" + #include "lm/thread/Thread.h" ++#include <pthread_np.h> + + namespace lm { + namespace thread { +@@ -72,10 +73,10 @@ void Thread::setAffinity(int cpuNumber) + if (running) + { + #if defined(LINUX) && !defined(ARM) +- cpu_set_t cpuset; ++ cpuset_t cpuset; + CPU_ZERO(&cpuset); + CPU_SET(cpuNumber, &cpuset); +- if (pthread_setaffinity_np(threadId, sizeof(cpu_set_t), &cpuset) != 0) ++ if (pthread_setaffinity_np(threadId, sizeof(cpuset_t), &cpuset) != 0) + Print::printf(Print::WARNING, "Could not bind thread %u to CPU core %d", threadId, cpuNumber); + #endif + } +@@ -100,10 +101,10 @@ void Thread::start() throw(PthreadExcept + if (cpuNumber >= 0) + { + #if defined(LINUX) && !defined(ARM) +- cpu_set_t cpuset; ++ cpuset_t cpuset; + CPU_ZERO(&cpuset); + CPU_SET(cpuNumber, &cpuset); +- if (pthread_setaffinity_np(threadId, sizeof(cpu_set_t), &cpuset) != 0) ++ if (pthread_setaffinity_np(threadId, sizeof(cpuset_t), &cpuset) != 0) + Print::printf(Print::WARNING, "Could not bind thread %u to CPU core %d", threadId, cpuNumber); + #endif + } Added: head/science/lm/files/patch-src_swig_lm.i ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/science/lm/files/patch-src_swig_lm.i Sun Sep 9 20:57:26 2018 (r479335) @@ -0,0 +1,11 @@ +--- src/swig/lm.i.orig 2018-09-09 20:47:46 UTC ++++ src/swig/lm.i +@@ -66,7 +66,7 @@ using lm::rdme::InvalidParticleException + %} + + %inline %{ +-typedef long time_t; ++//typedef long time_t; + typedef unsigned char uchar; + typedef unsigned int uint; + typedef unsigned long ulong; Added: head/science/lm/pkg-descr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/science/lm/pkg-descr Sun Sep 9 20:57:26 2018 (r479335) @@ -0,0 +1,9 @@ +Lattice Microbes is a software package for efficiently sampling trajectories +from the chemical and reaction-diffusion master equations (CME/RDME) on high +performance computing (HPC) infrastructure using both exact and approximate +methods. pyLM is a problem solving environment written in Python that leverages +the high-performance nature of the Lattice Microbes package while providing ease +of use for common stochastic simulations and high customizability for complex +biological applications. + +WWW: http://www.scs.illinois.edu/schulten/lm/ Added: head/science/lm/pkg-plist ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/science/lm/pkg-plist Sun Sep 9 20:57:26 2018 (r479335) @@ -0,0 +1,26 @@ +bin/lm +%%MPI%%bin/lm-mpmpd +%%PYTHON%%bin/lm_python +bin/lm_setdm +bin/lm_setp +bin/lm_setrm +%%PYTHON%%lib/lm/_lm.so +%%PYTHON%%lib/lm/lm.py +%%PYTHON%%lib/python/pyLM/CME.py +%%PYTHON%%lib/python/pyLM/LMLogger.py +%%PYTHON%%lib/python/pyLM/RDME.py +%%PYTHON%%lib/python/pyLM/__init__.py +%%PYTHON%%lib/python/pyLM/ipyInterface.py +%%PYTHON%%lib/python/pyLM/units.py +%%PYTHON%%lib/python/pySTDLM/CellArranger.py +%%PYTHON%%lib/python/pySTDLM/Cells.py +%%PYTHON%%lib/python/pySTDLM/Distributions.py +%%PYTHON%%lib/python/pySTDLM/NetworkVisualization.py +%%PYTHON%%lib/python/pySTDLM/OnTheFly.py +%%PYTHON%%lib/python/pySTDLM/PostProcessing.py +%%PYTHON%%lib/python/pySTDLM/SBMLReader.py +%%PYTHON%%lib/python/pySTDLM/StandardCells.py +%%PYTHON%%lib/python/pySTDLM/StandardReactionSystems.py +%%PYTHON%%lib/python/pySTDLM/StandardReactions.py +%%PYTHON%%lib/python/pySTDLM/__init__.py +%%VMD%%lib/vmd/plugins/%%VMD_ARCH%%/molfile/lmplugin.so
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201809092057.w89KvQ43038342>