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

Trouble compiling RUTH #4

Open
ElizabethBlue opened this issue Oct 23, 2020 · 8 comments
Open

Trouble compiling RUTH #4

ElizabethBlue opened this issue Oct 23, 2020 · 8 comments

Comments

@ElizabethBlue
Copy link

Hi,

Our lab is having trouble installing RUTH, and have tried different gcc compilers and older versions of htslib. We're wondering if it is related to the recent updates to RUTH, but we don't have an older copy to try. I've put the command and error messages below, do you have any advice?

Thanks for your time,

Liz

compiling RUTH

git clone https://github.com/statgen/ruth.git
cd ruth
mkdir build
cd build
cmake -DHTS_INCLUDE_DIRS=/home/src/htslib/include/ -DHTS_LIBRARIES=/home/src/htslib/lib/libhts.a ..
make

error message:

[  4%] Building CXX object CMakeFiles/ruth.dir/Error.cpp.o
In file included from /acct/em27/programs/ruth/Error.cpp:18:0:
/acct/em27/programs/ruth/Error.h:36:14: error: variable or field ‘verbose’ declared void
 void verbose(int32_t priority, const char * msg, ...);
              ^
/acct/em27/programs/ruth/Error.h:36:14: error: ‘int32_t’ was not declared in this scope
/acct/em27/programs/ruth/Error.h:36:32: error: expected primary-expression before ‘const’
 void verbose(int32_t priority, const char * msg, ...);
                                ^
/acct/em27/programs/ruth/Error.h:36:50: error: expected primary-expression before ‘...’ token
 void verbose(int32_t priority, const char * msg, ...);
                                                  ^
/acct/em27/programs/ruth/Error.h:39:8: error: ‘int32_t’ does not name a type
 extern int32_t globalVerbosityThreshold;
        ^
make[2]: *** [CMakeFiles/ruth.dir/Error.cpp.o] Error 1
make[1]: *** [CMakeFiles/ruth.dir/all] Error 2
make: *** [all] Error 2

@amkwong
Copy link
Collaborator

amkwong commented Oct 23, 2020 via email

@ElizabethBlue
Copy link
Author

Thank you for your quick reply!

We amended the Error.h file and compiled the program, but then another error came up, and the compilation stopped. I've pasted the error message below, for what it is worth.

/usr/include/c++/4.8.2/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.

It looks like there are multiple differences between our compilers. Can you send me more information on the compilers/compiler settings you are using so I can try to mimic them here?

Thanks again,

Liz

@hyunminkang
Copy link
Collaborator

hyunminkang commented Oct 27, 2020 via email

@ElizabethBlue
Copy link
Author

Thanks for your quick reply! In good news, we made some progress with the compilation. In bad news, we encountered another error. Looks like the compiler is grumpy about the forward declaration of faidx_t? Please see below for details.

[ 43%] Building CXX object CMakeFiles/ruth.dir/hts_utils.cpp.o
In file included from /home/temp/ruth/ruth/ruth-master/hts_utils.h:43:0,
from /home/temp/ruth/ruth/ruth-master/hts_utils.cpp:24:
/home/temp/ruth/ruth/ruth-master/hts_utils.cpp: In function ‘char* faidx_fetch_uc_seq(const faidx_t*, const char*, int, int, int*)’:
/home/temp/ruth/ruth/ruth-master/hts_utils.cpp:51:25: error: invalid use of incomplete type ‘const faidx_t {aka const struct faidx_t}’
iter = kh_get(s, fai->hash, c_name);
^
/home/src/htslib/include/htslib/khash.h:511:42: note: in definition of macro ‘kh_get’
#define kh_get(name, h, k) kh_get_##name(h, k)
^
In file included from /home/temp/ruth/ruth/ruth-master/hts_utils.h:48:0,
from /home/temp/ruth/ruth/ruth-master/hts_utils.cpp:24:
/home/src/htslib/include/htslib/faidx.h:69:8: error: forward declaration of ‘const faidx_t {aka const struct faidx_t}’
struct faidx_t;
^
In file included from /home/temp/ruth/ruth/ruth-master/hts_utils.h:43:0,
from /home/temp/ruth/ruth/ruth-master/hts_utils.cpp:24:
/home/temp/ruth/ruth/ruth-master/hts_utils.cpp:52:26: error: invalid use of incomplete type ‘const faidx_t {aka const struct faidx_t}’
if(iter == kh_end(fai->hash)) return 0;
^
/home/src/htslib/include/htslib/khash.h:563:21: note: in definition of macro ‘kh_end’
#define kh_end(h) ((h)->n_buckets)
^
In file included from /home/temp/ruth/ruth/ruth-master/hts_utils.h:48:0,
from /home/temp/ruth/ruth/ruth-master/hts_utils.cpp:24:
/home/src/htslib/include/htslib/faidx.h:69:8: error: forward declaration of ‘const faidx_t {aka const struct faidx_t}’
struct faidx_t;
^
In file included from /home/temp/ruth/ruth/ruth-master/hts_utils.h:43:0,
from /home/temp/ruth/ruth/ruth-master/hts_utils.cpp:24:
/home/temp/ruth/ruth/ruth-master/hts_utils.cpp:53:23: error: invalid use of incomplete type ‘const faidx_t {aka const struct faidx_t}’
val = kh_value(fai->hash, iter);
^
/home/src/htslib/include/htslib/khash.h:549:26: note: in definition of macro ‘kh_value’
#define kh_value(h, x) ((h)->vals[x])
^
In file included from /home/temp/ruth/ruth/ruth-master/hts_utils.h:48:0,
from /home/temp/ruth/ruth/ruth-master/hts_utils.cpp:24:
/home/src/htslib/include/htslib/faidx.h:69:8: error: forward declaration of ‘const faidx_t {aka const struct faidx_t}’
struct faidx_t;
^
/home/temp/ruth/ruth/ruth-master/hts_utils.cpp:61:29: error: invalid use of incomplete type ‘const faidx_t {aka const struct faidx_t}’
int ret = bgzf_useek(fai->bgzf, val.offset + p_beg_i / val.line_blen * val.line_len + p_beg_i % val.line_blen, SEEK_SET);
^
In file included from /home/temp/ruth/ruth/ruth-master/hts_utils.h:48:0,
from /home/temp/ruth/ruth/ruth-master/hts_utils.cpp:24:
/home/src/htslib/include/htslib/faidx.h:69:8: error: forward declaration of ‘const faidx_t {aka const struct faidx_t}’
struct faidx_t;
^
/home/temp/ruth/ruth/ruth-master/hts_utils.cpp:70:29: error: invalid use of incomplete type ‘const faidx_t {aka const struct faidx_t}’
while ( (c=bgzf_getc(fai->bgzf))>=0 && l < p_end_i - p_beg_i + 1)
^
In file included from /home/temp/ruth/ruth/ruth-master/hts_utils.h:48:0,
from /home/temp/ruth/ruth/ruth-master/hts_utils.cpp:24:
/home/src/htslib/include/htslib/faidx.h:69:8: error: forward declaration of ‘const faidx_t {aka const struct faidx_t}’
struct faidx_t;
^
make[2]: *** [CMakeFiles/ruth.dir/hts_utils.cpp.o] Error 1
make[1]: *** [CMakeFiles/ruth.dir/all] Error 2
make: *** [all] Error 2

@hyunminkang
Copy link
Collaborator

Are you sure that you are using the latest versions of htslib and ruth? You may encounter such problems if one of the versions are outdated.

@ElizabethBlue
Copy link
Author

Thanks again for your patience and interest in helping to resolve this problem.

I'm using htslib-1.11 and a version of ruth download using this command on Oct 23rd:

git clone https://github.com/statgen/ruth.git

Another person in my group has run into the same errors on a different machine using a ruth download dated Oct 19th.
Just for fun, I deleted my htslib and ruth files, and just performed a fresh installation, using these commands:

Installing htslib

wget https://github.com/samtools/htslib/releases/download/1.11/htslib-1.11.tar.bz2
tar jxvf htslib-1.11.tar.bz2
cd htslib-1.11vim
./configure --prefix=/home/src/htslib
make
make install

Compiling RUTH

git clone https://github.com/statgen/ruth.git
cd ruth
mkdir build
cd build
cmake -DHTS_INCLUDE_DIRS=/home/src/htslib/include/ -DHTS_LIBRARIES=/home/src/htslib/lib/libhts.a ..
make

I ran into the same errors we've discussed before, applied the same solutions you recommended, and came to the same error I described three days ago.

I then moved the files that changed fifteen days ago into a separate directory, manually downloaded their replacements from github to make sure I had the latest versions,, and end at nearly the same error described three days ago:

[ 39%] Building CXX object CMakeFiles/ruth.dir/hts_utils.cpp.o
In file included from /acct/em27/programs/ruth/hts_utils.h:43:0,
from /acct/em27/programs/ruth/hts_utils.cpp:24:
/acct/em27/programs/ruth/hts_utils.cpp: In function ‘char* faidx_fetch_uc_seq(const faidx_t*, const char*, int, int, int*)’:
/acct/em27/programs/ruth/hts_utils.cpp:51:25: error: invalid use of incomplete type ‘const faidx_t {aka const struct faidx_t}’
iter = kh_get(s, fai->hash, c_name);
^
/home/src/htslib/include/htslib/khash.h:511:42: note: in definition of macro ‘kh_get’
#define kh_get(name, h, k) kh_get_##name(h, k)
^
In file included from /acct/em27/programs/ruth/hts_utils.h:48:0,
from /acct/em27/programs/ruth/hts_utils.cpp:24:
/home/src/htslib/include/htslib/faidx.h:69:8: error: forward declaration of ‘const faidx_t {aka const struct faidx_t}’
struct faidx_t;
^
In file included from /acct/em27/programs/ruth/hts_utils.h:43:0,
from /acct/em27/programs/ruth/hts_utils.cpp:24:
/acct/em27/programs/ruth/hts_utils.cpp:52:26: error: invalid use of incomplete type ‘const faidx_t {aka const struct faidx_t}’
if(iter == kh_end(fai->hash)) return 0;
^
/home/src/htslib/include/htslib/khash.h:563:21: note: in definition of macro ‘kh_end’
#define kh_end(h) ((h)->n_buckets)
^
In file included from /acct/em27/programs/ruth/hts_utils.h:48:0,
from /acct/em27/programs/ruth/hts_utils.cpp:24:
/home/src/htslib/include/htslib/faidx.h:69:8: error: forward declaration of ‘const faidx_t {aka const struct faidx_t}’
struct faidx_t;
^
In file included from /acct/em27/programs/ruth/hts_utils.h:43:0,
from /acct/em27/programs/ruth/hts_utils.cpp:24:
/acct/em27/programs/ruth/hts_utils.cpp:53:23: error: invalid use of incomplete type ‘const faidx_t {aka const struct faidx_t}’
val = kh_value(fai->hash, iter);
^
/home/src/htslib/include/htslib/khash.h:549:26: note: in definition of macro ‘kh_value’
#define kh_value(h, x) ((h)->vals[x])
^
In file included from /acct/em27/programs/ruth/hts_utils.h:48:0,
from /acct/em27/programs/ruth/hts_utils.cpp:24:
/home/src/htslib/include/htslib/faidx.h:69:8: error: forward declaration of ‘const faidx_t {aka const struct faidx_t}’
struct faidx_t;
^
/acct/em27/programs/ruth/hts_utils.cpp:61:29: error: invalid use of incomplete type ‘const faidx_t {aka const struct faidx_t}’
int ret = bgzf_useek(fai->bgzf, val.offset + p_beg_i / val.line_blen * val.line_len + p_beg_i % val.line_blen, SEEK_SET);
^
In file included from /acct/em27/programs/ruth/hts_utils.h:48:0,
from /acct/em27/programs/ruth/hts_utils.cpp:24:
/home/src/htslib/include/htslib/faidx.h:69:8: error: forward declaration of ‘const faidx_t {aka const struct faidx_t}’
struct faidx_t;
^
/acct/em27/programs/ruth/hts_utils.cpp:70:29: error: invalid use of incomplete type ‘const faidx_t {aka const struct faidx_t}’
while ( (c=bgzf_getc(fai->bgzf))>=0 && l < p_end_i - p_beg_i + 1)
^
In file included from /acct/em27/programs/ruth/hts_utils.h:48:0,
from /acct/em27/programs/ruth/hts_utils.cpp:24:
/home/src/htslib/include/htslib/faidx.h:69:8: error: forward declaration of ‘const faidx_t {aka const struct faidx_t}’
struct faidx_t;
^
make[2]: *** [CMakeFiles/ruth.dir/hts_utils.cpp.o] Error 1
make[1]: *** [CMakeFiles/ruth.dir/all] Error 2
make: *** [all] Error 2

@hyunminkang
Copy link
Collaborator

I made some changes to avoid possible errors, and I also think you need to run cmake with different configurations

cmake -DHTS_INCLUDE_DIRS=/home/src/htslib/ -DHTS_LIBRARIES=/home/src/htslib/libhts.a ..

@ElizabethBlue
Copy link
Author

Hi Hyun,

We downloaded your new files this morning and have successfully compiled RUTH on multiple machines!!! Thank you again for all your help with this, I really appreciate it.

Best,
Liz

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