Ecogenomics / BamM

Metagenomics-focused BAM file manipulation
http://ecogenomics.github.io/BamM/
GNU Lesser General Public License v3.0
16 stars 7 forks source link

Installing on Ubuntu 14.04 #20

Closed linsalrob closed 9 years ago

linsalrob commented 9 years ago

Hey Mike

I downloaded BamM today (31/3/15):

$ git clone https://github.com/minillinim/BamM.git

and then try to set up:

$ python2.7 setup.py install > setup.py.out 2> setup.py.err

The error is:

$ cat setup.py.err
configure: error: Cannot find libhts
make: *** No rule to make target `clean'.  Stop.
make: *** No targets specified and no makefile found.  Stop.
Traceback (most recent call last):
  File "setup.py", line 39, in <module>
    rename(join('c', 'libBamM.a'), join('bamm', 'libBamM.a'))
OSError: [Errno 2] No such file or directory

I have libhts installed:

$ updatedb && locate libhts.so
/root/bamm/BamM/c/htslib-1.2.1/libhts.so
/root/bamm/BamM/c/htslib-1.2.1/libhts.so.1
/usr/lib/x86_64-linux-gnu/libhts.so
/usr/lib/x86_64-linux-gnu/libhts.so.0
/usr/lib/x86_64-linux-gnu/libhts.so.0.0.1
/usr/local/lib/libhts.so
/usr/local/lib/libhts.so.1
/usr/local/lib/libhts.so.1.2.1
/usr/local/lib/libhts.so.1.2.1-7-ga233385

(working directory is /root/bamm/BamM)

so lets try installing while specifying a location of libhts:

$ python2.7 setup.py  --with-libhts-lib /usr/lib/x86_64-linux-gnu --with-libhts-inc /usr/lib/x86_64-linux-gnu --with-libcfu-lib /root/bamm/BamM/c/libcfu-0.03/ --with-libcfu-inc /root/bamm/BamM/c/libcfu-0.03/include/ > setup.py.out 2> setup.py.err

And the error is essentially the same:

$ cat setup.py.err 
configure: error: Cannot find libhts
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires'
  warnings.warn(msg)
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help

error: no commands supplied
minillinim commented 9 years ago

Hi Rob,

A mystery!

But one worth solving :)

Could you please post the output of setup.py.out.

I'd like to see where it got up to

Sorry for the hassle

linsalrob commented 9 years ago
$ cat setup.py.out
Preparing the BamM build system...please wait

Found GNU Autoconf version 2.69
Found GNU Automake version 1.14.1
Found GNU Libtool version 2.4.2

Automatically preparing build ... done

The BamM build system is now prepared. To build here, run:
 ./configure
 make
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 g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for lgamma,log,exp in -lm... yes
checking for libcfu headers in /root/bamm/BamM/c/libcfu-0.03/include... found
checking for libcfu libraries in /root/bamm/BamM/c/libcfu-0.03... found
checking for libhts headers in /usr/lib/x86_64-linux-gnu... not found
rm -f *.o
rm -f libBamM.a
gcc -std=gnu99 -g -fPIC -pthread -O2 -Wall -I/usr/local/include/htslib -I/root/bamm/BamM/c/libcfu-0.03/include  -c -o bamExtractor.o bamExtractor.c
gcc -std=gnu99 -g -fPIC -pthread -O2 -Wall -I/usr/local/include/htslib -I/root/bamm/BamM/c/libcfu-0.03/include  -c -o bamParser.o bamParser.c
gcc -std=gnu99 -g -fPIC -pthread -O2 -Wall -I/usr/local/include/htslib -I/root/bamm/BamM/c/libcfu-0.03/include  -c -o pairedLink.o pairedLink.c
gcc -std=gnu99 -g -fPIC -pthread -O2 -Wall -I/usr/local/include/htslib -I/root/bamm/BamM/c/libcfu-0.03/include  -c -o bamRead.o bamRead.c
gcc -std=gnu99 -g -fPIC -pthread -O2 -Wall -I/usr/local/include/htslib -I/root/bamm/BamM/c/libcfu-0.03/include  -c -o coverageEstimators.o coverageEstimators.c
gcc -std=gnu99 -g -fPIC -pthread -O2 -Wall -I/usr/local/include/htslib -I/root/bamm/BamM/c/libcfu-0.03/include  -c -o stats.o stats.c
gcc -std=gnu99 -g -fPIC -pthread -O2 -Wall -I/usr/local/include/htslib -I/root/bamm/BamM/c/libcfu-0.03/include -static-libgcc -shared -Wl,-rpath,/usr/local/include/htslib -o libBamM.a bamExtractor.c bamParser.c pairedLink.c bamRead.c coverageEstimators.c stats.c -lm -L/root/bamm/BamM/c/libcfu-0.03 -lcfu -L/usr/local/include/htslib -lhts
Building BamM library
linsalrob commented 9 years ago

In addition, here is the sysInfoBamM.py output:

$ python2.7  bamm/tests/sysInfoBamM.py 
Numpy version: 1.8.2
Location: /usr/lib/python2.7/dist-packages/numpy/__init__.pyc
Linux 3.13.0-48-generic
2.7.6 (default, Mar 22 2014, 22:59:56) 
[GCC 4.8.2]
['/root/bamm/BamM/bamm/tests', '/root/bamm/BamM', '/home/redwards/python', '/home/redwards/python/lib/python2.5/site-packages', '/home/redwards/bioinformatics/Modules', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/PILcompat', '/usr/lib/python2.7/dist-packages/gst-0.10', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.7', '/usr/lib/python2.7/dist-packages/ubuntu-sso-client', '/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode']
linsalrob commented 9 years ago

I took another stab at this. I downloaded samtools from https://github.com/samtools/samtools and htslib from https://github.com/samtools/htslib and remade them both. I then ran make install on htslib and got the following output:

# make install
mkdir -p -m 755 /usr/local/bin /usr/local/include /usr/local/include/htslib /usr/local/lib /usr/local/share/man/man1 /usr/local/share/man/man5 /usr/local/lib/pkgconfig
install -p -m 644 libhts.so /usr/local/lib/libhts.so.1.2.1-69-gb79f40a
ln -sf libhts.so.1.2.1-69-gb79f40a /usr/local/lib/libhts.so
ln -sf libhts.so.1.2.1-69-gb79f40a /usr/local/lib/libhts.so.1
sed -e 's#@includedir@#/usr/local/include#g;s#@libdir@#/usr/local/lib#g;s#@PACKAGE_VERSION@#1.2.1-69-gb79f40a#g' htslib.pc.in > /usr/local/lib/pkgconfig/htslib.pc
chmod 644 /usr/local/lib/pkgconfig/htslib.pc
install -p bgzip htsfile tabix /usr/local/bin
install -p -m 644 htslib/*.h /usr/local/include/htslib
install -p -m 644 libhts.a /usr/local/lib/libhts.a
install -p -m 644 htsfile.1 tabix.1 /usr/local/share/man/man1
install -p -m 644 faidx.5 sam.5 vcf.5 /usr/local/share/man/man5

That showed me the appropriate set up command that I need to run:

python setup.py install  --with-libhts-lib /usr/local/lib/libhts.a --with-libhts-inc /usr/local/include/htslib

Note that sometimes hts lib is libhts and sometimes it is htslib.

This only gave me a warning:

/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires'
  warnings.warn(msg)

because setup.py does not recognize install_requires, and so make sure that you have numpy >= 1.6.1 installed

Finally:

# cd bamm
# nosetests
.............................................
----------------------------------------------------------------------
Ran 45 tests in 7.643s

OK
minillinim commented 9 years ago

Thanks so much for your work on this Rob. Is there anything you can suggest I change with respect to the setup instructions?