This commit is contained in:
Erik Frojdh 2020-02-11 16:01:32 +01:00
parent 4dc14bf9d6
commit 3523de8ba9
12 changed files with 82 additions and 52 deletions

1
.gitignore vendored
View File

@ -7,6 +7,7 @@ bin/
*.out
*.toc
*.o
*.so
.*
build
RELEASE.txt

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.11)
cmake_minimum_required(VERSION 3.12)
project(slsDetectorPackage)
set(PROJECT_VERSION 5.0.0)
include(CheckIPOSupported)
@ -126,7 +126,7 @@ install(TARGETS slsProjectOptions slsProjectWarnings rapidjson
)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_INSTALL_RPATH "$ORIGIN")
set(CMAKE_INSTALL_RPATH $ORIGIN)
# set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)

View File

@ -8,7 +8,7 @@ cmake .. \
-DSLS_USE_RECEIVER=ON \
-DSLS_USE_GUI=OFF \
-DSLS_USE_TESTS=ON \
-DSLS_USE_PYTHON=OFF \
-DSLS_USE_PYTHON=ON \
-DCMAKE_BUILD_TYPE=Release \
-DSLS_USE_HDF5=OFF\

View File

@ -10,5 +10,8 @@
# #Binaries
# cp -r build/bin/sls_detector $PREFIX/lib/.
#copy shared lib
cp build/bin/_sls_detector* python/.
cd python
${PYTHON} setup.py install
$PYTHON setup.py install

View File

@ -0,0 +1,9 @@
mkdir $PREFIX/lib
mkdir $PREFIX/bin
mkdir $PREFIX/include
cp build/bin/ctbGui $PREFIX/bin/.
cp build/bin/libctbRootLib.so $PREFIX/lib/.

View File

@ -16,7 +16,7 @@ requirements:
- {{ compiler('c') }}
- {{compiler('cxx')}}
- cmake
# - qwt 6.* #require qt5 investigate befor activating gui
# - qwt 6.* #require qt5 investigate before activating gui
# - qt=4.8.7=7
- zeromq=4.2.5=hfc679d8_5
- pyzmq
@ -65,10 +65,10 @@ outputs:
- setuptools
- sls_detector_lib
- pyzmq
- pybind11 2.4
# - pybind11 2.4
host:
- python
- pybind11 2.4
# - pybind11 2.4
- pyzmq
- sls_detector_lib
- libstdcxx-ng
@ -84,13 +84,13 @@ outputs:
imports:
- sls_detector
# requirements:
# build:
# - {{ compiler('c') }}
# - {{compiler('cxx')}}
requirements:
build:
- {{ compiler('c') }}
- {{compiler('cxx')}}
# - name: sls_detector_gui
# version: "refactor"
# version: "developer"
# script: copy_gui.sh
# requirements:
# build:
@ -98,7 +98,7 @@ outputs:
# - {{compiler('cxx')}}
# - cmake
# - qwt 6.*
# - qt=4.8.7=7
# - qt=4.8.*
# - zeromq=4.2.5=hfc679d8_5
# - pyzmq
# - xorg-libx11
@ -117,4 +117,4 @@ outputs:
# run:
# - sls_detector_lib=refactor
# - qwt 6.*
# - qt=4.8.7=7
# - qt=4.8.*

View File

@ -71,6 +71,11 @@ target_link_libraries(ctbRootLib PUBLIC
${ROOT_EXE_LINKER_FLAGS}
)
set_target_properties(
ctbRootLib PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)
target_link_libraries(ctbGui PUBLIC
slsDetectorShared
slsSupportLib
@ -80,4 +85,5 @@ target_link_libraries(ctbGui PUBLIC
set_target_properties(ctbGui PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)

@ -1 +1 @@
Subproject commit 80d452484c5409444b0ec19383faa84bb7a4d351
Subproject commit 4f72ef846fe8453596230ac285eeaa0ce3278bb4

View File

@ -1,4 +1,6 @@
# find_package (Python COMPONENTS Interpreter Development)
pybind11_add_module(_sls_detector
src/main.cpp
src/enums.cpp
@ -10,7 +12,7 @@ target_link_libraries(_sls_detector PUBLIC
slsDetectorShared
slsReceiverShared
slsSupportLib
zmq )
)

View File

@ -8,7 +8,7 @@ import sys
import setuptools
import os
__version__ = 'refactor'
__version__ = 'developer'
def get_conda_path():
@ -19,43 +19,44 @@ 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. """
# 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 __init__(self, user=False):
# self.user = user
def __str__(self):
import pybind11
return pybind11.get_include(self.user)
# def __str__(self):
# import pybind11
# return pybind11.get_include(self.user)
ext_modules = [
Extension(
'_sls_detector',
['src/main.cpp',
'src/enums.cpp',
'src/detector.cpp',
'src/network.cpp'],
include_dirs=[
# Path to pybind11 headers
get_pybind_include(),
get_pybind_include(user=True),
os.path.join(get_conda_path(), 'include/slsDetectorPackage'),
# ext_modules = [
# Extension(
# '_sls_detector',
# ['src/main.cpp',
# 'src/enums.cpp',
# 'src/detector.cpp',
# 'src/network.cpp'],
# include_dirs=[
# # Path to pybind11 headers
# # get_pybind_include(),
# # get_pybind_include(user=True),
# os.path.join(get_conda_path(), 'include/slsDetectorPackage/libs/pybind11'),
# os.path.join(get_conda_path(), 'include/slsDetectorPackage'),
],
libraries=['SlsDetector', 'SlsReceiver', 'zmq'],
library_dirs=[
os.path.join(get_conda_path(), 'lib'),
os.path.join(get_conda_path(), 'bin'),
],
# ],
# libraries=['SlsDetector', 'SlsReceiver', 'zmq'],
# library_dirs=[
# os.path.join(get_conda_path(), 'lib'),
# os.path.join(get_conda_path(), 'bin'),
# ],
language='c++'
),
]
# language='c++'
# ),
# ]
# As of Python 3.6, CCompiler has a `has_flag` method.
@ -112,6 +113,9 @@ class BuildExt(build_ext):
build_ext.build_extensions(self)
def get_shared_lib():
return [f for f in os.listdir('.') if '_sls_detector' in f]
setup(
name='sls_detector',
version=__version__,
@ -121,8 +125,10 @@ setup(
description='Detector API for SLS Detector Group detectors',
long_description='',
packages=find_packages(exclude=['contrib', 'docs', 'tests']),
ext_modules=ext_modules,
install_requires=['pybind11>=2.2'],
cmdclass={'build_ext': BuildExt},
# ext_modules=ext_modules,
data_files = [('', get_shared_lib())],
# package_data={'sls_detector': ['../build/bin/_sls_detector.cpython-38-x86_64-linux-gnu.so']},
# install_requires=['pybind11>=2.2'],
# cmdclass={'build_ext': BuildExt},
zip_safe=False,
)

View File

@ -32,7 +32,9 @@ target_link_libraries(slsDetectorShared PUBLIC
slsProjectOptions
slsProjectWarnings
slsSupportLib
${ZeroMQ_LIBRARIES}
${ZeroMQ_LIBRARIES}
pthread
rt
)
set(PUBLICHEADERS

View File

@ -58,6 +58,7 @@ set_target_properties(slsSupportLib PROPERTIES
target_link_libraries(slsSupportLib
slsProjectOptions
slsProjectWarnings
${ZeroMQ_LIBRARIES}
rapidjson)
if (SLS_USE_TESTS)