Skip to content

Commit

Permalink
Fix conda_env embree checks
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewturk committed Jul 28, 2020
1 parent 9138a0a commit 63a031e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions setupext.py
Expand Up @@ -143,17 +143,13 @@ def check_for_pyembree(std_libs):
embree_libs = []
embree_aliases = {}
try:
fn = resource_filename("pyembree", "rtcore.pxd")
_ = resource_filename("pyembree", "rtcore.pxd")
except ImportError:
return embree_libs, embree_aliases

embree_prefix = os.path.abspath(read_embree_location())
embree_inc_dir = os.path.join(embree_prefix, "include")
embree_lib_dir = os.path.join(embree_prefix, "lib")
if in_conda_env():
conda_basedir = os.path.dirname(os.path.dirname(sys.executable))
embree_inc_dir.append(os.path.join(conda_basedir, "include"))
embree_lib_dir.append(os.path.join(conda_basedir, "lib"))

if _platform == "darwin":
embree_lib_name = "embree.2"
Expand All @@ -164,6 +160,12 @@ def check_for_pyembree(std_libs):
embree_aliases["EMBREE_LIB_DIR"] = [embree_lib_dir]
embree_aliases["EMBREE_LIBS"] = std_libs + [embree_lib_name]
embree_libs += ["yt/utilities/lib/embree_mesh/*.pyx"]

if in_conda_env():
conda_basedir = os.path.dirname(os.path.dirname(sys.executable))
embree_aliases["EMBREE_INC_DIR"].append(os.path.join(conda_basedir, "include"))
embree_aliases["EMBREE_LIB_DIR"].append(os.path.join(conda_basedir, "lib"))

return embree_libs, embree_aliases


Expand Down

0 comments on commit 63a031e

Please sign in to comment.