Digenome-seq compilation issues
1
0
Entering edit mode
2.2 years ago

I’m trying to compile from the Digenome-seq code from this code repository on an Amazon Linux instance on AWS as described:

digenome-toolkit]$ cat /etc/os-release 
NAME="Amazon Linux"
VERSION="2"
ID="amzn"
ID_LIKE="centos rhel fedora"
VERSION_ID="2"
PRETTY_NAME="Amazon Linux 2"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2"
HOME_URL="https://amazonlinux.com/"

I have installed all the requirements listed - cmake, g++, and git. When I try to run the build_find_position_bam.sh command as instructed in the README I get the following error.

 digenome-toolkit]$ ./build_find_position_bam.sh 
CMake Error: The current CMakeCache.txt directory /home/ec2-user/digenome-toolkit/bamtools_build/CMakeCache.txt is different than the directory /home/ec2-user/digenome-toolkit2-master/bamtools_build where CMakeCache.txt was created. This may result in binaries being created in the wrong place. If you are not sure, reedit the CMakeCache.txt
CMake Error: The source "/home/ec2-user/digenome-toolkit/bamtools/CMakeLists.txt" does not match the source "/home/ec2-user/digenome-toolkit2-master/bamtools/CMakeLists.txt" used to generate cache.  Re-run cmake with a different source directory.
make: *** No targets specified and no makefile found.  Stop.
1.find_position_bam.cpp:7:10: fatal error: api/BamReader.h: No such file or directory
 #include "api/BamReader.h"
          ^~~~~~~~~~~~~~~~~
compilation terminated.

Since it is having some trouble linking to the bamtools directory, I tried adding the path for the header files to the last line of build_find_position_bam.sh but this still fails with this error:

digenome-toolkit]$ g++ -O3 1.find_position_bam.cpp -o 1.find_position_bam -Ibamtools/src -Ibamtools/include -Lbamtools/lib -lbamtools -lz
In file included from bamtools/src/api/BamAux.h:19:0,
                 from bamtools/src/api/BamAlignment.h:18,
                 from bamtools/src/api/BamReader.h:14,
                 from 1.find_position_bam.cpp:7:
bamtools/src/api/api_global.h:13:10: fatal error: api/bamtools_api_export.h: No such file or directory
 #include "api/bamtools_api_export.h"
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

Is there something I should be doing differently? Any help is appreciated. Thank you!

CRISPR Digenome off-target • 1.1k views
ADD COMMENT
0
Entering edit mode
2.2 years ago

I ended up solving my own problem by switching to Ubuntu Linux and using an older version of Bamtools. I'm not certain that the older Bamtools is absolutely necessary but the issue with api/bamtools_api_export.h was linked in a post to some breaking change in v.2.5.2. But switching to Ubuntu Linux made the Zlib library findable / linkable which was breaking the install on Amazon Linux (based on CentOS). Here's the code that gets this going on a new Ubuntu 20.04 Linux instance on AWS:

Install dependencies

sudo apt get update
sudo apt install g++ cmake python-pysam pypy libz-dev

Download and install Digenome, Bamtools version 2.4.1 from 2016, and Zlib

git clone https://github.com/chizksh/digenome-toolkit2.git
cd digenome-toolkit2/
wget https://github.com/pezmaster31/bamtools/archive/refs/tags/v2.4.1.tar.gz
tar xf v2.4.1.tar.gz 
mv bamtools-2.4.1/ bamtools
chmod +x install.sh 
./install.sh

Restart shell or source ~/.profile for new environment variables to be set!

Install python 2, change digenome-run shebang to find python2, and test run

sudo apt install python2-minimal
sed -i 's/python/python2/g' digenome-run 
chmod +x ~/digenome-toolkit/digenome-run
~/digenome-toolkit/digenome-run
ADD COMMENT
0
Entering edit mode

you can also accept your own answer to close this thread

ADD REPLY

Login before adding your answer.

Traffic: 1971 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6