RRZE-HPC / pycachesim

Python Cache Hierarchy Simulator
GNU Affero General Public License v3.0
88 stars 27 forks source link

Build failure with gcc14 #21

Open micwoj92 opened 5 months ago

micwoj92 commented 5 months ago

Hello, GCC14 turned some warnings into errors: https://gcc.gnu.org/gcc-14/porting_to.html

This makes this software fail to build, log below:

running install
/usr/lib/python3.12/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` directly.
        Instead, use pypa/build, pypa/installer or other
        standards-based tools.

        See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
        ********************************************************************************

!!
  self.initialize_options()
running build
running build_py
creating build
creating build/lib.linux-x86_64-cpython-312
creating build/lib.linux-x86_64-cpython-312/cachesim
copying cachesim/cache.py -> build/lib.linux-x86_64-cpython-312/cachesim
copying cachesim/__init__.py -> build/lib.linux-x86_64-cpython-312/cachesim
copying cachesim/backend.h -> build/lib.linux-x86_64-cpython-312/cachesim
running build_ext
building 'cachesim.backend' extension
creating build/temp.linux-x86_64-cpython-312
creating build/temp.linux-x86_64-cpython-312/cachesim
gcc -fno-strict-overflow -DNDEBUG -g -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -ffat-lto-objects -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python-pycachesim-git/src=/usr/src/debug/python-pycachesim-git -flto=auto -fPIC -I/usr/include/python3.12 -c cachesim/backend.c -o build/temp.linux-x86_64-cpython-312/cachesim/backend.o -std=c99
<command-line>: warning: "_FORTIFY_SOURCE" redefined
<command-line>: note: this is the location of the previous definition
cachesim/backend.c: In function ‘get_cacheSim_from_file’:
cachesim/backend.c:1182:36: warning: the comparison will always evaluate as ‘false’ for the address of ‘cacheSim’ will never be NULL [-Waddress]
 1182 |             if (&cacheSim[counter] == NULL)
      |                                    ^~
cachesim/backend.c:1157:12: note: ‘cacheSim’ declared here
 1157 |     Cache* cacheSim[size];
      |            ^~~~~~~~
cachesim/backend.c:1373:44: error: assignment to ‘PyObject *’ {aka ‘struct _object *’} from incompatible pointer type ‘Cache *’ [-Wincompatible-pointer-types]
 1373 |                     cacheSim[i]->load_from = cacheSim[j];
      |                                            ^
cachesim/backend.c:1378:43: error: assignment to ‘PyObject *’ {aka ‘struct _object *’} from incompatible pointer type ‘Cache *’ [-Wincompatible-pointer-types]
 1378 |                     cacheSim[i]->store_to = cacheSim[j];
      |                                           ^
cachesim/backend.c:1383:45: error: assignment to ‘PyObject *’ {aka ‘struct _object *’} from incompatible pointer type ‘Cache *’ [-Wincompatible-pointer-types]
 1383 |                     cacheSim[i]->victims_to = cacheSim[j];
      |                                             ^
cachesim/backend.c: In function ‘printStats’:
cachesim/backend.c:1447:25: error: passing argument 1 of ‘printStats’ from incompatible pointer type [-Wincompatible-pointer-types]
 1447 |         printStats(cache->load_from);
      |                    ~~~~~^~~~~~~~~~~
      |                         |
      |                         PyObject * {aka struct _object *}
cachesim/backend.c:1437:24: note: expected ‘Cache *’ but argument is of type ‘PyObject *’ {aka ‘struct _object *’}
 1437 | void printStats(Cache* cache)
      |                 ~~~~~~~^~~~~
cachesim/backend.c:1449:25: error: passing argument 1 of ‘printStats’ from incompatible pointer type [-Wincompatible-pointer-types]
 1449 |         printStats(cache->store_to);
      |                    ~~~~~^~~~~~~~~~
      |                         |
      |                         PyObject * {aka struct _object *}
cachesim/backend.c:1437:24: note: expected ‘Cache *’ but argument is of type ‘PyObject *’ {aka ‘struct _object *’}
 1437 | void printStats(Cache* cache)
      |                 ~~~~~~~^~~~~
cachesim/backend.c:1451:25: error: passing argument 1 of ‘printStats’ from incompatible pointer type [-Wincompatible-pointer-types]
 1451 |         printStats(cache->victims_to);
      |                    ~~~~~^~~~~~~~~~~~
      |                         |
      |                         PyObject * {aka struct _object *}
cachesim/backend.c:1437:24: note: expected ‘Cache *’ but argument is of type ‘PyObject *’ {aka ‘struct _object *’}
 1437 | void printStats(Cache* cache)
      |                 ~~~~~~~^~~~~
error: command '/usr/bin/gcc' failed with exit code 1
xXIty commented 2 months ago

Same here with gcc 14.1.1!