Skip to content
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

Debug flags #169

Merged
merged 40 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
cda0ad7
Removed many warnings + added more checks
scemama Nov 11, 2024
d14b98b
More checks
scemama Nov 11, 2024
debee61
No warnings in trexio.c
scemama Nov 11, 2024
4bd1474
Merge branch 'det-checks' into debug_flags
scemama Nov 12, 2024
d9e56c5
Merge branch 'det-checks' into debug_flags
scemama Nov 12, 2024
fad2df8
Added sanitizer flags for fortran
scemama Nov 12, 2024
38a4b60
Added missing prototypes in the text backend
scemama Nov 12, 2024
8d534d8
Fixed unused parameters in hdf5
scemama Nov 12, 2024
1a07e65
Added download link of tar.gz in documentation
scemama Nov 20, 2024
e5a3061
Merge branch 'master' into debug_flags
scemama Dec 4, 2024
66bb1e9
Fixed bug for arrays of strings in text backend
scemama Dec 5, 2024
3638513
Fixed strncpy
scemama Dec 5, 2024
770b136
Revert "Fixed strncpy"
scemama Dec 5, 2024
a5d39ac
Replaced some strnlen by memcpy
scemama Dec 5, 2024
72619db
Removed strnlen
scemama Dec 5, 2024
cd369bd
Fix previous commit
scemama Dec 5, 2024
c7d5d42
Fixed valgrind test_f.f90
scemama Dec 6, 2024
751b3c9
Fixed valgrind issue with trim
scemama Dec 6, 2024
d2c5dc7
Merge branch 'master' into debug_flags
scemama Dec 12, 2024
35795a9
Update determinant test such that last chunk is smaller (100 dets in …
scemama Dec 29, 2024
c502a61
Merge branch 'master' into debug_flags
scemama Dec 30, 2024
8bb2c1e
Improved text backend
scemama Dec 30, 2024
8cbc71e
Fixed previous commit
scemama Dec 30, 2024
156f09f
Merge branch 'master' of github.com:TREX-CoE/trexio
scemama Dec 30, 2024
deb0e65
Merge branch 'master' into debug_flags
scemama Dec 30, 2024
886561a
Merge branch 'master' into debug_flags
q-posev Jan 2, 2025
0fd9779
Add hardcore valgring checking
q-posev Jan 2, 2025
d804b14
No need for -g in FCFLAGS
q-posev Jan 2, 2025
1513eec
Refactored CI: first do valgrind and then debug configure
q-posev Jan 2, 2025
a9cdc27
Fix CI
q-posev Jan 2, 2025
0533cc6
Fix CI
q-posev Jan 2, 2025
68d6780
Fix CI
q-posev Jan 2, 2025
a7cf055
Install valgrind for the CI
q-posev Jan 2, 2025
22be7fa
Silence prints in tests
q-posev Jan 3, 2025
155d695
Remove TODO - the error handling is manual
q-posev Jan 3, 2025
b62ddcb
Remove useless n_chunks
q-posev Jan 3, 2025
fb4e234
Implement a check to prevent data corruption for sparse I/O
q-posev Jan 3, 2025
fd1e23a
+2 -> +1
scemama Jan 8, 2025
a889bb8
TREXIO exit codes decoding function
scemama Jan 8, 2025
ff6e556
Update TREXIO exit codes decoding function
scemama Jan 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,23 @@ jobs:
- name: install dependencies
run: |
sudo apt-get update
sudo apt-get install libhdf5-dev emacs
sudo apt-get install libhdf5-dev emacs libtool-bin valgrind

- name: configure with autotools
run: |
./autogen.sh
./configure --enable-silent-rules
./configure --enable-silent-rules

- name: compile TREXIO
run: make -j2

- name: check TREXIO
run: make -j2 check # Non-parallel run
run: make -j2 check

- name: check via valgrind
run: |
which libtool
cd tests && ./run_valgrind.sh

- name: Archive test log file
if: failure()
Expand Down Expand Up @@ -113,15 +118,15 @@ jobs:
- name: maintainer clean
run: make maintainer-clean

- name: reconfigure with clang and AddressSanitizer
- name: reconfigure with debugging
run: |
./autogen.sh
./configure CC=clang-15 CFLAGS="-O2 -fsanitize=address -fno-omit-frame-pointer" LDFLAGS="-fsanitize=address" --enable-silent-rules
./configure --enable-silent-rules --enable-debug --enable-sanitizer

- name: recompile TREXIO
run: make -j2

- name: recheck TREXIO for memory leaks
- name: recheck TREXIO
run: make -j2 check

- name: Archive test log file
Expand Down
23 changes: 19 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ AS_IF([test "$ok" = "yes"],[

# Specific options required with some compilers
AS_CASE([$FC],
[*gfortran*], [FCFLAGS="$FCFLAGS -g -fPIC"],
[*flang*], [FCFLAGS="$FCFLAGS -g -fPIC"],
[*ifort*], [FCFLAGS="$FCFLAGS -g -fPIC"],
[*gfortran*], [FCFLAGS="$FCFLAGS -fPIC"],
[*flang*], [FCFLAGS="$FCFLAGS -fPIC"],
[*ifort*], [FCFLAGS="$FCFLAGS -fPIC"],
[])

])
Expand Down Expand Up @@ -131,7 +131,7 @@ AC_ARG_WITH([hdf5],
AS_HELP_STRING([--with-hdf5=PATH], [Path to HDF5 library and headers]), [
with_hdf5="$withval"], [with_hdf5="yes"])

AS_IF([test "x$with_hdf5" == "xno"], [],
AS_IF([test "x$with_hdf5" == "xno"], [],
[test "x$with_hdf5" != "xyes"], [
HDF5_LIBS="-lhdf5"
HDF5_PATH="$with_hdf5"
Expand Down Expand Up @@ -312,6 +312,21 @@ AC_CHECK_HEADERS([math.h])
AC_SEARCH_LIBS([pthread_create], [pthread], [], AC_MSG_ERROR([The pthread library is required]))
AC_CHECK_HEADERS([pthread.h])

# Debug flags

AC_ARG_ENABLE(debug, [AS_HELP_STRING([--enable-debug],[enable gcc and gfortran debug flags])], ok=$enableval, ok=no)
if test "$ok" = "yes"; then
CFLAGS="${CFLAGS} -Wall -Wextra -Wpedantic -Werror -Wshadow -Wformat -Wfloat-equal -Wconversion -Wcast-align -Wnull-dereference -Wstrict-aliasing -Winline -Wmissing-prototypes -Wunreachable-code -fstack-protector-strong -fdiagnostics-show-option -Wfloat-conversion -Wcast-qual -fno-inline -fno-omit-frame-pointer -Wno-sign-conversion -Wno-cast-qual -Wno-float-conversion" # -Wno-unused-variable"
FCFLAGS="${FCFLAGS} -g -fcheck=all -Waliasing -Wampersand -Wconversion -Wsurprising -Wintrinsics-std -Wno-tabs -Wintrinsic-shadow -Wline-truncation -Wreal-q-constant -Wuninitialized -fbacktrace -ffpe-trap=zero,overflow -finit-real=nan"
fi


AC_ARG_ENABLE(sanitizer, [AS_HELP_STRING([--enable-sanitizer],[enable sanitizer debug flags])], ok=$enableval, ok=no)
if test "$ok" = "yes"; then
CFLAGS="${CFLAGS} -fsanitize=address -fsanitize=undefined -fsanitize=leak -fsanitize=pointer-compare -fsanitize=pointer-subtract -fsanitize=bounds -fsanitize=bounds-strict"
FCFLAGS="${FCFLAGS} -fsanitize=address -fsanitize=undefined -fsanitize=leak -fsanitize=pointer-compare -fsanitize=pointer-subtract -fsanitize=bounds -fsanitize=bounds-strict"
fi


AC_CONFIG_FILES([Makefile
pkgconfig/trexio.pc])
Expand Down
Loading
Loading