Skip to content

Commit

Permalink
Revert "Add search path to occt libraries"
Browse files Browse the repository at this point in the history
This reverts commit 7ac609c.
  • Loading branch information
mhochsteger committed Jun 12, 2024
1 parent 7ac609c commit c488fa9
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions python/__init__.py
Original file line number Diff line number Diff line change
@@ -1,31 +1,10 @@
import os
import sys
import importlib.metadata
from pathlib import Path

from . import config
_netgen_bin_dir=os.path.realpath(os.path.join(os.path.dirname(__file__),'..',config.NETGEN_PYTHON_RPATH_BIN))
_netgen_lib_dir=os.path.realpath(os.path.join(os.path.dirname(__file__),'..',config.NETGEN_PYTHON_RPATH))

def _add_shared_lib_path(p: Path):
print("Adding shared search path", f.locate().parent)
if sys.platform.startswith('win'):
os.add_dll_directory(p)
elif 'linux' in sys.platform:
if str(p) not in os.environ['LD_LIBRARY_PATH']:
os.environ['LD_LIBRARY_PATH'] = str(p) + ':' + os.environ['LD_LIBRARY_PATH']
elif 'darwin' in sys.platform:
if str(p) not in os.environ['DYLD_LIBRARY_PATH']:
os.environ['DYLD_LIBRARY_PATH'] = str(p) + ':' + os.environ['DYLD_LIBRARY_PATH']
try:
importlib.metadata.metadata('netgen-occt')
for f in importlib.metadata.files('netgen-occt'):
if f.match('*libTKernel*'):
print("Adding shared search path", f.locate().parent)
_add_shared_lib_path(f.locate().parent)
except importlib.metadata.PackageNotFoundError:
pass

__diagnostics_template = """
Netgen diagnostics:
sys.platform: {sys.platform}
Expand Down

0 comments on commit c488fa9

Please sign in to comment.