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

Compile fails with gcc 14.2/clang 18.1 #79

Open
lrauschning opened this issue Dec 16, 2024 · 0 comments
Open

Compile fails with gcc 14.2/clang 18.1 #79

lrauschning opened this issue Dec 16, 2024 · 0 comments

Comments

@lrauschning
Copy link

Hi all,
had a CI failure caused by a compile error during a pip installation of pypairix (see here).
Tried to compile it manually then and also got compilation errors.
On my linux machine, I get the following error trying to compile with gcc 14.2:

cd src; make; cd ..
make[1]: Entering directory '/home/src/pairix/src'
make[2]: Entering directory '/home/src/pairix/src'
gcc -c -g -w -O2 -fPIC  -D_FILE_OFFSET_BITS=64 -D_USE_KNETFILE -DBGZF_CACHE  index.c -o index.o
index.c: In function ‘ti_querys_2d_general’:
index.c:1219:31: error: initialization of ‘char **’ from incompatible pointer type ‘const char **’ [-Wincompatible-pointer-types]
 1219 |          char **chrpairlist = ti_seqname(t->idx, &n_seqpair_list);
      |                               ^~~~~~~~~~
index.c:1236:59: error: passing argument 2 of ‘ti_querys_2d_multi’ from incompatible pointer type [-Wincompatible-pointer-types]
 1236 |          sequential_iter_t *siter = ti_querys_2d_multi(t, regions, n_sub_list);
      |                                                           ^~~~~~~
      |                                                           |
      |                                                           char **
In file included from index.c:11:
pairix.h:131:73: note: expected ‘const char **’ but argument is of type ‘char **’
  131 |         sequential_iter_t *ti_querys_2d_multi(pairix_t *t, const char **regs, int nRegs);
      |                                                            ~~~~~~~~~~~~~^~~~
index.c:1246:31: error: initialization of ‘char **’ from incompatible pointer type ‘const char **’ [-Wincompatible-pointer-types]
 1246 |          char **chrpairlist = ti_seqname(t->idx, &n_seqpair_list);
      |                               ^~~~~~~~~~
index.c:1263:59: error: passing argument 2 of ‘ti_querys_2d_multi’ from incompatible pointer type [-Wincompatible-pointer-types]
 1263 |          sequential_iter_t *siter = ti_querys_2d_multi(t, regions, n_sub_list);
      |                                                           ^~~~~~~
      |                                                           |
      |                                                           char **
pairix.h:131:73: note: expected ‘const char **’ but argument is of type ‘char **’
  131 |         sequential_iter_t *ti_querys_2d_multi(pairix_t *t, const char **regs, int nRegs);
      |                                                            ~~~~~~~~~~~~~^~~~
index.c: In function ‘ti_query_2d_tid’:
index.c:1417:31: error: returning ‘ti_iter_t’ {aka ‘struct __ti_iter_t *’} from a function with return type ‘int’ makes integer from pointer without a cast [-Wint-conversion]
 1417 |         if (name == 0) return ti_iter_first();
      |                               ^~~~~~~~~~~~~~~
index.c: In function ‘get_unique_merged_seqname’:
index.c:1643:22: error: assignment to ‘char **’ from incompatible pointer type ‘const char **’ [-Wincompatible-pointer-types]
 1643 |             seqnames = ti_seqname(tbs[i]->idx,&len);
      |                      ^
index.c: In function ‘check_triangle’:
index.c:1971:23: error: initialization of ‘char **’ from incompatible pointer type ‘const char **’ [-Wincompatible-pointer-types]
 1971 |     char **seqnames = ti_seqname(idx,&len);
      |                       ^~~~~~~~~~
make[2]: *** [Makefile:15: index.o] Error 1
make[2]: Leaving directory '/home/src/pairix/src'
make[1]: *** [Makefile:18: all-recur] Error 1
make[1]: Leaving directory '/home/src/pairix/src'

And a similar error running the compile with clang 18.1:

cd src; make; cd ..
make[1]: Entering directory '/home/src/pairix/src'
make[2]: Entering directory '/home/src/pairix/src'
clang -c -g -w -O2 -fPIC  -D_FILE_OFFSET_BITS=64 -D_USE_KNETFILE -DBGZF_CACHE  index.c -o index.o
index.c:1417:24: error: incompatible pointer to integer conversion returning 'ti_iter_t' (aka 'struct __ti_iter_t *') from a function with result type 'int' [-Wint-conversion]
 1417 |         if (name == 0) return ti_iter_first();
      |                               ^~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [Makefile:15: index.o] Error 1
make[2]: Leaving directory '/home/src/pairix/src'
make[1]: *** [Makefile:18: all-recur] Error 1
make[1]: Leaving directory '/home/src/pairix/src'

Also, pypi still seems to be on version 0.3.7.
Happy to contribute to fix this, but would appreciate some pointers – I'm a bit wary of messing with types in a large C codebase.

Cheers and happy winter holidays,
Leon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant