From 2f9b8d67e7bcc681e3d8ce450865b252f823a475 Mon Sep 17 00:00:00 2001 From: wspear Date: Mon, 4 Mar 2024 12:09:48 -0800 Subject: [PATCH 1/3] Allow alternate tau dir for tests --- CMakeLists.txt | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9a746fe..7c39f2b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -315,36 +315,43 @@ endforeach() ################ -# The following paths are fragile and somewhat specific to +# The following default paths are fragile and somewhat specific to # the salt-dev container. -# More abstract & robust logic for reasoning about TAU -# isntallations and their locations would be helpful here. +# For alternative TAU installs add -DTAU_ROOT= to the +# cmake invication. Make sure TAU is built with these +# configurations: -pthread -cc=clang -c++=clang++ -bfd=download +# -unwind=download -dwarf=download -otf=download +# and -pthread -bfd=download -unwind=download -libdwarf=download +# -otf=download + +set(TAU_ROOT "/usr/local" CACHE PATH "TAU Root Directory") + find_file(TAU_CLANG_MAKEFILE Makefile.tau-clang-pthread - PATH_SUFFIXES x86_64 x86_64/lib +PATHS ${TAU_ROOT} PATH_SUFFIXES x86_64 x86_64/lib ) find_file(TAU_GCC_MAKEFILE Makefile.tau-pthread - PATH_SUFFIXES x86_64 x86_64/lib +PATHS ${TAU_ROOT} PATH_SUFFIXES x86_64 x86_64/lib ) find_program(TAUCC tau_cc.sh - PATH_SUFFIXES x86_64 x86_64/bin +PATHS ${TAU_ROOT} PATH_SUFFIXES x86_64 x86_64/bin ) find_program(TAUCXX tau_cxx.sh - PATH_SUFFIXES x86_64 x86_64/bin +PATHS ${TAU_ROOT} PATH_SUFFIXES x86_64 x86_64/bin ) find_program(TAU_EXEC tau_exec - PATH_SUFFIXES x86_64 x86_64/bin +PATHS ${TAU_ROOT} PATH_SUFFIXES x86_64 x86_64/bin ) set(TAU_HEADER_LOCATIONS - -I/usr/local/include + -I${TAU_ROOT}/include ) set(TAU_CLANG_HEADER_LOCATIONS - -I/usr/local/x86_64/libdwarf-clang/include - -I/usr/local/x86_64/libunwind-1.3.1-clang/include + -I${TAU_ROOT}/x86_64/libdwarf-clang/include + -I${TAU_ROOT}/x86_64/libunwind-1.3.1-clang/include ) set(TAU_GCC_HEADER_LOCATIONS - -I/usr/local/x86_64/libdwarf-clang/include - -I/usr/local/x86_64/libunwind-1.3.1-clang/include + -I${TAU_ROOT}/x86_64/libdwarf-clang/include + -I${TAU_ROOT}/x86_64/libunwind-1.3.1-clang/include ) # End of section that note applies to ################ From b20c3cb614f6f90ebec78092fd7a5294fe744746 Mon Sep 17 00:00:00 2001 From: wspear Date: Mon, 4 Mar 2024 12:16:56 -0800 Subject: [PATCH 2/3] Update README.md --- README.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7565c49..45a894e 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ may fix the problem. ``` shell $ docker pull paratools/salt-dev:latest -$ docker run -it --pull --tmpfs=/dev/shm:rw,nosuid,nodev,exec \ +$ docker run -it --pull always --tmpfs=/dev/shm:rw,nosuid,nodev,exec \ --privileged -v $(pwd):/home/salt/src paratools/salt-dev:latest # cd /home/salt/src # ccache --show-stats @@ -106,11 +106,20 @@ The tests are all located in the `tests` subdirectory of the project. * Old profiles associated with each test are JIT removed * New profiles are moved to subdirectories indicating which test they are assosciated with -A limitation of the tests is that they assume a TAU installation matching the [salt-dev] +By default the tests assume a TAU installation matching the [salt-dev] development image. If you don't have a GCC and Clang configuration of TAU installed into the default location (`/usr/local/x86_64/`) then some of the tests will fail. +Alternatively you can add `-DTAU_ROOT=` to the cmake invocation to point the tests +to a different location. The tests require TAU to be built with these two configurations: + + `-pthread -cc=clang -c++=clang++ -bfd=download -unwind=download -dwarf=download -otf=download` + + and + + `-pthread -bfd=download -unwind=download -libdwarf=download -otf=download` + ### 5. Example usage: ``` From 702336ec07caf86d398fd0b73da1770bcfc53e95 Mon Sep 17 00:00:00 2001 From: wspear Date: Mon, 4 Mar 2024 13:41:31 -0800 Subject: [PATCH 3/3] Update README.md --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 45a894e..460aaf6 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ for testing with both GCC and Clang. ### 3. Configure and build SALT: This step is most easily performed in the [salt-dev] container, -but can also be performed in a suitable installation of LLVM and Clang are present. +but can also be performed if a suitable installation of LLVM and Clang are present. ``` shell # Tell CMake to use the clang/clang++ compiler to build SALT @@ -75,6 +75,8 @@ export CXX=clang++ cmake -Wdev -Wdeprecated -S . -B build cmake --build build --parallel # Add --verbose to debug something going wrong ``` +To specify a TAU installation for testing other than the one used by the [salt-dev] container +you can add `-DTAU_ROOT=` to the first cmake invocation. If the Ninja build system is present and you prefer it to Makefiles (it's already present in the [salt-dev] container image), @@ -107,12 +109,10 @@ The tests are all located in the `tests` subdirectory of the project. * New profiles are moved to subdirectories indicating which test they are assosciated with By default the tests assume a TAU installation matching the [salt-dev] -development image. -If you don't have a GCC and Clang configuration of TAU installed into the default location -(`/usr/local/x86_64/`) then some of the tests will fail. +development image (located at `/usr/local/x86_64/` with a GCC and Clang configuration). -Alternatively you can add `-DTAU_ROOT=` to the cmake invocation to point the tests -to a different location. The tests require TAU to be built with these two configurations: +To use a different TAU installation add `-DTAU_ROOT=` to the cmake invocation. +The specified directory should point to a TAU install built with at least these two configurations: `-pthread -cc=clang -c++=clang++ -bfd=download -unwind=download -dwarf=download -otf=download`