Silo icon indicating copy to clipboard operation
Silo copied to clipboard

arbpoly3d fails to build with CMake

Open junghans opened this issue 10 months ago • 6 comments

/home/christoph/packages/Silo/Silo-4.11.1-build/Silo-main/tests/arbpoly3d.c:393:40: error: passing argument 4 of ‘DBPutUcdmesh’ from incompatible pointer type [-Wincompatible-pointer-types]
  393 |     DBPutUcdmesh(dbfile, "arbmesh", 3, coordnames, coords, nnodes, nzones, 0, 0, DB_FLOAT, ol);
      |                                        ^~~~~~~~~~
      |                                        |
      |                                        char **
In file included from /home/christoph/packages/Silo/Silo-4.11.1-build/Silo-main/tests/arbpoly3d.c:52:
/home/christoph/packages/Silo/Silo-4.11.1-build/Silo-main/redhat-linux-build/include/silo.h:2136:82: note: expected ‘const char * const*’ but argument is of type ‘char **’
 2136 | SILO_API extern int                    DBPutUcdmesh(DBfile *, char const *, int, char const * const *, DBVCP2_t, int,
      |                                                                                  ^~~~~~~~~~~~~~~~~~~~
/home/christoph/packages/Silo/Silo-4.11.1-build/Silo-main/tests/arbpoly3d.c:403:42: error: passing argument 4 of ‘DBPutUcdmesh’ from incompatible pointer type [-Wincompatible-pointer-types]
  403 |     DBPutUcdmesh(dbfile, "arbmesh_r", 3, coordnames, coords, nnodes, nzones, 0, 0, DB_FLOAT, ol);
      |                                          ^~~~~~~~~~
      |                                          |
      |                                          char **
/home/christoph/packages/Silo/Silo-4.11.1-build/Silo-main/redhat-linux-build/include/silo.h:2136:82: note: expected ‘const char * const*’ but argument is of type ‘char **’
 2136 | SILO_API extern int                    DBPutUcdmesh(DBfile *, char const *, int, char const * const *, DBVCP2_t, int,
      |                                                                                  ^~~~~~~~~~~~~~~~~~~~
/home/christoph/packages/Silo/Silo-4.11.1-build/Silo-main/tests/arbpoly3d.c:344:21: warning: unused variable ‘nl’ [-Wunused-variable]
  344 |     int            *nl;
      |                     ^~
gmake[2]: *** [tests/CMakeFiles/arbpoly3d.dir/build.make:79: tests/CMakeFiles/arbpoly3d.dir/arbpoly3d.c.o] Error 1

build-main-1.fc43.log.zip

junghans avatar Feb 27 '25 20:02 junghans

And dir as well:

/home/christoph/packages/Silo/Silo-4.11.1-build/Silo-main/tests/dir.c: In function ‘main’:
/home/christoph/packages/Silo/Silo-4.11.1-build/Silo-main/tests/dir.c:129:2: warning: #warning SEEMS LIKE HACK TO TEST SOMETHING [-Wcpp]
  129 | #warning SEEMS LIKE HACK TO TEST SOMETHING
      |  ^~~~~~~
/home/christoph/packages/Silo/Silo-4.11.1-build/Silo-main/tests/dir.c:178:2: warning: #warning CONFIRM COPY HANDLES LINK CORRECTLY [-Wcpp]
  178 | #warning CONFIRM COPY HANDLES LINK CORRECTLY
      |  ^~~~~~~
/home/christoph/packages/Silo/Silo-4.11.1-build/Silo-main/tests/dir.c:203:44: error: passing argument 4 of ‘DBPutMultimesh’ from incompatible pointer type [-Wincompatible-pointer-types]
  203 |     DBPutMultimesh(dbfile, "mmesh", nmesh, meshnames, meshtypes, NULL);
      |                                            ^~~~~~~~~
      |                                            |
      |                                            char **
In file included from /home/christoph/packages/Silo/Silo-4.11.1-build/Silo-main/tests/dir.c:64:
/home/christoph/packages/Silo/Silo-4.11.1-build/Silo-main/redhat-linux-build/include/silo.h:2196:84: note: expected ‘const char * const*’ but argument is of type ‘char **’
 2196 | SILO_API extern int                    DBPutMultimesh(DBfile *, char const *, int, char const * const *, int const *,
      |                                                                                    ^~~~~~~~~~~~~~~~~~~~
/home/christoph/packages/Silo/Silo-4.11.1-build/Silo-main/tests/dir.c:262:20: warning: variable ‘dbtoc’ set but not used [-Wunused-but-set-variable]
  262 |             DBtoc *dbtoc;
      |                    ^~~~~
/home/christoph/packages/Silo/Silo-4.11.1-build/Silo-main/tests/dir.c:97:20: warning: variable ‘objname’ set but not used [-Wunused-but-set-variable]
   97 |     char          *objname = 0;
      |                    ^~~~~~~
gmake[2]: *** [tests/CMakeFiles/sdir.dir/build.make:79: tests/CMakeFiles/sdir.dir/dir.c.o] Error 1

junghans avatar Feb 27 '25 20:02 junghans

And I saw this error in Autotools and CMake:

make[2]: Entering directory '/home/christoph/packages/Silo/Silo-4.11.1-build/Silo-main/tests'
gcc -DHAVE_CONFIG_H -I. -I..  -I./../src/silo -I./../src/silo -I/usr/include   -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Wdeclaration-after-statement -c -o listtypes.o listtypes.c
listtypes.c: In function ‘PrintObjectComponentsType’:
listtypes.c:322:21: error: format not a string literal and no format arguments [-Werror=format-security]
  322 |                     snprintf(tmpnm, sizeof(tmpnm), &(obj->pdb_names[i][4]));
      |                     ^~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [Makefile:1815: listtypes.o] Error 1

junghans avatar Feb 27 '25 21:02 junghans

Ok, looking at this now. I think these are fixed on the 4.11RC. But, will confirm.

markcmiller86 avatar Mar 04 '25 19:03 markcmiller86

Thanks, let me give it some testing.

junghans avatar Mar 04 '25 20:03 junghans

https://koji.fedoraproject.org/koji/taskinfo?taskID=129811867:

make[4]: Leaving directory '/builddir/build/BUILD/Silo-4.11.1-build/Silo-4.11RC/src/score'
/bin/sh: line 1: ../../config/mklite: cannot execute: required file not found
make[4]: *** [Makefile:777: lite_score.h] Error 127
make[4]: *** Waiting for unfinished jobs....
make[4]: Entering directory '/builddir/build/BUILD/Silo-4.11.1-build/Silo-4.11RC/src/score'

I guess have to rerun autcreonf?

junghans avatar Mar 04 '25 21:03 junghans

Ok, on gcc-12.2.1, I get the compilation error you mention above for dir.c but adjusting code to...

    DBPutMultimesh(dbfile, "mmesh", nmesh, (DBCAS_t) meshnames, meshtypes, NULL);

fixes and that is what I will be committing to fix.

The DBCAS_t type is related to https://github.com/LLNL/Silo/blob/c2414603797c24afb14e9c932707c290003a4bc8/src/silo/silo.h.in#L77-L112

markcmiller86 avatar Mar 05 '25 00:03 markcmiller86

Now fixed from work on CMake

markcmiller86 avatar Oct 17 '25 03:10 markcmiller86