From 4d6fd6ac819ba543a8564c0a860ff4e456861b46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nadir=20Rom=C3=A1n=20Guerrero?= Date: Tue, 13 Jun 2023 14:26:27 +0200 Subject: [PATCH] BRAYNS 550 - Update libsonata and morphio dependencies (#1184) --- .gitlab-ci.viz.yml | 1 + .../api/circuit/MorphologyCircuitBuilder.cpp | 14 -------- plugins/deps/CMakeLists.txt | 35 +++++++++++++++---- 3 files changed, 29 insertions(+), 21 deletions(-) diff --git a/.gitlab-ci.viz.yml b/.gitlab-ci.viz.yml index 149f567be..5fcaacdb9 100644 --- a/.gitlab-ci.viz.yml +++ b/.gitlab-ci.viz.yml @@ -4,6 +4,7 @@ stages: include: - project: viz/ci/gitlabpipelines + ref: update_cpp_ubuntu_version file: index.yml ubuntu-clangformat-check: diff --git a/plugins/CircuitExplorer/api/circuit/MorphologyCircuitBuilder.cpp b/plugins/CircuitExplorer/api/circuit/MorphologyCircuitBuilder.cpp index d111b6df2..17f7b934d 100644 --- a/plugins/CircuitExplorer/api/circuit/MorphologyCircuitBuilder.cpp +++ b/plugins/CircuitExplorer/api/circuit/MorphologyCircuitBuilder.cpp @@ -72,17 +72,6 @@ class MorphologyMapBuilder } }; -class MorphIOSingletonFixer -{ -public: - static void fix(const MorphologyMap &map) - { - auto it = map.pathToCellIndices.begin(); - auto path = it->first; - NeuronMorphologyReader::read(path, true, true, true); - } -}; - class ParallelMorphologyLoader { public: @@ -103,9 +92,6 @@ class ParallelMorphologyLoader auto dendrites = morphologyParameters.load_dendrites; auto pipeline = NeuronMorphologyPipeline::fromParameters(morphologyParameters); - // TODO: Remove once a new version of MorphIO is released (current version is 3.3.4) - MorphIOSingletonFixer::fix(morphologyMap); - auto loadFn = [&](const std::string &path, const std::vector &indices) { auto morphology = NeuronMorphologyReader::read(path, soma, axon, dendrites); diff --git a/plugins/deps/CMakeLists.txt b/plugins/deps/CMakeLists.txt index a1a5c256b..17ff3452d 100644 --- a/plugins/deps/CMakeLists.txt +++ b/plugins/deps/CMakeLists.txt @@ -8,6 +8,8 @@ include(FetchContent) set(CMAKE_EXPORT_NO_PACKAGE_REGISTRY ON) set(CMAKE_INSTALL_LIBDIR lib) +find_package(Git REQUIRED) + # ============================================================================= # libsonata # ============================================================================= @@ -17,18 +19,34 @@ if(BRAYNS_CIRCUITEXPLORER_ENABLED OR BRAYNS_DTI_ENABLED AND NOT sonata_FOUND AND FetchContent_Declare( libsonata GIT_REPOSITORY https://github.com/BlueBrain/libsonata.git - GIT_TAG v0.1.20 - GIT_SHALLOW OFF # Required for its own CMakeLists.txt not to fail + GIT_TAG v0.1.21 + GIT_SHALLOW ON GIT_SUBMODULES_RECURSE ON SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/libsonata ) FetchContent_Populate(libsonata) endif() + # MorphIO requires latest version of HighFive. (2.7.1) + # libsonata version of HighFive is 2.4.0 + # We have to use libsonata version of HighFive because libsonata CMakeLists.txt both adds + # the dependency and compiles the library. + # MorphIO separates this in two CMakeLists, so we can build the library and use libsonata HighFive. + # TL;DR WE CANNOT MAKE LIBSONATA USE A DIFFERENT HIGHTFIVE THAN ITS OWN. WE NEED TO UPDATE IT TO BE + # VALID FOR MORPHIO AS WELL. + message(STATUS "> Updating libsonata's HighFive to v2.7.1") + execute_process( + COMMAND ${GIT_EXECUTABLE} checkout v2.7.1 + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/libsonata/extlib/HighFive + RESULT_VARIABLE GIT_SUBMOD_RESULT + OUTPUT_QUIET) + if(NOT GIT_SUBMOD_RESULT EQUAL "0") + message(FATAL_ERROR "Could not update libsonata's HighFive dependency") + endif() + set(EXTLIB_FROM_SUBMODULES ON CACHE BOOL "" FORCE) set(SONATA_TESTS OFF CACHE BOOL "" FORCE) - - # Force C++14 for GCC < 12.2.0 + SET(SONATA_CXX_WARNINGS OFF CACHE BOOL "" FORCE) set(CMAKE_CXX_STANDARD 14 CACHE STRING "" FORCE) add_subdirectory(libsonata) @@ -44,7 +62,7 @@ if(BRAYNS_CIRCUITEXPLORER_ENABLED OR BRAYNS_DTI_ENABLED AND NOT MorphIO_FOUND AN FetchContent_Declare( MorphIO GIT_REPOSITORY https://github.com/BlueBrain/MorphIO.git - GIT_TAG v3.3.3 + GIT_TAG v3.3.5 GIT_SHALLOW ON GIT_SUBMODULES_RECURSE ON SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/MorphIO @@ -63,11 +81,14 @@ if(BRAYNS_CIRCUITEXPLORER_ENABLED OR BRAYNS_DTI_ENABLED AND NOT MorphIO_FOUND AN add_library(lexertl INTERFACE) target_include_directories(lexertl SYSTEM INTERFACE MorphIO/3rdparty/lexertl14/include) + add_library(ghc_filesystem INTERFACE) + target_include_directories(ghc_filesystem SYSTEM INTERFACE MorphIO/3rdparty/ghc_filesystem/include) + # Retrieve version - set(MORPHIO_VERSION_STRING "3.3.2") + set(MORPHIO_VERSION_STRING "3.3.5") set(MorphIO_VERSION_MAJOR 3) set(MorphIO_VERSION_MINOR 3) - set(MorphIO_VERSION_PATCH 2) + set(MorphIO_VERSION_PATCH 5) # Morphio add_subdirectory(MorphIO/src)