diff options
author | Yuri Victorovich <yuri@FreeBSD.org> | 2018-04-01 18:49:19 +0000 |
---|---|---|
committer | Yuri Victorovich <yuri@FreeBSD.org> | 2018-04-01 18:49:19 +0000 |
commit | 1523527acdee7a36786b45b7f7cf0311acf09e7b (patch) | |
tree | 415796f7bed847004d1dbdebc9a535dc0844a990 | |
parent | d86e8c1e362f96da999e4012e8a4ff26c1031cf2 (diff) | |
download | ports-1523527acdee7a36786b45b7f7cf0311acf09e7b.tar.gz ports-1523527acdee7a36786b45b7f7cf0311acf09e7b.zip |
New port: math/py-pynleq2: Python binding for NLEQ2 algorithm's fortran implementation
Notes
Notes:
svn path=/head/; revision=466175
-rw-r--r-- | math/Makefile | 1 | ||||
-rw-r--r-- | math/py-pynleq2/Makefile | 37 | ||||
-rw-r--r-- | math/py-pynleq2/distinfo | 5 | ||||
-rw-r--r-- | math/py-pynleq2/files/patch-setup.py | 27 | ||||
-rw-r--r-- | math/py-pynleq2/pkg-descr | 7 |
5 files changed, 77 insertions, 0 deletions
diff --git a/math/Makefile b/math/Makefile index 4062a40eb2cd..8caf47cd3860 100644 --- a/math/Makefile +++ b/math/Makefile @@ -675,6 +675,7 @@ SUBDIR += py-pymc SUBDIR += py-pymc3 SUBDIR += py-pyneqsys + SUBDIR += py-pynleq2 SUBDIR += py-pyodesys SUBDIR += py-pysparse SUBDIR += py-pysym diff --git a/math/py-pynleq2/Makefile b/math/py-pynleq2/Makefile new file mode 100644 index 000000000000..fb366ecc734a --- /dev/null +++ b/math/py-pynleq2/Makefile @@ -0,0 +1,37 @@ +# $FreeBSD$ + +PORTNAME= pynleq2 +DISTVERSION= 0.0.2 +CATEGORIES= math python +MASTER_SITES= CHEESESHOP \ + https://github.com/PySCeS/pysces/archive/:fortran +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} +DISTFILES= ${PORTNAME}-${DISTVERSION}${EXTRACT_SUFX} \ + ${PYSCES_VERSION}${EXTRACT_SUFX}:fortran + +MAINTAINER= yuri@FreeBSD.org +COMMENT= Python binding for NLEQ2 algorithm's fortran implementation + +LICENSE= BSD2CLAUSE +LICENSE_FILE= ${WRKSRC}/LICENSE + +BUILD_DEPENDS= ${PYNUMPY} + +USES= fortran:flang python +USE_PYTHON= distutils autoplist + +BINARY_ALIAS= gfortran6=flang # it keeps using gfortran6 regardless of the environment variables and arguments + +PYSCES_VERSION= 0.9.5 +FORTRAN_FILES= linalg_nleq2.f nleq2.f wnorm.f zibconst.f zibmon.f zibsec.f + +pre-build: # compile fortran files into a static library because distutils fails while doing this + @${MKDIR} ${WRKDIR}/.fbuild && \ + cd ${WRKDIR}/.fbuild && \ + flang -c ${CFLAGS} -fPIC ${FORTRAN_FILES:C/^/${WRKDIR}\/pysces-${PYSCES_VERSION}\/pysces\/nleq2\//} && \ + ${AR} -qc libff.a ${FORTRAN_FILES:S/.f/.o/} + +post-install: + @${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/${PORTNAME}/nleq2.so + +.include <bsd.port.mk> diff --git a/math/py-pynleq2/distinfo b/math/py-pynleq2/distinfo new file mode 100644 index 000000000000..3d2edac876ef --- /dev/null +++ b/math/py-pynleq2/distinfo @@ -0,0 +1,5 @@ +TIMESTAMP = 1522600966 +SHA256 (pynleq2-0.0.2.tar.gz) = b9be75bb7def34cd7a82aed87b70f6c3c9f4602cbe9e8d4fcf43a4aae241112d +SIZE (pynleq2-0.0.2.tar.gz) = 6219 +SHA256 (0.9.5.tar.gz) = 14131578b36154593ee5e793b3886572746209dcc3d9ed5ef3787a3476876cf6 +SIZE (0.9.5.tar.gz) = 2119094 diff --git a/math/py-pynleq2/files/patch-setup.py b/math/py-pynleq2/files/patch-setup.py new file mode 100644 index 000000000000..036483b8c3fe --- /dev/null +++ b/math/py-pynleq2/files/patch-setup.py @@ -0,0 +1,27 @@ +--- setup.py.orig 2015-10-20 14:54:08 UTC ++++ setup.py +@@ -75,19 +75,21 @@ if len(sys.argv) > 1 and '--help' not in + + for src, md5sum in zip(sources, md5sums): + srcpath = os.path.join('nleq2', src) +- if not os.path.exists(srcpath): ++ if False and not os.path.exists(srcpath): + NLEQ2_URL = os.environ.get('PYNLEQ2_NLEQ2_ROOT_URL', None) + if NLEQ2_URL: + download(NLEQ2_URL+src, srcpath) + else: + fmtstr = "Could not find: %s ($PYNLEQ2_NLEQ2_ROOT_URL not set)" + raise ValueError(fmtstr % src) +- if md5_of_file(srcpath).hexdigest() != md5sum: ++ if False and md5_of_file(srcpath).hexdigest() != md5sum: + raise ValueError("Mismatching MD5 sum for %s" % srcpath) + + ext_modules = [ + Extension('pynleq2.nleq2', [os.path.join('nleq2', f) +- for f in ('nleq2.pyf',) + sources]) ++ for f in ('nleq2.pyf',)] ++ , libraries=['ff', 'flang', 'execinfo'] ++ , library_dirs=['../.fbuild', '/usr/local/flang/lib']) + ] + + PYNLEQ2_RELEASE_VERSION = os.environ.get('PYNLEQ2_RELEASE_VERSION', '') diff --git a/math/py-pynleq2/pkg-descr b/math/py-pynleq2/pkg-descr new file mode 100644 index 000000000000..a6c81068c5ff --- /dev/null +++ b/math/py-pynleq2/pkg-descr @@ -0,0 +1,7 @@ +pynleq2 provides a Python binding to the NLEQ2 algorithm from CodeLib +distributed by Zuse Institute Berlin (ZIB). + +pynleq2 can be used as a backend for pyneqsys (math/py-pyneqsys) +to solve non-linear symbolic equation systems. + +WWW: https://github.com/bjodah/pynleq2 |