popscle icon indicating copy to clipboard operation
popscle copied to clipboard

error: expected ')' before 'PRId64'

Open Zepeng-Mu opened this issue 4 years ago • 3 comments

Hi, I encountered this error when trying to install popscle. My C and CXX compiler version are 9.3.0. HTSlib 1.10.2. This error seems to be related to GNU version? But I'm not sure exactly which version I should use or how to solve this error.

[ 45%] Building CXX object CMakeFiles/popscle.dir/filter.cpp.o
popscle/filter.cpp: In function 'void filters_set_format_int(filter_t*, bcf1_t*, token_t*)':
popscle/filter.cpp:705:58: error: expected ')' before 'PRId64'
  705 |         error("Incorrect number of FORMAT fields at %s:%" PRId64 " .. %s, %d vs %d\n", bcf_seqname(flt->hdr,line),(int64_t) line->pos+1,tok->tag,line->n_sample,tok->nsamples);
      |              ~                                           ^~~~~~~
      |                                                          )

Thanks!!

Zepeng-Mu avatar May 13 '21 14:05 Zepeng-Mu

Solved this by making a separate Conda environment for everything. There are several warnings in cmake but everything is fine. I think the reason is the difference between GNU 4.8.5 and GNU 9.3.0.

-- The C compiler identification is GNU 4.8.5
-- The CXX compiler identification is GNU 4.8.5
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- /home/zepengmu/miniconda3/envs/popscle/include
-- /home/zepengmu/miniconda3/envs/popscle/lib/libhts.so
-- Found BZip2: /usr/lib64/libbz2.so (found version "1.0.6")
-- Looking for BZ2_bzCompressInit
-- Looking for BZ2_bzCompressInit - found
-- Configuring done
CMake Warning at CMakeLists.txt:25 (add_executable):
  Cannot generate a safe runtime search path for target popscle because files
  in some directories may conflict with libraries in implicit directories:

    runtime library [libz.so.1] in /usr/lib64 may be hidden by files in:
      /home/zepengmu/miniconda3/envs/popscle/lib
    runtime library [liblzma.so.5] in /usr/lib64 may be hidden by files in:
      /home/zepengmu/miniconda3/envs/popscle/lib
    runtime library [libcurl.so.4] in /usr/lib64 may be hidden by files in:
      /home/zepengmu/miniconda3/envs/popscle/lib

  Some of these libraries may not be found correctly.


-- Generating done
-- Build files have been written to: /home/zepengmu/tools/popscle/build

Zepeng-Mu avatar May 13 '21 16:05 Zepeng-Mu

I still get this error and I've tried GNU GCC/G++ versions 4.8.5, 7.5.0, 8.4.0 and 9.3.0

I created a conda environment and tried each of these version but still couldn't get it to compile. Any suggestions?

dfermin avatar Jun 15 '21 21:06 dfermin

It looks that some compilers do not properly recognize PRId64. In this case, the simplest solution is to change %" PRId64 " to %lld in the source code. Finding out the right compile option for all platforms would be ideal, but at the moment, I cannot figure out what the problem might be.

hyunminkang avatar Jun 18 '21 13:06 hyunminkang