Skip to content

Commit

Permalink
build: add support for building against conda TileDB and HTSLIB
Browse files Browse the repository at this point in the history
For #47
  • Loading branch information
ihnorton committed Feb 10, 2020
1 parent 216e90d commit 8e13d44
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion apis/python/conda-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ dependencies:
- pip:
- setuptools==39.0.1
- pytest-runner==5.1
- pytest==5.1.2
- pytest==5.1.2
19 changes: 19 additions & 0 deletions apis/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,21 @@ def find_libtiledbvcf():
return None


def get_cmake_env_config():
conf = list()

key = "TILEDBVCF_CMAKE_PREFIX_PATH"
val = os.environ.get(key, None)
if val:
conf.append("-DCMAKE_PREFIX_PATH={}".format(val))

key = "TILEDBVCF_FORCE_EXTERNAL_HTSLIB"
val = os.environ.get(key, None)
if val:
conf.append("-DTILEDBVCF_FORCE_EXTERNAL_HTSLIB={}".format(val))

return conf

def build_libtiledbvcf():
p = PathConfig()

Expand All @@ -98,6 +113,10 @@ def build_libtiledbvcf():
'-DFORCE_EXTERNAL_HTSLIB=ON',
'-DCMAKE_BUILD_TYPE=Release',
src_dir]

env_conf = get_cmake_env_config()
cmake_cmd.extend(env_conf)

build_cmd = ['make', '-j{}'.format(multiprocessing.cpu_count() or 2)]
install_cmd = ['make', 'install-libtiledbvcf']

Expand Down

0 comments on commit 8e13d44

Please sign in to comment.