Skip to content

Commit 2eab26b

Browse files
committed
Merged python API examples and Master
2 parents ffc952a + 7273931 commit 2eab26b

File tree

84 files changed

+6348
-5482
lines changed

Some content is hidden

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

84 files changed

+6348
-5482
lines changed

CMakeLists.txt

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,20 @@ 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" ON)
20+
option(APR_BUILD_PYTHON_WRAPPERS "Build APR PYTHON wrappers (experimental - under development)" OFF)
2121
option(APR_USE_CUDA "should APR use CUDA? (experimental - under development)" OFF)
22+
option(APR_USE_OPENMP "should APR use OpenMP?" ON)
2223
option(APR_BENCHMARK "add benchmarking code" OFF)
2324

2425
# Validation of options
2526
if (NOT APR_BUILD_SHARED_LIB AND NOT APR_BUILD_STATIC_LIB)
2627
message(FATAL_ERROR "At least one target: APR_BUILD_SHARED_LIB or APR_BUILD_STATIC_LIB must be build!")
2728
endif()
29+
if (NOT APR_USE_LIBTIFF)
30+
if (APR_TESTS OR APR_BUILD_EXAMPLES OR APR_BUILD_JAVA_WRAPPERS)
31+
message(FATAL_ERROR "Building tests, examples or java wrappers not possible when APR_USE_LIBTIFF=OFF!")
32+
endif()
33+
endif()
2834

2935
list(APPEND CMAKE_MODULE_PATH
3036
${CMAKE_CURRENT_SOURCE_DIR}/cmake/
@@ -35,7 +41,7 @@ list(APPEND CMAKE_MODULE_PATH
3541
###############################################################################
3642
set (APR_VERSION_MAJOR 1)
3743
set (APR_VERSION_MINOR 0)
38-
set (APR_VERSION_PATCH 1)
44+
set (APR_VERSION_PATCH 2)
3945
set (APR_VERSION_STRING ${APR_VERSION_MAJOR}.${APR_VERSION_MINOR}.${APR_VERSION_PATCH})
4046
execute_process(COMMAND git rev-parse HEAD
4147
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
@@ -58,13 +64,11 @@ if(APR_USE_LIBTIFF)
5864
find_package(TIFF)
5965
set(CMAKE_C_FLAGS "${CMAKE_CFLAGS} -DHAVE_LIBTIFF")
6066
set(CMAKE_CXX_FLAGS "${CMAKE_CXXFLAGS} -DHAVE_LIBTIFF")
61-
else()
62-
message(WARNING "LibTIFF support disable, this disables TIFF writing functionality.")
6367
endif()
6468

6569
# Handle OpenMP
6670
find_package(OpenMP)
67-
if(NOT OPENMP_FOUND OR DISABLE_OPENMP)
71+
if(NOT OPENMP_FOUND OR NOT APR_USE_OPENMP)
6872
message(WARNING "OpenMP support not found or disabled with current compiler. While APR can compile like this, performance might not be optimal. Please see README.md for instructions.")
6973
else()
7074
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DHAVE_OPENMP ${OpenMP_C_FLAGS}")
@@ -97,24 +101,31 @@ endif()
97101
# Add submodule GLM (include files only)
98102
include_directories("external/glm")
99103

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 ---------------------")
100110

101111
###############################################################################
102112
# Configure compiler options
103113
###############################################################################
104114
# If you ever want to compile with Intel's icc (or any other compiler) provide
105115
# compiler names/paths in cmake command like this:
106116
# CC="icc" CXX="icc" CXXFLAGS="-O3" cmake -DAPR_TESTS=1
107-
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 ")
108118
if(CMAKE_COMPILER_IS_GNUCC)
109119
set(CMAKE_CXX_FLAGS_RELEASE "-O4 -ffast-math")
110120
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
111121
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Bdynamic")
112122
if(NOT WIN32)
113-
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -ldl")
123+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -ldl -lz")
114124
endif()
115125
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
116126
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -ffast-math")
117127
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
128+
# set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lz")
118129
endif()
119130

120131
if (APR_BENCHMARK)
@@ -132,14 +143,14 @@ set(LIBRARY_NAME apr)
132143
include_directories(src)
133144

134145
set(SOURCE_FILES src/io/blosc_filter.c src/io/hdf5functions_blosc.cpp)
135-
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)
136147

137148
add_library(aprObjLib OBJECT ${SOURCE_FILES} ${SOURCE_FILES_RAYCAST})
138149

139150
if(APR_USE_CUDA)
140151
message(STATUS "APR: Building CUDA for APR")
141152
set(CMAKE_CUDA_STANDARD 14)
142-
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")
143154
if(APR_BENCHMARK)
144155
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -DAPR_BENCHMARK")
145156
endif()
@@ -148,10 +159,9 @@ if(APR_USE_CUDA)
148159
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DAPR_USE_CUDA")
149160
set(APR_CUDA_SROUCE_FILES
150161
src/algorithm/ComputeGradientCuda.cu
151-
src/algorithm/ComputeBsplineRecursiveFilter.cu
152-
src/algorithm/ComputeInverseCubicBsplineCuda.cu
153162
src/data_structures/Mesh/PixelData.cu
154-
src/algorithm/LocalIntensityScale.cu)
163+
src/algorithm/LocalIntensityScale.cu
164+
)
155165
include_directories(${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES})
156166
endif()
157167

@@ -183,7 +193,7 @@ if(APR_BUILD_SHARED_LIB)
183193
set_property(TARGET ${SHARED_TARGET_NAME} PROPERTY VERSION ${APR_VERSION_STRING})
184194
set_property(TARGET ${SHARED_TARGET_NAME} PROPERTY SOVERSION ${APR_VERSION_MAJOR})
185195

186-
target_link_libraries(${SHARED_TARGET_NAME} PRIVATE ${HDF5_LIBRARIES} ${TIFF_LIBRARIES} ${CUDA_CUDART_LIBRARY})
196+
target_link_libraries(${SHARED_TARGET_NAME} PRIVATE ${HDF5_LIBRARIES} ${TIFF_LIBRARIES} ${CUDA_CUDART_LIBRARY} ${ZLIB_LIBRARIES})
187197
if(BLOSC_FOUND)
188198
target_link_libraries(${SHARED_TARGET_NAME} PRIVATE ${BLOSC_LIBRARIES} ${ZLIB_LIBRARIES})
189199
else()

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: 1 addition & 1 deletion
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

77
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)