Skip to content

Commit

Permalink
BRAYNS 550 - Update libsonata and morphio dependencies (#1184)
Browse files Browse the repository at this point in the history
  • Loading branch information
NadirRoGue committed Jun 13, 2023
1 parent ad1298d commit 4d6fd6a
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 21 deletions.
1 change: 1 addition & 0 deletions .gitlab-ci.viz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ stages:

include:
- project: viz/ci/gitlabpipelines
ref: update_cpp_ubuntu_version
file: index.yml

ubuntu-clangformat-check:
Expand Down
14 changes: 0 additions & 14 deletions plugins/CircuitExplorer/api/circuit/MorphologyCircuitBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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<size_t> &indices)
{
auto morphology = NeuronMorphologyReader::read(path, soma, axon, dendrites);
Expand Down
35 changes: 28 additions & 7 deletions plugins/deps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ include(FetchContent)
set(CMAKE_EXPORT_NO_PACKAGE_REGISTRY ON)
set(CMAKE_INSTALL_LIBDIR lib)

find_package(Git REQUIRED)

# =============================================================================
# libsonata
# =============================================================================
Expand All @@ -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)
Expand All @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit 4d6fd6a

Please sign in to comment.