cyvcf2 icon indicating copy to clipboard operation
cyvcf2 copied to clipboard

Can't install cyvcf2 from source: error: use of undeclared identifier 'CRAM_OPT_STORE_MD'

Open nh13 opened this issue 7 years ago • 4 comments

python setup.py test or python setup.py install gives the error message below. I wanted to test my PR https://github.com/brentp/cyvcf2/pull/98 locally.

20 warnings generated.
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/nhomer/miniconda3/include -arch x86_64 -I/Users/nhomer/miniconda3/include -arch x86_64 -Ihtslib -Icyvcf2 -I/Users/nhomer/miniconda3/lib/python3.6/site-packages/numpy/core/include -I/Users/nhomer/miniconda3/include/python3.6m -c htslib/cram/cram_io.c -o build/temp.macosx-10.9-x86_64-3.6/htslib/cram/cram_io.o
In file included from htslib/cram/cram_io.c:77:
In file included from htslib/cram/cram.h:45:
In file included from htslib/cram/cram_samtools.h:61:
In file included from /Users/nhomer/miniconda3/include/htslib/sam.h:31:
In file included from /Users/nhomer/miniconda3/include/htslib/hts.h:35:
/Users/nhomer/miniconda3/include/htslib/hts_log.h:52:35: warning: this function declaration is not a prototype [-Wstrict-prototypes]
enum htsLogLevel hts_get_log_level();
                                  ^
                                   void
In file included from htslib/cram/cram_io.c:77:
In file included from htslib/cram/cram.h:52:
htslib/cram/cram_codecs.h:169:20: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int32_t' (aka 'int') [-Wsign-compare]
        (blk->byte >= blk->uncomp_size && nbits > 0) ||
         ~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~
htslib/cram/cram_codecs.h:171:60: warning: comparison of integers of different signs: 'unsigned long' and 'int' [-Wsign-compare]
         (blk->uncomp_size - blk->byte) * 8 + blk->bit - 7 < nbits)) {
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~
In file included from htslib/cram/cram_io.c:94:
/Users/nhomer/miniconda3/include/htslib/hfile.h:245:35: warning: comparison of integers of different signs: 'long' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
        if (fp->limit - fp->begin < nbytes){
            ~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~
In file included from htslib/cram/cram_io.c:97:
In file included from htslib/hts_internal.h:31:
htslib/textutils_internal.h:68:38: warning: this function declaration is not a prototype [-Wstrict-prototypes]
hts_json_token * hts_json_alloc_token();
                                     ^
                                      void
htslib/cram/cram_io.c:1920:20: warning: comparison of integers of different signs: 'long' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
        if (cp-dir >= sz) return -1;
            ~~~~~~ ^  ~~
htslib/cram/cram_io.c:1938:17: warning: comparison of integers of different signs: 'long' and 'unsigned long' [-Wsign-compare]
            l = MIN(l, strlen(fn));
                ^   ~  ~~~~~~~~~~
htslib/cram/misc.h:103:26: note: expanded from macro 'MIN'
#define MIN(A,B) ( ( (A) < (B) ) ? (A) : (B) )
                      ~  ^  ~
htslib/cram/cram_io.c:1940:23: warning: comparison of integers of different signs: 'long' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
                if (l >= sz) return -1;
                    ~ ^  ~~
htslib/cram/cram_io.c:2882:50: warning: comparison of integers of different signs: 'int32_t' (aka 'int') and 'unsigned long' [-Wsign-compare]
    if (c2.num_landmarks < 0 || c2.num_landmarks >= SIZE_MAX / sizeof(int32_t))
                                ~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~
htslib/cram/cram_io.c:3925:13: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare]
            BLOCK_RESIZE(b, padded_length);
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
htslib/cram/cram_io.h:511:26: note: expanded from macro 'BLOCK_RESIZE'
        while((b)->alloc <= (l)) {                              \
              ~~~~~~~~~~ ^   ~
htslib/cram/cram_io.c:4569:10: error: use of undeclared identifier 'CRAM_OPT_STORE_MD'
    case CRAM_OPT_STORE_MD:
         ^
htslib/cram/cram_io.c:4573:10: error: use of undeclared identifier 'CRAM_OPT_STORE_NM'; did you mean 'CRAM_OPT_NTHREADS'?
    case CRAM_OPT_STORE_NM:
         ^~~~~~~~~~~~~~~~~
         CRAM_OPT_NTHREADS
/Users/nhomer/miniconda3/include/htslib/hts.h:226:5: note: 'CRAM_OPT_NTHREADS' declared here
    CRAM_OPT_NTHREADS,   // deprecated, use HTS_OPT_NTHREADS
    ^
htslib/cram/cram_io.c:4573:10: error: duplicate case value 'CRAM_OPT_NTHREADS'
    case CRAM_OPT_STORE_NM:
         ^
htslib/cram/cram_io.c:4525:10: note: previous case defined here
    case CRAM_OPT_NTHREADS: {
         ^
10 warnings and 3 errors generated.
error: command 'gcc' failed with exit status 1
(base) Nils:cyvcf2 nhomer$ python --version
Python 3.6.4
(base) Nils:cyvcf2 nhomer$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin17.3.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

nh13 avatar Oct 09 '18 23:10 nh13

yeah, I somehow broke the install and I'm not sure how to fix it. you might be able to run ./configure from the htslib/ directory and then re-do the setup.py stuff. I'll try to sort this out in a few weeks unless someone beats me to it. There's another issue open for this as well.

brentp avatar Oct 09 '18 23:10 brentp

@brentp I think you can take a look at pysam's use of htslib in their setup.py for some hints.

nh13 avatar Oct 10 '18 16:10 nh13

indeed: https://github.com/brentp/cyvcf2/issues/96#issuecomment-422372156

brentp avatar Oct 10 '18 16:10 brentp

Is this fixed?

CholoTook avatar Mar 09 '22 16:03 CholoTook