From 13ebc2dc8c8c70932a58ac08ff323abf7f8b3910 Mon Sep 17 00:00:00 2001 From: Chun Cai Date: Thu, 16 Nov 2023 14:40:06 +0800 Subject: [PATCH 1/3] Build: enable address sanitizer for Intel oneAPI compiler --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ef1c95f27c9..7befb142db8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -325,8 +325,8 @@ if(USE_ROCM) endif() if(ENABLE_ASAN) - if (CMAKE_CXX_COMPILER_ID MATCHES Intel) - message(FATAL_ERROR "Address Sanitizer is not supported on Intel compiler.") + if (CMAKE_CXX_COMPILER_ID STREQUAL "Intel") + message(FATAL_ERROR "Address Sanitizer is not supported on Intel Classic compiler. Use Intel oneAPI compiler (icpx) instead.") endif() add_compile_options( -fsanitize=address @@ -662,4 +662,4 @@ install(PROGRAMS ${ABACUS_BIN_PATH} if(ENABLE_COVERAGE) coverage_evaluate() -endif() \ No newline at end of file +endif() From 7ae2919fdbca735046613032b7e8ff9ad5ded7ce Mon Sep 17 00:00:00 2001 From: Chun Cai Date: Thu, 16 Nov 2023 14:41:26 +0800 Subject: [PATCH 2/3] Update easy_install.md --- docs/quick_start/easy_install.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/quick_start/easy_install.md b/docs/quick_start/easy_install.md index e87b5152302..31f948b9774 100644 --- a/docs/quick_start/easy_install.md +++ b/docs/quick_start/easy_install.md @@ -128,7 +128,7 @@ Here, 'build' is the path for building ABACUS; and '-D' is used for setting up s - `BUILD_TESTING=OFF`: [Build unit tests](../advanced/install.md#build-unit-tests). - `ENABLE_MPI=ON`: Enable MPI parallel compilation. If set to `OFF`, a serial version of ABACUS with PW basis only will be compiled. Currently serial version of ABACUS with LCAO basis is not supported yet, so `ENABLE_LCAO` will be automatically set to `OFF`. - `ENABLE_COVERAGE=OFF`: Build ABACUS executable supporting [coverage analysis](../CONTRIBUTING.md#generating-code-coverage-report). This feature has a drastic impact on performance. - - `ENABLE_ASAN=OFF`: Build with Address Sanitizer. This feature would help detecting memory problems. Only supports GCC. + - `ENABLE_ASAN=OFF`: Build with Address Sanitizer. This feature would help detecting memory problems. - `USE_ELPA=ON`: Use ELPA library in LCAO calculations. If this value is set to OFF, ABACUS can be compiled without ELPA library. Here is an example: From 6cdb05fad4c48e5d61bd94a323a608a48ca5681f Mon Sep 17 00:00:00 2001 From: Chun Cai Date: Thu, 16 Nov 2023 14:42:18 +0800 Subject: [PATCH 3/3] Update CONTRIBUTING.md --- docs/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 93edc15feee..424aff519a9 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -280,7 +280,7 @@ For the unexpected results when developing ABACUS, [GDB](https://www.sourceware. 4. For debugging ABACUS in multiprocessing situation, `mpirun -n 1 gdb abacus : -n 3 abacus` will attach GDB to the master process, and launch 3 other MPI processes. -For segmentation faults, ABACUS can be built with [Address Sanitizer](https://github.com/google/sanitizers/wiki/AddressSanitizer) to locate the bugs. This feature requires a GCC or Clang compiler, and does not support Intel compiler. +For segmentation faults, ABACUS can be built with [Address Sanitizer](https://github.com/google/sanitizers/wiki/AddressSanitizer) to locate the bugs. ```bash cmake -B build -DENABLE_ASAN=1