cyvcf2 icon indicating copy to clipboard operation
cyvcf2 copied to clipboard

Can't install from source

Open dprat opened this issue 2 years ago • 5 comments

I've been trying to install cyvcf2 from the source. But i end up with the following error. I'm on MacOS Monterey v12.1 and i have a M1 chip (dunno if the problem can from here) and I'm using Python 3.9.12

Thanks for the help !


× python setup.py develop did not run successfully.
│ exit code: 1
╰─> [308 lines of output]
    running develop
    /opt/homebrew/lib/python3.9/site-packages/setuptools/command/easy_install.py:156: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
      warnings.warn(
    /opt/homebrew/lib/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
      warnings.warn(
    running egg_info
    creating cyvcf2.egg-info
    writing manifest file 'cyvcf2.egg-info/SOURCES.txt'
    writing manifest file 'cyvcf2.egg-info/SOURCES.txt'
    running build_ext
    creating build
    creating build/temp.macosx-12-arm64-3.9
    creating build/temp.macosx-12-arm64-3.9/cyvcf2
    creating build/temp.macosx-12-arm64-3.9/htslib
    creating build/temp.macosx-12-arm64-3.9/htslib/cram
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -Icyvcf2 -Ihtslib -I/opt/homebrew/lib/python3.9/site-packages/numpy/core/include -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c cyvcf2/cyvcf2.c -o build/temp.macosx-12-arm64-3.9/cyvcf2/cyvcf2.o -Wno-sign-compare -Wno-unused-function -Wno-strict-prototypes -Wno-unused-result -Wno-discarded-qualifiers
    warning: unknown warning option '-Wno-discarded-qualifiers'; did you mean '-Wno-ignored-qualifiers'? [-Wunknown-warning-option]
    In file included from cyvcf2/cyvcf2.c:777:
    In file included from /opt/homebrew/lib/python3.9/site-packages/numpy/core/include/numpy/arrayobject.h:5:
    In file included from /opt/homebrew/lib/python3.9/site-packages/numpy/core/include/numpy/ndarrayobject.h:12:
    In file included from /opt/homebrew/lib/python3.9/site-packages/numpy/core/include/numpy/ndarraytypes.h:1960:
    /opt/homebrew/lib/python3.9/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: "Using deprecated NumPy API, disable it with "          "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
    #warning "Using deprecated NumPy API, disable it with " \
     ^
    cyvcf2/cyvcf2.c:9204:32: warning: passing 'const bcf_hdr_t *' to parameter of type 'bcf_hdr_t *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
      __pyx_v_ret = bcf_hdr_append(__pyx_v_self->hdr, __pyx_t_2);
                                   ^~~~~~~~~~~~~~~~~
    htslib/htslib/vcf.h:561:35: note: passing argument to parameter 'h' here
        int bcf_hdr_append(bcf_hdr_t *h, const char *line);
                                      ^
    cyvcf2/cyvcf2.c:9246:30: warning: passing 'const bcf_hdr_t *' to parameter of type 'bcf_hdr_t *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
      __pyx_v_ret = bcf_hdr_sync(__pyx_v_self->hdr);
                                 ^~~~~~~~~~~~~~~~~
    htslib/htslib/vcf.h:624:33: note: passing argument to parameter 'h' here
        int bcf_hdr_sync(bcf_hdr_t *h) HTS_RESULT_USED;
                                    ^
    cyvcf2/cyvcf2.c:9813:37: warning: passing 'const bcf_hdr_t *' to parameter of type 'bcf_hdr_t *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
      __pyx_v_ret = bcf_hdr_set_samples(__pyx_v_self->hdr, ((char const *)__pyx_t_5), 0);
                                        ^~~~~~~~~~~~~~~~~
    htslib/htslib/vcf.h:342:40: note: passing argument to parameter 'hdr' here
        int bcf_hdr_set_samples(bcf_hdr_t *hdr, const char *samples, int is_file) HTS_RESULT_USED;
                                           ^
    cyvcf2/cyvcf2.c:10114:32: warning: passing 'const bcf_hdr_t *' to parameter of type 'bcf_hdr_t *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
      __pyx_v_ret = bcf_hdr_append(__pyx_v_self->hdr, __pyx_t_4);
                                   ^~~~~~~~~~~~~~~~~
    htslib/htslib/vcf.h:561:35: note: passing argument to parameter 'h' here
        int bcf_hdr_append(bcf_hdr_t *h, const char *line);
                                      ^
    cyvcf2/cyvcf2.c:10167:30: warning: passing 'const bcf_hdr_t *' to parameter of type 'bcf_hdr_t *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
      __pyx_v_ret = bcf_hdr_sync(__pyx_v_self->hdr);
                                 ^~~~~~~~~~~~~~~~~
    htslib/htslib/vcf.h:624:33: note: passing argument to parameter 'h' here
        int bcf_hdr_sync(bcf_hdr_t *h) HTS_RESULT_USED;
                                    ^
    cyvcf2/cyvcf2.c:10714:34: warning: passing 'const bcf_hdr_t *' to parameter of type 'void *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
      __pyx_cur_scope->__pyx_v_itr = bcf_itr_querys(__pyx_cur_scope->__pyx_v_self->hidx, __pyx_cur_scope->__pyx_v_self->hdr, __pyx_t_2);
                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    htslib/htslib/vcf.h:1123:102: note: expanded from macro 'bcf_itr_querys'
        #define bcf_itr_querys(idx, hdr, s) hts_itr_querys((idx), (s), (hts_name2id_f)(bcf_hdr_name2id), (hdr), hts_itr_query, bcf_readrec)
                                                                                                         ^~~~~
    htslib/htslib/hts.h:1074:93: note: passing argument to parameter 'hdr' here
    hts_itr_t *hts_itr_querys(const hts_idx_t *idx, const char *reg, hts_name2id_f getid, void *hdr, hts_itr_query_func *itr_query, hts_readrec_func *readrec);
                                                                                                ^
    cyvcf2/cyvcf2.c:12017:134: warning: passing 'const bcf_hdr_t *' to parameter of type 'bcf_hdr_t *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
        __pyx_t_4 = ((PyObject *)__pyx_f_6cyvcf2_6cyvcf2_newHREC((__pyx_cur_scope->__pyx_v_self->hdr->hrec[__pyx_cur_scope->__pyx_v_i]), __pyx_cur_scope->__pyx_v_self->hdr)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 485, __pyx_L1_error)
                                                                                                                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cyvcf2/cyvcf2.c:3172:118: note: passing argument to parameter here
    static CYTHON_INLINE struct __pyx_obj_6cyvcf2_6cyvcf2_HREC *__pyx_f_6cyvcf2_6cyvcf2_newHREC(bcf_hrec_t *, bcf_hdr_t *); /*proto*/
                                                                                                                         ^
    cyvcf2/cyvcf2.c:13591:21: warning: passing 'const bcf_hdr_t *' to parameter of type 'bcf_hdr_t *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
        bcf_hdr_destroy(__pyx_v_self->hdr);
                        ^~~~~~~~~~~~~~~~~
    htslib/htslib/vcf.h:271:37: note: passing argument to parameter 'h' here
        void bcf_hdr_destroy(bcf_hdr_t *h);
                                        ^
    cyvcf2/cyvcf2.c:14492:18: warning: assigning to 'char **' from 'const char **' discards qualifiers in nested pointer types [-Wincompatible-pointer-types-discards-qualifiers]
      __pyx_v_cnames = bcf_hdr_seqnames(__pyx_v_self->hdr, (&__pyx_v_n));
                     ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cyvcf2/cyvcf2.c:14601:24: warning: passing 'const bcf_hdr_t *' to parameter of type 'void *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
          __pyx_v_cnames = bcf_index_seqnames(__pyx_v_self->hidx, __pyx_v_self->hdr, (&__pyx_v_n));
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    htslib/htslib/vcf.h:1140:111: note: expanded from macro 'bcf_index_seqnames'
        #define bcf_index_seqnames(idx, hdr, nptr) hts_idx_seqnames((idx),(nptr),(hts_id2name_f)(bcf_hdr_id2name),(hdr))
                                                                                                                  ^~~~~
    htslib/htslib/hts.h:1097:88: note: passing argument to parameter 'hdr' here
    const char **hts_idx_seqnames(const hts_idx_t *idx, int *n, hts_id2name_f getid, void *hdr); // free only the array, not the values
                                                                                           ^
    cyvcf2/cyvcf2.c:14601:22: warning: assigning to 'char **' from 'const char **' discards qualifiers in nested pointer types [-Wincompatible-pointer-types-discards-qualifiers]
          __pyx_v_cnames = bcf_index_seqnames(__pyx_v_self->hidx, __pyx_v_self->hdr, (&__pyx_v_n));
                         ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cyvcf2/cyvcf2.c:14684:22: warning: assigning to 'char **' from 'const char **' discards qualifiers in nested pointer types [-Wincompatible-pointer-types-discards-qualifiers]
          __pyx_v_cnames = tbx_seqnames(__pyx_v_self->idx, (&__pyx_v_n));
                         ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cyvcf2/cyvcf2.c:28333:17: warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
        __pyx_v_key = bcf_hdr_int2id(__pyx_v_self->vcf->hdr, BCF_DT_ID, __pyx_v_fmt.id);
                    ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cyvcf2/cyvcf2.c:39629:13: warning: assigning to 'bcf_hdr_t *' from 'const bcf_hdr_t *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
      __pyx_v_h = __pyx_t_6;
                ^ ~~~~~~~~~
    cyvcf2/cyvcf2.c:42857:16: warning: assigning to 'char *' from 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
      __pyx_v_name = bcf_hdr_int2id(__pyx_v_self->hdr, BCF_DT_ID, __pyx_v_info->key);
                   ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    cyvcf2/cyvcf2.c:43858:18: warning: assigning to 'bcf_hdr_t *' from 'const bcf_hdr_t *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
      __pyx_v_i->hdr = __pyx_t_3;
                     ^ ~~~~~~~~~
    cyvcf2/cyvcf2.c:44411:23: warning: passing 'const bcf_hdr_t *' to parameter of type 'bcf_hdr_t *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
      (void)(bcf_hdr_sync(__pyx_v_tmpl->hdr));
                          ^~~~~~~~~~~~~~~~~
    htslib/htslib/vcf.h:624:33: note: passing argument to parameter 'h' here
        int bcf_hdr_sync(bcf_hdr_t *h) HTS_RESULT_USED;
                                    ^
    cyvcf2/cyvcf2.c:44439:23: warning: passing 'const bcf_hdr_t *' to parameter of type 'bcf_hdr_t *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
      (void)(bcf_hdr_sync(__pyx_v_self->__pyx_base.hdr));
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    htslib/htslib/vcf.h:624:33: note: passing argument to parameter 'h' here
        int bcf_hdr_sync(bcf_hdr_t *h) HTS_RESULT_USED;
                                    ^
    cyvcf2/cyvcf2.c:45022:31: warning: passing 'const bcf_hdr_t *' to parameter of type 'bcf_hdr_t *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
      __pyx_t_3 = ((bcf_hdr_parse(__pyx_v_self->__pyx_base.hdr, __pyx_t_2) != 0) != 0);
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    htslib/htslib/vcf.h:613:34: note: passing argument to parameter 'hdr' here
        int bcf_hdr_parse(bcf_hdr_t *hdr, char *htxt);
                                     ^
    cyvcf2/cyvcf2.c:45058:30: warning: passing 'const bcf_hdr_t *' to parameter of type 'bcf_hdr_t *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
      __pyx_t_3 = ((bcf_hdr_sync(__pyx_v_self->__pyx_base.hdr) != 0) != 0);
                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    htslib/htslib/vcf.h:624:33: note: passing argument to parameter 'h' here
        int bcf_hdr_sync(bcf_hdr_t *h) HTS_RESULT_USED;
                                    ^
    cyvcf2/cyvcf2.c:45437:65: warning: passing 'const bcf_hdr_t *' to parameter of type 'bcf_hdr_t *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
      (void)(bcf_hdr_write(__pyx_v_self->__pyx_base.__pyx_base.hts, __pyx_v_self->__pyx_base.hdr));
                                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    htslib/htslib/vcf.h:353:47: note: passing argument to parameter 'h' here
        int bcf_hdr_write(htsFile *fp, bcf_hdr_t *h) HTS_RESULT_USED;
                                                  ^
    cyvcf2/cyvcf2.c:45615:36: warning: passing 'const bcf_hdr_t *' to parameter of type 'bcf_hdr_t *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
        __pyx_t_1 = ((bcf_hdr_add_hrec(__pyx_v_self->__pyx_base.hdr, __pyx_v_h) < 0) != 0);
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    htslib/htslib/vcf.h:638:37: note: passing argument to parameter 'hdr' here
        int bcf_hdr_add_hrec(bcf_hdr_t *hdr, bcf_hrec_t *hrec);
                                        ^
    cyvcf2/cyvcf2.c:45653:25: warning: passing 'const bcf_hdr_t *' to parameter of type 'bcf_hdr_t *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
        (void)(bcf_hdr_sync(__pyx_v_self->__pyx_base.hdr));
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    htslib/htslib/vcf.h:624:33: note: passing argument to parameter 'h' here
        int bcf_hdr_sync(bcf_hdr_t *h) HTS_RESULT_USED;
                                    ^
    cyvcf2/cyvcf2.c:45712:87: warning: passing 'const bcf_hdr_t *' to parameter of type 'bcf_hdr_t *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
      __pyx_t_2 = __Pyx_PyInt_From_int(bcf_write(__pyx_v_self->__pyx_base.__pyx_base.hts, __pyx_v_self->__pyx_base.hdr, __pyx_v_var->b)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2402, __pyx_L1_error)
                                                                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
    htslib/htslib/vcf.h:419:43: note: passing argument to parameter 'h' here
        int bcf_write(htsFile *fp, bcf_hdr_t *h, bcf1_t *v) HTS_RESULT_USED;
                                              ^
    26 warnings generated.
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -Icyvcf2 -Ihtslib -I/opt/homebrew/lib/python3.9/site-packages/numpy/core/include -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c cyvcf2/helpers.c -o build/temp.macosx-12-arm64-3.9/cyvcf2/helpers.o -Wno-sign-compare -Wno-unused-function -Wno-strict-prototypes -Wno-unused-result -Wno-discarded-qualifiers
    warning: unknown warning option '-Wno-discarded-qualifiers'; did you mean '-Wno-ignored-qualifiers'? [-Wunknown-warning-option]
    cyvcf2/helpers.c:55:20: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
            else if((a == b)) {
                     ~~^~~~
    cyvcf2/helpers.c:55:20: note: remove extraneous parentheses around the comparison to silence this warning
            else if((a == b)) {
                    ~  ^   ~
    cyvcf2/helpers.c:55:20: note: use '=' to turn this equality comparison into an assignment
            else if((a == b)) {
                       ^~
                       =
    2 warnings generated.
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -Icyvcf2 -Ihtslib -I/opt/homebrew/lib/python3.9/site-packages/numpy/core/include -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c htslib/bcf_sr_sort.c -o build/temp.macosx-12-arm64-3.9/htslib/bcf_sr_sort.o -Wno-sign-compare -Wno-unused-function -Wno-strict-prototypes -Wno-unused-result -Wno-discarded-qualifiers
    warning: unknown warning option '-Wno-discarded-qualifiers'; did you mean '-Wno-ignored-qualifiers'? [-Wunknown-warning-option]
    1 warning generated.
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -Icyvcf2 -Ihtslib -I/opt/homebrew/lib/python3.9/site-packages/numpy/core/include -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c htslib/bgzf.c -o build/temp.macosx-12-arm64-3.9/htslib/bgzf.o -Wno-sign-compare -Wno-unused-function -Wno-strict-prototypes -Wno-unused-result -Wno-discarded-qualifiers
    warning: unknown warning option '-Wno-discarded-qualifiers'; did you mean '-Wno-ignored-qualifiers'? [-Wunknown-warning-option]
    1 warning generated.
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -Icyvcf2 -Ihtslib -I/opt/homebrew/lib/python3.9/site-packages/numpy/core/include -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c htslib/cram/cram_codecs.c -o build/temp.macosx-12-arm64-3.9/htslib/cram/cram_codecs.o -Wno-sign-compare -Wno-unused-function -Wno-strict-prototypes -Wno-unused-result -Wno-discarded-qualifiers
    warning: unknown warning option '-Wno-discarded-qualifiers'; did you mean '-Wno-ignored-qualifiers'? [-Wunknown-warning-option]
    1 warning generated.
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -Icyvcf2 -Ihtslib -I/opt/homebrew/lib/python3.9/site-packages/numpy/core/include -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c htslib/cram/cram_decode.c -o build/temp.macosx-12-arm64-3.9/htslib/cram/cram_decode.o -Wno-sign-compare -Wno-unused-function -Wno-strict-prototypes -Wno-unused-result -Wno-discarded-qualifiers
    warning: unknown warning option '-Wno-discarded-qualifiers'; did you mean '-Wno-ignored-qualifiers'? [-Wunknown-warning-option]
    1 warning generated.
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -Icyvcf2 -Ihtslib -I/opt/homebrew/lib/python3.9/site-packages/numpy/core/include -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c htslib/cram/cram_encode.c -o build/temp.macosx-12-arm64-3.9/htslib/cram/cram_encode.o -Wno-sign-compare -Wno-unused-function -Wno-strict-prototypes -Wno-unused-result -Wno-discarded-qualifiers
    warning: unknown warning option '-Wno-discarded-qualifiers'; did you mean '-Wno-ignored-qualifiers'? [-Wunknown-warning-option]
    htslib/cram/cram_encode.c:1727:13: warning: code will never be executed [-Wunreachable-code]
                cram_byte_array_len_encoder e;
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    htslib/cram/cram_encode.c:1717:13: note: silence by adding parentheses to mark code as explicitly dead
            if (1) {
                ^
                /* DISABLES CODE */ ( )
    htslib/cram/cram_encode.c:3045:24: warning: unused variable 'brg' [-Wunused-variable]
            sam_hrec_rg_t *brg = sam_hrecs_find_rg(fd->header->hrecs, "UNKNOWN");
                           ^
    htslib/cram/cram_encode.c:2874:40: warning: code will never be executed [-Wunreachable-code]
                                    int ol=l;
                                           ^
    htslib/cram/cram_encode.c:2871:33: note: silence by adding parentheses to mark code as explicitly dead
                                if (0 && CRAM_MAJOR_VERS(fd->version) >= 3) {
                                    ^
                                    /* DISABLES CODE */ ( )
    htslib/cram/cram_encode.c:2835:17: warning: code will never be executed [-Wunreachable-code]
                    int l;
                    ^~~~~~
    5 warnings generated.
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -Icyvcf2 -Ihtslib -I/opt/homebrew/lib/python3.9/site-packages/numpy/core/include -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c htslib/cram/cram_external.c -o build/temp.macosx-12-arm64-3.9/htslib/cram/cram_external.o -Wno-sign-compare -Wno-unused-function -Wno-strict-prototypes -Wno-unused-result -Wno-discarded-qualifiers
    warning: unknown warning option '-Wno-discarded-qualifiers'; did you mean '-Wno-ignored-qualifiers'? [-Wunknown-warning-option]
    1 warning generated.
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -Icyvcf2 -Ihtslib -I/opt/homebrew/lib/python3.9/site-packages/numpy/core/include -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c htslib/cram/cram_index.c -o build/temp.macosx-12-arm64-3.9/htslib/cram/cram_index.o -Wno-sign-compare -Wno-unused-function -Wno-strict-prototypes -Wno-unused-result -Wno-discarded-qualifiers
    warning: unknown warning option '-Wno-discarded-qualifiers'; did you mean '-Wno-ignored-qualifiers'? [-Wunknown-warning-option]
    1 warning generated.
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -Icyvcf2 -Ihtslib -I/opt/homebrew/lib/python3.9/site-packages/numpy/core/include -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c htslib/cram/cram_io.c -o build/temp.macosx-12-arm64-3.9/htslib/cram/cram_io.o -Wno-sign-compare -Wno-unused-function -Wno-strict-prototypes -Wno-unused-result -Wno-discarded-qualifiers
    warning: unknown warning option '-Wno-discarded-qualifiers'; did you mean '-Wno-ignored-qualifiers'? [-Wunknown-warning-option]
    1 warning generated.
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -Icyvcf2 -Ihtslib -I/opt/homebrew/lib/python3.9/site-packages/numpy/core/include -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c htslib/cram/cram_samtools.c -o build/temp.macosx-12-arm64-3.9/htslib/cram/cram_samtools.o -Wno-sign-compare -Wno-unused-function -Wno-strict-prototypes -Wno-unused-result -Wno-discarded-qualifiers
    warning: unknown warning option '-Wno-discarded-qualifiers'; did you mean '-Wno-ignored-qualifiers'? [-Wunknown-warning-option]
    1 warning generated.
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -Icyvcf2 -Ihtslib -I/opt/homebrew/lib/python3.9/site-packages/numpy/core/include -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c htslib/cram/cram_stats.c -o build/temp.macosx-12-arm64-3.9/htslib/cram/cram_stats.o -Wno-sign-compare -Wno-unused-function -Wno-strict-prototypes -Wno-unused-result -Wno-discarded-qualifiers
    warning: unknown warning option '-Wno-discarded-qualifiers'; did you mean '-Wno-ignored-qualifiers'? [-Wunknown-warning-option]
    1 warning generated.
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -Icyvcf2 -Ihtslib -I/opt/homebrew/lib/python3.9/site-packages/numpy/core/include -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c htslib/cram/mFILE.c -o build/temp.macosx-12-arm64-3.9/htslib/cram/mFILE.o -Wno-sign-compare -Wno-unused-function -Wno-strict-prototypes -Wno-unused-result -Wno-discarded-qualifiers
    warning: unknown warning option '-Wno-discarded-qualifiers'; did you mean '-Wno-ignored-qualifiers'? [-Wunknown-warning-option]
    1 warning generated.
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -Icyvcf2 -Ihtslib -I/opt/homebrew/lib/python3.9/site-packages/numpy/core/include -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c htslib/cram/open_trace_file.c -o build/temp.macosx-12-arm64-3.9/htslib/cram/open_trace_file.o -Wno-sign-compare -Wno-unused-function -Wno-strict-prototypes -Wno-unused-result -Wno-discarded-qualifiers
    warning: unknown warning option '-Wno-discarded-qualifiers'; did you mean '-Wno-ignored-qualifiers'? [-Wunknown-warning-option]
    1 warning generated.
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -Icyvcf2 -Ihtslib -I/opt/homebrew/lib/python3.9/site-packages/numpy/core/include -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c htslib/cram/pooled_alloc.c -o build/temp.macosx-12-arm64-3.9/htslib/cram/pooled_alloc.o -Wno-sign-compare -Wno-unused-function -Wno-strict-prototypes -Wno-unused-result -Wno-discarded-qualifiers
    warning: unknown warning option '-Wno-discarded-qualifiers'; did you mean '-Wno-ignored-qualifiers'? [-Wunknown-warning-option]
    1 warning generated.
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -Icyvcf2 -Ihtslib -I/opt/homebrew/lib/python3.9/site-packages/numpy/core/include -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c htslib/cram/rANS_static.c -o build/temp.macosx-12-arm64-3.9/htslib/cram/rANS_static.o -Wno-sign-compare -Wno-unused-function -Wno-strict-prototypes -Wno-unused-result -Wno-discarded-qualifiers
    warning: unknown warning option '-Wno-discarded-qualifiers'; did you mean '-Wno-ignored-qualifiers'? [-Wunknown-warning-option]
    1 warning generated.
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -Icyvcf2 -Ihtslib -I/opt/homebrew/lib/python3.9/site-packages/numpy/core/include -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c htslib/cram/string_alloc.c -o build/temp.macosx-12-arm64-3.9/htslib/cram/string_alloc.o -Wno-sign-compare -Wno-unused-function -Wno-strict-prototypes -Wno-unused-result -Wno-discarded-qualifiers
    warning: unknown warning option '-Wno-discarded-qualifiers'; did you mean '-Wno-ignored-qualifiers'? [-Wunknown-warning-option]
    1 warning generated.
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -Icyvcf2 -Ihtslib -I/opt/homebrew/lib/python3.9/site-packages/numpy/core/include -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c htslib/errmod.c -o build/temp.macosx-12-arm64-3.9/htslib/errmod.o -Wno-sign-compare -Wno-unused-function -Wno-strict-prototypes -Wno-unused-result -Wno-discarded-qualifiers
    warning: unknown warning option '-Wno-discarded-qualifiers'; did you mean '-Wno-ignored-qualifiers'? [-Wunknown-warning-option]
    1 warning generated.
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -Icyvcf2 -Ihtslib -I/opt/homebrew/lib/python3.9/site-packages/numpy/core/include -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c htslib/faidx.c -o build/temp.macosx-12-arm64-3.9/htslib/faidx.o -Wno-sign-compare -Wno-unused-function -Wno-strict-prototypes -Wno-unused-result -Wno-discarded-qualifiers
    warning: unknown warning option '-Wno-discarded-qualifiers'; did you mean '-Wno-ignored-qualifiers'? [-Wunknown-warning-option]
    1 warning generated.
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -Icyvcf2 -Ihtslib -I/opt/homebrew/lib/python3.9/site-packages/numpy/core/include -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c htslib/header.c -o build/temp.macosx-12-arm64-3.9/htslib/header.o -Wno-sign-compare -Wno-unused-function -Wno-strict-prototypes -Wno-unused-result -Wno-discarded-qualifiers
    warning: unknown warning option '-Wno-discarded-qualifiers'; did you mean '-Wno-ignored-qualifiers'? [-Wunknown-warning-option]
    1 warning generated.
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -Icyvcf2 -Ihtslib -I/opt/homebrew/lib/python3.9/site-packages/numpy/core/include -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c htslib/hfile.c -o build/temp.macosx-12-arm64-3.9/htslib/hfile.o -Wno-sign-compare -Wno-unused-function -Wno-strict-prototypes -Wno-unused-result -Wno-discarded-qualifiers
    warning: unknown warning option '-Wno-discarded-qualifiers'; did you mean '-Wno-ignored-qualifiers'? [-Wunknown-warning-option]
    1 warning generated.
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -Icyvcf2 -Ihtslib -I/opt/homebrew/lib/python3.9/site-packages/numpy/core/include -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c htslib/hfile_gcs.c -o build/temp.macosx-12-arm64-3.9/htslib/hfile_gcs.o -Wno-sign-compare -Wno-unused-function -Wno-strict-prototypes -Wno-unused-result -Wno-discarded-qualifiers
    warning: unknown warning option '-Wno-discarded-qualifiers'; did you mean '-Wno-ignored-qualifiers'? [-Wunknown-warning-option]
    1 warning generated.
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -Icyvcf2 -Ihtslib -I/opt/homebrew/lib/python3.9/site-packages/numpy/core/include -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c htslib/hfile_libcurl.c -o build/temp.macosx-12-arm64-3.9/htslib/hfile_libcurl.o -Wno-sign-compare -Wno-unused-function -Wno-strict-prototypes -Wno-unused-result -Wno-discarded-qualifiers
    warning: unknown warning option '-Wno-discarded-qualifiers'; did you mean '-Wno-ignored-qualifiers'? [-Wunknown-warning-option]
    1 warning generated.
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -Icyvcf2 -Ihtslib -I/opt/homebrew/lib/python3.9/site-packages/numpy/core/include -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c htslib/hfile_net.c -o build/temp.macosx-12-arm64-3.9/htslib/hfile_net.o -Wno-sign-compare -Wno-unused-function -Wno-strict-prototypes -Wno-unused-result -Wno-discarded-qualifiers
    warning: unknown warning option '-Wno-discarded-qualifiers'; did you mean '-Wno-ignored-qualifiers'? [-Wunknown-warning-option]
    1 warning generated.
    clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -Icyvcf2 -Ihtslib -I/opt/homebrew/lib/python3.9/site-packages/numpy/core/include -I/opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c htslib/hfile_s3.c -o build/temp.macosx-12-arm64-3.9/htslib/hfile_s3.o -Wno-sign-compare -Wno-unused-function -Wno-strict-prototypes -Wno-unused-result -Wno-discarded-qualifiers
    warning: unknown warning option '-Wno-discarded-qualifiers'; did you mean '-Wno-ignored-qualifiers'? [-Wunknown-warning-option]
    htslib/hfile_s3.c:121:2: error: No HMAC() routine found by configure
    #error No HMAC() routine found by configure
     ^
    htslib/hfile_s3.c:314:26: error: use of undeclared identifier 'DIGEST_BUFSIZ'
        unsigned char digest[DIGEST_BUFSIZ];
                             ^
    htslib/hfile_s3.c:343:18: error: implicit declaration of function 's3_sign' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        digest_len = s3_sign(digest, &ad->secret, &message);
                     ^
    htslib/hfile_s3.c:710:26: error: use of undeclared identifier 'SHA256_DIGEST_BUFSIZE'
        unsigned char hashed[SHA256_DIGEST_BUFSIZE];
                             ^
    htslib/hfile_s3.c:713:5: error: implicit declaration of function 's3_sha256' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        s3_sha256((const unsigned char *)in, length, hashed);
        ^
    htslib/hfile_s3.c:715:28: error: use of undeclared identifier 'SHA256_DIGEST_BUFSIZE'
        for (i = 0, j = 0; i < SHA256_DIGEST_BUFSIZE; i++, j+= 2) {
                               ^
    htslib/hfile_s3.c:734:28: error: use of undeclared identifier 'SHA256_DIGEST_BUFSIZE'
        unsigned char date_key[SHA256_DIGEST_BUFSIZE];
                               ^
    htslib/hfile_s3.c:735:35: error: use of undeclared identifier 'SHA256_DIGEST_BUFSIZE'
        unsigned char date_region_key[SHA256_DIGEST_BUFSIZE];
                                      ^
    htslib/hfile_s3.c:736:43: error: use of undeclared identifier 'SHA256_DIGEST_BUFSIZE'
        unsigned char date_region_service_key[SHA256_DIGEST_BUFSIZE];
                                              ^
    htslib/hfile_s3.c:737:31: error: use of undeclared identifier 'SHA256_DIGEST_BUFSIZE'
        unsigned char signing_key[SHA256_DIGEST_BUFSIZE];
                                  ^
    htslib/hfile_s3.c:738:29: error: use of undeclared identifier 'SHA256_DIGEST_BUFSIZE'
        unsigned char signature[SHA256_DIGEST_BUFSIZE];
                                ^
    htslib/hfile_s3.c:753:5: error: implicit declaration of function 's3_sign_sha256' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        s3_sign_sha256(secret_access_key.s, secret_access_key.l, (const unsigned char *)ad->date_short, strlen(ad->date_short), date_key, &len);
        ^
    htslib/hfile_s3.c:775:18: error: use of undeclared identifier 'HASH_LENGTH_SHA256'
        char cr_hash[HASH_LENGTH_SHA256];
                     ^
    htslib/hfile_s3.c:776:27: error: use of undeclared identifier 'HASH_LENGTH_SHA256'
        char signature_string[HASH_LENGTH_SHA256];
                              ^
    htslib/hfile_s3.c:941:23: error: use of undeclared identifier 'HASH_LENGTH_SHA256'
        char content_hash[HASH_LENGTH_SHA256];
                          ^
    htslib/hfile_s3.c:982:26: error: use of undeclared identifier 'HASH_LENGTH_SHA256'
        kputsn(content_hash, HASH_LENGTH_SHA256, hash);
                             ^
    htslib/hfile_s3.c:998:23: error: use of undeclared identifier 'HASH_LENGTH_SHA256'
        char content_hash[HASH_LENGTH_SHA256];
                          ^
    1 warning and 17 errors generated.
    error: command '/usr/bin/clang' failed with exit code 1
    [end of output]

dprat avatar May 09 '22 14:05 dprat

Hi, these errors mean that you need libssl. You can also cd into the htslib directory and reconfigure.

brentp avatar May 09 '22 15:05 brentp

Thanks for your answer !

openssl is already installed from homebrew and i follow the recommandation from the README:

For compilers to find openssl you may need to set:
  export LDFLAGS="-L/usr/local/opt/openssl/lib"
  export CPPFLAGS="-I/usr/local/opt/openssl/include"

For pkg-config to find openssl you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig"

On my machine it is located at /opt/homebrew/Cellar/openssl@3/3.0.3 instead of /usr/local/opt/openssl

dprat avatar May 09 '22 15:05 dprat

I'm posting this here as it is one of the few results that come up when searching for installation issues.

I was having similar errors under Linux. For installation of htslib I used:

 cd htslib/
 autoheader
 autoconf
 sudo apt install liblzma-dev
 sudo apt install libcurl4-openssl-dev 
 ./configure --enable-libcurl
 make

It worked and I was able to use htslib utils like tabix. However, attempting to install cyvf2 failed with the same errors as in the OP.

   htslib/hfile_s3.c:121:2: error: #error No HMAC() routine found by configure
      121 | #error No HMAC() routine found by configure
          |  ^~~~~
    htslib/hfile_s3.c: In function ‘auth_header_callback’:
    htslib/hfile_s3.c:314:26: error: ‘DIGEST_BUFSIZ’ undeclared (first use in this function)
      314 |     unsigned char digest[DIGEST_BUFSIZ];
          |                          ^~~~~~~~~~~~~
    htslib/hfile_s3.c:314:26: note: each undeclared identifier is reported only once for each function it appears in
....

So it seems a successful configure and make of htslib does not grantee a working installation of cyvf2.

To solve I reinstalled htslib as described in https://github.com/samtools/htslib/blob/develop/INSTALL:

 cd htslib/
 autoheader
 autoconf
 sudo apt install zlib1g-dev libbz2-dev liblzma-dev libcurl4-gnutls-dev libssl-dev
 ./configure --enable-libcurl
 make

I was missing libssl-dev, and I changed libcurl4-openssl-dev to libcurl4-gnutls-dev. Not sure which of the two did the trick.

waltergallegog avatar Jun 17 '22 20:06 waltergallegog

Completely separate, but I had some install issues, which I've fixed and will document here in case anyone wants workarounds

HTSLib - I got missing config.sub config.guess

I found this was due to a new Automake, and was in htslib issue 1197 which I fixed via this page

After building, I got undefined symbol: libdeflate_gzip_decompress when importing cyvcf2 - this is needed by HTSLib but the setup.py only links against it if you set LIBDEFLATE=1 - I just commented out the if test in setup.py so it was always included

davmlaw avatar May 04 '23 08:05 davmlaw

Please issue a PR on the README to list these dependencies.

CholoTook avatar Oct 05 '23 10:10 CholoTook