Skip to content

Nwchem-7.2.3 fails to compile with gcc-15 -std=gnu23 #1082

@marcindulak

Description

@marcindulak

Describe the bug

For 8701f25, the compilation fails on Fedora42, gcc version 15.0.1 20250114 (Red Hat 15.0.1-0) (GCC), with

md5wrap.c: In function ‘checksum_init’:
md5wrap.c:48:5: error: too many arguments to function ‘MD5Init’; expected 0, have 1
   48 |     MD5Init(&context);
                  ^

Attach log files

Build on fedora42 https://koji.fedoraproject.org/koji/taskinfo?taskID=129346569, the log is attached for reference build.log

After applying a fix sed -i 's|-O0 -g|-std=gnu17 -O0 -g|' src/util/md5/GNUmakefile, other errors follow up https://koji.fedoraproject.org/koji/taskinfo?taskID=129347266 build.log

clustrfix.c:140:23: error: prototype for ‘relgap’ declares fewer arguments than previous old-style definition
  140 |   DoublePrecision xj, relgap(), delta1, delta2;
      |                       ^~~~~~
...

It may be possible to silence them individually, but I only successfully tried globally with export CC='gcc -std=gnu17'.

Additional context

The errors appear to be related to https://gcc.gnu.org/gcc-15/changes.html#c

GCC 15 changes the default language version for C compilation from -std=gnu17 to -std=gnu23.

The problem looks similar to GlobalArrays/ga#359

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions