Compilation error
Closed this issue · 14 comments
Hello,
I encountered the following error when compiling smartdenovo. Could you help to diagnose what might have caused this problem? Thanks!
....
wtzmo.c:91:1: note: in expansion of macro ‘define_list’
define_list(pbreadv, pbread_t);
^~~~~~~~~~~
wtzmo.c: In function ‘push_long_read_wtzmo’:
wtzmo.c:210:2: warning: incompatible implicit declaration of built-in function ‘memcpy’
memcpy(ptr, name, name_len);
^~~~~~
wtzmo.c:210:2: note: include ‘<string.h>’ or provide a declaration of ‘memcpy’
wtzmo.c: In function ‘thread_midx_func’:
wtzmo.c:247:1: warning: incompatible implicit declaration of built-in function ‘memset’
memset(&U, 0, sizeof(hzmh_t));
^~~~~~
wtzmo.c:247:1: note: include ‘<string.h>’ or provide a declaration of ‘memset’
wtzmo.c: In function ‘thread_mzmo_func’:
wtzmo.c:789:1: warning: incompatible implicit declaration of built-in function ‘memset’
memset(&SEED[0], 0, sizeof(wt_seed_t));
^~~~~~
wtzmo.c:789:1: note: include ‘<string.h>’ or provide a declaration of ‘memset’
wtzmo.c:1058:15: warning: implicit declaration of function ‘strdup’ [-Wimplicit-function-declaration]
HIT.cigar = strdup(cigar_str->string);
^~~~~~
wtzmo.c:1058:15: warning: incompatible implicit declaration of built-in function ‘strdup’
In file included from wtzmo.c:25:0:
wtzmo.c: In function ‘main’:
file_reader.h:97:30: warning: implicit declaration of function ‘ref_VStrv’; did you mean ‘ref_diagv’? [-Wimplicit-function-declaration]
#define get_col_str(fr, col) ref_VStrv((fr)->tabs, col)->string
^
wtzmo.c:1738:28: note: in expansion of macro ‘get_col_str’
set_read_clip_wtzmo(wt, get_col_str(fr, 0), atoi(get_col_str(fr, 1)), atoi(get_col_str(fr, 2)));
^~~~~~~~~~~
file_reader.h:97:56: error: invalid type argument of ‘->’ (have ‘int’)
#define get_col_str(fr, col) ref_VStrv((fr)->tabs, col)->string
^
wtzmo.c:1738:28: note: in expansion of macro ‘get_col_str’
set_read_clip_wtzmo(wt, get_col_str(fr, 0), atoi(get_col_str(fr, 1)), atoi(get_col_str(fr, 2)));
^~~~~~~~~~~
file_reader.h:97:56: error: invalid type argument of ‘->’ (have ‘int’)
#define get_col_str(fr, col) ref_VStrv((fr)->tabs, col)->string
^
wtzmo.c:1738:53: note: in expansion of macro ‘get_col_str’
set_read_clip_wtzmo(wt, get_col_str(fr, 0), atoi(get_col_str(fr, 1)), atoi(get_col_str(fr, 2)));
^~~~~~~~~~~
file_reader.h:97:56: error: invalid type argument of ‘->’ (have ‘int’)
#define get_col_str(fr, col) ref_VStrv((fr)->tabs, col)->string
^
wtzmo.c:1738:79: note: in expansion of macro ‘get_col_str’
set_read_clip_wtzmo(wt, get_col_str(fr, 0), atoi(get_col_str(fr, 1)), atoi(get_col_str(fr, 2)));
^~~~~~~~~~~
file_reader.h:97:56: error: invalid type argument of ‘->’ (have ‘int’)
#define get_col_str(fr, col) ref_VStrv((fr)->tabs, col)->string
^
wtzmo.c:1766:43: note: in expansion of macro ‘get_col_str’
if((pb1 = kv_get_cuhash(wt->rdname2id, get_col_str(fr, 0))) == 0xFFFFFFFFU) continue;
^~~~~~~~~~~
file_reader.h:97:56: error: invalid type argument of ‘->’ (have ‘int’)
#define get_col_str(fr, col) ref_VStrv((fr)->tabs, col)->string
^
wtzmo.c:1767:43: note: in expansion of macro ‘get_col_str’
if((pb2 = kv_get_cuhash(wt->rdname2id, get_col_str(fr, 1))) == 0xFFFFFFFFU) continue;
^~~~~~~~~~~
Makefile:33: recipe for target 'wtzmo' failed
make: *** [wtzmo] Error 1
Best,
Jia-Xing
Hi Jue,
I worked around that problem by switching to an alternative server for my task. But now since I need to work with my main server, I need to reopen this issue to look for a formal solution. I have checked the the thread that you mentioned and did similar check. But since what I got is a bit different from what the other user described in that thread, so I might need you further help for this.
Here is what I got after typing gcc -v and cpp -v:
gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib64/gcc/x86_64-suse-linux/7/lto-wrapper
OFFLOAD_TARGET_NAMES=hsa:nvptx-none
Target: x86_64-suse-linux
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64 --enable-languages=c,c++,objc,fortran,obj-c++,ada,go --enable-offload-targets=hsa,nvptx-none=/usr/nvptx-none, --without-cuda-driver --enable-checking=release --disable-werror --with-gxx-include-dir=/usr/include/c++/7 --enable-ssp --disable-libssp --disable-libvtv --disable-libcc1 --enable-plugin --with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE Linux' --with-slibdir=/lib64 --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --with-default-libstdcxx-abi=gcc4-compatible --enable-version-specific-runtime-libs --with-gcc-major-version-only --enable-linker-build-id --enable-linux-futex --enable-gnu-indirect-function --program-suffix=-7 --without-system-libunwind --enable-multilib --with-arch-32=x86-64 --with-tune=generic --build=x86_64-suse-linux --host=x86_64-suse-linux
Thread model: posix
gcc version 7.3.0 (SUSE Linux)
cpp -v
Using built-in specs.
COLLECT_GCC=cpp
COLLECT_LTO_WRAPPER=/usr/lib64/gcc/x86_64-suse-linux/7/lto-wrapper
OFFLOAD_TARGET_NAMES=hsa:nvptx-none
Target: x86_64-suse-linux
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64 --enable-languages=c,c++,objc,fortran,obj-c++,ada,go --enable-offload-targets=hsa,nvptx-none=/usr/nvptx-none, --without-cuda-driver --enable-checking=release --disable-werror --with-gxx-include-dir=/usr/include/c++/7 --enable-ssp --disable-libssp --disable-libvtv --disable-libcc1 --enable-plugin --with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE Linux' --with-slibdir=/lib64 --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --with-default-libstdcxx-abi=gcc4-compatible --enable-version-specific-runtime-libs --with-gcc-major-version-only --enable-linker-build-id --enable-linux-futex --enable-gnu-indirect-function --program-suffix=-7 --without-system-libunwind --enable-multilib --with-arch-32=x86-64 --with-tune=generic --build=x86_64-suse-linux --host=x86_64-suse-linux
Thread model: posix
gcc version 7.3.0 (SUSE Linux)
Thanks!
Best,
Jia-Xing
Let us first check the issue in ruanjue/wtdbg#4 .
1, echo $CPATH
2, cpp -v
, you post partial text in last message
Also, please make sure the compilation error was the same with the first message you had reported.
Best,
Jue
hmm, I noticed that my email got truncated somehow. So here I re-paste the very last few lines for the compilation error:
wtzmo.c:1058:15: warning: incompatible implicit declaration of built-in function ‘strdup’
In file included from wtzmo.c:25:0:
wtzmo.c: In function ‘main’:
file_reader.h:97:30: warning: implicit declaration of function ‘ref_VStrv’; did you mean ‘ref_diagv’? [-Wimplicit-function-declaration]
#define get_col_str(fr, col) ref_VStrv((fr)->tabs, col)->string
^
wtzmo.c:1738:28: note: in expansion of macro ‘get_col_str’
set_read_clip_wtzmo(wt, get_col_str(fr, 0), atoi(get_col_str(fr, 1)), atoi(get_col_str(fr, 2)));
^~~~~~~~~~~
file_reader.h:97:56: error: invalid type argument of ‘->’ (have ‘int’)
#define get_col_str(fr, col) ref_VStrv((fr)->tabs, col)->string
^
wtzmo.c:1738:28: note: in expansion of macro ‘get_col_str’
set_read_clip_wtzmo(wt, get_col_str(fr, 0), atoi(get_col_str(fr, 1)), atoi(get_col_str(fr, 2)));
^~~~~~~~~~~
file_reader.h:97:56: error: invalid type argument of ‘->’ (have ‘int’)
#define get_col_str(fr, col) ref_VStrv((fr)->tabs, col)->string
^
wtzmo.c:1738:53: note: in expansion of macro ‘get_col_str’
set_read_clip_wtzmo(wt, get_col_str(fr, 0), atoi(get_col_str(fr, 1)), atoi(get_col_str(fr, 2)));
^~~~~~~~~~~
file_reader.h:97:56: error: invalid type argument of ‘->’ (have ‘int’)
#define get_col_str(fr, col) ref_VStrv((fr)->tabs, col)->string
^
wtzmo.c:1738:79: note: in expansion of macro ‘get_col_str’
set_read_clip_wtzmo(wt, get_col_str(fr, 0), atoi(get_col_str(fr, 1)), atoi(get_col_str(fr, 2)));
^~~~~~~~~~~
file_reader.h:97:56: error: invalid type argument of ‘->’ (have ‘int’)
#define get_col_str(fr, col) ref_VStrv((fr)->tabs, col)->string
^
wtzmo.c:1766:43: note: in expansion of macro ‘get_col_str’
if((pb1 = kv_get_cuhash(wt->rdname2id, get_col_str(fr, 0))) == 0xFFFFFFFFU) continue;
^~~~~~~~~~~
file_reader.h:97:56: error: invalid type argument of ‘->’ (have ‘int’)
#define get_col_str(fr, col) ref_VStrv((fr)->tabs, col)->string
^
wtzmo.c:1767:43: note: in expansion of macro ‘get_col_str’
if((pb2 = kv_get_cuhash(wt->rdname2id, get_col_str(fr, 1))) == 0xFFFFFFFFU) continue;
^~~~~~~~~~~
Makefile:33: recipe for target 'wtzmo' failed
make: *** [wtzmo] Error 1
Thanks. It was caused by gcc locating string.h in '.' instead of system include path.
1, Please give the result of echo $CPATH
.
2, Have A look at ruanjue/wtdbg#4, cpp -v
gave more information than you got.
In my computer: cpp -v
> cpp -v
Using built-in specs.
COLLECT_GCC=cpp
Target: x86_64-unknown-linux-gnu
Configured with: ./configure --prefix=/public/software/gcc-5.2.0 --enable-threads=posix --disable-checking --disable-multilib --enable-languages=c,c++ --with-gmp=/public/software/gcc-5.2.0/gmp-4.2.3 --with-mpfr=/public/software/gcc-5.2.0/mpfr-2.4.2 --with-mpc=/public/software/gcc-5.2.0/mpc-0.8.1
Thread model: posix
gcc version 5.2.0 (GCC)
COLLECT_GCC_OPTIONS='-E' '-v' '-mtune=generic' '-march=x86-64'
/public/software/gcc-5.2.0/libexec/gcc/x86_64-unknown-linux-gnu/5.2.0/cc1 -E -quiet -v - -mtune=generic -march=x86-64
ignoring nonexistent directory "/public/software/gcc-5.2.0/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../../x86_64-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/public/software/compiler/intel/composer_xe_2013_sp1.0.080/mkl/include
/public/software/gcc-5.2.0/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/include
/usr/local/include
/public/software/gcc-5.2.0/include
/public/software/gcc-5.2.0/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/include-fixed
/usr/include
End of search list.
Best,
Jue
Ok, let us try cpp -v /dev/null -o /dev/null
.
I haven't upgrate gcc to 7.3. Let us try:
1, echo | gcc -E -Wp,-v -
2, echo $C_INCLUDE_PATH
3, echo $CPLUS_INCLUDE_PATH
Yeah! Found it. The dot .
#include "..." search starts here:
#include <...> search starts here:
.
/scratch/bin/samtools/include/
Now, modify the C_INCLUDE_PATH, export C_INCLUDE_PATH=/scratch/bin/samtools/include/
, and compile program again.
Regards,
Jue
Cheers