Ecogenomics / BamM

Metagenomics-focused BAM file manipulation
http://ecogenomics.github.io/BamM/
GNU Lesser General Public License v3.0
16 stars 7 forks source link

libcfu :: compilation error #58

Open EricDeveaud opened 4 years ago

EricDeveaud commented 4 years ago

I'm trying to install Bamm from release tag 1.7.3 (https://github.com/Ecogenomics/BamM/archive/1.7.3.tar.gz) on a centos-8.2 system, using gcc/9.2.0 and pythton/2.7.17

I have a compilation error while building libcfu

in order to have a smaller error log and for you to be abble to reproduce the problem I've done the following

tar xf 1.7.3.tar.gz cd BamM-1.7.3/c/libcfu autoreconf -fiv ./configure make

here is the errror I have

Making all in src
make[1]: Entering directory '/opt/gensoft/src/BamM/BamM-1.7.3/c/libcfu-0.03/src'
/opt/gensoft/exe/gcc/9.2.0/bin/gcc -DPACKAGE_NAME=\"libcfu\" -DPACKAGE_TARNAME=\"libcfu\" -DPACKAGE_VERSION=\"0.03\" -DPACKAGE_STRING=\"libcfu\ 0.03\" -DPACKAGE_BUGREPORT=\"mike@mikeimelfort.com\" -DPACKAGE_URL=\"\" -DPACKAGE=\"libcfu\" -DVERSION=\"0.03\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DSTDC_HEADERS=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -Dsize_t=unsigned\ int -DTIME_WITH_SYS_TIME=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=0 -Dmalloc=rpl_malloc -DHAVE_GETTIMEOFDAY=1 -DHAVE_MEMSET=1 -DHAVE_STRCASECMP=1 -DHAVE_STRNCASECMP=1 -I.  -I../include -I/opt/gensoft/exe/gcc/9.2.0/include -I/opt/gensoft/exe/libtool/2.4.6/include -I../include -std=gnu99 -W -pthread -g -fPIC -pthread -O2 -Wall -Wno-unused-but-set-variable -Wno-unused-function -pthread -g -O2 -MT cfuhash.o -MD -MP -MF .deps/cfuhash.Tpo -c -o cfuhash.o cfuhash.c
<command-line>: error: duplicate ‘unsigned’
<command-line>: error: two or more data types in declaration specifiers
cfuhash.c: In function ‘cfuhash_bencode_strings’:
cfuhash.c:879:28: warning: format ‘%zd’ expects argument of type ‘signed size_t’, but argument 4 has type ‘unsigned int’ [-Wformat=]
  879 |   snprintf(len_str, 32, "%zd:", (keys[i] ? strlen(keys[i]) : 0));
      |                          ~~^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                            |                               |
      |                            long int                        unsigned int
      |                          %d
cfuhash.c:884:28: warning: format ‘%zd’ expects argument of type ‘signed size_t’, but argument 4 has type ‘unsigned int’ [-Wformat=]
  884 |   snprintf(len_str, 32, "%zd:", (val ? strlen(val) : 0));
      |                          ~~^    ~~~~~~~~~~~~~~~~~~~~~~~
      |                            |                       |
      |                            long int                unsigned int
      |                          %d
make[1]: *** [Makefile:431: cfuhash.o] Error 1

loog int vs unsigned int is not a prpble to fix using a cast, but I'm not abble to track down the duplicate unsigned error

can you help. ?

regards

Eric

EricDeveaud commented 4 years ago

FIY libcfu-0.0.3 from sourceforge: https://sourceforge.net/projects/libcfu/files/libcfu/libcfu-0.03/libcfu-0.03.tar.gz

compiles fine on the same system unsing the same tools, libcfu.a is generated examples compilation fails on hash_usage.c

hash_usage.c:39:33: error: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘size_t’ {aka ‘long unsigned int’} [-Werror=format=]
   39 |   sprintf(list[i][0], "test_var%d", i);
      |                                ~^   ~
      |                                 |   |
      |                                 int size_t {aka long unsigned int}
      |                                %ld
hash_usage.c:40:30: error: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘size_t’ {aka ‘long unsigned int’} [-Werror=format=]
   40 |   sprintf(list[i][1], "value%d", i);
      |                             ~^   ~
      |                              |   |
      |                              int size_t {aka long unsigned int}
      |                             %ld

etc etc....

eric

wwood commented 4 years ago

Hi,

Unfortunately BamM is no longer supported - instead it would be best to switch to CoverM https://github.com/wwood/CoverM

If you really need BamM, you might try installing according to the guix recipe, available here, which compiles as I understand. https://guix.gnu.org/packages/bamm-1.7.3/ https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/bioinformatics.scm#n183 Hope that helps. ben

Ben WoodcroftMicrobial informatics team leader Centre for Microbiome Research, Level 3, Translational Research Institute, Queensland University of Technology (https://maps.google.com/?q=Centre%20for%20Microbiome%20Research%2C%20Level%203%2C%20Translational%20Research%20Institute%2C%20Queensland%20University%20of%20Technology)

On Jun 20 2020, at 12:19 am, Eric Deveaud notifications@github.com wrote:

FIY libcfu-0.0.3 from sourceforge: https://sourceforge.net/projects/libcfu/files/libcfu/libcfu-0.03/libcfu-0.03.tar.gz compiles fine on the same system unsing the same tools, libcfu.a is generated examples compilation fails on hash_usage.c

hash_usage.c:39:33: error: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘size_t’ {aka ‘long unsigned int’} [-Werror=format=]

39 | sprintf(list[i][0], "test_var%d", i);

| ~^ ~

| | |

| int size_t {aka long unsigned int}

| %ld

hash_usage.c:40:30: error: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘size_t’ {aka ‘long unsigned int’} [-Werror=format=]

40 | sprintf(list[i][1], "value%d", i);

| ~^ ~

| | |

| int size_t {aka long unsigned int}

| %ld

etc etc.... eric — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub (https://github.com/Ecogenomics/BamM/issues/58#issuecomment-646661960), or unsubscribe (https://github.com/notifications/unsubscribe-auth/AAADX5H72XFF6LMHFESJ64LRXNXYZANCNFSM4OCYP5YQ).