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

installation issue #34

Open
HyunjunNam opened this issue Oct 24, 2019 · 6 comments
Open

installation issue #34

HyunjunNam opened this issue Oct 24, 2019 · 6 comments

Comments

@HyunjunNam
Copy link

During the installation, I've got this error message.

In file included from bam_access.c:36:0:
bam_access.h:39:20: fatal error: bigWig.h: No such file or directory
#include "bigWig.h"
^
compilation terminated.
make: *** [bam_access.o] Error 1

@ghost
Copy link

ghost commented Oct 25, 2019

How are you installing cgpBigWig? This implies libBigWig was not installed ir that the header files are not present (it should be installed by ./setup.sh path/to/installation/folder)

@keiranmraine
Copy link
Contributor

There is also a pre-built Docker container which is known to function correctly under Singularity (if Docker is not permitted)

@HyunjunNam
Copy link
Author

HyunjunNam commented Oct 25, 2019

@drjsanger
I've tried to install them by using this command

(./setup.sh /path/to/installation_folder)
I think that is same with what you recommended for the installation.

However...... I got different kind of error message that I did not get before.
Even though, every dependencies were already installed (such as gnutls, tasn1 and etc..), it could not find them......

[sequencer@av1pbm-ngs3 cgpBigWig-develop]$ ./setup.sh ./opt/test
Max compilation CPUs set to 6
Get htslib ... already staged ...
Building htslib ... previously installed ...
Building libBigWig ... previously installed ...
Building cgpBigWig ...make: Entering directory `/isilon/R_and_D/user_folders/hjnam/Programs/cgpBigWig-develop/c'
clean
rm -f ./*.o *~ ../bin/bam2bedgraph ../bin/bam2bw ../bin/bg2bw ../bin/bam2bwbases ../bin/bwjoin ../bin/detectExtremeDepth ../bin/bwcat ./tests/tests_log ./c_tests/utils_tests ./*.gcda ./*.gcov ./*.gcno *.gcda *.gcov *.gcno ./c_tests/*.gcda ./c_tests/*.gcov ./c_tests/*.gcno
rm -rf ./htslib_tmp ../bin
make: Leaving directory `/isilon/R_and_D/user_folders/hjnam/Programs/cgpBigWig-develop/c'
make: Entering directory `/isilon/R_and_D/user_folders/hjnam/Programs/cgpBigWig-develop/c'
clean
rm -f ./*.o *~ ../bin/bam2bedgraph ../bin/bam2bw ../bin/bg2bw ../bin/bam2bwbases ../bin/bwjoin ../bin/detectExtremeDepth ../bin/bwcat ./tests/tests_log ./c_tests/utils_tests ./*.gcda ./*.gcov ./*.gcno *.gcda *.gcov *.gcno ./c_tests/*.gcda ./c_tests/*.gcov ./c_tests/*.gcno
rm -rf ./htslib_tmp ../bin
mkdir ../bin
mkdir ./htslib_tmp
#Do some magic to ensure we compile with the static libhts.a rather than libhts.so
ln -s /isilon/R_and_D/user_folders/hjnam/Programs/cgpBigWig-develop/install_tmp/htslib/libhts.a ./htslib_tmp/libhts.a
gcc -O3 -DVERSION='"1.1.0"' -g -Wall -I/isilon/R_and_D/user_folders/hjnam/Programs/cgpBigWig-develop/opt/test/include -I/isilon/R_and_D/user_folders/hjnam/Programs/cgpBigWig-develop/install_tmp/htslib/ -rdynamic -c bam_access.c  -o bam_access.o
bam_access.c: In function ‘process_bam_region_bases’:
bam_access.c:329:9: warning: unused variable ‘contig’ [-Wunused-variable]
   char *contig = parseRegionString(region, &start, &stop);
         ^
bam_access.c: In function ‘process_bam_region’:
bam_access.c:439:9: warning: unused variable ‘contig’ [-Wunused-variable]
   char *contig = parseRegionString(region, &reg_sta, &reg_sto);
         ^
gcc -O3 -DVERSION='"1.1.0"' -g -Wall -I/isilon/R_and_D/user_folders/hjnam/Programs/cgpBigWig-develop/opt/test/include -I/isilon/R_and_D/user_folders/hjnam/Programs/cgpBigWig-develop/install_tmp/htslib/ -rdynamic -c utils.c  -o utils.o
utils.c: In function ‘parse_file_name’:
utils.c:53:22: warning: argument to ‘sizeof’ in ‘memset’ call is the same expression as the destination; did you mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
   memset(dir,0,sizeof(dir));
                      ^
utils.c:54:24: warning: argument to ‘sizeof’ in ‘memset’ call is the same expression as the destination; did you mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
   memset(fname,0,sizeof(fname));
                        ^
utils.c: In function ‘parseRegionString’:
utils.c:103:3: warning: pointer targets in passing argument 2 of ‘hts_parse_reg’ differ in signedness [-Wpointer-sign]
   const char *q = hts_parse_reg(region, start, stop);
   ^
In file included from /isilon/R_and_D/user_folders/hjnam/Programs/cgpBigWig-develop/opt/test/include/htslib/sam.h:31:0,
                 from utils.c:36:
/isilon/R_and_D/user_folders/hjnam/Programs/cgpBigWig-develop/opt/test/include/htslib/hts.h:664:13: note: expected ‘int *’ but argument is of type ‘uint32_t *’
 const char *hts_parse_reg(const char *str, int *beg, int *end);
             ^
utils.c:103:3: warning: pointer targets in passing argument 3 of ‘hts_parse_reg’ differ in signedness [-Wpointer-sign]
   const char *q = hts_parse_reg(region, start, stop);
   ^
In file included from /isilon/R_and_D/user_folders/hjnam/Programs/cgpBigWig-develop/opt/test/include/htslib/sam.h:31:0,
                 from utils.c:36:
/isilon/R_and_D/user_folders/hjnam/Programs/cgpBigWig-develop/opt/test/include/htslib/hts.h:664:13: note: expected ‘int *’ but argument is of type ‘uint32_t *’
 const char *hts_parse_reg(const char *str, int *beg, int *end);
             ^
gcc -O3 -DVERSION='"1.1.0"' -g -Wall -I/isilon/R_and_D/user_folders/hjnam/Programs/cgpBigWig-develop/opt/test/include -I/isilon/R_and_D/user_folders/hjnam/Programs/cgpBigWig-develop/install_tmp/htslib/ -rdynamic ./bam2bedgraph.c ./bam_access.o ./utils.o -L./htslib_tmp -lhts -lpthread -lz -lbz2 -llzma -lm -ldl -o ../bin/bam2bedgraph
./bam2bedgraph.c: In function ‘main’:
./bam2bedgraph.c:228:25: warning: initialization from incompatible pointer type [enabled by default]
  bw_func_reg func_reg = &pileup_func;
                         ^
./bam2bedgraph.c:231:12: warning: assignment from incompatible pointer type [enabled by default]
   func_reg = &pileup_func_overlap;
            ^
gcc -O3 -DVERSION='"1.1.0"' -g -I/isilon/R_and_D/user_folders/hjnam/Programs/cgpBigWig-develop/opt/test/include -I/isilon/R_and_D/user_folders/hjnam/Programs/cgpBigWig-develop/install_tmp/htslib/ -rdynamic -Wall ./bam2bw.c ./bam_access.o ./utils.o -L./htslib_tmp -L/isilon/R_and_D/user_folders/hjnam/Programs/cgpBigWig-develop/opt/test/lib -lBigWig -lz -lbz2 -llzma -lcurl -lm -lgnutls -ltasn1 -lhogweed -lnettle -lgmp -lp11-kit -lhts -lpthread -lz -lbz2 -llzma -lm -ldl -o ../bin/bam2bw
./bam2bw.c: In function ‘main’:
./bam2bw.c:442:16: warning: ‘chromList’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   chromList_t *chromList = NULL;
                ^
/bin/ld: cannot find -lgnutls
/bin/ld: cannot find -ltasn1
/bin/ld: cannot find -lhogweed
/bin/ld: cannot find -lnettle
/bin/ld: cannot find -lp11-kit
collect2: error: ld returned 1 exit status
make: *** [../bin/bam2bw] Error 1

@jykr
Copy link

jykr commented Sep 1, 2020

I'm using CentOS7 and I also encountered the exact same error (/usr/bin/ld: cannot find -lgnutls ...). I worked it around by creating symbolic link to the location ld looks for (This ld is called by gcc in c/Makefile).

Specifically, try

  1. Find the usable library by doing ldconfig -p | grep gnutls. This will show the location of your installed library (ex. libgnutls.so.28 (libc6,x86-64) => /lib64/libgnutls.so.28).

    • It seems like if the name is not exactly libgnutls.so but contains the version following it, ld cannot find it.
  2. Add the symbolic link to one of the directories searched by your ld.

    • ld has default libraries that it searches for and you can check it by ld --verbose -lgnutls | grep SEARCH_DIR.
    • Alternatively, you can add it to the directory specified in the -L option of gcc (in cgpBigWig/c/Makefile). -L option adds the specified directory to the directories that ld searches for.
      • In your code, there are two -L option used by gcc: gcc ... -L./htslib_tmp -L/isilon/R_and_D/user_folders/hjnam/Programs/cgpBigWig-develop/opt/test/lib .... First one is a temporary folder so you can make the symbolic link in the second folder you're using.
    • If you don't have access to any of the above-mentioned folders, you can create a personal directory (ex. /home/yourdir/lib64) that will contain the symbolic link. In this case, you need to edit the /c/Makefile so that you can add an additional -L/home/yourdir/lib64 option to gcc.
      • One way to do this is to add CAT_LFLAGS+= -L/home/yourdir/lib64 in line 36 of c/Makefile.
    • In the directory (that will be searched by ld), add symbolic link of your library: ln -s /lib64/libgnutls.so.28 libgnutls.so

@keiranmraine
Copy link
Contributor

@davidrajones as your old account won't be notifying you of the conversation.

@Solenyalyl
Copy link

@jykr according to your solution ,I solved the problem ,thank you.

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

4 participants