Christina-hshi / psirc

Full-length linear and circular transcript isoform reconstruction and quantification
MIT License
11 stars 4 forks source link

Error to install psirc #2

Closed Alipe2021 closed 2 years ago

Alipe2021 commented 2 years ago

Dear Dr. Christina Huan Shi,

Thank you for this great work. I have some problems to be solved. When I ran the following installation steps it

conda create -n psirc_py3_env
conda install -n psirc_py3_env -c conda-forge python=3
source activate psirc_py3_env 
pip install conan
conda install -n psirc_py3_env -c bioconda -c conda-forge zlib htslib xz hdf5
git clone https://github.com/Christina-hshi/psirc.git
cd psirc
cd psirc-quant
mkdir release
cd release
cmake ..
make psirc-quant

when I ran cmake .. it reported as follows:

-- The C compiler identification is GNU 10.2.1
-- The CXX compiler identification is GNU 10.2.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
shared build
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- HDF5: Using hdf5 compiler wrapper to determine C configuration
-- Found HDF5: /home/labpub/miniconda3/envs/psirc_py3_env/lib/libhdf5.so;/home/labpub/miniconda3/envs/psirc_py3_env/lib/libcrypto.so;/home/labpub/miniconda3/envs/psirc_py3_env/lib/libcurl.so;/usr/lib64/librt.so;/usr/lib64/libpthread.so;/home/labpub/miniconda3/envs/psirc_py3_env/lib/libz.so;/usr/lib64/libdl.so;/usr/lib64/libm.so (found version "1.12.1")
-- Found ZLIB: /opt/biosoft/zlib-1.2.11/lib/libz.so (found version "1.2.11")
-- Configuring done
-- Generating done
-- Build files have been written to: /opt/biosoft/psirc/psirc-quant/release

And When I ran make psirc-quant, it's output as follows:

Scanning dependencies of target psirc_core
[  5%] Building CXX object src/CMakeFiles/psirc_core.dir/Bootstrap.cpp.o
[ 11%] Building CXX object src/CMakeFiles/psirc_core.dir/GeneModel.cpp.o
[ 16%] Building CXX object src/CMakeFiles/psirc_core.dir/H5Writer.cpp.o
[ 22%] Building CXX object src/CMakeFiles/psirc_core.dir/Kmer.cpp.o
[ 27%] Building CXX object src/CMakeFiles/psirc_core.dir/KmerIndex.cpp.o
[ 33%] Building CXX object src/CMakeFiles/psirc_core.dir/KmerIterator.cpp.o
[ 38%] Building CXX object src/CMakeFiles/psirc_core.dir/MinCollector.cpp.o
[ 44%] Building CXX object src/CMakeFiles/psirc_core.dir/PlaintextWriter.cpp.o
[ 50%] Building CXX object src/CMakeFiles/psirc_core.dir/ProcessReads.cpp.o
[ 55%] Building CXX object src/CMakeFiles/psirc_core.dir/PseudoBam.cpp.o
[ 61%] Building CXX object src/CMakeFiles/psirc_core.dir/common.cpp.o
[ 66%] Building CXX object src/CMakeFiles/psirc_core.dir/h5utils.cpp.o
[ 72%] Building CXX object src/CMakeFiles/psirc_core.dir/hash.cpp.o
[ 77%] Building CXX object src/CMakeFiles/psirc_core.dir/main.cpp.o
[ 83%] Building CXX object src/CMakeFiles/psirc_core.dir/weights.cpp.o
[ 88%] Linking CXX static library libpsirc_core.a
[ 88%] Built target psirc_core
Scanning dependencies of target psirc-quant
[ 94%] Building CXX object src/CMakeFiles/psirc-quant.dir/main.cpp.o
[100%] Linking CXX executable psirc-quant
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: ../../src/../ext/htslib/libhts.a(cram_io.o): in function `lzma_mem_deflate':
/opt/biosoft/psirc/psirc-quant/ext/htslib/cram/cram_io.c:669: undefined reference to `lzma_stream_buffer_bound'
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: /opt/biosoft/psirc/psirc-quant/ext/htslib/cram/cram_io.c:675: undefined reference to `lzma_easy_buffer_encode'
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: ../../src/../ext/htslib/libhts.a(cram_io.o): in function `cram_compress_by_method':
/opt/biosoft/psirc/psirc-quant/ext/htslib/cram/cram_io.c:1030: undefined reference to `BZ2_bzBuffToBuffCompress'
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: ../../src/../ext/htslib/libhts.a(cram_io.o): in function `lzma_mem_inflate':
/opt/biosoft/psirc/psirc-quant/ext/htslib/cram/cram_io.c:719: undefined reference to `lzma_code'
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: /opt/biosoft/psirc/psirc-quant/ext/htslib/cram/cram_io.c:728: undefined reference to `lzma_end'
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: /opt/biosoft/psirc/psirc-quant/ext/htslib/cram/cram_io.c:691: undefined reference to `lzma_easy_decoder_memusage'
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: /opt/biosoft/psirc/psirc-quant/ext/htslib/cram/cram_io.c:691: undefined reference to `lzma_stream_decoder'
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: /opt/biosoft/psirc/psirc-quant/ext/htslib/cram/cram_io.c:706: undefined reference to `lzma_code'
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: ../../src/../ext/htslib/libhts.a(cram_io.o): in function `cram_uncompress_block':
/opt/biosoft/psirc/psirc-quant/ext/htslib/cram/cram_io.c:954: undefined reference to `BZ2_bzBuffToBuffDecompress'
collect2: error: ld returned 1 exit status
make[3]: *** [src/CMakeFiles/psirc-quant.dir/build.make:111: src/psirc-quant] Error 1
make[2]: *** [CMakeFiles/Makefile2:142: src/CMakeFiles/psirc-quant.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:149: src/CMakeFiles/psirc-quant.dir/rule] Error 2
make: *** [Makefile:194: psirc-quant] Error 2

I can't solve these problems, could you help me .

Yours sincerely,

Alipe

Christina-hshi commented 2 years ago

Hi Alipe,

Thanks for your interest in our tool. Could you run "make VERBOSE=1 psirc-quant" instead and show the output? Thank you.

Alipe2021 commented 2 years ago

Dear Christina,

I ran make VERBOSE=1 psirc-quant and got the errors as follow:

/usr/bin/cmake -S/opt/biosoft/psirc/psirc-quant -B/opt/biosoft/psirc/psirc-quant/release --check-build-system CMakeFiles/Makefile.cmake 0
make -f CMakeFiles/Makefile2 psirc-quant
make[1]: Entering directory '/home/labpub/biosoft/psirc/psirc-quant/release'
/usr/bin/cmake -S/opt/biosoft/psirc/psirc-quant -B/opt/biosoft/psirc/psirc-quant/release --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /opt/biosoft/psirc/psirc-quant/release/CMakeFiles 18
make -f CMakeFiles/Makefile2 src/CMakeFiles/psirc-quant.dir/all
make[2]: Entering directory '/home/labpub/biosoft/psirc/psirc-quant/release'
make -f src/CMakeFiles/psirc_core.dir/build.make src/CMakeFiles/psirc_core.dir/depend
make[3]: Entering directory '/home/labpub/biosoft/psirc/psirc-quant/release'
cd /opt/biosoft/psirc/psirc-quant/release && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /opt/biosoft/psirc/psirc-quant /opt/biosoft/psirc/psirc-quant/src /opt/biosoft/psirc/psirc-quant/release /opt/biosoft/psirc/psirc-quant/release/src /opt/biosoft/psirc/psirc-quant/release/src/CMakeFiles/psirc_core.dir/DependInfo.cmake --color=
make[3]: Leaving directory '/home/labpub/biosoft/psirc/psirc-quant/release'
make -f src/CMakeFiles/psirc_core.dir/build.make src/CMakeFiles/psirc_core.dir/build
make[3]: Entering directory '/home/labpub/biosoft/psirc/psirc-quant/release'
make[3]: Nothing to be done for 'src/CMakeFiles/psirc_core.dir/build'.
make[3]: Leaving directory '/home/labpub/biosoft/psirc/psirc-quant/release'
[ 88%] Built target psirc_core
make -f src/CMakeFiles/psirc-quant.dir/build.make src/CMakeFiles/psirc-quant.dir/depend
make[3]: Entering directory '/home/labpub/biosoft/psirc/psirc-quant/release'
cd /opt/biosoft/psirc/psirc-quant/release && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /opt/biosoft/psirc/psirc-quant /opt/biosoft/psirc/psirc-quant/src /opt/biosoft/psirc/psirc-quant/release /opt/biosoft/psirc/psirc-quant/release/src /opt/biosoft/psirc/psirc-quant/release/src/CMakeFiles/psirc-quant.dir/DependInfo.cmake --color=
make[3]: Leaving directory '/home/labpub/biosoft/psirc/psirc-quant/release'
make -f src/CMakeFiles/psirc-quant.dir/build.make src/CMakeFiles/psirc-quant.dir/build
make[3]: Entering directory '/home/labpub/biosoft/psirc/psirc-quant/release'
make[3]: *** No rule to make target '../src/../ext/htslib/libhts.a', needed by 'src/psirc-quant'.  Stop.
make[3]: Leaving directory '/home/labpub/biosoft/psirc/psirc-quant/release'
make[2]: *** [CMakeFiles/Makefile2:142: src/CMakeFiles/psirc-quant.dir/all] Error 2
make[2]: Leaving directory '/home/labpub/biosoft/psirc/psirc-quant/release'
make[1]: *** [CMakeFiles/Makefile2:149: src/CMakeFiles/psirc-quant.dir/rule] Error 2
make[1]: Leaving directory '/home/labpub/biosoft/psirc/psirc-quant/release'
make: *** [Makefile:194: psirc-quant] Error 2

How can I do next? Thank you.

Christina-hshi commented 2 years ago

Hi Alipe,

Thanks. It seems that you will need to compile htslib separately. Please go to the folder "/ext/htslib/", and compile htslib following the instructions in the README file there.

Alipe2021 commented 2 years ago

Hi Christina,

I ran the commands as follows before the make psirc-quant :

## cd /opt/biosoft/psirc/psirc-quant/ext/htslib
autoreconf
./configure
make

the log of ./configure are as follows:

configure: loading site script /usr/share/site/x86_64-unknown-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for ranlib... ranlib
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking shared library type... plain .so
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for sys/param.h... yes
checking for getpagesize... yes
checking for working mmap... yes
checking for gmtime_r... yes
checking whether fdatasync is declared... yes
checking for fdatasync... yes
checking for library containing log... -lm
checking for zlib.h... yes
checking for inflate in -lz... yes
checking for library containing connect... none required
checking for bzlib.h... yes
checking for BZ2_bzBuffToBuffCompress in -lbz2... yes
checking for lzma.h... yes
checking for lzma_easy_buffer_encode in -llzma... yes
checking for curl_easy_pause in -lcurl... yes
checking for CCHmac... no
checking for library containing HMAC... -lcrypto
configure: creating ./config.status
config.status: creating config.mk
config.status: creating htslib.pc.tmp
config.status: creating config.h
config.status: config.h is unchanged

and the log of make are as floows:

(psirc_py3_env) liupeng@zmhpc1:/opt/biosoft/psirc/psirc-quant/ext/htslib> make
gcc -g -O2 -I.  -c -o kfunc.o kfunc.c
gcc -g -O2 -I.  -c -o knetfile.o knetfile.c
gcc -g -O2 -I.  -c -o kstring.o kstring.c
gcc -g -O2 -I.  -c -o bcf_sr_sort.o bcf_sr_sort.c
gcc -g -O2 -I.  -c -o bgzf.o bgzf.c
gcc -g -O2 -I.  -c -o errmod.o errmod.c
gcc -g -O2 -I.  -c -o faidx.o faidx.c
gcc -g -O2 -I.  -c -o hfile.o hfile.c
gcc -g -O2 -I.  -c -o hfile_net.o hfile_net.c
echo '#define HTS_VERSION "1.4.1"' > version.h
gcc -g -O2 -I.  -c -o hts.o hts.c
hts.c: In function ‘hts_idx_init’:
hts.c:1333:59: warning: overflow in conversion from ‘uint32_t’ {aka ‘unsigned int’} to ‘int’ changes value from ‘idx->z.last_bin = 4294967295’ to ‘-1’ [-Woverflow]
 1333 |     idx->z.save_bin = idx->z.save_tid = idx->z.last_tid = idx->z.last_bin = 0xffffffffu;
      |                                                           ^~~
gcc -g -O2 -I.  -c -o md5.o md5.c
gcc -g -O2 -I.  -c -o multipart.o multipart.c
gcc -g -O2 -I.  -c -o probaln.o probaln.c
gcc -g -O2 -I.  -c -o realn.o realn.c
gcc -g -O2 -I.  -c -o regidx.o regidx.c
gcc -g -O2 -I.  -c -o sam.o sam.c
gcc -g -O2 -I.  -c -o synced_bcf_reader.o synced_bcf_reader.c
gcc -g -O2 -I.  -c -o vcf_sweep.o vcf_sweep.c
gcc -g -O2 -I.  -c -o tbx.o tbx.c
gcc -g -O2 -I.  -c -o textutils.o textutils.c
gcc -g -O2 -I.  -c -o thread_pool.o thread_pool.c
gcc -g -O2 -I.  -c -o vcf.o vcf.c
gcc -g -O2 -I.  -c -o vcfutils.o vcfutils.c
gcc -g -O2 -I.  -c -o cram/cram_codecs.o cram/cram_codecs.c
gcc -g -O2 -I.  -c -o cram/cram_decode.o cram/cram_decode.c
gcc -g -O2 -I.  -c -o cram/cram_encode.o cram/cram_encode.c
gcc -g -O2 -I.  -c -o cram/cram_external.o cram/cram_external.c
gcc -g -O2 -I.  -c -o cram/cram_index.o cram/cram_index.c
In file included from ./cram/sam_header.h:56,
                 from ./cram/cram_samtools.h:77,
                 from ./cram/cram.h:45,
                 from cram/cram_index.c:65:
In function ‘kputsn’,
    inlined from ‘kputs’ at ./htslib/kstring.h:156:9,
    inlined from ‘cram_index_build’ at cram/cram_index.c:516:9:
./htslib/kstring.h:148:2: warning: ‘memcpy’ specified bound 18446744073709551614 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
  148 |  memcpy(s->s + s->l, p, l);
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~
gcc -g -O2 -I.  -c -o cram/cram_io.o cram/cram_io.c
gcc -g -O2 -I.  -c -o cram/cram_samtools.o cram/cram_samtools.c
gcc -g -O2 -I.  -c -o cram/cram_stats.o cram/cram_stats.c
gcc -g -O2 -I.  -c -o cram/files.o cram/files.c
gcc -g -O2 -I.  -c -o cram/mFILE.o cram/mFILE.c
gcc -g -O2 -I.  -c -o cram/open_trace_file.o cram/open_trace_file.c
gcc -g -O2 -I.  -c -o cram/pooled_alloc.o cram/pooled_alloc.c
gcc -g -O2 -I.  -c -o cram/rANS_static.o cram/rANS_static.c
gcc -g -O2 -I.  -c -o cram/sam_header.o cram/sam_header.c
gcc -g -O2 -I.  -c -o cram/string_alloc.o cram/string_alloc.c
gcc -g -O2 -I.  -c -o cram/vlen.o cram/vlen.c
gcc -g -O2 -I.  -c -o cram/zfio.o cram/zfio.c
gcc -g -O2 -I.  -c -o hfile_libcurl.o hfile_libcurl.c
gcc -g -O2 -I.  -c -o hfile_gcs.o hfile_gcs.c
In file included from hfile_gcs.c:34:
In function ‘kputsn’,
    inlined from ‘kputs’ at htslib/kstring.h:156:9,
    inlined from ‘gcs_rewrite’ at hfile_gcs.c:85:13:
htslib/kstring.h:148:2: warning: ‘memcpy’ specified bound 18446744073709551614 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
  148 |  memcpy(s->s + s->l, p, l);
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~
gcc -g -O2 -I.  -c -o hfile_s3.o hfile_s3.c
In file included from hfile_s3.c:39:
In function ‘kputsn’,
    inlined from ‘kputs’ at htslib/kstring.h:156:9,
    inlined from ‘s3_open’ at hfile_s3.c:364:5:
htslib/kstring.h:148:2: warning: ‘memcpy’ specified bound 18446744073709551614 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
  148 |  memcpy(s->s + s->l, p, l);
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~
ar -rc libhts.a kfunc.o knetfile.o kstring.o bcf_sr_sort.o bgzf.o errmod.o faidx.o hfile.o hfile_net.o hts.o md5.o multipart.o probaln.o realn.o regidx.o sam.o synced_bcf_reader.o vcf_sweep.o tbx.o textutils.o thread_pool.o vcf.o vcfutils.o cram/cram_codecs.o cram/cram_decode.o cram/cram_encode.o cram/cram_external.o cram/cram_index.o cram/cram_io.o cram/cram_samtools.o cram/cram_stats.o cram/files.o cram/mFILE.o cram/open_trace_file.o cram/pooled_alloc.o cram/rANS_static.o cram/sam_header.o cram/string_alloc.o cram/vlen.o cram/zfio.o  hfile_libcurl.o hfile_gcs.o hfile_s3.o
ranlib libhts.a
gcc -g -O2 -I.  -fpic -c -o kfunc.pico kfunc.c
gcc -g -O2 -I.  -fpic -c -o knetfile.pico knetfile.c
gcc -g -O2 -I.  -fpic -c -o kstring.pico kstring.c
gcc -g -O2 -I.  -fpic -c -o bcf_sr_sort.pico bcf_sr_sort.c
gcc -g -O2 -I.  -fpic -c -o bgzf.pico bgzf.c
gcc -g -O2 -I.  -fpic -c -o errmod.pico errmod.c
gcc -g -O2 -I.  -fpic -c -o faidx.pico faidx.c
gcc -g -O2 -I.  -fpic -c -o hfile.pico hfile.c
gcc -g -O2 -I.  -fpic -c -o hfile_net.pico hfile_net.c
gcc -g -O2 -I.  -fpic -c -o hts.pico hts.c
hts.c: In function ‘hts_idx_init’:
hts.c:1333:59: warning: overflow in conversion from ‘uint32_t’ {aka ‘unsigned int’} to ‘int’ changes value from ‘idx->z.last_bin = 4294967295’ to ‘-1’ [-Woverflow]
 1333 |     idx->z.save_bin = idx->z.save_tid = idx->z.last_tid = idx->z.last_bin = 0xffffffffu;
      |                                                           ^~~
gcc -g -O2 -I.  -fpic -c -o md5.pico md5.c
gcc -g -O2 -I.  -fpic -c -o multipart.pico multipart.c
gcc -g -O2 -I.  -fpic -c -o probaln.pico probaln.c
gcc -g -O2 -I.  -fpic -c -o realn.pico realn.c
gcc -g -O2 -I.  -fpic -c -o regidx.pico regidx.c
gcc -g -O2 -I.  -fpic -c -o sam.pico sam.c
gcc -g -O2 -I.  -fpic -c -o synced_bcf_reader.pico synced_bcf_reader.c
gcc -g -O2 -I.  -fpic -c -o vcf_sweep.pico vcf_sweep.c
gcc -g -O2 -I.  -fpic -c -o tbx.pico tbx.c
gcc -g -O2 -I.  -fpic -c -o textutils.pico textutils.c
gcc -g -O2 -I.  -fpic -c -o thread_pool.pico thread_pool.c
gcc -g -O2 -I.  -fpic -c -o vcf.pico vcf.c
gcc -g -O2 -I.  -fpic -c -o vcfutils.pico vcfutils.c
gcc -g -O2 -I.  -fpic -c -o cram/cram_codecs.pico cram/cram_codecs.c
gcc -g -O2 -I.  -fpic -c -o cram/cram_decode.pico cram/cram_decode.c
gcc -g -O2 -I.  -fpic -c -o cram/cram_encode.pico cram/cram_encode.c
gcc -g -O2 -I.  -fpic -c -o cram/cram_external.pico cram/cram_external.c
gcc -g -O2 -I.  -fpic -c -o cram/cram_index.pico cram/cram_index.c
In file included from ./cram/sam_header.h:56,
                 from ./cram/cram_samtools.h:77,
                 from ./cram/cram.h:45,
                 from cram/cram_index.c:65:
In function ‘kputsn’,
    inlined from ‘kputs’ at ./htslib/kstring.h:156:9,
    inlined from ‘cram_index_build’ at cram/cram_index.c:516:9:
./htslib/kstring.h:148:2: warning: ‘memcpy’ specified bound 18446744073709551614 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
  148 |  memcpy(s->s + s->l, p, l);
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~
gcc -g -O2 -I.  -fpic -c -o cram/cram_io.pico cram/cram_io.c
gcc -g -O2 -I.  -fpic -c -o cram/cram_samtools.pico cram/cram_samtools.c
gcc -g -O2 -I.  -fpic -c -o cram/cram_stats.pico cram/cram_stats.c
gcc -g -O2 -I.  -fpic -c -o cram/files.pico cram/files.c
gcc -g -O2 -I.  -fpic -c -o cram/mFILE.pico cram/mFILE.c
gcc -g -O2 -I.  -fpic -c -o cram/open_trace_file.pico cram/open_trace_file.c
gcc -g -O2 -I.  -fpic -c -o cram/pooled_alloc.pico cram/pooled_alloc.c
gcc -g -O2 -I.  -fpic -c -o cram/rANS_static.pico cram/rANS_static.c
gcc -g -O2 -I.  -fpic -c -o cram/sam_header.pico cram/sam_header.c
gcc -g -O2 -I.  -fpic -c -o cram/string_alloc.pico cram/string_alloc.c
gcc -g -O2 -I.  -fpic -c -o cram/vlen.pico cram/vlen.c
gcc -g -O2 -I.  -fpic -c -o cram/zfio.pico cram/zfio.c
gcc -g -O2 -I.  -fpic -c -o hfile_libcurl.pico hfile_libcurl.c
gcc -g -O2 -I.  -fpic -c -o hfile_gcs.pico hfile_gcs.c
In file included from hfile_gcs.c:34:
In function ‘kputsn’,
    inlined from ‘kputs’ at htslib/kstring.h:156:9,
    inlined from ‘gcs_rewrite’ at hfile_gcs.c:85:13:
htslib/kstring.h:148:2: warning: ‘memcpy’ specified bound 18446744073709551614 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
  148 |  memcpy(s->s + s->l, p, l);
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~
gcc -g -O2 -I.  -fpic -c -o hfile_s3.pico hfile_s3.c
In file included from hfile_s3.c:39:
In function ‘kputsn’,
    inlined from ‘kputs’ at htslib/kstring.h:156:9,
    inlined from ‘s3_open’ at hfile_s3.c:364:5:
htslib/kstring.h:148:2: warning: ‘memcpy’ specified bound 18446744073709551614 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]
  148 |  memcpy(s->s + s->l, p, l);
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~
gcc -shared -Wl,-soname,libhts.so.2   -o libhts.so kfunc.pico knetfile.pico kstring.pico bcf_sr_sort.pico bgzf.pico errmod.pico faidx.pico hfile.pico hfile_net.pico hts.pico md5.pico multipart.pico probaln.pico realn.pico regidx.pico sam.pico synced_bcf_reader.pico vcf_sweep.pico tbx.pico textutils.pico thread_pool.pico vcf.pico vcfutils.pico cram/cram_codecs.pico cram/cram_decode.pico cram/cram_encode.pico cram/cram_external.pico cram/cram_index.pico cram/cram_io.pico cram/cram_samtools.pico cram/cram_stats.pico cram/files.pico cram/mFILE.pico cram/open_trace_file.pico cram/pooled_alloc.pico cram/rANS_static.pico cram/sam_header.pico cram/string_alloc.pico cram/vlen.pico cram/zfio.pico hfile_libcurl.pico hfile_gcs.pico hfile_s3.pico -llzma -lbz2 -lz -lm   -lcurl -lcrypto -lpthread
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: /usr/local/lib/libbz2.a(bzlib.o): relocation R_X86_64_32S against symbol `BZ2_crc32Table' can not be used when making a shared object; recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: /usr/local/lib/libbz2.a(compress.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: /usr/local/lib/libbz2.a(decompress.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: /usr/local/lib/libbz2.a(blocksort.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: /usr/local/lib/libbz2.a(compress.o): warning: relocation against `BZ2_blockSort' in read-only section `.text'
collect2: error: ld returned 1 exit status
make: *** [Makefile:267: libhts.so] Error 1

As we can see, some errors were happened, and I can not solve them. Instead, I install the htslib, zlib, and hdf5 in a conda environment namely psirc_py3_env as mentioned earlier. All subsequent steps were ran in the psirc_py3_env.

Christina-hshi commented 2 years ago

Hi Alipe,

The error message suggests that you were trying to use a static library (libbz2.a) to build a shared library (libhts.so). Similar problem was reported in the htslib repository. Could you check whether you have the dynamic version of libbz2 in your machine? Otherwise, I would suggest install a dynamic version first, and then re-compile htslib.

Alipe2021 commented 2 years ago

Hi Christina,

I test the installation on my Ubuntu 20.04 (WLS) and faild. Then I ran the command sudo apt-get install --reinstall libbz2-dev. Finally, when I ran the make psirc-quant the errors happened again.

liupeng@Maize:~/psirc-master/psirc-quant/release$ make psirc-quant
Scanning dependencies of target psirc_core
[  5%] Building CXX object src/CMakeFiles/psirc_core.dir/Bootstrap.cpp.o
[ 11%] Building CXX object src/CMakeFiles/psirc_core.dir/GeneModel.cpp.o
[ 16%] Building CXX object src/CMakeFiles/psirc_core.dir/H5Writer.cpp.o
[ 22%] Building CXX object src/CMakeFiles/psirc_core.dir/Kmer.cpp.o
[ 27%] Building CXX object src/CMakeFiles/psirc_core.dir/KmerIndex.cpp.o
[ 33%] Building CXX object src/CMakeFiles/psirc_core.dir/KmerIterator.cpp.o
[ 38%] Building CXX object src/CMakeFiles/psirc_core.dir/MinCollector.cpp.o
[ 44%] Building CXX object src/CMakeFiles/psirc_core.dir/PlaintextWriter.cpp.o
[ 50%] Building CXX object src/CMakeFiles/psirc_core.dir/ProcessReads.cpp.o
[ 55%] Building CXX object src/CMakeFiles/psirc_core.dir/PseudoBam.cpp.o
[ 61%] Building CXX object src/CMakeFiles/psirc_core.dir/common.cpp.o
[ 66%] Building CXX object src/CMakeFiles/psirc_core.dir/h5utils.cpp.o
[ 72%] Building CXX object src/CMakeFiles/psirc_core.dir/hash.cpp.o
[ 77%] Building CXX object src/CMakeFiles/psirc_core.dir/main.cpp.o
[ 83%] Building CXX object src/CMakeFiles/psirc_core.dir/weights.cpp.o
[ 88%] Linking CXX static library libpsirc_core.a
[ 88%] Built target psirc_core
Scanning dependencies of target psirc-quant
[ 94%] Building CXX object src/CMakeFiles/psirc-quant.dir/main.cpp.o
[100%] Linking CXX executable psirc-quant
/usr/bin/ld: ../../src/../ext/htslib/libhts.a(cram_io.o): in function `lzma_mem_deflate':
/home/liupeng/psirc-master/psirc-quant/ext/htslib/cram/cram_io.c:669: undefined reference to `lzma_stream_buffer_bound'
/usr/bin/ld: /home/liupeng/psirc-master/psirc-quant/ext/htslib/cram/cram_io.c:675: undefined reference to `lzma_easy_buffer_encode'
/usr/bin/ld: ../../src/../ext/htslib/libhts.a(cram_io.o): in function `cram_compress_by_method':
/home/liupeng/psirc-master/psirc-quant/ext/htslib/cram/cram_io.c:1030: undefined reference to `BZ2_bzBuffToBuffCompress'
/usr/bin/ld: ../../src/../ext/htslib/libhts.a(cram_io.o): in function `cram_uncompress_block':
/home/liupeng/psirc-master/psirc-quant/ext/htslib/cram/cram_io.c:954: undefined reference to `BZ2_bzBuffToBuffDecompress'
/usr/bin/ld: ../../src/../ext/htslib/libhts.a(cram_io.o): in function `lzma_mem_inflate':
/home/liupeng/psirc-master/psirc-quant/ext/htslib/cram/cram_io.c:691: undefined reference to `lzma_easy_decoder_memusage'
/usr/bin/ld: /home/liupeng/psirc-master/psirc-quant/ext/htslib/cram/cram_io.c:691: undefined reference to `lzma_stream_decoder'
/usr/bin/ld: /home/liupeng/psirc-master/psirc-quant/ext/htslib/cram/cram_io.c:706: undefined reference to `lzma_code'
/usr/bin/ld: /home/liupeng/psirc-master/psirc-quant/ext/htslib/cram/cram_io.c:719: undefined reference to `lzma_code'
/usr/bin/ld: /home/liupeng/psirc-master/psirc-quant/ext/htslib/cram/cram_io.c:728: undefined reference to `lzma_end'
collect2: error: ld returned 1 exit status
make[3]: *** [src/CMakeFiles/psirc-quant.dir/build.make:92: src/psirc-quant] Error 1
make[2]: *** [CMakeFiles/Makefile2:125: src/CMakeFiles/psirc-quant.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:132: src/CMakeFiles/psirc-quant.dir/rule] Error 2
make: *** [Makefile:177: psirc-quant] Error 2

I have no more time to learn how to compile a program, because I haven't studied C/C++ at all. Could you please upload a well compiled psirc-quant.

Thanks.

Alipe

Christina-hshi commented 2 years ago

Hi Alipe,

Good suggestion. I have compiled psirc-quant linked with static library in a x86_64 machine. See whether it can work on your machine. You can download the binary following the GoogleDrive link below. In case that you cannot access the GoogleDrive, let me know your email and I will send to you by email.

https://drive.google.com/file/d/1Vdtmb8CyRGS38NGT7VGMsSwkajUmqv_a/view?usp=sharing

Alipe2021 commented 2 years ago

Hi Christina,

Thank you for your help. I compiled it successfully a few minutes ago with the command make at the last step instead of make psirc-quant. I don't known what happened.

Thank you again for your help.

Yours Alipe

Christina-hshi commented 2 years ago

Hi Alipe,

It might be still related to the "htslib". You can compile it by make htslib before make psirc-quant, instead of going to the ext/htslib to compile there. Anyway, good to hear that you have compiled it successfully. Thank you for reporting the compile problems and your interest in our programs. I will upload the release version with binaries in case others have problems compiling the programs on their machines.

Best, Christina