Skip to content

Commit

Permalink
Merge branch 'wheel-install' into 'master'
Browse files Browse the repository at this point in the history
[cmake,web] Don't overwrite `--preset wheel` in usage instructions.

See merge request ogs/ogs!5114
  • Loading branch information
bilke committed Sep 24, 2024
2 parents bb92bc6 + 47afdd5 commit 86bdefa
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
8 changes: 8 additions & 0 deletions Applications/Python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ if(NOT OGS_BUILD_WHEEL)
set(_py_build_location "${PROJECT_BINARY_DIR}/site-packages/ogs")
endif()

if(SKBUILD AND NOT OGS_BUILD_WHEEL)
message(
FATAL_ERROR
"Invalid configuration! Don't use --config-settings=cmake.args!"
"Use --config-settings=cmake.define instead or supply '--preset wheel` to cmake.args"
)
endif()

add_subdirectory(ogs)
add_subdirectory(ogs.simulator)
add_subdirectory(ogs.mesh)
Expand Down
6 changes: 1 addition & 5 deletions Applications/Python/ogs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ string(REPLACE ";" "\n" _config_content "${_config_content}")
set(_config_file ${PROJECT_BINARY_DIR}/site-packages/ogs/config.py)
file(CONFIGURE OUTPUT ${_config_file} CONTENT "${_config_content}")

if(OGS_BUILD_WHEEL)
install(FILES ${_config_file} DESTINATION ${SKBUILD_PLATLIB_DIR}/ogs)
else()
install(FILES ${_config_file} DESTINATION ${_py_install_location})
endif()
install(FILES ${_config_file} DESTINATION ${_py_install_location})

if(OGS_BUILD_WHEEL)
return()
Expand Down
4 changes: 1 addition & 3 deletions web/content/docs/devguide/advanced/python-wheel/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ pip install -v .[test]
Successfully installed ogs-6.4.2.dev1207

# To build with additional CMake arguments, e.g.:
CMAKE_ARGS="-DOGS_BUILD_PROCESSES=SteadyStateDiffusion" pip install -v .[test]
# OR
pip install -v .[test] --config-settings=cmake.args="-DOGS_BUILD_PROCESSES=SteadyStateDiffusion"
pip install -v .[test] --config-settings=cmake.define.OGS_BUILD_PROCESSES=SteadyStateDiffusion"
```
The `pip install`-step starts a new CMake-based ogs build in `_skbuild`-subdirectory (inside the source code) using the `wheel`-preset. When the CMake build is done it installs the wheel into the activated virtual environment and you can interact with it.
Expand Down

0 comments on commit 86bdefa

Please sign in to comment.