Bug#1055896: cod-tools: FTBFS: source.c:33:5: error: ‘SPGCONST’ undeclared (first use in this function); did you mean ‘OP_CONST’?

Gianfranco Costamagna locutusofborg at debian.org
Tue Nov 14 12:27:43 GMT 2023


control: tags -1 patch
control: tags -1 fixed-upstream

https://github.com/cod-developers/cod-tools/commit/2e9c0aaa367366883105fa9a7ba3d965495700f8

Just removing SPGCONST from the source.c file is enough, trivial patch attached:

Sadly I opened an upstream PR before upstream updated the branch, so the patch I uploaded in Ubuntu has my name as author

cat debian/patches/new-spdlib-build-fix.patch
Author: Gianfranco Costamagna <locutusofborg at debian.org>
Description: sed s/SPGCONST//g -i ./src/lib/perl5/COD/SPGLib/SPGLib.c

Due to upstream removing it https://github.com/spglib/spglib/pull/258/files
Bug-Debian: https://bugs.debian.org/1055896
Forwarded: https://github.com/cod-developers/cod-tools/pull/16
Last-Update: 2023-11-14

--- cod-tools-3.7.0+dfsg.orig/src/lib/perl5/COD/SPGLib/SPGLib.c
+++ cod-tools-3.7.0+dfsg/src/lib/perl5/COD/SPGLib/SPGLib.c
@@ -30,7 +30,7 @@ SV* get_sym_dataset( SV* lattice_ref, SV
      int j;
      int k;
  
-    SPGCONST double lattice[3][3];
+    double lattice[3][3];
      for( i = 0; i < 3; i++ ) {
          for( j = 0; j < 3; j++ ) {
              lattice[i][j] = SvNV( (SV*)
@@ -41,7 +41,7 @@ SV* get_sym_dataset( SV* lattice_ref, SV
          }
      }
  
-    SPGCONST double positions[natoms][3];
+    double positions[natoms][3];
      int types[natoms];
      for( i = 0; i < natoms; i++ ) {
          types[i] = SvIV( (SV*) *av_fetch( types_av, i, 0 ) );


On Mon, 13 Nov 2023 21:11:56 +0100 Sebastian Ramacher <sramacher at debian.org> wrote:
> Source: cod-tools
> Version: 3.7.0+dfsg-1
> Severity: serious
> Tags: ftbfs sid trixie
> Justification: fails to build from source (but built successfully in the past)
> X-Debbugs-Cc: sramacher at debian.org
> 
> https://buildd.debian.org/status/fetch.php?pkg=cod-tools&arch=s390x&ver=3.7.0%2Bdfsg-1%2Bb4&stamp=1699906136&raw=0
> 
> make[2]: Entering directory '/<<PKGBUILDDIR>>/src/lib/perl5/COD/SPGLib'
> swig -perl5 -Wall -outdir lib/COD/ source.i
> cc -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wno-unused-value \
> 	-I. -c \
> 	`perl -MConfig -e 'print join(" ", @Config{qw(ccflags optimize cccdlflags)}, "-I$Config{archlib}/CORE")'` \
> 	source.c source_wrap.c
> source.c: In function ‘get_sym_dataset’:
> source.c:33:5: error: ‘SPGCONST’ undeclared (first use in this function); did you mean ‘OP_CONST’?
>    33 |     SPGCONST double lattice[3][3];
>       |     ^~~~~~~~
>       |     OP_CONST
> source.c:33:5: note: each undeclared identifier is reported only once for each function it appears in
> source.c:33:13: error: expected ‘;’ before ‘double’
>    33 |     SPGCONST double lattice[3][3];
>       |             ^~~~~~~
>       |             ;
> source.c:36:13: error: ‘lattice’ undeclared (first use in this function); did you mean ‘lattice_av’?
>    36 |             lattice[i][j] = SvNV( (SV*)
>       |             ^~~~~~~
>       |             lattice_av
> source.c:44:13: error: expected ‘;’ before ‘double’
>    44 |     SPGCONST double positions[natoms][3];
>       |             ^~~~~~~
>       |             ;
> source.c:49:13: error: ‘positions’ undeclared (first use in this function)
>    49 |             positions[i][j] = SvNV( (SV*)
>       |             ^~~~~~~~~
> make[2]: *** [Makelocal-SWIG-module:36: source.o] Error 1
> 
> Cheers
> -- 
> Sebastian Ramacher
> 
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/debian-science-maintainers/attachments/20231114/993907ea/attachment.sig>


More information about the debian-science-maintainers mailing list