Skip to content

Commit

Permalink
Merge pull request #200 from broadinstitute/ct-various-fixes
Browse files Browse the repository at this point in the history
cmake -> make in diamond, existence checks in diamond and kraken wrappers
  • Loading branch information
tomkinsc committed Jan 20, 2016
2 parents c997abd + 3fcf941 commit 890227d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
11 changes: 6 additions & 5 deletions tools/diamond.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Diamond(tools.Tool):

def __init__(self, install_methods=None):
if not install_methods:
install_methods = [DownloadAndBuildDiamond(URL, os.path.join(DIAMOND_DIR, 'build', 'diamond'))]
install_methods = [DownloadAndBuildDiamond(URL, os.path.join(DIAMOND_DIR, 'bin', 'diamond'))]
super().__init__(install_methods=install_methods)

def version(self):
Expand Down Expand Up @@ -105,14 +105,15 @@ def post_download(self):
diamond_dir = os.path.join(self.destination_dir, DIAMOND_DIR)
# We should rather have a way to rename self.download_file in
# DownloadPackage generically.
shutil.move(os.path.join(self.destination_dir, DIAMOND_COMMIT_DIR), diamond_dir)
build_dir = os.path.join(diamond_dir, 'build')
util.file.mkdir_p(build_dir)
if not os.path.exists(diamond_dir):
shutil.move(os.path.join(self.destination_dir, DIAMOND_COMMIT_DIR), diamond_dir)
build_dir = os.path.join(diamond_dir, 'src')
#util.file.mkdir_p(build_dir)
env = os.environ.copy()
# The default travis gcc version is 4.6, which is too old to build
# diamond properly.
if os.environ.get('TRAVIS') == 'true':
env['CC'] = 'gcc-4.9'
env['CXX'] = 'g++-4.9'
util.misc.run_and_print(['cmake', '..'], env=env, cwd=build_dir)
#util.misc.run_and_print(['cmake', '..'], env=env, cwd=build_dir)
util.misc.run_and_print(['make'], env=env, cwd=build_dir)
6 changes: 4 additions & 2 deletions tools/kraken.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ def post_download(self):
env['PATH'] = '{}:{}'.format(os.path.dirname(yaggo_path), env['PATH'])
jellyfish_dir = os.path.join(self.destination_dir, JELLYFISH_DIR)

shutil.move(os.path.join(self.destination_dir, JELLYFISH_COMMIT_DIR), jellyfish_dir)
if not os.path.exists(jellyfish_dir):
shutil.move(os.path.join(self.destination_dir, JELLYFISH_COMMIT_DIR), jellyfish_dir)

install_dir = os.path.join(jellyfish_dir, 'local')
util.file.replace_in_file(
Expand Down Expand Up @@ -159,7 +160,8 @@ def post_download(self):
env['PATH'] = '{}:{}'.format(os.path.dirname(jellyfish_path), env['PATH'])
kraken_dir = os.path.join(self.destination_dir, KRAKEN_DIR)

shutil.move(os.path.join(self.destination_dir, KRAKEN_COMMIT_DIR), kraken_dir)
if not os.path.exists(kraken_dir):
shutil.move(os.path.join(self.destination_dir, KRAKEN_COMMIT_DIR), kraken_dir)
libexec_dir = os.path.join(kraken_dir, 'libexec')
bin_dir = os.path.join(kraken_dir, 'bin')
util.misc.run_and_print(['./install_kraken.sh', 'libexec'], cwd=kraken_dir, env=env)
Expand Down

0 comments on commit 890227d

Please sign in to comment.