Skip to content

Commit

Permalink
Added ENABLE_JULIA toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
Ananya2003Gupta committed Nov 27, 2023
1 parent 6e19bee commit 5b62bb9
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/coverity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: cvmfs-contrib/github-action-cvmfs@v3
- uses: aidasoft/run-lcg-view@v4
with:
coverity-cmake-command: 'cmake -DCMAKE_CXX_STANDARD=17 -DENABLE_SIO=ON -DUSE_EXTERNAL_CATCH2=OFF ..'
coverity-cmake-command: 'cmake -DCMAKE_CXX_STANDARD=17 -DENABLE_SIO=ON -DENABLE_JULIA=ON -DUSE_EXTERNAL_CATCH2=OFF ..'
coverity-project: 'AIDASoft%2Fpodio'
coverity-project-token: ${{ secrets.PODIO_COVERITY_TOKEN }}
github-pat: ${{ secrets.READ_COVERITY_IMAGE }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/edm4hep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
cd $STARTDIR/podio
mkdir build && cd build
cmake -DENABLE_SIO=ON \
-DENABLE_JULIA=ON \
-DCMAKE_INSTALL_PREFIX=../install \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_CXX_FLAGS=" -fdiagnostics-color=always -Werror -Wno-error=deprecated-declarations " \
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/key4hep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
mkdir build install
cd build
cmake -DENABLE_SIO=ON \
-DENABLE_JULIA=ON \
-DCMAKE_INSTALL_PREFIX=../install \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_CXX_FLAGS=" -fdiagnostics-color=always -Werror -Wno-error=deprecated-declarations " \
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
mkdir build
cd build
cmake .. -DENABLE_SIO=ON \
-DENABLE_JULIA=ON \
-DENABLE_RNTUPLE=ON \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_CXX_FLAGS=" -fdiagnostics-color=always -Werror "\
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/sanitizers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
-DCMAKE_CXX_FLAGS=" -fdiagnostics-color=always " \
-DUSE_EXTERNAL_CATCH2=OFF \
-DENABLE_SIO=ON \
-DENABLE_JULIA=ON \
-G Ninja ..
echo "::endgroup::"
echo "::group::Build"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
mkdir build install
cd build
cmake -DENABLE_SIO=ON \
-DENABLE_JULIA=ON \
-DENABLE_RNTUPLE=${{ matrix.RNTUPLE }} \
-DCMAKE_INSTALL_PREFIX=../install \
-DCMAKE_CXX_STANDARD=${{ matrix.CXX_STANDARD }} \
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
mkdir build install
cd build
cmake -DENABLE_SIO=${{ matrix.sio }} \
-DENABLE_JULIA=ON \
-DCMAKE_INSTALL_PREFIX=../install \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_CXX_FLAGS=" -fdiagnostics-color=always -Werror -Wno-error=deprecated-declarations " \
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ option(ENABLE_SIO "Build SIO I/O support" OFF)
option(PODIO_RELAX_PYVER "Do not require exact python version match with ROOT" OFF)
option(ENABLE_RNTUPLE "Build with support for the new ROOT NTtuple format" OFF)
option(PODIO_USE_CLANG_FORMAT "Use clang-format to format the code" OFF)
option(ENABLE_JULIA "Enable Julia support. When enabled, Julia datamodels will be generated, and Julia tests will run." OFF)


#--- Declare ROOT dependency ---------------------------------------------------
Expand Down
3 changes: 1 addition & 2 deletions python/templates/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,5 @@ set(PODIO_TEMPLATES

${CMAKE_CURRENT_LIST_DIR}/MutableStruct.jl.jinja2
${CMAKE_CURRENT_LIST_DIR}/ParentModule.jl.jinja2
${CMAKE_CURRENT_LIST_DIR}/macros/abstracttypes.jinja2
${CMAKE_CURRENT_LIST_DIR}/macros/params.jinja2
${CMAKE_CURRENT_LIST_DIR}/macros/julia_helpers.jinja2
)
43 changes: 25 additions & 18 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,26 +63,33 @@ add_subdirectory(schema_evolution)
CREATE_PODIO_TEST(ostream_operator.cpp "")
CREATE_PODIO_TEST(write_ascii.cpp "")

PODIO_GENERATE_DATAMODEL(datamodeljulia datalayout.yaml headers sources
IO_BACKEND_HANDLERS ${PODIO_IO_HANDLERS}
LANG julia
)

PODIO_GENERATE_DATAMODEL(extensionmodeljulia datalayout_extension.yaml ext_headers ext_sources
UPSTREAM_EDM ../../datamodeljulia:datalayout.yaml
IO_BACKEND_HANDLERS ${PODIO_IO_HANDLERS}
OUTPUT_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/extension_model
LANG julia
)
if (ENABLE_JULIA)
message(STATUS "Julia Datamodel generation is enabled.")
PODIO_GENERATE_DATAMODEL(datamodeljulia datalayout.yaml headers sources
IO_BACKEND_HANDLERS ${PODIO_IO_HANDLERS}
LANG julia
)

find_program(Julia_EXECUTABLE julia)
if (Julia_EXECUTABLE)
message(STATUS "Found Julia, will add the Julia tests")
set(UNITTEST_SCRIPT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/unittests/unittest.jl)
add_test(NAME julia-unittests COMMAND julia ${UNITTEST_SCRIPT_PATH})
set_tests_properties(julia-unittests PROPERTIES
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
PODIO_GENERATE_DATAMODEL(extensionmodeljulia datalayout_extension.yaml ext_headers ext_sources
UPSTREAM_EDM ../../datamodeljulia:datalayout.yaml
IO_BACKEND_HANDLERS ${PODIO_IO_HANDLERS}
OUTPUT_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/extension_model
LANG julia
)

find_program(Julia_EXECUTABLE julia)
if (Julia_EXECUTABLE)
message(STATUS "Found Julia, will add the Julia tests")
set(UNITTEST_SCRIPT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/unittests/unittest.jl)
add_test(NAME julia-unittests COMMAND julia ${UNITTEST_SCRIPT_PATH})
set_tests_properties(julia-unittests PROPERTIES
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
)
else()
message(WARNING "Julia not found.")
endif()
else()
message(STATUS "Julia Datamodel generation is disabled.")
endif()

# Customize CTest to potentially disable some of the tests with known problems
Expand Down

0 comments on commit 5b62bb9

Please sign in to comment.