Skip to content

Commit 5c46141

Browse files
authored
Merge pull request #20 from Fluorescence-Tools/development
Development
2 parents 564754d + 3757f97 commit 5c46141

File tree

150 files changed

+11274
-2021
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+11274
-2021
lines changed

.appveyor.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ install:
2020
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
2121
##################################################
2222
# Build conda package
23+
- git submodule update --init --recursive
2324
- conda config --set always_yes yes --set changeps1 no
2425
- conda update -q conda
2526
- conda create -n build python=3.7 git conda-build anaconda-client numpy conda-verify ripgrep
@@ -37,10 +38,10 @@ test_script:
3738
- nosetests
3839
- cd ..
3940

40-
#### scripts to run after tests
41-
#deploy_script:
42-
# - if not "%APPVEYOR_REPO_BRANCH%" == "master" exit 0
43-
# - anaconda upload C:\Miniconda3-x64\envs\build\conda-bld\win-64\tttrlib-*.tar.bz2
41+
# scripts to run after tests
42+
deploy_script:
43+
- if "%APPVEYOR_REPO_BRANCH%" == "master" exit 0
44+
- anaconda -t %ANACONDA_API_TOKEN% upload -u %CONDA_USER% -l nightly C:\Miniconda3-x64\envs\build\conda-bld\win-64\tttrlib-*.tar.bz2 --force
4445

4546
build: off
4647

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ playground
1010
temp
1111
*.egg-info
1212
docs/_build
13+
test/stage
1314

1415
# Documentation and tools
1516
doc/_*

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "thirdparty/CRoaringUnityBuild"]
2+
path = thirdparty/CRoaringUnityBuild
3+
url = https://github.com/lemire/CRoaringUnityBuild

.travis.yml

+12-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,18 @@ matrix:
55
include:
66
- os: linux
77
dist: bionic
8+
addons:
9+
apt:
10+
packages:
11+
- doxygen
812
- os: osx
913
osx_image: xcode9.4
14+
addons:
15+
homebrew:
16+
packages:
17+
- doxygen
18+
- libomp
19+
update: true
1020

1121
# The Sphinx C++ docs are build with doxygen and breathe
1222
addons:
@@ -16,6 +26,7 @@ addons:
1626
homebrew:
1727
packages:
1828
- doxygen
29+
update: true
1930

2031
env:
2132
# Build and test package on all supported python versions
@@ -47,7 +58,7 @@ script:
4758
- ln -sf $(which nosetests) $(pwd)/test/
4859
- cd $(pwd)/test/
4960
- echo $PWD
50-
- nosetests --with-coverage test_*.py
61+
- nosetests --nocapture --with-coverage test_*.py
5162
- cd ..
5263

5364
after_success:

CMakeLists.txt

+67-16
Original file line numberDiff line numberDiff line change
@@ -11,84 +11,135 @@ OPTION(BUILD_R_INTERFACE "Build R interface" OFF)
1111

1212
SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake;${CMAKE_MODULE_PATH}")
1313

14+
## Optimize compiler flags
15+
############################
16+
#INCLUDE(CMakeHostSystemInformationExtra)
17+
#INCLUDE(GetCPUSIMDFeatures)
18+
#INCLUDE(CMakeCompilerMachineOption)
19+
#SET(TARGET_ARCHITECTURE skylake)
20+
#CMAKE_COMPILER_MACHINE_OPTION(ARCHITECTURE_FLAG ${TARGET_ARCHITECTURE})
21+
#MESSAGE(STATUS "Use compiler option: ${ARCHITECTURE_FLAG}")
22+
#ADD_COMPILE_OPTIONS(${ARCHITECTURE_FLAG})
23+
24+
1425
# Debug build detection
1526
###########################
16-
IF(CMAKE_BUILD_TYPE STREQUAL "Release")
27+
IF (CMAKE_BUILD_TYPE STREQUAL "Release")
1728
MESSAGE("Release build")
1829
ADD_DEFINITIONS("-DVERBOSE=0")
19-
ELSE(CMAKE_BUILD_TYPE STREQUAL "Debug")
30+
ELSE (CMAKE_BUILD_TYPE STREQUAL "Debug")
2031
MESSAGE("Debug build")
2132
ADD_DEFINITIONS("-DVERBOSE=1")
22-
ENDIF(CMAKE_BUILD_TYPE STREQUAL "Release")
33+
ENDIF (CMAKE_BUILD_TYPE STREQUAL "Release")
2334

2435
# Windows
25-
if(MSVC)
36+
##############
37+
if (MSVC)
2638
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++latest")
27-
add_definitions(-DMS_WIN64)
28-
endif(MSVC)
39+
ADD_DEFINITIONS(-DMS_WIN64)
40+
ADD_DEFINITIONS(-D_USE_MATH_DEFINES)
41+
endif (MSVC)
2942

3043
# MACOSX
44+
##############
3145
FIND_PACKAGE(Threads)
32-
if(APPLE)
46+
if (APPLE)
3347
# explicit link to libc++ for recent osx versions
3448
MESSAGE(STATUS "Explicitly link to libc++ on modern osx versions")
3549
ADD_DEFINITIONS(-stdlib=libc++)
3650
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
3751
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread")
3852
# Don't set MACOSX_RPATH by default
3953
set(CMAKE_MACOSX_RPATH 0)
40-
endif(APPLE)
54+
endif (APPLE)
55+
56+
### CRoaring
57+
###############
58+
#INCLUDE_DIRECTORIES(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/thirdparty/CRoaringUnityBuild)
4159

4260
## FFTW
61+
##############
4362
FIND_PACKAGE(FFTW REQUIRED)
4463
LINK_LIBRARIES(${FFTW_LIBRARIES})
4564
INCLUDE_DIRECTORIES(${FFTW_INCLUDE_DIRS})
4665

66+
# Does not work on Windows and conda mkl
67+
# maybe the pytorch people will resolve this issue in the future.
68+
### Intel MKL
69+
###############
70+
#find_package(MKL REQUIRED)
71+
#if (MKL_FOUND)
72+
# INCLUDE_DIRECTORIES(${MKL_INCLUDE_DIRS})
73+
# LINK_LIBRARIES(${MKL_CORE_LIBRARY})
74+
#else ()
75+
# message(WARNING "MKL libs not found")
76+
#endif ()
77+
4778
## Boost
48-
if(WIN32)
79+
###########################
80+
if (WIN32)
4981
# use static Boost in Windows
5082
set(Boost_USE_STATIC_LIBS ON)
5183
set(Boost_USE_STATIC ON)
5284
set(Boost_USE_MULTITHREAD)
53-
endif(WIN32)
85+
endif (WIN32)
5486
FIND_PACKAGE(Boost 1.36 REQUIRED COMPONENTS date_time filesystem iostreams)
5587
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
5688
LINK_LIBRARIES(${Boost_LIBRARIES})
5789
MESSAGE(${Boost_INCLUDE_DIRS})
5890

5991
## HDF5
92+
###########################
6093
FIND_PACKAGE(HDF5 1.10 REQUIRED COMPONENTS C)
6194
INCLUDE_DIRECTORIES(${HDF5_INCLUDE_DIRS})
6295
LINK_LIBRARIES(${HDF5_LIBRARIES})
6396
ADD_DEFINITIONS(-DH5_BUILT_AS_DYNAMIC_LIB)
6497

6598
## OpenMP
66-
# FIND_PACKAGE(OpenMP REQUIRED)
99+
###########################
100+
if (APPLE)
101+
# dirty hack to make OpenMP work see:
102+
# https://gitlab.kitware.com/cmake/cmake/issues/18098
103+
set(OpenMP_CXX_FLAGS "-Xpreprocessor -fopenmp -I/usr/local/opt/libomp/include" CACHE INTERNAL "OpenMP flags for Xcode toolchain.")
104+
set(OpenMP_CXX_LIB_NAMES "omp" CACHE INTERNAL "OpenMP lib name for Xcode toolchain.")
105+
set(OpenMP_C_FLAGS "-Xpreprocessor -fopenmp -I/usr/local/opt/libomp/include" CACHE INTERNAL "OpenMP flags for Xcode toolchain.")
106+
set(OpenMP_C_LIB_NAMES "libomp" "libgomp" "libiomp5")
107+
set(OpenMP_omp_LIBRARY "/usr/local/opt/libomp/lib/libomp.dylib" CACHE INTERNAL "OpenMP lib name for Xcode toolchain.")
108+
set(OpenMP_libomp_LIBRARY ${OpenMP_C_LIB_NAMES})
109+
set(OpenMP_libgomp_LIBRARY ${OpenMP_C_LIB_NAMES})
110+
set(OpenMP_libiomp5_LIBRARY ${OpenMP_C_LIB_NAMES})
111+
endif ()
112+
FIND_PACKAGE(OpenMP REQUIRED)
113+
LINK_LIBRARIES(OpenMP::OpenMP_CXX)
67114

68115
# Doxygen
69-
IF(BUILD_DOC)
116+
###########################
117+
IF (BUILD_DOC)
70118
FIND_PACKAGE(Doxygen REQUIRED)
71119
IF (DOXYGEN_FOUND)
72120
ELSE (DOXYGEN_FOUND)
73121
MESSAGE("Doxygen need to be installed to generate the doxygen documentation")
74122
ENDIF (DOXYGEN_FOUND)
75-
ENDIF()
123+
ENDIF ()
76124

77125
FILE(
78126
GLOB
79127
SRC_files
80-
"../src/*.cpp"
81-
"../src/correlation/*.cpp"
128+
"${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp"
129+
"${CMAKE_CURRENT_SOURCE_DIR}/src/correlation/*.cpp"
130+
"${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/lbfgs/*.cpp"
82131
)
83132
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
84133
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/src)
85134
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
86135
ADD_SUBDIRECTORY(ext)
87136

88137
# Add install target
138+
##############
89139
INSTALL(TARGETS ${PROJECT_NAME}
90140
RUNTIME DESTINATION bin
91141
LIBRARY DESTINATION lib
92142
ARCHIVE DESTINATION lib/static
93-
PUBLIC_HEADER DESTINATION include)
143+
PUBLIC_HEADER DESTINATION include
144+
)
94145

README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@ Scilab and R. Currently, tttrlib is wrapped for the use in Python.
2727

2828
![tttrlib FLIM][3]
2929

30-
tttrlib is NOT intended as ready-to-use software for specific application
31-
purposes.
30+
tttrlib is a library that facilitates the interaction with TTTR data that can be
31+
used to develop data analysis pipelines e.g. for single-molecule and image
32+
spectroscopy. tttrlib is not intended as end-user software for specific application
33+
purposes.
3234

3335
## Supported file formats
3436
### PicoQuant (PQ)
+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2+
# file Copyright.txt or https://cmake.org/licensing for details.
3+
4+
#[=======================================================================[.rst:
5+
CMakeCompilerMachineOption
6+
--------------------------
7+
8+
Get march flags for target Intel micro architecture
9+
10+
.. command:: cmake_compiler_machine_option
11+
12+
cmake_compiler_machine_option(<output variable>
13+
[TARGET_ARCHITECTURE <target architecture>]
14+
[FEATURES <feature> ...])
15+
16+
#]=======================================================================]
17+
18+
include("${CMAKE_CURRENT_LIST_DIR}/CMakeCompilerMachineOption/X64CompilerOptions.cmake")
19+
20+
function(CMAKE_COMPILER_MACHINE_OPTION outvar tarch)
21+
set(compiler_options)
22+
if("${CMAKE_HOST_SYSTEM_PROCESSOR}" MATCHES "(x86|AMD64)")
23+
x64_compiler_options(compiler_options ${tarch})
24+
elseif("${CMAKE_HOST_SYSTEM_PROCESSOR}" MATCHES "(ARM|aarch64)")
25+
arm_compiler_options(compiler_options ${tarch})
26+
endif()
27+
set(${outvar} ${compiler_options} PARENT_SCOPE)
28+
endfunction()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2+
# file Copyright.txt or https://cmake.org/licensing for details.
3+
4+
#[=======================================================================[.rst:
5+
GetArmMarchCompilerOptions
6+
--------------------------
7+
8+
Get march flags for target Intel micro architecture
9+
10+
.. command:: arm_compiler_options
11+
12+
arm_compiler_options(<output variable> <target SoC name>)
13+
14+
#]=======================================================================]
15+
16+
include(CheckCCompilerFlag)
17+
include(CheckCXXCompilerFlag)
18+
include(CheckIncludeFileCXX)
19+
include(CheckIncludeFile)
20+
21+
function(ARM_COMPILER_OPTIONS outvar tarch)
22+
set(ARCHITECTURE_FLAGS)
23+
24+
if(tarch STREQUAL "none")
25+
message(WARNING "Unsupported target architecture. No flag is added.")
26+
else()
27+
# -mfpu= VFP NEON
28+
#--------------------------------
29+
# vfpv3 VFPv3 -
30+
# neon VFPv3 Y
31+
# vfpv3-d16 VFPv3 -
32+
# vfpv3-fp16 VFPv3 -
33+
# neon-fp16 VFPv3 Y
34+
# vfpv3xd VFPv3 -
35+
# vfpv3xd-fp16 VFPv3 -
36+
# vfpv4 VFPv4 -
37+
# vfpv4-d16 VFPv4 -
38+
# neon-vfpv4 VFPv4 Y
39+
# fpv4-sp-d16 VFPv4 -
40+
# fp-armv8 AA64 -
41+
# neon-fp-armv8 AA64 Y
42+
# crypto-neon-fp-armv8 AA64 Y
43+
#
44+
# on gcc armv7A neon, -funsafe-math-optimizations is necessary.
45+
#
46+
# Tegra2 ARMv7 A9
47+
# Tegra3 ARMv7 A9
48+
# Tegra4 ARMv7 A15
49+
# TegraK1-T124 ARMv7 A15
50+
# TegraK1-T132 ARMv8 Denver
51+
# TegraX1-T210 ARMv8 A53+A57
52+
# TegraX1-T186 ARMv8 Denver2+A57
53+
# Xavier-T194 ARMv8 custom-carnel
54+
#
55+
# XScale
56+
# https://en.wikipedia.org/wiki/XScale
57+
# PXA25x Cotulla ARMv5TE
58+
# PXA26x Dalhart ARMv5TE
59+
# PXA27x Bulverde Wireless-MMX ARMv5TE
60+
# PXA3xx Monahans ARMv5TE
61+
# PXA90x
62+
# PXA16x
63+
#
64+
# PXA930 Sheeva
65+
# PXA935 Sheeva
66+
# PXA940 Cortex-A8
67+
# PXA986/988 Cortex-A9
68+
# PXA1088 Cortex-A7
69+
#
70+
set(ARMv7-core-list Cortex-A8 Cortex-A9 Cortex-A12 Cortex-A15 Cortex-A7 )
71+
set(ARMv8A-core-list Denver Dever2 ThunderX Kyro Kyro2 M1 M2 M3)
72+
set(ARMv8.0A-core-list Cortex-A32 Cortex-A35 Cortex-A53 Cortex-A55 Cortex-A57 Cortex-A72 Cortex-A73 Hurricane )
73+
set(ARMv8.1A-core-list ThunderX2 Falkor)
74+
set(ARMv8.2A-core-list Cortex-A75 Cortex-A76 Monsoon Kyro3)
75+
set(ARMv8.3A-core-list Vortex )
76+
77+
if(MSVC)
78+
# TODO implement me
79+
elseif(CMAKE_CXX_COMPILER MATCHES "/(icpc|icc)$") # ICC (on Linux)
80+
# TODO implement me
81+
else() # not MSVC and not ICC => GCC, Clang, Open64
82+
set(soc-core-map
83+
Tegra2 Cortex-A9 Tegra3 Cortex-A9 Tegra4 Cortex-A15
84+
PXA25x ARMv5TE PXA26x ARMv5TE PXA27x ARMv5TE
85+
PXA3xx ARMv5TE PXA940 Cortex-A8 PXA986 Cortex-A9
86+
PXA988 Cortex-A9 PXA1088 Cortex-A7
87+
)
88+
set(core-mfpu-map
89+
ARMv5TE ""
90+
Cortex-A8 neon-vfpv3
91+
Cortex-A9 "neon,vfpv3-d16"
92+
Cortex-A5 "neon-vfpv4,vfpv4-d16"
93+
Cortex-A15 neon-vfpv4
94+
Cortex-A7 neon-vfpv4
95+
Cortex-A53 neon-fp-armv8
96+
Cortex-A57 neon-fp-armv8
97+
)
98+
list(FIND soc-core-map ${tarch} _res)
99+
if(_res GREATER -1)
100+
math(EXPR _index "${_res} + 1")
101+
list(GET soc-core-map ${_index} _ARMCORE)
102+
list(FIND core-mfpu-map ${_ARMCORE} _res)
103+
if(_res GREATER -1)
104+
math(EXPR _index "${_res} + 1")
105+
list(GET soc-mfpu-map ${_index} _flags)
106+
if(_flags)
107+
string(REPLACE "," ";" _flag_list "${_flags}")
108+
foreach(flag IN ITEMS ${_flag_list})
109+
__check_compiler_flag("-m${_flag}" test_${_flag})
110+
if(test_${_flag})
111+
list(APPEND ARCHITECTURE_FLAGS "-m${_flag}")
112+
break()
113+
endif()
114+
endforeach()
115+
endif()
116+
endif()
117+
endif()
118+
endif()
119+
endif()
120+
set(${outvar} "${ARCHITECTURE_FLAGS}" PARENT_SCOPE)
121+
endfunction()

0 commit comments

Comments
 (0)