Skip to content

Commit

Permalink
Merge branch 'tfel-python-nb' into 'master'
Browse files Browse the repository at this point in the history
[nb] Make tfel available

See merge request ogs/ogs!4842
  • Loading branch information
bilke committed Dec 18, 2023
2 parents 55b15d1 + 3d0c726 commit e2c94a2
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 14 deletions.
17 changes: 11 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -232,13 +232,18 @@ if(OGS_WRITE_BENCHMARK_COMMANDS)
endif()

# cmake-lint: disable=E1126
file(
CONFIGURE
OUTPUT
.envrc
CONTENT
"PATH_add ${CMAKE_INSTALL_BINDIR}\n[ -d \".venv\" ] && source .venv/bin/activate"
set(_envrc_content
"[ -d \"${PROJECT_BINARY_DIR}/.venv\" ] && source ${PROJECT_BINARY_DIR}/.venv/bin/activate"
"export PATH=$PATH:${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}"
)
if(_TFEL_SITE-PACKAGES_DIR)
set(_envrc_content
"${_envrc_content}"
"export PYTHONPATH=${_TFEL_SITE-PACKAGES_DIR}:$PYTHONPATH"
)
endif()
string(REPLACE ";" "\n" _envrc_content "${_envrc_content}")
file(CONFIGURE OUTPUT .envrc CONTENT "${_envrc_content}")

check_header_compilation()

Expand Down
4 changes: 2 additions & 2 deletions scripts/ci/extends/template-build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
- ln -s `$readlink_cmd -f $build_dir_full` build/${CMAKE_PRESET}
- ([[ $BUILD_CTEST_LARGE_ON_MASTER && "${CI_COMMIT_BRANCH}" == "master" ]]) && export BUILD_CTEST_LARGE=true
- cmake --preset=$CMAKE_PRESET --log-level=VERBOSE -Wno-dev $CMAKE_ARGS
# Activate .venv
- test -f $build_dir_full/.venv/bin/activate && source $build_dir_full/.venv/bin/activate
# Activate .venv via .envrc
- test -f $build_dir_full/.venv/bin/activate && source $build_dir_full/.envrc
- |
function maybe_run_with_xvfb()
{
Expand Down
19 changes: 13 additions & 6 deletions scripts/cmake/DependenciesExternalProject.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,6 @@ if(OGS_USE_MFRONT)
"-DPython_ADDITIONAL_VERSIONS=${_py_version_major_minor}"
"-Denable-python-bindings=ON"
)
message(
STATUS
"TFEL build with Python bindings. To use them:\n "
" export PYTHONPATH=${PROJECT_BINARY_DIR}/_ext/TFEL/lib/python"
"${_py_version_major_minor}/site-packages:$PYTHONPATH"
)
else()
# Cleanup variables from previous find_package()-call
unset(Boost_INCLUDE_DIR)
Expand Down Expand Up @@ -111,8 +105,20 @@ if(OGS_USE_MFRONT)
STATUS
"ExternalProject_Add(): added package TFEL@rliv-${ogs.minimum_version.tfel-rliv}"
)
if(Boost_${_py_boost_comp}_FOUND)
set(_TFEL_SITE-PACKAGES_DIR
"${build_dir_TFEL}/lib/python${_py_version_major_minor}/site-packages"
CACHE INTERNAL ""
)
endif()
set(TFELHOME ${build_dir_TFEL} CACHE PATH "" FORCE)
endif()
if(_TFEL_SITE-PACKAGES_DIR)
message(
STATUS "TFEL build with Python bindings. To use them:\n "
" export PYTHONPATH=${_TFEL_SITE-PACKAGES_DIR}:$PYTHONPATH"
)
endif()
endif()

if(OGS_USE_PETSC)
Expand Down Expand Up @@ -350,6 +356,7 @@ endif()
# Building from source requires newer hdf version
string(REPLACE "." "_" HDF5_TAG ${ogs.tested_version.hdf5})

# cmake-lint: disable=C0103
if(COMPILER_IS_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13.2)
set(ogs.minimum_version.vtk "9.3.0")
endif()
Expand Down

0 comments on commit e2c94a2

Please sign in to comment.