Fix header file checks to not depend on hardcoded paths#681
Conversation
|
This test should be disabled when using a normal build. Besides adding unnecessary extra build time to rocblas, it also uses hardcoded paths that will break when hcc and hip are in non-standard paths. The best solution is to create cmake targets that are Of course, that is more work, so in the short term you can disable the test when tests are disabled in cmake via the |
|
If there are more hard coded paths which need to use variables instead, we can add them. This is intentionally done at build time, because it's closely tied to the build make system, and the rocBLAS test build system is very dissimilar. Also, errors in this script are hard build errors, not just test failures, meaning that the product is unreleaseable. The time is minimal with parallelism (<10 seconds the first time; instantaneous on later builds). You are basing it on the old version, which was not parallel. The compiler arguments are hard-coded intentionally to test different use-case scenarios. If one of them fails, it is a concern to us. We want to ensure different compilers and different languages can compile all headers. |
The cmake targets should be used for the usage requirements not a bunch of variables.
As a user installing rocBLAS, it is not necessary.
Yes, but that should've been checked by the CI before merging. As a user, I assume you have already tested all these things, I just need to build and install rocBLAS.
You can make the tests for different languages in cmake, and also you can set different compilers in the clients if you want to test different compilers for the same language. Ideally, you would have a C test in rocblas to test the headers with vanilla gcc. Another test in rocBLAS to test the headers with |
|
As a user, with an unknown ROCm installed, unknown previous version of rocBLAS installed, etc., we need to run these "tests" at build time. We may add other checks in the future. Two weeks ago, the original issue was taken over by someone who could not build rocBLAS without it hanging, until he removed a previous rocBLAS. As we transition between different compilers and GPU targets, this kind of checking is best done at build time, to save time later. .githooks is not the place to check it, because Git commands are unrelated to build status -- someone may want to make commits before builds. These checks should be done post-builds, not pre-commit. They verify that rocBLAS is compatible with the user's build environment, while allowing flexibility. |
zaliu
left a comment
There was a problem hiding this comment.
LGTM; thanks so much Paul for your effort and comments. We can continue to make improvements later.
Merge rocBLAS PR#1190 to use CMAKE_CXX_COMPILER_ID to detect Clang
resolves #664
Change
header_compilation_tests.shto use CMake variables and data extracted from files, instead of hard-coded paths.I have verified that it works in a
/tmpbuild directory instead of the standard rocBLAS build tree. Runninginstall.shand runningmakefrombuild/releasestill run the header checks.We are nearing code-complete and this will be merged into
master(or thestagingbranch) shortly, which will add parallelism to the existing script onmaster, making it less annoying during builds.