aboutsummaryrefslogtreecommitdiffstats
path: root/science
diff options
context:
space:
mode:
authoryuri <yuri@FreeBSD.org>2018-09-22 04:33:16 +0800
committeryuri <yuri@FreeBSD.org>2018-09-22 04:33:16 +0800
commit65ee3b59655c7f1e9a69e02fdc9ca987835cfd0f (patch)
treeb7b24cfed2b6116945682a4b861058986c9f8a9a /science
parentd0bf8492eccf70841784190ea4eae71eb0850ade (diff)
downloadfreebsd-ports-gnome-65ee3b59655c7f1e9a69e02fdc9ca987835cfd0f.tar.gz
freebsd-ports-gnome-65ee3b59655c7f1e9a69e02fdc9ca987835cfd0f.tar.zst
freebsd-ports-gnome-65ee3b59655c7f1e9a69e02fdc9ca987835cfd0f.zip
science/py-PyFR: Fix the OpenMP computation mode by adding -I and -L flags to the compiler command.
Also fix license.
Diffstat (limited to 'science')
-rw-r--r--science/py-PyFR/Makefile14
-rw-r--r--science/py-PyFR/files/patch-pyfr_backends_openmp_compiler.py11
2 files changed, 20 insertions, 5 deletions
diff --git a/science/py-PyFR/Makefile b/science/py-PyFR/Makefile
index 466603d42492..9bfbb2bfabb5 100644
--- a/science/py-PyFR/Makefile
+++ b/science/py-PyFR/Makefile
@@ -2,6 +2,7 @@
PORTNAME= PyFR
DISTVERSION= 1.7.6
+PORTREVISION= 1
CATEGORIES= science python
MASTER_SITES= http://www.pyfr.org/download/
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
@@ -10,7 +11,7 @@ MAINTAINER= yuri@FreeBSD.org
COMMENT= Framework for solving advection-diffusion type problems
LICENSE= BSD3CLAUSE
-xLICENSE_FILE= ${WRKSRC}/LICENSE
+LICENSE_FILE= ${WRKSRC}/LICENSE
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}appdirs>=1.4.0:devel/py-appdirs@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}gimmik>=2.0:math/py-gimmik@${PY_FLAVOR} \
@@ -26,14 +27,17 @@ SHEBANG_FILES= setup.py pyfr/__main__.py
USE_PYTHON= distutils concurrent autoplist
NO_ARCH= yes
-OPTIONS_MULTI= MP
-OPTIONS_MULTI_MP= OPENCL OPENMP # CUDA isn't supported on FreeBSD
-OPTIONS_DEFAULT= ${OPTIONS_MULTI_MP}
-MP_DESC= Parallelization backend to install
+OPTIONS_MULTI= PARALLEL
+OPTIONS_MULTI_PARALLEL= OPENCL OPENMP # CUDA isn't supported on FreeBSD
+OPTIONS_DEFAULT= ${OPTIONS_MULTI_PARALLEL}
+PARALLEL_DESC= Parallelization backend to install
OPENCL_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pyopencl>0:devel/py-pyopencl@${PY_FLAVOR}
OPENMP_RUN_DEPENDS= openmp>0:devel/openmp
+pre-build: # patch in pre-build to make the patch less error-prone (it has %%LOCALBASE%%)
+ @${REINPLACE_CMD} 's|%%LOCALBASE%%|${LOCALBASE}|' ${WRKSRC}/pyfr/backends/openmp/compiler.py
+
post-install: # workaround: https://groups.google.com/forum/#!topic/pyfrmailinglist/RNi_LcizGBo
@${RM} ${STAGEDIR}${PREFIX}/__main__.py
@${REINPLACE_CMD} 's|^${PREFIX}/__main__\.py||' ${_PYTHONPKGLIST}
diff --git a/science/py-PyFR/files/patch-pyfr_backends_openmp_compiler.py b/science/py-PyFR/files/patch-pyfr_backends_openmp_compiler.py
new file mode 100644
index 000000000000..f77a4b146f77
--- /dev/null
+++ b/science/py-PyFR/files/patch-pyfr_backends_openmp_compiler.py
@@ -0,0 +1,11 @@
+--- pyfr/backends/openmp/compiler.py.orig 2018-03-19 21:34:24 UTC
++++ pyfr/backends/openmp/compiler.py
+@@ -76,6 +76,8 @@ class SourceModule(object):
+ '-Ofast', # Optimise, incl. -ffast-math
+ '-march=native', # Use CPU-specific instructions
+ '-fopenmp', # Enable OpenMP support
++ '-I%%LOCALBASE%%/include', # Add the include directory
++ '-L%%LOCALBASE%%/lib', # Add the library directory
+ '-fPIC', # Generate position-independent code
+ '-o', libname, srcname, # Library and source file names
+ '-lm' # Link against libm