diff --git a/.github/workflows/publish_pypi.yml b/.github/workflows/publish_pypi.yml index 96acfe1..b3e0c16 100644 --- a/.github/workflows/publish_pypi.yml +++ b/.github/workflows/publish_pypi.yml @@ -40,7 +40,7 @@ jobs: - name: Install cibuildwheel run: | - python -m pip install cibuildwheel==2.16.2 delvewheel wheel + python -m pip install cibuildwheel==2.16.2 delvewheel==1.7.1 wheel - name: Building wheels run: | diff --git a/.github/workflows/wheel_build.yml b/.github/workflows/wheel_build.yml index c11d7d1..5564d80 100644 --- a/.github/workflows/wheel_build.yml +++ b/.github/workflows/wheel_build.yml @@ -38,7 +38,7 @@ jobs: - name: Install cibuildwheel run: | - python -m pip install cibuildwheel==2.16.2 delvewheel wheel + python -m pip install cibuildwheel==2.16.2 delvewheel==1.7.1 wheel - name: Building wheels run: | diff --git a/CMakeLists.txt b/CMakeLists.txt index c3ead3c..e8ee5c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,11 @@ project(Argolid) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) +if(NOT WIN32) + set(CMAKE_CXX_VISIBILITY_PRESET hidden) + set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) +endif() + include(GNUInstallDirs) # this is a workaround for GitHub Action for wheelbuiling if(DEFINED ENV{ARGOLID_DEP_DIR}) @@ -11,22 +16,23 @@ if(DEFINED ENV{ARGOLID_DEP_DIR}) link_directories($ENV{ARGOLID_DEP_DIR}/${CMAKE_INSTALL_LIBDIR}) endif() message(STATUS "CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH}") + if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) endif() set(CMAKE_CXX_FLAGS_RELEASE "-O2") set(SOURCE - src/ts_driver/tiled_tiff/omexml.cc - src/ts_driver/tiled_tiff/tiled_tiff_key_value_store.cc - src/ts_driver/ometiff/metadata.cc - src/ts_driver/ometiff/driver.cc - src/ome_tiff_to_chunked_converter.cpp - src/chunked_pyramid_assembler.cpp - src/chunked_base_to_pyr_gen.cpp - src/ome_tiff_to_chunked_pyramid.cpp - src/utilities.cpp - src/pyramid_view.cpp + src/cpp/ts_driver/tiled_tiff/omexml.cc + src/cpp/ts_driver/tiled_tiff/tiled_tiff_key_value_store.cc + src/cpp/ts_driver/ometiff/metadata.cc + src/cpp/ts_driver/ometiff/driver.cc + src/cpp/core/ome_tiff_to_chunked_converter.cpp + src/cpp/core/chunked_pyramid_assembler.cpp + src/cpp/core/chunked_base_to_pyr_gen.cpp + src/cpp/core/ome_tiff_to_chunked_pyramid.cpp + src/cpp/core/pyramid_view.cpp + src/cpp/utilities/utilities.cpp ) include(FetchContent) @@ -52,8 +58,10 @@ find_package(filepattern REQUIRED) find_package(Threads QUIET) if (Threads_FOUND) if (CMAKE_USE_PTHREADS_INIT) - if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread") + if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread") + elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /pthread") endif() endif (CMAKE_USE_PTHREADS_INIT) list(APPEND Build_LIBRARIES ${CMAKE_THREAD_LIBS_INIT}) @@ -66,7 +74,7 @@ find_package(pybind11 CONFIG REQUIRED) pybind11_add_module(libargolid ${SOURCE} - src/python/pyramid_python_interface.cpp + src/cpp/interface/pyramid_python_interface.cpp ) # VERSION_INFO is defined by setup.py and passed into the C++ code as a define (VERSION_INFO) here. @@ -81,5 +89,9 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") target_link_libraries(libargolid PRIVATE stdc++fs) endif() -target_link_libraries(libargolid PRIVATE tensorstore::tensorstore tensorstore::all_drivers filepattern::filepattern) +target_link_libraries(libargolid PRIVATE + tensorstore::tensorstore + tensorstore::all_drivers + filepattern::filepattern + ) target_link_libraries(libargolid PRIVATE ${Build_LIBRARIES}) \ No newline at end of file diff --git a/src/chunked_base_to_pyr_gen.cpp b/src/cpp/core/chunked_base_to_pyr_gen.cpp similarity index 99% rename from src/chunked_base_to_pyr_gen.cpp rename to src/cpp/core/chunked_base_to_pyr_gen.cpp index b0a3ce7..4a64012 100644 --- a/src/chunked_base_to_pyr_gen.cpp +++ b/src/cpp/core/chunked_base_to_pyr_gen.cpp @@ -1,6 +1,6 @@ #include "chunked_base_to_pyr_gen.h" -#include "downsample.h" -#include "utilities.h" +#include "../utilities/downsample.h" +#include "../utilities/utilities.h" #include #include "plog/Initializers/RollingFileInitializer.h" diff --git a/src/chunked_base_to_pyr_gen.h b/src/cpp/core/chunked_base_to_pyr_gen.h similarity index 96% rename from src/chunked_base_to_pyr_gen.h rename to src/cpp/core/chunked_base_to_pyr_gen.h index 97d0d7b..e9ac2ec 100644 --- a/src/chunked_base_to_pyr_gen.h +++ b/src/cpp/core/chunked_base_to_pyr_gen.h @@ -2,8 +2,7 @@ #include #include #include "BS_thread_pool.hpp" -#include "utilities.h" - +#include "../utilities/utilities.h" namespace argolid{ class ChunkedBaseToPyramid{ public: diff --git a/src/chunked_pyramid_assembler.cpp b/src/cpp/core/chunked_pyramid_assembler.cpp similarity index 99% rename from src/chunked_pyramid_assembler.cpp rename to src/cpp/core/chunked_pyramid_assembler.cpp index 682c307..48c540e 100644 --- a/src/chunked_pyramid_assembler.cpp +++ b/src/cpp/core/chunked_pyramid_assembler.cpp @@ -1,5 +1,5 @@ #include "chunked_pyramid_assembler.h" -#include "utilities.h" +#include "../utilities/utilities.h" #include "pugixml.hpp" #include "tiffio.h" #include diff --git a/src/chunked_pyramid_assembler.h b/src/cpp/core/chunked_pyramid_assembler.h similarity index 95% rename from src/chunked_pyramid_assembler.h rename to src/cpp/core/chunked_pyramid_assembler.h index 1610e52..4f857fd 100644 --- a/src/chunked_pyramid_assembler.h +++ b/src/cpp/core/chunked_pyramid_assembler.h @@ -1,7 +1,7 @@ #pragma once #include -#include "utilities.h" +#include "../utilities/utilities.h" #include "BS_thread_pool.hpp" namespace argolid{ diff --git a/src/ome_tiff_to_chunked_converter.cpp b/src/cpp/core/ome_tiff_to_chunked_converter.cpp similarity index 99% rename from src/ome_tiff_to_chunked_converter.cpp rename to src/cpp/core/ome_tiff_to_chunked_converter.cpp index e473e04..b21c0b7 100644 --- a/src/ome_tiff_to_chunked_converter.cpp +++ b/src/cpp/core/ome_tiff_to_chunked_converter.cpp @@ -1,6 +1,5 @@ #include "ome_tiff_to_chunked_converter.h" -#include "utilities.h" - +#include "../utilities/utilities.h" #include #include #include diff --git a/src/ome_tiff_to_chunked_converter.h b/src/cpp/core/ome_tiff_to_chunked_converter.h similarity index 92% rename from src/ome_tiff_to_chunked_converter.h rename to src/cpp/core/ome_tiff_to_chunked_converter.h index 5a5767b..2b86dd6 100644 --- a/src/ome_tiff_to_chunked_converter.h +++ b/src/cpp/core/ome_tiff_to_chunked_converter.h @@ -2,7 +2,7 @@ #include #include "BS_thread_pool.hpp" -#include "utilities.h" +#include "../utilities/utilities.h" namespace argolid { class OmeTiffToChunkedConverter{ diff --git a/src/ome_tiff_to_chunked_pyramid.cpp b/src/cpp/core/ome_tiff_to_chunked_pyramid.cpp similarity index 100% rename from src/ome_tiff_to_chunked_pyramid.cpp rename to src/cpp/core/ome_tiff_to_chunked_pyramid.cpp diff --git a/src/ome_tiff_to_chunked_pyramid.h b/src/cpp/core/ome_tiff_to_chunked_pyramid.h similarity index 97% rename from src/ome_tiff_to_chunked_pyramid.h rename to src/cpp/core/ome_tiff_to_chunked_pyramid.h index 1612373..1360b4d 100644 --- a/src/ome_tiff_to_chunked_pyramid.h +++ b/src/cpp/core/ome_tiff_to_chunked_pyramid.h @@ -6,7 +6,7 @@ #include "ome_tiff_to_chunked_converter.h" #include "chunked_pyramid_assembler.h" #include "chunked_base_to_pyr_gen.h" -#include "utilities.h" +#include "../utilities/utilities.h" #include "BS_thread_pool.hpp" #include #include "plog/Initializers/RollingFileInitializer.h" diff --git a/src/pyramid_view.cpp b/src/cpp/core/pyramid_view.cpp similarity index 99% rename from src/pyramid_view.cpp rename to src/cpp/core/pyramid_view.cpp index eea14e0..63b133e 100644 --- a/src/pyramid_view.cpp +++ b/src/cpp/core/pyramid_view.cpp @@ -28,7 +28,7 @@ #include "pyramid_view.h" #include "chunked_base_to_pyr_gen.h" -#include "utilities.h" +#include "../utilities/utilities.h" #include "pugixml.hpp" #include #include "plog/Initializers/RollingFileInitializer.h" diff --git a/src/pyramid_view.h b/src/cpp/core/pyramid_view.h similarity index 97% rename from src/pyramid_view.h rename to src/cpp/core/pyramid_view.h index 6e79081..7a807cd 100644 --- a/src/pyramid_view.h +++ b/src/cpp/core/pyramid_view.h @@ -3,7 +3,7 @@ #include #include #include -#include "utilities.h" +#include "../utilities/utilities.h" #include "BS_thread_pool.hpp" namespace argolid{ diff --git a/src/python/pyramid_python_interface.cpp b/src/cpp/interface/pyramid_python_interface.cpp similarity index 91% rename from src/python/pyramid_python_interface.cpp rename to src/cpp/interface/pyramid_python_interface.cpp index c350e82..adefd7f 100644 --- a/src/python/pyramid_python_interface.cpp +++ b/src/cpp/interface/pyramid_python_interface.cpp @@ -1,6 +1,6 @@ -#include "../ome_tiff_to_chunked_pyramid.h" -#include "../pyramid_view.h" -#include "../utilities.h" +#include "../core/ome_tiff_to_chunked_pyramid.h" +#include "../core/pyramid_view.h" +#include "../utilities/utilities.h" #include #include namespace py = pybind11; diff --git a/src/ts_driver/ometiff/BUILD b/src/cpp/ts_driver/ometiff/BUILD similarity index 100% rename from src/ts_driver/ometiff/BUILD rename to src/cpp/ts_driver/ometiff/BUILD diff --git a/src/ts_driver/ometiff/driver.cc b/src/cpp/ts_driver/ometiff/driver.cc similarity index 99% rename from src/ts_driver/ometiff/driver.cc rename to src/cpp/ts_driver/ometiff/driver.cc index 51b2d80..4e0df34 100644 --- a/src/ts_driver/ometiff/driver.cc +++ b/src/cpp/ts_driver/ometiff/driver.cc @@ -1,5 +1,5 @@ -#include "../../src/ts_driver/ometiff/metadata.h" +#include "metadata.h" #include "tensorstore/driver/driver.h" #include "absl/status/status.h" diff --git a/src/ts_driver/ometiff/metadata.cc b/src/cpp/ts_driver/ometiff/metadata.cc similarity index 99% rename from src/ts_driver/ometiff/metadata.cc rename to src/cpp/ts_driver/ometiff/metadata.cc index ac661dd..266fb43 100644 --- a/src/ts_driver/ometiff/metadata.cc +++ b/src/cpp/ts_driver/ometiff/metadata.cc @@ -1,5 +1,5 @@ -#include "../../src/ts_driver/ometiff/metadata.h" +#include "metadata.h" // ToDo - Clean up headers #include diff --git a/src/ts_driver/ometiff/metadata.h b/src/cpp/ts_driver/ometiff/metadata.h similarity index 100% rename from src/ts_driver/ometiff/metadata.h rename to src/cpp/ts_driver/ometiff/metadata.h diff --git a/src/ts_driver/tiled_tiff/BUILD b/src/cpp/ts_driver/tiled_tiff/BUILD similarity index 100% rename from src/ts_driver/tiled_tiff/BUILD rename to src/cpp/ts_driver/tiled_tiff/BUILD diff --git a/src/ts_driver/tiled_tiff/omexml.cc b/src/cpp/ts_driver/tiled_tiff/omexml.cc similarity index 98% rename from src/ts_driver/tiled_tiff/omexml.cc rename to src/cpp/ts_driver/tiled_tiff/omexml.cc index f52cbb9..2a3dd19 100644 --- a/src/ts_driver/tiled_tiff/omexml.cc +++ b/src/cpp/ts_driver/tiled_tiff/omexml.cc @@ -1,4 +1,4 @@ -#include "../../src/ts_driver/tiled_tiff/omexml.h" +#include "omexml.h" #include #include #include diff --git a/src/ts_driver/tiled_tiff/omexml.h b/src/cpp/ts_driver/tiled_tiff/omexml.h similarity index 100% rename from src/ts_driver/tiled_tiff/omexml.h rename to src/cpp/ts_driver/tiled_tiff/omexml.h diff --git a/src/ts_driver/tiled_tiff/tiled_tiff_key_value_store.cc b/src/cpp/ts_driver/tiled_tiff/tiled_tiff_key_value_store.cc similarity index 99% rename from src/ts_driver/tiled_tiff/tiled_tiff_key_value_store.cc rename to src/cpp/ts_driver/tiled_tiff/tiled_tiff_key_value_store.cc index b0a79b1..576a2cb 100644 --- a/src/ts_driver/tiled_tiff/tiled_tiff_key_value_store.cc +++ b/src/cpp/ts_driver/tiled_tiff/tiled_tiff_key_value_store.cc @@ -1,4 +1,4 @@ -#include "../../src/ts_driver/tiled_tiff/omexml.h" +#include "omexml.h" #include #include #include diff --git a/src/downsample.h b/src/cpp/utilities/downsample.h similarity index 100% rename from src/downsample.h rename to src/cpp/utilities/downsample.h diff --git a/src/utilities.cpp b/src/cpp/utilities/utilities.cpp similarity index 100% rename from src/utilities.cpp rename to src/cpp/utilities/utilities.cpp diff --git a/src/utilities.h b/src/cpp/utilities/utilities.h similarity index 100% rename from src/utilities.h rename to src/cpp/utilities/utilities.h