samtools / bcftools

This is the official development repository for BCFtools. See installation instructions and other documentation here http://samtools.github.io/bcftools/howtos/install.html
http://samtools.github.io/bcftools/
Other
652 stars 240 forks source link

errors for bcftools.h when compiling #1017

Closed whoisleehom closed 5 years ago

whoisleehom commented 5 years ago

gcc -Wall -I/public1/home/zhangxt/include -I. -Ihtslib-1.9 -c -o main.o main.c In file included from main.c:33: bcftools.h:42:50: error: expected ‘,’ or ‘;’ before ‘HTS_FORMAT’ void error(const char *format, ...) HTS_NORETURN HTS_FORMAT(HTS_PRINTF_FMT, 1, 2); ^~~~~~ make: *** [main.o] Error 1

valeriuo commented 5 years ago

Have your run ./configure before make? How does your config.log file look like? Also, what gcc/OS are you using?

whoisleehom commented 5 years ago

Have your run ./configure before make? How does your config.log file look like? Also, what gcc/OS are you using?

I run ./configure –prefix=my/installation/path before make, and I’m using gcc 8.3 as compiler under centos 7. Here is my config.log:

This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake.

It was created by BCFtools configure 1.9, which was generated by GNU Autoconf 2.68. Invocation command line was

$ ./configure --prefix=/public1/home/stu_gaoyuan/software/bcftools-1.9

---------

Platform.

---------

hostname = admin1 uname -m = x86_64 uname -r = 2.6.32-504.el6.x86_64 uname -s = Linux uname -v = #1 SMP Wed Oct 15 04:27:16 UTC 2014

/usr/bin/uname -p = unknown /bin/uname -X = unknown

/bin/arch = x86_64 /usr/bin/arch -k = unknown /usr/convex/getsysinfo = unknown /usr/bin/hostinfo = unknown /bin/machine = unknown /usr/bin/oslevel = unknown /bin/universe = unknown

PATH: /public1/home/stu_gaoyuan/software/bamtools/bin PATH: /public1/home/stu_gaoyuan/software/BRAKER-2.1.2/scripts PATH: /public1/user_program/RepeatModeler/ PATH: /public1/export/samtools-1.3 PATH: /public1/home/stu_gaoyuan/software/GraphViz/bin PATH: /public1/home/stu_gaoyuan/software/lzma1900/bin PATH: /public1/home/stu_gaoyuan/software/maker/bin PATH: /public1/home/stu_gaoyuan/software/PASApipeline-pasa-v2.3.0/bin PATH: /public1/home/stu_gaoyuan/software/tophat-2.1.1.Linux_x86_64 PATH: /public1/home/stu_gaoyuan/software/Trinity-2.8.0 PATH: /public1/home/stu_gaoyuan/software/salmon-latest_linux_x86_64/bin PATH: /public1/home/stu_gaoyuan/software/sratoolkit.2.9.4-2-centos_linux64/bin PATH: /public1/home/zhangxt/software/MaSuRCA-3.2.1_08102016/bin PATH: /public1/home/stu_gaoyuan/software/valgrind-3.14.0/bin PATH: /public1/home/stu_gaoyuan/software/automake-1.15/bin PATH: /public1/home/stu_gaoyuan/software/autoconf-2.69/bin PATH: /public1/home/stu_gaoyuan/software/estimate_genome_size/bin PATH: /public1/home/stu_gaoyuan/software/ALLHiC/bin PATH: /public1/home/stu_gaoyuan/software/MCScanX PATH: /public1/home/stu_gaoyuan/software/allhic PATH: /public1/home/stu_gaoyuan/software/ncbi-blast-2.7.1+/bin PATH: /public1/home/stu_gaoyuan/software/HiC-Pro_2.10.0/bin PATH: /public1/home/stu_gaoyuan/software/gcc-8.3.0/bin PATH: /public1/user_program/sentieon-genomics-201711/bin PATH: /public1/home/zhangxt/software/bzip2-1.0.6 PATH: /public1/home/zhangxt/software/circos-0.69/bin PATH: /public1/home/stu_gaoyuan/perl5/bin PATH: /public1/home/stu_gaoyuan/perl5/bin PATH: /public1/home/zhangxt/tools PATH: /public1/home/zhangxt/scripts PATH: /public1/home/zhangxt/software/MSTmap PATH: /public1/home/zhangxt/software/structure-master PATH: /public1/home/zhangxt/software/pyrad-master/pyrad PATH: /public1/home/zhangxt/software/angsd-master PATH: /public1/user_program/stringtie PATH: /public1/home/zhangxt/software/hisat2-2.0.5 PATH: /public1/home/zhangxt/bin PATH: /public1/home/zhangxt/software/cdhit-master PATH: /public1/home/zhangxt/software/RSEM-1.2.31 PATH: . PATH: /public1/home/zhangxt/software/REPET_linux-x64-2.5/bin PATH: /public1/home/zhangxt/software/allhic PATH: /public4/zhangxt/project/26_HiCdev/walkthrough_example/bin PATH: /public1/home/zhangxt/software/lastz-distrib-1.04.00/src PATH: /public1/home/stu_gaoyuan/software/HiC-Pro_2.10.0/bin PATH: /public1/home/zhangxt/software/LACHESIS-master PATH: /public1/home/zhangxt/software/cpc-0.9-r2/bin PATH: /public1/home/zhangxt/software/LTR_retriever PATH: /public1/home/zhangxt/software/miRDP1.3 PATH: /public1/home/zhangxt/software/MITE-Hunter/ PATH: /public1/home/zhangxt/software/LTR_FINDER.x86_64-1.0.6 PATH: /public1/home/zhangxt/software/CEGMA_v2.5/bin PATH: /public1/home/zhangxt/software/popCNV PATH: /public1/home/zhangxt/software/Assemblytics-master PATH: /public1/home/zhangxt/software/MCScanX PATH: /public1/home/zhangxt/software/easy_KaKs PATH: /public1/home/zhangxt/software/til-r-20180523 PATH: /public1/home/zhangxt/software/nanopolish PATH: /public1/home/zhangxt/software/DEXTRACTOR PATH: /public1/home/zhangxt/software/MECAT/Linux-amd64/bin PATH: /public1/home/zhangxt/software/GetOrganelle-master/Utilities PATH: /public1/home/zhangxt/software/SSPACE-STANDARD-3.0_linux-x86_64 PATH: /public1/home/zhangxt/software/snap-master PATH: /public1/home/zhangxt/software/DBG2OLC PATH: /public1/home/zhangxt/software/LoRDEC-0.6 PATH: /public1/home/zhangxt/software/SPAdes-3.9.1-Linux/bin PATH: /public1/home/zhangxt/software/lastz-master/src PATH: /public1/home/zhangxt/software/PBSuite_15.8.24/bin PATH: /public1/home/zhangxt/software/filter_data_7 PATH: /public1/user_program/freebayes/vcflib/bin PATH: /public1/user_program/freebayes/scripts PATH: /public1/user_program/freebayes/vcflib/scripts PATH: /public1/home/zhangxt/software/TransDecoder-3.0.0/ PATH: /public1/home/zhangxt/software/trinityrnaseq-Trinity-v2.3.2 PATH: /public1/home/zhangxt/software/jdk1.8.0_60/bin PATH: /public1/home/zhangxt/software/canu-1.7/Linux-amd64/bin PATH: /public1/user_program/gm_et_linux_64/gmes_petap PATH: /public1/user_program/bin PATH: /public1/user_program/augustus-2.4/scripts PATH: /public1/user_program/PASApipeline-2.0.2/seqclean/seqclean PATH: /public1/user_program/snap PATH: /public1/user_program/maker/bin PATH: /public1/home/zhangxt/software/soap2.21release PATH: /public1/home/zhangxt/software/iTools_Code PATH: /public1/home/zhangxt/software/sbt/bin PATH: /public1/user_program/RepeatMasker PATH: /public1/home/zhangxt/software/bedtools2-master/bin PATH: /public4/zhangxt/software/FALCON-integrate/DALIGNER PATH: /public1/user_program/RepeatModeler PATH: /public1/home/zhangxt/software/Cross_Match PATH: /public1/home/zhangxt/software/quickmerge/MUMmer3.23 PATH: /public1/export/bin PATH: /public1/home/zhangxt/software/sratoolkit.2.5.4-1-centos_linux64/bin PATH: /public1/home/zhangxt/software/jdk1.8.0_60/bin PATH: /public1/home/zhangxt/software/julia-903644385b/bin PATH: /public1/home/zhangxt/bin PATH: /public1/home/stu_gaoyuan/lib PATH: /public1/home/stu_gaoyuan/software/bin PATH: /public1/export/bin PATH: /public1/home/stu_gaoyuan/software/anaconda2/bin PATH: /public1/export PATH: /public1/export/bin PATH: /public1/user_program/pacbio/smrtanalysis/current/analysis/bin PATH: /opt/xcat/bin PATH: /opt/xcat/sbin PATH: /public1/software/sge-8.1.7/bin/lx-amd64 PATH: /public1/software/sge-8.1.7/bin PATH: /usr/lib64/qt-3.3/bin PATH: /public1/software/mpi/openmpi/1.6.5/intel/bin PATH: /public1/software/mathlib/lapack/3.4.2/intel/bin PATH: /public/software/db-6.2.23/bin PATH: /public1/software/compiler/intel/composer_xe_2013_sp1.0.080/bin/intel64 PATH: /opt/clusconf/bin PATH: /usr/local/bin PATH: /bin PATH: /usr/bin PATH: /usr/local/sbin PATH: /usr/sbin PATH: /sbin PATH: /opt/ibutils/bin PATH: /public1/export/bin/ PATH: /public1/home/stu_gaoyuan/bin

-----------

Core tests.

-----------

configure:1983: checking for gcc configure:1999: found /public1/home/stu_gaoyuan/software/gcc-8.3.0/bin/gcc configure:2010: result: gcc configure:2239: checking for C compiler version configure:2248: gcc --version >&5 gcc (GCC) 8.3.0 Copyright (C) 2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:2259: $? = 0 configure:2248: gcc -v >&5 Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/public1/home/stu_gaoyuan/software/gcc-8.3.0/libexec/gcc/x86_64-pc-linux-gnu/8.3.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /public1/home/stu_gaoyuan/software/package/gcc-8.3.0/configure --prefix=/public1/home/stu_gaoyuan/software/gcc-8.3.0 --with-mpc=/public1/home/stu_gaoyuan/software/mpc --with-mpfr=/public1/home/stu_gaoyuan/software/mpfr --with-gmp=/public1/home/stu_gaoyuan/software/gmp --enable-threads=posix --disable-checking --enable--long-long --enable-languages=c,c++ --disable-multilib Thread model: posix gcc version 8.3.0 (GCC) configure:2259: $? = 0 configure:2248: gcc -V >&5 gcc: error: unrecognized command line option '-V' gcc: fatal error: no input files compilation terminated. configure:2259: $? = 1 configure:2248: gcc -qversion >&5 gcc: error: unrecognized command line option '-qversion'; did you mean '--version'? gcc: fatal error: no input files compilation terminated. configure:2259: $? = 1 configure:2279: checking whether the C compiler works configure:2301: gcc -I/public1/home/zhangxt/include -L/public1/home/zhangxt/lib conftest.c >&5 configure:2305: $? = 0 configure:2353: result: yes configure:2356: checking for C compiler default output file name configure:2358: result: a.out configure:2364: checking for suffix of executables configure:2371: gcc -o conftest -I/public1/home/zhangxt/include -L/public1/home/zhangxt/lib conftest.c >&5 configure:2375: $? = 0 configure:2397: result: configure:2419: checking whether we are cross compiling configure:2427: gcc -o conftest -I/public1/home/zhangxt/include -L/public1/home/zhangxt/lib conftest.c >&5 configure:2431: $? = 0 configure:2438: ./conftest configure:2442: $? = 0 configure:2457: result: no configure:2462: checking for suffix of object files configure:2484: gcc -c -I/public1/home/zhangxt/include conftest.c >&5 configure:2488: $? = 0 configure:2509: result: o configure:2513: checking whether we are using the GNU C compiler configure:2532: gcc -c -I/public1/home/zhangxt/include conftest.c >&5 configure:2532: $? = 0 configure:2541: result: yes configure:2550: checking whether gcc accepts -g configure:2570: gcc -c -g conftest.c >&5 configure:2570: $? = 0 configure:2611: result: yes configure:2628: checking for gcc option to accept ISO C89 configure:2692: gcc -c -I/public1/home/zhangxt/include conftest.c >&5 configure:2692: $? = 0 configure:2705: result: none needed configure:2726: checking for grep that handles long lines and -e configure:2784: result: /bin/grep configure:2809: checking for C compiler warning flags configure:2922: result: -Wall configure:3015: checking for special C compiler options needed for large files configure:3060: result: no configure:3066: checking for _FILE_OFFSET_BITS value needed for large files configure:3091: gcc -c -Wall -I/public1/home/zhangxt/include conftest.c >&5 configure:3091: $? = 0 configure:3123: result: no configure:3323: checking location of HTSlib source tree configure:3344: result: htslib-1.9 configure:3529: checking shared library type configure:3548: result: plain .so configure:3561: checking for library containing dlopen configure:3592: gcc -o conftest -Wall -I/public1/home/zhangxt/include -L/public1/home/zhangxt/lib conftest.c >&5 /tmp/ccdN7bQN.o: In function main': conftest.c:(.text+0xa): undefined reference todlopen' collect2: error: ld returned 1 exit status configure:3592: $? = 1 configure: failed program was: / confdefs.h / #define PACKAGE_NAME "BCFtools" #define PACKAGE_TARNAME "bcftools" #define PACKAGE_VERSION "1.9" #define PACKAGE_STRING "BCFtools 1.9" #define PACKAGE_BUGREPORT "samtools-help@lists.sourceforge.net" #define PACKAGE_URL "http://www.htslib.org/" #define PLUGIN_EXT ".so" #define ENABLE_BCF_PLUGINS 1 / end confdefs.h. /
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char dlopen ();
int
main ()
{
return dlopen ();
;
return 0;
}

configure:3592: gcc -o conftest -Wall -I/public1/home/zhangxt/include -L/public1/home/zhangxt/lib conftest.c -ldl >&5 configure:3592: $? = 0 configure:3609: result: -ldl configure:3624: checking if the compiler accepts -rdynamic configure:3639: gcc -o conftest -Wall -I/public1/home/zhangxt/include -rdynamic -L/public1/home/zhangxt/lib conftest.c -ldl >&5 configure:3639: $? = 0 configure:3647: result: yes configure:3660: checking for zlib.h configure:3660: gcc -c -Wall -I/public1/home/zhangxt/include conftest.c >&5 configure:3660: $? = 0 configure:3660: result: yes configure:3669: checking for inflate in -lz configure:3694: gcc -o conftest -Wall -I/public1/home/zhangxt/include -L/public1/home/zhangxt/lib conftest.c -lz -ldl >&5 configure:3694: $? = 0 configure:3703: result: yes configure:4051: creating ./config.status

----------------------

Running config.status.

----------------------

This file was extended by BCFtools config.status 1.9, which was generated by GNU Autoconf 2.68. Invocation command line was

CONFIG_FILES = CONFIG_HEADERS = CONFIG_LINKS = CONFIG_COMMANDS = $ ./config.status

on admin1

config.status:818: creating config.mk config.status:818: creating config.h configure:5288: === configuring in htslib-1.9 (/public1/home/stu_gaoyuan/software/package/bcftools-1.9/htslib-1.9) configure:5351: running /bin/sh ./configure --disable-option-checking '--prefix=/public1/home/stu_gaoyuan/software/bcftools-1.9' 'CFLAGS=-I/public1/home/zhangxt/include' 'LDFLAGS=-L/public1/home/zhangxt/lib' --cache-file=/dev/null --srcdir=.

----------------

Cache variables.

----------------

ac_cv_c_compiler_gnu=yes ac_cv_env_CC_set= ac_cv_env_CC_value= ac_cv_env_CFLAGS_set=set ac_cv_env_CFLAGS_value=-I/public1/home/zhangxt/include ac_cv_env_CPPFLAGS_set= ac_cv_env_CPPFLAGS_value= ac_cv_env_LDFLAGS_set=set ac_cv_env_LDFLAGS_value=-L/public1/home/zhangxt/lib ac_cv_env_LIBS_set= ac_cv_env_LIBS_value= ac_cv_env_build_alias_set= ac_cv_env_build_alias_value= ac_cv_env_host_alias_set= ac_cv_env_host_alias_value= ac_cv_env_target_alias_set= ac_cv_env_target_alias_value= ac_cv_header_zlib_h=yes ac_cv_lib_z_inflate=yes ac_cv_objext=o ac_cv_path_GREP=/bin/grep ac_cv_prog_ac_ct_CC=gcc ac_cv_prog_cc_c89= ac_cv_prog_cc_g=yes ac_cv_search_dlopen=-ldl ac_cv_sys_file_offset_bits=no ac_cv_sys_largefile_CC=no ax_cv_htslib=yes ax_cv_htslib_which=source hts_cv_prog_cc_warnings=-Wall

-----------------

Output variables.

-----------------

CC='gcc' CC_RDYNAMIC_OPT='-rdynamic' CFLAGS=' -Wall -I/public1/home/zhangxt/include' CPPFLAGS='' DEFS='-DHAVE_CONFIG_H' ECHO_C='' ECHO_N='-n' ECHO_T='' EXEEXT='' GREP='/bin/grep' GSL_LIBS='' HTSDIR='htslib-1.9' HTSLIB_CPPFLAGS='-Ihtslib-1.9' HTSLIB_LDFLAGS='-Lhtslib-1.9' Hinstall='#' Hsource='' LDFLAGS='-L/public1/home/zhangxt/lib' LIBOBJS='' LIBS='-ldl ' LTLIBOBJS='' OBJEXT='o' PACKAGE_BUGREPORT='samtools-help@lists.sourceforge.net' PACKAGE_NAME='BCFtools' PACKAGE_STRING='BCFtools 1.9' PACKAGE_TARNAME='bcftools' PACKAGE_URL='http://www.htslib.org/' PACKAGE_VERSION='1.9' PATH_SEPARATOR=':' PERL_CCOPTS='' PERL_LIBS='' PLATFORM='default' PLUGINPATH='$(libexecdir)/bcftools' PLUGIN_EXT='.so' SHELL='/bin/sh' USE_GPL='' ac_ct_CC='gcc' bcf_plugindir='$(libexecdir)/bcftools' bindir='${exec_prefix}/bin' build_alias='' datadir='${datarootdir}' datarootdir='${prefix}/share' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' dvidir='${docdir}' enable_bcftools_plugins='yes' enable_perl_filters='no' exec_prefix='${prefix}' host_alias='unknown-Linux' htmldir='${docdir}' includedir='${prefix}/include' infodir='${datarootdir}/info' libdir='${exec_prefix}/lib' libexecdir='${exec_prefix}/libexec' localedir='${datarootdir}/locale' localstatedir='${prefix}/var' mandir='${datarootdir}/man' oldincludedir='/usr/include' pdfdir='${docdir}' prefix='/public1/home/stu_gaoyuan/software/bcftools-1.9' program_transform_name='s,x,x,' psdir='${docdir}' sbindir='${exec_prefix}/sbin' sharedstatedir='${prefix}/com' subdirs=' htslib-1.9' sysconfdir='${prefix}/etc' target_alias=''

-----------

confdefs.h.

-----------

/ confdefs.h /

define PACKAGE_NAME "BCFtools"

define PACKAGE_TARNAME "bcftools"

define PACKAGE_VERSION "1.9"

define PACKAGE_STRING "BCFtools 1.9"

define PACKAGE_BUGREPORT "samtools-help@lists.sourceforge.net"

define PACKAGE_URL "http://www.htslib.org/"

define PLUGIN_EXT ".so"

define ENABLE_BCF_PLUGINS 1

define HAVE_LIBZ 1

configure: exit 0

valeriuo commented 5 years ago

Do you have an older version of htslib installed on your system or an older version of the file hts_defs.h in your include path? Also why do you need -I/public1/home/zhangxt/include ?

whoisleehom commented 5 years ago

Do you have an older version of htslib installed on your system or an older version of the file hts_defs.h in your include path? Also why do you need -I/public1/home/zhangxt/include ?

There was a environment variables called CFLAGS in my .bash_profile, which caused '-I/public1/home/zhangxt/include' . I compiled the code successfully after I blocked it. Thank you for pointing out the problem.

valeriuo commented 5 years ago

Great!