diff --git a/CMakeLists.txt b/CMakeLists.txt index 482520f18..9e662fde6 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.12) project(slsDetectorPackage) -set(PROJECT_VERSION 5.0.0) +set(PROJECT_VERSION 5.1.0) include(CheckIPOSupported) set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG") diff --git a/python/setup.py b/python/setup.py index db4ec2112..2e6422031 100755 --- a/python/setup.py +++ b/python/setup.py @@ -2,11 +2,12 @@ Setup file for slsdet Build upon the pybind11 example found here: https://github.com/pybind/python_example """ -from setuptools import setup, Extension, find_packages -from setuptools.command.build_ext import build_ext -import sys -import setuptools + import os +import sys +sys.path.append('../libs/pybind11') +from setuptools import setup, find_packages +from pybind11.setup_helpers import Pybind11Extension, build_ext __version__ = os.environ.get('GIT_DESCRIBE_TAG', 'developer') @@ -19,109 +20,29 @@ def get_conda_path(): return os.environ['CONDA_PREFIX'] -# class get_pybind_include(object): -# """Helper class to determine the pybind11 include path -# The purpose of this class is to postpone importing pybind11 -# until it is actually installed, so that the ``get_include()`` -# method can be invoked. """ - -# def __init__(self, user=False): -# self.user = user - -# def __str__(self): -# import pybind11 -# return pybind11.get_include(self.user) - - +#TODO migrate to CMake build? ext_modules = [ - Extension( + Pybind11Extension( '_slsdet', ['src/main.cpp', 'src/enums.cpp', 'src/detector.cpp', - 'src/network.cpp'], + 'src/network.cpp', + 'src/pattern.cpp', + 'src/scan.cpp',], include_dirs=[ - # Path to pybind11 headers - # get_pybind_include(), - # get_pybind_include(user=True), os.path.join('../libs/pybind11/include'), os.path.join(get_conda_path(), 'include'), ], - libraries=['SlsDetector', 'SlsReceiver', 'zmq'], + libraries=['SlsDetector', 'SlsSupport', 'SlsReceiver', 'zmq'], library_dirs=[ os.path.join(get_conda_path(), 'lib'), - os.path.join(get_conda_path(), 'bin'), ], - language='c++' ), ] - -# As of Python 3.6, CCompiler has a `has_flag` method. -# cf http://bugs.python.org/issue26689 -def has_flag(compiler, flagname): - """Return a boolean indicating whether a flag name is supported on - the specified compiler. - """ - import tempfile - with tempfile.NamedTemporaryFile('w', suffix='.cpp') as f: - f.write('int main (int argc, char **argv) { return 0; }') - try: - compiler.compile([f.name], extra_postargs=[flagname]) - except setuptools.distutils.errors.CompileError: - return False - return True - - -def cpp_flag(compiler): - """Return the -std=c++[11/14] compiler flag. - The c++14 is prefered over c++11 (when it is available). - """ - if has_flag(compiler, '-std=c++14'): - return '-std=c++14' - elif has_flag(compiler, '-std=c++11'): - return '-std=c++11' - else: - raise RuntimeError('Unsupported compiler -- at least C++11 support ' - 'is needed!') - - -class BuildExt(build_ext): - """A custom build extension for adding compiler-specific options.""" - c_opts = { - 'msvc': ['/EHsc'], - 'unix': [], - } - - if sys.platform == 'darwin': - c_opts['unix'] += ['-stdlib=libc++', '-mmacosx-version-min=10.7'] - - def build_extensions(self): - ct = self.compiler.compiler_type - opts = self.c_opts.get(ct, []) - if ct == 'unix': - opts.append('-DVERSION_INFO="%s"' % self.distribution.get_version()) - opts.append(cpp_flag(self.compiler)) - if has_flag(self.compiler, '-fvisibility=hidden'): - opts.append('-fvisibility=hidden') - elif ct == 'msvc': - opts.append('/DVERSION_INFO=\\"%s\\"' % self.distribution.get_version()) - for ext in self.extensions: - ext.extra_compile_args = opts - - print('**************************************************') - print(ct) - print(opts) - print('**************************************************') - build_ext.build_extensions(self) - - - -def get_shared_lib(): - return [f for f in os.listdir('.') if '_slsdet' in f] - setup( name='slsdet', version=__version__, @@ -132,6 +53,6 @@ setup( long_description='', packages=find_packages(exclude=['contrib', 'docs', 'tests']), ext_modules=ext_modules, - cmdclass={'build_ext': BuildExt}, + cmdclass={"build_ext": build_ext}, zip_safe=False, ) diff --git a/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer b/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServerv5.1.0.rc1 similarity index 100% rename from slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer rename to slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServerv5.1.0.rc1 diff --git a/slsSupportLib/include/sls/versionAPI.h b/slsSupportLib/include/sls/versionAPI.h index bb8c27743..7b454a3fb 100644 --- a/slsSupportLib/include/sls/versionAPI.h +++ b/slsSupportLib/include/sls/versionAPI.h @@ -1,12 +1,12 @@ /** API versions */ -#define GITBRANCH "developer" -#define APILIB 0x201119 -#define APIRECEIVER 0x201119 -#define APIGUI 0x201119 -#define APICTB 0x201214 -#define APIGOTTHARD 0x201214 -#define APIGOTTHARD2 0x201214 -#define APIJUNGFRAU 0x201214 -#define APIMOENCH 0x201214 -#define APIEIGER 0x201214 -#define APIMYTHEN3 0x201214 +#define GITBRANCH "5.1.0.rc1" +#define APICTB 0x210225 +#define APIGOTTHARD 0x210225 +#define APIGOTTHARD2 0x210225 +#define APIJUNGFRAU 0x210225 +#define APIMOENCH 0x210225 +#define APIEIGER 0x210225 +#define APIMYTHEN3 0x210225 +#define APILIB 0x210225 +#define APIRECEIVER 0x210225 +#define APIGUI 0x210225