Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: expected ')' before 'PRId64' #44

Open
Zepeng-Mu opened this issue May 13, 2021 · 3 comments
Open

error: expected ')' before 'PRId64' #44

Zepeng-Mu opened this issue May 13, 2021 · 3 comments

Comments

@Zepeng-Mu
Copy link

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
Copy link
Author

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

@dfermin
Copy link

dfermin commented Jun 15, 2021

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?

@hyunminkang
Copy link
Contributor

hyunminkang commented Jun 18, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants