Skip to content

Commit 1d41bb1

Browse files
committed
Merge branch 'develop'
2 parents d2c664b + 920a22b commit 1d41bb1

File tree

88 files changed

+6429
-5382
lines changed

Some content is hidden

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

88 files changed

+6429
-5382
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@
77
[submodule "external/c-blosc"]
88
path = external/c-blosc
99
url = https://github.com/Blosc/c-blosc
10+
[submodule "external/pybind11"]
11+
path = external/pybind11
12+
url = https://github.com/pybind/pybind11.git

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,8 @@ install:
3535
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export CC=clang-3.6; fi
3636
- git submodule init
3737
- git submodule update
38+
- pip install --user -U pip
39+
- pip install --user numpy
40+
3841
script:
3942
- sh ./cmake-build.sh

CMakeLists.txt

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ option(APR_TESTS "Build APR tests" OFF)
1717
option(APR_PREFER_EXTERNAL_GTEST "When found, use the installed GTEST libs instead of included sources" OFF)
1818
option(APR_PREFER_EXTERNAL_BLOSC "When found, use the installed BLOSC libs instead of included sources" OFF)
1919
option(APR_BUILD_JAVA_WRAPPERS "Build APR JAVA wrappers" OFF)
20+
option(APR_BUILD_PYTHON_WRAPPERS "Build APR PYTHON wrappers (experimental - under development)" OFF)
2021
option(APR_USE_CUDA "should APR use CUDA? (experimental - under development)" OFF)
2122
option(APR_USE_OPENMP "should APR use OpenMP?" ON)
2223
option(APR_BENCHMARK "add benchmarking code" OFF)
@@ -100,24 +101,31 @@ endif()
100101
# Add submodule GLM (include files only)
101102
include_directories("external/glm")
102103

104+
#message(STATUS "---------------------- VARS BEG ---------------------")
105+
#get_cmake_property(_variableNames VARIABLES)
106+
#foreach (_variableName ${_variableNames})
107+
# message(STATUS "${_variableName}=${${_variableName}}")
108+
#endforeach()
109+
#message(STATUS "---------------------- VARS END ---------------------")
103110

104111
###############################################################################
105112
# Configure compiler options
106113
###############################################################################
107114
# If you ever want to compile with Intel's icc (or any other compiler) provide
108115
# compiler names/paths in cmake command like this:
109116
# CC="icc" CXX="icc" CXXFLAGS="-O3" cmake -DAPR_TESTS=1
110-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wall -pedantic")
117+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wall -pedantic ")
111118
if(CMAKE_COMPILER_IS_GNUCC)
112119
set(CMAKE_CXX_FLAGS_RELEASE "-O4 -ffast-math")
113120
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
114121
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Bdynamic")
115122
if(NOT WIN32)
116-
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -ldl")
123+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -ldl -lz")
117124
endif()
118125
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
119126
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -ffast-math")
120127
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
128+
# set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lz")
121129
endif()
122130

123131
if (APR_BENCHMARK)
@@ -135,14 +143,14 @@ set(LIBRARY_NAME apr)
135143
include_directories(src)
136144

137145
set(SOURCE_FILES src/io/blosc_filter.c src/io/hdf5functions_blosc.cpp)
138-
set(SOURCE_FILES_RAYCAST src/numerics/APRRaycaster.cpp src/vis/Camera.cpp src/vis/Object.cpp src/vis/RaytracedObject.cpp)
146+
#set(SOURCE_FILES_RAYCAST src/numerics/APRRaycaster.cpp src/vis/Camera.cpp src/vis/Object.cpp src/vis/RaytracedObject.cpp)
139147

140148
add_library(aprObjLib OBJECT ${SOURCE_FILES} ${SOURCE_FILES_RAYCAST})
141149

142150
if(APR_USE_CUDA)
143151
message(STATUS "APR: Building CUDA for APR")
144152
set(CMAKE_CUDA_STANDARD 14)
145-
set(CMAKE_CUDA_FLAGS "--cudart shared -g -lineinfo -Xptxas -O3,-v -use_fast_math -DAPR_USE_CUDA")
153+
set(CMAKE_CUDA_FLAGS "--default-stream per-thread --cudart shared -g -lineinfo -Xptxas -O3,-v -use_fast_math -DAPR_USE_CUDA")
146154
if(APR_BENCHMARK)
147155
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -DAPR_BENCHMARK")
148156
endif()
@@ -151,10 +159,9 @@ if(APR_USE_CUDA)
151159
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DAPR_USE_CUDA")
152160
set(APR_CUDA_SROUCE_FILES
153161
src/algorithm/ComputeGradientCuda.cu
154-
src/algorithm/ComputeBsplineRecursiveFilter.cu
155-
src/algorithm/ComputeInverseCubicBsplineCuda.cu
156162
src/data_structures/Mesh/PixelData.cu
157-
src/algorithm/LocalIntensityScale.cu)
163+
src/algorithm/LocalIntensityScale.cu
164+
)
158165
include_directories(${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES})
159166
endif()
160167

@@ -306,3 +313,24 @@ if(APR_BUILD_JAVA_WRAPPERS)
306313
swig_add_library(apr LANGUAGE java SOURCES libapr.i ${SOURCE_FILES})
307314
swig_link_libraries(apr ${HDF5_LIBRARIES} ${TIFF_LIBRARIES} ${BLOSC_LIBRARIES} ${ZLIB_LIBRARIES})
308315
endif(APR_BUILD_JAVA_WRAPPERS)
316+
317+
318+
###############################################################################
319+
# PYTHON wrappers
320+
###############################################################################
321+
if(APR_BUILD_PYTHON_WRAPPERS)
322+
message(STATUS "APR: Building PYTHON wrappers")
323+
set(PYBIND11_PYTHON_VERSION 2.7)
324+
325+
add_subdirectory("external/pybind11")
326+
327+
set(APR_PYTHON_MODULE_NAME pyApr)
328+
add_definitions(-DAPR_PYTHON_MODULE_NAME=${APR_PYTHON_MODULE_NAME})
329+
add_library(${APR_PYTHON_MODULE_NAME} MODULE src/wrapper/pythonBind.cpp $<TARGET_OBJECTS:aprObjLib>)
330+
target_include_directories(${APR_PYTHON_MODULE_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
331+
target_link_libraries(${APR_PYTHON_MODULE_NAME} PRIVATE pybind11::module ${HDF5_LIBRARIES} ${TIFF_LIBRARIES} ${BLOSC_LIBRARIES} ${ZLIB_LIBRARIES})
332+
set_target_properties(${APR_PYTHON_MODULE_NAME} PROPERTIES OUTPUT_NAME ${APR_PYTHON_MODULE_NAME})
333+
set_target_properties(${APR_PYTHON_MODULE_NAME} PROPERTIES PREFIX "${PYTHON_MODULE_PREFIX}"
334+
SUFFIX "${PYTHON_MODULE_EXTENSION}")
335+
336+
endif(APR_BUILD_PYTHON_WRAPPERS)

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ Labeled Zebrafish nuclei: Gopi Shah, Huisken Lab ([MPI-CBG](https://www.mpi-cbg.
1616
* LibTIFF 5.0 or higher
1717
* SWIG 3.0.12 (optional, for generating Java wrappers)
1818

19+
NB: This branch introduces changes to IO and iteration that are not compatable with old versions.
20+
1921
## Building
2022

2123
The repository requires sub-modules, so the repository needs to be cloned recursively:

cmake-build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22
mkdir build
33
cd build
4-
cmake -DAPR_BUILD_STATIC_LIB=ON -DAPR_BUILD_SHARED_LIB=ON -DAPR_BUILD_EXAMPLES=ON -DAPR_TESTS=ON -DAPR_USE_CUDA=OFF ..
4+
cmake -DAPR_BUILD_STATIC_LIB=ON -DAPR_BUILD_SHARED_LIB=ON -DAPR_BUILD_EXAMPLES=ON -DAPR_TESTS=ON -DAPR_USE_CUDA=OFF -DAPR_BUILD_PYTHON_WRAPPERS=ON ..
55
cmake --build .
66

7-
CTEST_OUTPUT_ON_FAILURE=1 ctest
7+
CTEST_OUTPUT_ON_FAILURE=1 ctest -V

cmake/AddStaticLibs.cmake

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Adds staticLib to provided (existing) static target. Useful for merging all dependencies to
22
# one fat static lib.
33
# Use: addStaticLibs(libStatic someStaticLibToMerge [evenMoreStaticLibsIfNeeded])
4-
cmake_policy(SET CMP0026 OLD)
54

65
function(addStaticLibs outLibTarget)
76
get_target_property(libtype ${outLibTarget} TYPE)
@@ -19,8 +18,7 @@ function(addStaticLibs outLibTarget)
1918
if(NOT libtype STREQUAL "STATIC_LIBRARY")
2019
message(FATAL_ERROR "[${lib}] is not a static lib!")
2120
endif()
22-
get_target_property(myLib ${lib} LOCATION)
23-
set(filesToMerge ${filesTomerge} ${myLib})
21+
list(APPEND filesToMerge $<TARGET_FILE:${lib}>)
2422
endforeach()
2523

2624
set(outLibFile $<TARGET_FILE:${outLibTarget}>)

examples/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ buildTarget(Example_produce_paraview_file)
1111
buildTarget(Example_apr_neighbour_access)
1212
buildTarget(Example_compute_gradient)
1313
buildTarget(Example_random_access)
14-
buildTarget(Example_ray_cast)
14+
1515
buildTarget(Example_reconstruct_patch)
16+
buildTarget(Example_apr_tree)
1617

18+
#buildTarget(Example_ray_cast)

0 commit comments

Comments
 (0)