-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add standard install locations #2278
Conversation
untereiner
commented
Feb 6, 2023
- add GNUInstallDirs
- install examples / scripts / schema to CMAKE_INSTALL_DATAROOTDIR (i.e. read-only architecture-independent data root (share))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CMAKE_INSTALL_DATAROOTDIR
is definitely better!
src/CMakeLists.txt
Outdated
install( FILES ${SCHEMA_DIR}/schema.xsd | ||
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/${CMAKE_PROJECT_NAME}/schema ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The creation of schema.xsd
is done iff ENABLE_XML_UPDATES AND ENABLE_MPI AND UNIX AND NOT CMAKE_HOST_APPLE AND NOT ENABLE_CUDA
evaluates to true. Otherwise we're using the last existing version of schema.xsd
(yes, we commit generated code and I do agree that we shouldn't...).
Can you manage to reunite the creation of schema.xsd
and its installation. I do not think we want a mismatch between geosx
and its scheme.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I understand your point. The install is at the end outside the "if blabla then create schema" statement.
It should then install either the existing schema (the commited one) or either install the just generated one that crushed the commited one ?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The root of the issue is that, yes, we commit the generated file schema.xsd
, and I claim that it's a bad pattern (I think mostly driven by some readthedocs
deployment considerations).
As such, there will always be a moment where the schema.xsd
will be out of sync (Because someone will have forgotten to commit, for example. Or because the dev won't have ENABLE_XML_UPDATES
set to true
to save time. Or because some CLion
remote working dev pattern won't update schema.xsd
in your work tree, but only on the remote and you may not notice).
To enforce sync, we should only deploy the schema.xsd
that has been generated by the geosx
binary itself.
That way, our end-users will always have something reliable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case any deployment of GEOSX on a GPU system will not have a schema installed... which is probably not what we want? Generation is only disabled with CUDA to avoid producing diffs on LvArray type names (something developers care about), but users need the schema regardless (whether freshly generated or pre-committed) for input validation. I agree that neither solution is perfect and we should ideally improve the schema generation to not produce diffs between systems/configurations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case any deployment of GEOSX on a GPU system will not have a schema installed... which is probably not what we want?
What I do not want is that end-users get provided wrong information. It's worse than everything, because they may be building their workflow on a brittle tool, and this always gets back to us as a broken feature and we have to fix it quick. And we do not have the resources for this.
Also, having brittle side-tools can ruin the confidence users would place in geosx
. I do not think we need this.
Generation is only disabled with CUDA to avoid producing diffs on LvArray type names (something developers care about), but users need the schema regardless (whether freshly generated or pre-committed) for input validation.
Then if the schema.xsd
gets generated nevertheless in the installation folder but not into the git
working tree, this should be fine? End-users would not care about the LvArray
discrepancy? And this would generate no diff in git
.
I'm simply saying that the committed schema.xsd
cannot be considered as a trustworthy source of information.
I'd like geosx
to produce it for consistency.
As such I'm fine having an installation step which basically does geosx -s > /path/to/install/schema.xsd
.
I agree that neither solution is perfect and we should ideally improve the schema generation to not produce diffs between systems/configurations.
I think that the whole generated-doc-in-the-git pattern should be revised.
If the only reason why we do this is readthedocs
, then we should bundle the generated doc and get readthedocs
download and deploy it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I agree with you is that's a bad pattern to commit files that can be generated.
For me it is to a specific CI step to generate the documentation files and push them into a documentation
git repository for readthedocs
to find its files. I have each time a bunch of rst files to commit without really understanding the reason. It gets the commits messy IHMO.
For the time being I will follow your idea: add a specific cmake target that generates always the schema to install it
da2b8e9
to
8552216
Compare
Nevertheless, IIUC the problem is still there: we risk deploying a |
src/CMakeLists.txt
Outdated
@@ -129,9 +130,10 @@ set_target_properties( geosx PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE ) | |||
|
|||
install(TARGETS geosx RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) | |||
|
|||
set(SCHEMA_DIR ${CMAKE_SOURCE_DIR}/coreComponents/schema) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you extract SCHEMA_DIR
from the next if
scope?
It looks to me that it's not used outside of this scope?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are true, previous attempt I didn't rollback
add_custom_target( geosx_generate_install_schema | ||
ALL | ||
COMMAND geosx -s ${CMAKE_BINARY_DIR}/schema.xsd >generate_schema.log 2>&1 || (cat generate_schema.log && exit 1) | ||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR} | ||
DEPENDS geosx | ||
COMMENT "Generating XML schema to install" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I confess I was kind of fearing this: we do not have any GPU on travis so the CUDA drivers are not installed and GEOSX
cannot be run:
[1002/1083] Generating XML schema to install
FAILED: CMakeFiles/geosx_generate_install_schema /tmp/build/CMakeFiles/geosx_generate_install_schema
cd /tmp/build && /tmp/build/bin/geosx -s /tmp/build/schema.xsd >generate_schema.log 2>&1 || ( cat generate_schema.log && exit 1 )
GEOSX version: 0.2.0
- c++ compiler: clang 10.0.0
- cuda compiler version: 11.2
- MPI version: Open MPI v4.0.3, package: Debian OpenMPI, ident: 4.0.3, repo rev: v4.0.3, Mar 03, 2020
- HDF5 version: 1.12.1
...
CUDA ERROR (code = 35, CUDA driver version is insufficient for CUDA runtime version) at general.c:253
As options, we could
- Add a
cmake
option to control thiscmake
step. That implies to updatetravis
as well, and I'm not sure this will be seamless to change the option in thehost-config
s only ontravis
. - Ignore the error code (not my favorite option, obviously).
- Check for the
TRAVIS
environment variable to be present and set totrue
(see here), and deploy the schema accordingly. - Define a
cmake
option to control this step, set totrue
by default for everyone, but overwritten tofalse
ifTRAVIS
exists and is set totrue
.
If we chose the cmake
option way, we'll surely have to update the doc as well.
(Not a big deal, but still needs to be done).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This problem is CI related. We should not put a cmake ghost argument, CI specific, to resolve this CI issue IHMO.
What do you think of passing the option --build-exe-only
to the travis_build_and_test.sh
script in case of GPU related builds ? (as the green target Ubuntu CUDA debug (20.04, clang 10.0.0 + gcc 9.4.0, open-mpi 4.0.3, cuda-11.2.152)
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's obviously better to have the options properly defined in the build.
Here the option would be some --deploy-scheme
. If you manage to make it happen, that's great.
I do not think we can rely on --build-exe-only
: knowing that the tests can be built is important, even if we can't run them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean that the tests are build with option --build-exe-only
? If I understand the CMakeLists correctly they are build with the all
target.
What you want is to be able to (compile only the executable or executable and tests) and choose to install or not the schema as a separate step. Default behavior would install the schema. That's not so easy to implement only passing arguments to cmake to configure step.
Since you want to keep the default behavior and their isn't a global target to build the tests and I should not list all tests as build targets in the travis_build_and_test.sh
a simple way is to exclude from all the schema generation target when specified by the user.
If it works with GEOSX_INSTALL_SCHEMA
I will document the variable as well
@@ -187,7 +187,7 @@ jobs: | |||
env: | |||
- DOCKER_REPOSITORY=geosx/centos7.6.1810-gcc8.3.1-cuda10.1.243 | |||
- CMAKE_BUILD_TYPE=Release | |||
- BUILD_AND_TEST_ARGS="--disable-unit-tests --reduce-install-logs --disable-schema-deployment" | |||
- BUILD_AND_TEST_ARGS="--disable-unit-tests --disable-schema-deployment" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you forgot to remove https://github.com/GEOSX/GEOSX/blob/b6b0e875d1b55bca361497bb572ef83a25c31f65/scripts/travis_build_and_test.sh#L83-L87 which lead me to --reduce-install-logs
being dummy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
scripts/travis_build_and_test.sh
Outdated
|
||
|
||
exit 0 | ||
exit 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exit 0 | |
exit 0 | |
scripts/travis_build_and_test.sh
Outdated
if [[ "$*" == *--disable-schema-deployment* ]]; then | ||
GEOSX_INSTALL_SCHEMA=0 | ||
GEOSX_INSTALL_SCHEMA=0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GEOSX_INSTALL_SCHEMA=0 | |
GEOSX_INSTALL_SCHEMA=0 |
src/docs/doxygen/GeosxConfig.hpp
Outdated
@@ -114,10 +114,10 @@ | |||
/* #undef chai_VERSION */ | |||
|
|||
/// Version information for adiak | |||
#define adiak_VERSION .. | |||
/* #undef adiak_VERSION */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rollback this file. I know it's generated automatically... Sorry for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have'nt seen it. should avoit git commit -a
@@ -57,7 +61,8 @@ or_die python3 scripts/config-build.py \ | |||
-bp ${GEOSX_BUILD_DIR} \ | |||
-ip ${GEOSX_DIR} \ | |||
--ninja \ | |||
-DBLT_MPI_COMMAND_APPEND='"--allow-run-as-root;--oversubscribe"' | |||
-DBLT_MPI_COMMAND_APPEND='"--allow-run-as-root;--oversubscribe"' \ | |||
-DGEOSX_INSTALL_SCHEMA=${GEOSX_INSTALL_SCHEMA} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the logs I find
[config-build.py]:[INFO]: Passing the following unknown arguments directly to cmake: ['-DBLT_MPI_COMMAND_APPEND="--allow-run-as-root;--oversubscribe"', '-DGEOSX_INSTALL_SCHEMA=']
whatever if you've added --disable-schema-deployment
or not. Can you double check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I initialized the variable with 1 so there are -DGEOSX_INSTALL_SCHEMA=0
and -DGEOSX_INSTALL_SCHEMA=1