Skip to content

Commit

Permalink
fixed bin directory
Browse files Browse the repository at this point in the history
  • Loading branch information
joelb123 committed May 23, 2017
1 parent 25c6c1f commit f062919
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ def compile_fasttree_binary():
exe_dir = sys.prefix
else:
exe_dir = '.'
exe_path = str(Path(exe_dir).resolve()/'bin'/'FastTree-lorax')
bin_path = Path(exe_dir).resolve()/'bin'
if not bin_path.exists():
print('Creating binary directory %s:' %(str(bin_path)))
bin_path.mkdir(mode=0o755, parents=True)
exe_path = str(bin_path/'FastTree-lorax')
print('compiling double-precision FastTree binary to %s:' %(exe_path))
command = ['gcc',
'-DUSE_DOUBLE',
Expand All @@ -48,9 +52,13 @@ def compile_fasttree_binary():
stderr=subprocess.PIPE)
for line in pipe.stdout.readline():
print(line.decode('UTF-8'))
stderr = pipe.stderr.readline().decode('UTF-8')
if stderr != "":
print(stderr)
cmd_err = False
for line in pipe.stderr.readline():
errline = line.decode('UTF-8')
if errline != "":
cmd_err = True
print(stderr)
if cmd_err:
sys.exit(1)


Expand Down

0 comments on commit f062919

Please sign in to comment.