From c3cb395a740a41a625b436a8a581700616b8cb99 Mon Sep 17 00:00:00 2001 From: Theofilos Manitaras Date: Fri, 15 Jun 2018 08:55:04 +0200 Subject: [PATCH 1/3] Fix paths for Boost Python check * Update python3 test from python3.5 to python3.6. * Use the PYTHONPATH environment variable to extract the python dir. --- cscs-checks/libraries/boost/boost_python_check.py | 4 ++-- cscs-checks/libraries/boost/src/Makefile | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cscs-checks/libraries/boost/boost_python_check.py b/cscs-checks/libraries/boost/boost_python_check.py index 900a9fcc0c..908dc84024 100644 --- a/cscs-checks/libraries/boost/boost_python_check.py +++ b/cscs-checks/libraries/boost/boost_python_check.py @@ -28,7 +28,7 @@ def normalize(s): python_include_suffix = 'm' if python_major_version == '3' else '' python_lib_suffix = '3' if python_major_version == '3' else '' self.variables = { - 'PYTHON_INCLUDE': (r'${PYTHON_PATH}/include/python%s%s') % ( + 'PYTHON_INCLUDE': r'include/python%s%s' % ( python_version, python_include_suffix), 'PYTHON_BOOST_LIB': 'boost_python' + python_lib_suffix } @@ -38,4 +38,4 @@ def normalize(s): def _get_checks(**kwargs): return [BoostCrayGnuPythonTest('1.65.0', '17.08', '2.7', **kwargs), - BoostCrayGnuPythonTest('1.65.0', '17.08', '3.5', **kwargs)] + BoostCrayGnuPythonTest('1.65.0', '17.08', '3.6', **kwargs)] diff --git a/cscs-checks/libraries/boost/src/Makefile b/cscs-checks/libraries/boost/src/Makefile index a2f25ba821..ed03b6e93e 100644 --- a/cscs-checks/libraries/boost/src/Makefile +++ b/cscs-checks/libraries/boost/src/Makefile @@ -1,7 +1,8 @@ TARGET = hello_boost_python +PYTHONDIR=$(shell echo $(PYTHONPATH) | cut -d ':' -f 1) $(TARGET).so: $(TARGET).o $(CXX) -shared -Wl,--export-dynamic $^ -l$(PYTHON_BOOST_LIB) -o $@ $(TARGET).o: $(TARGET).cpp - $(CXX) -fPIC -c -I$(PYTHON_INCLUDE) $^ -o $@ + $(CXX) -fPIC -c -I"$(PYTHONDIR)/$(PYTHON_INCLUDE)" $^ -o $@ From 411244579441812fdf0646cf89dc8c19c187598b Mon Sep 17 00:00:00 2001 From: Theofilos Manitaras Date: Fri, 15 Jun 2018 10:49:43 +0200 Subject: [PATCH 2/3] Convert to new check syntax --- .../libraries/boost/boost_python_check.py | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/cscs-checks/libraries/boost/boost_python_check.py b/cscs-checks/libraries/boost/boost_python_check.py index 908dc84024..6d02b94573 100644 --- a/cscs-checks/libraries/boost/boost_python_check.py +++ b/cscs-checks/libraries/boost/boost_python_check.py @@ -1,20 +1,18 @@ import os +import reframe as rfm import reframe.utility.sanity as sn -from reframe.core.pipeline import RegressionTest -class BoostCrayGnuPythonTest(RegressionTest): - - def __init__(self, boost_version, cray_gnu_version, python_version, - **kwargs): - +@rfm.parameterized_test(['1.65.0', '17.08', '2.7'], ['1.65.0', '17.08', '3.6']) +class BoostCrayGnuPythonTest(rfm.RegressionTest): + def __init__(self, boost_version, cray_gnu_version, python_version): def normalize(s): return s.replace('.', '_') super().__init__('boost_%s_cray_gnu_%s_python_%s_check' % ( normalize(boost_version), normalize(cray_gnu_version), - normalize(python_version)), os.path.dirname(__file__), **kwargs) + normalize(python_version))) self.descr = ('Test for Boost-%s for CrayGnu-%s with python %s ' 'support') % (boost_version, cray_gnu_version, python_version) @@ -34,8 +32,3 @@ def normalize(s): } self.maintainers = ['JB', 'AJ'] self.tags = {'scs', 'production'} - - -def _get_checks(**kwargs): - return [BoostCrayGnuPythonTest('1.65.0', '17.08', '2.7', **kwargs), - BoostCrayGnuPythonTest('1.65.0', '17.08', '3.6', **kwargs)] From 1666c5dd25af51167dbb3f2d1d189c80416f0c2f Mon Sep 17 00:00:00 2001 From: Theofilos Manitaras Date: Fri, 15 Jun 2018 14:01:51 +0200 Subject: [PATCH 3/3] Remove name normalization --- cscs-checks/libraries/boost/boost_python_check.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/cscs-checks/libraries/boost/boost_python_check.py b/cscs-checks/libraries/boost/boost_python_check.py index 6d02b94573..efb6c89bb2 100644 --- a/cscs-checks/libraries/boost/boost_python_check.py +++ b/cscs-checks/libraries/boost/boost_python_check.py @@ -1,5 +1,3 @@ -import os - import reframe as rfm import reframe.utility.sanity as sn @@ -7,12 +5,7 @@ @rfm.parameterized_test(['1.65.0', '17.08', '2.7'], ['1.65.0', '17.08', '3.6']) class BoostCrayGnuPythonTest(rfm.RegressionTest): def __init__(self, boost_version, cray_gnu_version, python_version): - def normalize(s): - return s.replace('.', '_') - - super().__init__('boost_%s_cray_gnu_%s_python_%s_check' % ( - normalize(boost_version), normalize(cray_gnu_version), - normalize(python_version))) + super().__init__() self.descr = ('Test for Boost-%s for CrayGnu-%s with python %s ' 'support') % (boost_version, cray_gnu_version, python_version)