-
Notifications
You must be signed in to change notification settings - Fork 45
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
Improve TribitsExampleProject and TribitsExampleApp readme #445
Improve TribitsExampleProject and TribitsExampleApp readme #445
Conversation
- added installation description - added information regarding Fortran
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.
Just a few small tweaks are needed as noted. You can make them or I can make them.
If I make them I think I will post a stacked PR against this for my changes to make them clear. (See the stacked pull request page in Pull Request Size Matters.)
libraries from packages from `TribitsExampleProject`. If subpackage C of | ||
`TribitsExampleProject` was build, then Fortran compiler is required to build | ||
`TribitsExampleApp`. To build against all of the installed packages from an | ||
upstream `TribitsExampleProject`, configure, build, and run the tests with: |
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.
Actually, if the WithSubpackageC
subpackage or or the MixedLang
packages are built, then a Fortran compiler is required.
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.
Change pushed
@@ -3,7 +3,7 @@ | |||
The project `TribitsExampleProject` defines a TriBITS CMake project designed to | |||
provide a simple example to demonstrate how to use the TriBITS system to | |||
create a CMake build, test, and deployment system using a package-based | |||
architecture. | |||
architecture. To build `TribitsExampleProject` Fortran compiler is needed. |
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.
To build all of the packages from TribitsExampleProject
, a Fortran compiler is needed.
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.
Change pushed
and then install: | ||
|
||
``` | ||
make DESTDIR=<path-to-install-dir> 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.
Did you confirm this works? I know this works if the CMake project is using GNUInstallDirs.cmake
and specifying install()
commands correctly but I am not sure if TriBITS is doing that yet. See #411.
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.
Works fine for my, that's what I did on my machine.
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.
Great! But I thinks that only works if you specify relative paths for the various install dirs fir includes, libs, etc. But that is the default so that is why this is working I guess.
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.
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.
If that is really what DESTDIR does then you don't want to use it. No one wants things installed under <install-prefix>/user/local
.
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 is wrong with using -D CMAKE_INSTALL_PREFIX=<install-prefix>
? That does what people want (i.e. installs headers under <install-prefix>/include
, libraries under <install-prefix>/libs
, etc.) and has worked for years. The other option is to use the newer cmake --install <build-dir> --prefix <install-prefix>
command supported with CMake 3.15+. Have you tried that? That has the advantage that it works with any build tool (i.e. Makefiles or Ninja).
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.
Ross, there is nothing wrong with it. It was just a proposal. It could stay as it was.
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.
DESTDIR
is mentioned here as well. I will change it as you wanted.
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.
DESTDIR
is obviously an old Makefiles standard and CMake supports it to be a drop-in replacement for other old Makefile-based build systems. But that does not mean that you have to use it or encourage that people use it. It seems the purpose is to allow people to test the installation of things that should go under /usr/local without actually doing it. That is never that case with most of the software we are installing.
Let's never mention or use DESTDIR
in TriBITS documentation or processes.
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.
@marcinwrobel1986, more careful reading of:
make it clear that DESTDIR
is just used for "staging installs" and not for the actual final install location itself. I got confirmation from Kitware that this is how this is used. It seems the CMake documentation for DESTDIR and "Professional CMake: 10th edition" don't really mention how DESTDIR
is supposed to be used (that it is not for the final install destination). That variable name DESTDIR is a terrible name because it does not explain the intent of the variable. Based on its intent, it should be called something like STAGING_PREFIX
(see section "The Most Important Naming Consideration" in Chapter 11 "The Power of Variable Names" in the book "Code Complete: 2nd Edition").
``` | ||
|
||
`TribitsExampleProject` will be installed to | ||
`<path-to-install-dir>/usr/local/` and this path should be then used |
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.
Is that true? It will install to <path-to-install-dir>/usr/local/
? Does DESTDIR
not just override the configure-time option CMAKE_INSTALL_PREFIX
?
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.
Hello Ross,
please find logs below:
marcin@pop-os ~/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/build
ls -la ../install
total 8
drwxrwxr-x 2 marcin marcin 4096 lut 4 10:47 .
drwxrwxr-x 7 marcin marcin 4096 lut 4 10:47 ..
marcin@pop-os ~/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/build
make DESTDIR=/home/marcin/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/install install
Consolidate compiler generated dependencies of target simplecxx
[ 5%] Built target simplecxx
Consolidate compiler generated dependencies of target simplecxx-helloworld
[ 10%] Built target simplecxx-helloworld
Consolidate compiler generated dependencies of target SimpleCxx_HelloWorldTests
[ 16%] Built target SimpleCxx_HelloWorldTests
Consolidate compiler generated dependencies of target mixedlang
[ 29%] Built target mixedlang
Consolidate compiler generated dependencies of target MixedLang_RayTracerTests
[ 35%] Built target MixedLang_RayTracerTests
Consolidate compiler generated dependencies of target pws_a
[ 40%] Built target pws_a
Consolidate compiler generated dependencies of target WithSubpackagesA_a_test
[ 45%] Built target WithSubpackagesA_a_test
Consolidate compiler generated dependencies of target pws_b
[ 51%] Built target pws_b
Consolidate compiler generated dependencies of target WithSubpackagesB_b_test
[ 56%] Built target WithSubpackagesB_b_test
Consolidate compiler generated dependencies of target b_test_utils
[ 62%] Built target b_test_utils
Consolidate compiler generated dependencies of target b_mixed_lang
[ 67%] Built target b_mixed_lang
Consolidate compiler generated dependencies of target WithSubpackagesB_test_of_b_mixed_lang
[ 72%] Built target WithSubpackagesB_test_of_b_mixed_lang
Consolidate compiler generated dependencies of target c_util
[ 78%] Built target c_util
Consolidate compiler generated dependencies of target pws_c
[ 83%] Built target pws_c
Consolidate compiler generated dependencies of target WithSubpackagesC_c_test
[ 89%] Built target WithSubpackagesC_c_test
Consolidate compiler generated dependencies of target c_b_mixed_lang
[ 94%] Built target c_b_mixed_lang
Consolidate compiler generated dependencies of target WithSubpackagesC_test_of_c_b_mixed_lang
[100%] Built target WithSubpackagesC_test_of_c_b_mixed_lang
Install the project...
-- Install configuration: "RELEASE"
-- Installing: /home/marcin/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/install/usr/local/lib/external_packages/HeaderOnlyTpl/HeaderOnlyTplConfig.cmake
-- Installing: /home/marcin/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/install/usr/local/lib/external_packages/HeaderOnlyTpl/HeaderOnlyTplConfigVersion.cmake
-- Installing: /home/marcin/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/install/usr/local/include/TribitsExProj_version.h
-- Installing: /home/marcin/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/install/usr/local/lib/libsimplecxx.a
-- Installing: /home/marcin/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/install/usr/local/include/SimpleCxx_config.h
-- Installing: /home/marcin/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/install/usr/local/include/SimpleCxx_HelloWorld.hpp
-- Installing: /home/marcin/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/install/usr/local/bin/simplecxx-helloworld
-- Set runtime path of "/home/marcin/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/install/usr/local/bin/simplecxx-helloworld" to "/usr/local/lib"
-- Installing: /home/marcin/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/install/usr/local/lib/cmake/SimpleCxx/SimpleCxxConfig.cmake
-- Installing: /home/marcin/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/install/usr/local/lib/cmake/SimpleCxx/SimpleCxxTargets.cmake
-- Installing: /home/marcin/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/install/usr/local/lib/cmake/SimpleCxx/SimpleCxxTargets-release.cmake
-- Installing: /home/marcin/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/install/usr/local/lib/libmixedlang.a
-- Installing: /home/marcin/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/install/usr/local/include/MixedLang_config.h
-- Installing: /home/marcin/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/install/usr/local/include/MixedLang.hpp
-- Installing: /home/marcin/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/install/usr/local/include/Ray_Tracer.hh
-- Installing: /home/marcin/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/install/usr/local/include/Ray.hh
-- Installing: /home/marcin/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/install/usr/local/lib/cmake/MixedLang/MixedLangConfig.cmake
-- Installing: /home/marcin/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/install/usr/local/lib/cmake/MixedLang/MixedLangTargets.cmake
-- Installing: /home/marcin/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/install/usr/local/lib/cmake/MixedLang/MixedLangTargets-release.cmake
-- Installing: /home/marcin/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/install/usr/local/lib/libpws_a.a
-- Installing: /home/marcin/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/install/usr/local/include/A.hpp
-- Installing: /home/marcin/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/install/usr/local/lib/cmake/WithSubpackagesA/WithSubpackagesAConfig.cmake
-- Installing: /home/marcin/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/install/usr/local/lib/cmake/WithSubpackagesA/WithSubpackagesATargets.cmake
-- Installing: /home/marcin/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/install/usr/local/lib/cmake/WithSubpackagesA/WithSubpackagesATargets-release.cmake
-- Installing: /home/marcin/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/install/usr/local/lib/libpws_b.a
-- Installing: /home/marcin/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/install/usr/local/include/B.hpp
-- Installing: /home/marcin/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/install/usr/local/include/WithSubpackagesB_config.h
-- Installing: /home/marcin/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/install/usr/local/share/WithSubpackagesB/stuff
-- Installing: /home/marcin/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/install/usr/local/share/WithSubpackagesB/stuff/regular_file.txt
-- Installing: /home/marcin/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/install/usr/local/share/WithSubpackagesB/stuff/exec_script.sh
-- Installing: /home/marcin/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/install/usr/local/lib/cmake/WithSubpackagesB/WithSubpackagesBConfig.cmake
-- Installing: /home/marcin/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/install/usr/local/lib/cmake/WithSubpackagesB/WithSubpackagesBTargets.cmake
-- Installing: /home/marcin/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/install/usr/local/lib/cmake/WithSubpackagesB/WithSubpackagesBTargets-release.cmake
-- Installing: /home/marcin/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/install/usr/local/lib/libpws_c.a
-- Installing: /home/marcin/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/install/usr/local/include/wsp_c/C.hpp
-- Installing: /home/marcin/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/install/usr/local/lib/cmake/WithSubpackagesC/WithSubpackagesCConfig.cmake
-- Installing: /home/marcin/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/install/usr/local/lib/cmake/WithSubpackagesC/WithSubpackagesCTargets.cmake
-- Installing: /home/marcin/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/install/usr/local/lib/cmake/WithSubpackagesC/WithSubpackagesCTargets-release.cmake
-- Installing: /home/marcin/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/install/usr/local/lib/cmake/WithSubpackages/WithSubpackagesConfig.cmake
-- Installing: /home/marcin/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/install/usr/local/lib/cmake/WithSubpackages/WithSubpackagesTargets.cmake
-- Installing: /home/marcin/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/install/usr/local/lib/cmake/TribitsExProj/TribitsExProjConfig.cmake
-- Installing: /home/marcin/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/install/usr/local/lib/cmake/TribitsExProj/TribitsExProjConfigVersion.cmake
-- Installing: /home/marcin/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/install/usr/local/include/TribitsExProjConfig.cmake
marcin@pop-os ~/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/build
ls -la ../install
total 12
drwxrwxr-x 3 marcin marcin 4096 lut 4 10:50 .
drwxrwxr-x 7 marcin marcin 4096 lut 4 10:47 ..
drwxrwxr-x 3 marcin marcin 4096 lut 4 10:50 usr
marcin@pop-os ~/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/build
ls -la ../install/usr
total 12
drwxrwxr-x 3 marcin marcin 4096 lut 4 10:50 .
drwxrwxr-x 3 marcin marcin 4096 lut 4 10:50 ..
drwxrwxr-x 6 marcin marcin 4096 lut 4 10:50 local
marcin@pop-os ~/Dokumenty/NGA/projects/tribits_test/TriBITS/tribits/examples/TribitsExampleProject/build
ls -la ../install/usr/local
total 24
drwxrwxr-x 6 marcin marcin 4096 lut 4 10:50 .
drwxrwxr-x 3 marcin marcin 4096 lut 4 10:50 ..
drwxrwxr-x 2 marcin marcin 4096 lut 4 10:50 bin
drwxrwxr-x 3 marcin marcin 4096 lut 4 10:50 include
drwxrwxr-x 4 marcin marcin 4096 lut 4 10:50 lib
drwxrwxr-x 3 marcin marcin 4096 lut 4 10:50 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.
Okay then, you definitely don't want to encourage that. No one wants things installed under <install-prefix>/usr/local
. Let's remove that and go back to:
cmake -D CMAKE_INSTALL_PREFIX=<install-prefix> ...
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.
@marcinwrobel1986, looks good to me. Sorry for the confusion of over make DESTDIR install
.
Hum, I have found a weakness in GitHub Actions. If the builds/tests were broken due to no changes in the code but due to a change in the env of the container (which was fixed by PR #447) and you merge that PR, then GHA will not remerge the other PR branches and rerun the those PR builds. In fact, if you manually rerun the GHA jobs, it will just rerun with the old merges to 'master' before you pushed the fix to 'master'. The only way that I know to fix this is to go back and rebase the PR branches on 'master' and force push. That triggers a fresh merge of 'master' and a fresh set of GHA builds. (That is what I just did in PR #446.) The more I get to know GitHub Actions, the less impressed I am. It seem like they just did not think about these types of situations when they designed it. |
I will go ahead and merge even though testing does not pass due to above which has nothing to do with this PR branch. Besides, these README.md files are not used in testing at this point. |
@bartlettroscoe No problem Ross, always something to think about :) |
TribitsExProj_ENABLE_SECONDARY_TESTED_CODE=ON
as default