Open Source Development

Power Open Source Development

Explore the open source tools and capabilities for building and deploying modern applications on IBM Power platforms including AIX, IBM i, and Linux.


#Power


#Power

 View Only
  • 1.  pysam via pip on AIX

    Posted Sun December 26, 2021 10:50 AM
    Hi,

    I've been trying to get pysam compiled and installed on AIX 7.2 using pip since it's a dependency for the latest Ansible versions. But i've been having some issues.
    I tried compiling with gcc10 first which yields the same result as every other item i've recently attempted to compile with gcc10 :

    gcc -maix64 -fPIC -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -I/usr/include -I/opt/freeware/include -I/opt/freeware/include/ncurses -DAIX_GENUINE_CPLUSCPLUS -D_LINUX_SOURCE_COMPAT -Wl,-brtl -O2 -fPIC -I/usr/include -I/opt/freeware/include -I/opt/freeware/include/ncurses -DAIX_GENUINE_CPLUSCPLUS -D_LINUX_SOURCE_COMPAT -Wl,-brtl -O2 -fPIC -I/tmp/pip-install-nm0bh379/pysam_c665efca91f74f6e964fbcabac313c5a/htslib -I/tmp/pip-install-nm0bh379/pysam_c665efca91f74f6e964fbcabac313c5a/samtools -I/tmp/pip-install-nm0bh379/pysam_c665efca91f74f6e964fbcabac313c5a/samtools/lz4 -I/tmp/pip-install-nm0bh379/pysam_c665efca91f74f6e964fbcabac313c5a/bcftools -I/tmp/pip-install-nm0bh379/pysam_c665efca91f74f6e964fbcabac313c5a/pysam -I/tmp/pip-install-nm0bh379/pysam_c665efca91f74f6e964fbcabac313c5a -I/opt/freeware/include/python3.7m -c pysam/libchtslib.c -o build/temp.aix-7.2-3.7/pysam/libchtslib.o -Wno-unused -Wno-strict-prototypes -Wno-sign-compare -Wno-error=declaration-after-statement
    In file included from /usr/include/sys/resource.h:57,
    from /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/10/include-fixed/sys/wait.h:56,
    from /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/10/include-fixed/stdlib.h:411,
    from /opt/freeware/include/python3.7m/Python.h:34,
    from pysam/libchtslib.c:110:
    /usr/include/sys/time.h:110:16: error: redefinition of 'struct sigset_t'
    110 | typedef struct sigset_t {
    | ^~~~~~~~
    In file included from /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/10/include-fixed/stdio.h:503,
    from /opt/freeware/include/python3.7m/Python.h:25,
    from pysam/libchtslib.c:110:
    /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/10/include-fixed/sys/types.h:345:16: note: originally defined here
    345 | typedef struct sigset_t {
    | ^~~~~~~~
    In file included from /usr/include/sys/resource.h:57,
    from /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/10/include-fixed/sys/wait.h:56,
    from /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/10/include-fixed/stdlib.h:411,
    from /opt/freeware/include/python3.7m/Python.h:34,
    from pysam/libchtslib.c:110:
    /usr/include/sys/time.h:126:3: error: conflicting types for 'sigset_t'
    126 | } sigset_t;
    | ^~~~~~~~
    In file included from /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/10/include-fixed/stdio.h:503,
    from /opt/freeware/include/python3.7m/Python.h:25,
    from pysam/libchtslib.c:110:
    /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/10/include-fixed/sys/types.h:361:3: note: previous declaration of 'sigset_t' was here
    361 | } sigset_t;
    | ^~~~~~~~
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
    ERROR: Failed building wheel for pysam

    I've had this error multiple times now for different items and looking through the forums, i did find references to this same issue dating back to several years ago. I also found a forum reference stating it had been fixed in the newer gcc version, but one relates to gcc versions older than 10.
    It seems this issue has been re-introduced ? Is this a known issue with a fix in the works or how can we circumvent this ?

    Due to finding these references, i also attempted to get pysam compiled with gcc8. This does solve the duplicate declaration issue, but now i'm getting linker errors :

    /opt/freeware/lib/python3.7/config-3.7m/ld_so_aix gcc -maix64 -fPIC -pthread -bI:/opt/freeware/lib/python3.7/config-3.7m/python.exp -L. -L/opt/freeware/lib/pthread/ppc64 -L/opt/freeware/lib64 -L/opt/freeware/lib -L/usr/lib -Wl,-brtl -Wl,-blibpath:/opt/freeware/lib/pthread/ppc64:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib -L. -L/opt/freeware/lib/pthread/ppc64 -L/opt/freeware/lib64 -L/opt/freeware/lib -L/usr/lib -Wl,-brtl -Wl,-blibpath:/opt/freeware/lib/pthread/ppc64:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib -maix64 -L/opt/freeware/lib64 -L/opt/freeware/lib -L/usr/lib -L/lib -maix64 -O2 -D_AIX -D_AIX53 -D_AIX61 -D_AIX71 -D_AIX72 -I/opt/freeware/include -I/usr/include build/temp.aix-7.2-3.7/pysam/libchtslib.o build/temp.aix-7.2-3.7/pysam/htslib_util.o build/temp.aix-7.2-3.7/htslib/kfunc.o build/temp.aix-7.2-3.7/htslib/kstring.o build/temp.aix-7.2-3.7/htslib/bcf_sr_sort.o build/temp.aix-7.2-3.7/htslib/bgzf.o build/temp.aix-7.2-3.7/htslib/errmod.o build/temp.aix-7.2-3.7/htslib/faidx.o build/temp.aix-7.2-3.7/htslib/header.o build/temp.aix-7.2-3.7/htslib/hfile.o build/temp.aix-7.2-3.7/htslib/hts.o build/temp.aix-7.2-3.7/htslib/hts_expr.o build/temp.aix-7.2-3.7/htslib/hts_os.o build/temp.aix-7.2-3.7/htslib/md5.o build/temp.aix-7.2-3.7/htslib/multipart.o build/temp.aix-7.2-3.7/htslib/probaln.o build/temp.aix-7.2-3.7/htslib/realn.o build/temp.aix-7.2-3.7/htslib/regidx.o build/temp.aix-7.2-3.7/htslib/region.o build/temp.aix-7.2-3.7/htslib/sam.o build/temp.aix-7.2-3.7/htslib/synced_bcf_reader.o build/temp.aix-7.2-3.7/htslib/vcf_sweep.o build/temp.aix-7.2-3.7/htslib/tbx.o build/temp.aix-7.2-3.7/htslib/textutils.o build/temp.aix-7.2-3.7/htslib/thread_pool.o build/temp.aix-7.2-3.7/htslib/vcf.o build/temp.aix-7.2-3.7/htslib/vcfutils.o build/temp.aix-7.2-3.7/htslib/cram/cram_codecs.o build/temp.aix-7.2-3.7/htslib/cram/cram_decode.o build/temp.aix-7.2-3.7/htslib/cram/cram_encode.o build/temp.aix-7.2-3.7/htslib/cram/cram_external.o build/temp.aix-7.2-3.7/htslib/cram/cram_index.o build/temp.aix-7.2-3.7/htslib/cram/cram_io.o build/temp.aix-7.2-3.7/htslib/cram/cram_stats.o build/temp.aix-7.2-3.7/htslib/cram/mFILE.o build/temp.aix-7.2-3.7/htslib/cram/open_trace_file.o build/temp.aix-7.2-3.7/htslib/cram/pooled_alloc.o build/temp.aix-7.2-3.7/htslib/cram/string_alloc.o build/temp.aix-7.2-3.7/htslib/htscodecs/htscodecs/arith_dynamic.o build/temp.aix-7.2-3.7/htslib/htscodecs/htscodecs/fqzcomp_qual.o build/temp.aix-7.2-3.7/htslib/htscodecs/htscodecs/htscodecs.o build/temp.aix-7.2-3.7/htslib/htscodecs/htscodecs/pack.o build/temp.aix-7.2-3.7/htslib/htscodecs/htscodecs/rANS_static4x16pr.o build/temp.aix-7.2-3.7/htslib/htscodecs/htscodecs/rANS_static.o build/temp.aix-7.2-3.7/htslib/htscodecs/htscodecs/rle.o build/temp.aix-7.2-3.7/htslib/htscodecs/htscodecs/tokenise_name3.o build/temp.aix-7.2-3.7/htslib/hfile_libcurl.o build/temp.aix-7.2-3.7/htslib/hfile_gcs.o build/temp.aix-7.2-3.7/htslib/hfile_s3.o build/temp.aix-7.2-3.7/htslib/hfile_s3_write.o -L/tmp/pip-install-9rt48s04/pysam_36a060fc642648858654bbba8c7b3dcd/pysam -L/tmp/pip-install-9rt48s04/pysam_36a060fc642648858654bbba8c7b3dcd/pysam -L/tmp/pip-install-9rt48s04/pysam_36a060fc642648858654bbba8c7b3dcd -L/tmp/pip-install-9rt48s04/pysam_36a060fc642648858654bbba8c7b3dcd/build/lib.aix-7.2-3.7/pysam -Lbuild/lib.aix-7.2-3.7/pysam -L/opt/freeware/lib64 -lz -llzma -lbz2 -lz -lm -lcurl -lcrypto -o build/lib.aix-7.2-3.7/pysam/libchtslib.so -Wl,-rpath,$ORIGIN
    ld: 0706-012 The -p flag is not recognized.
    ld: 0706-012 The -a flag is not recognized.
    ld: 0706-012 The -t flag is not recognized.
    ld: 0706-012 The -h flag is not recognized.
    ld: 0706-005 Cannot find or open file: $ORIGIN
    ld:open(): No such file or directory
    collect2: error: ld returned 255 exit status
    error: command '/opt/freeware/lib/python3.7/config-3.7m/ld_so_aix' failed with exit status 1
    ----------------------------------------
    ERROR: Failed building wheel for pysam

    Any help in solving this would be greatly appreciated.

    Davy Keppens


    ------------------------------
    Davy Keppens
    ------------------------------

    #AIXOpenSource


  • 2.  RE: pysam via pip on AIX

    Posted Mon January 03, 2022 02:55 AM

    The linker flag "-rpath" & "$ORIGIN" is not supported by AIX linker. 

    You need to remove them (-Wl, -rpath,$ORIGIN) from the pysam source code. 



    ------------------------------
    Ayappan P
    ------------------------------