Skip to content

move the shared dynamic libs to lib #70

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 22 additions & 20 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,15 @@ __pycache__/
*.py[cod]
*$py.class

# Mac specific files
.DS_Store

# Notepad++ backup file
.bak

# C extensions
*.so

# Distribution / packaging
.Python
./build/
.vscode
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
Expand All @@ -33,6 +22,21 @@ wheels/
*.egg
MANIFEST

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Exclude femzip shared libraries
!**/lib/**/*.dll
!**/lib/**/*.so

# Unit test / coverage reports
htmlcov/
.tox/
Expand Down Expand Up @@ -61,16 +65,14 @@ venv.bak/
# mkdocs documentation
/site

# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Mac specific files
.DS_Store

# Compiled Dynamic libraries
#*.so
*.dylib
*.dll
# Notepad++ backup file
.bak

# Vscode configurations
.vscode

# Ignore generated changelog
CHANGELOG.md
Expand Down
67 changes: 32 additions & 35 deletions lasso/femzip/femzip_api.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import logging
import os
from pathlib import Path
import re
import stat
import sys
Expand Down Expand Up @@ -245,49 +246,45 @@ def api(self) -> CDLL:

if self._api is None:

bin_dirpath = (
os.path.abspath(os.path.dirname(sys.executable))
if hasattr(sys, "frozen")
else os.path.dirname(os.path.abspath(__file__))
)
# Set the base path once
base_path = Path(__file__).parent

# Flexlm Settings
# prevent flexlm gui to pop up
# Set environment variables for FlexLM
os.environ["FLEXLM_BATCH"] = "1"
# set a low timeout from originally 10 seconds
if "FLEXLM_TIMEOUT" not in os.environ:
os.environ["FLEXLM_TIMEOUT"] = "200000"

# windows
if "win32" in sys.platform:

# Platform-specific configurations
if sys.platform == "win32":
bin_dirpath = base_path / "lib" / "windows"
shared_lib_name = "api_extended.dll"
self.load_dynamic_library(os.path.join(bin_dirpath, "libmmd.dll"))
self.load_dynamic_library(os.path.join(bin_dirpath, "libifcoremd.dll"))
self.load_dynamic_library(os.path.join(bin_dirpath, "libifportmd.dll"))
self.load_dynamic_library(os.path.join(bin_dirpath, "libiomp5md.dll"))
self.load_dynamic_library(
os.path.join(bin_dirpath, "femzip_a_dyna_sidact_generic.dll")
)
self.load_dynamic_library(
os.path.join(bin_dirpath, "libfemzip_post_licgenerator_ext_flexlm.dll")
)
# linux hopefully
libs = [
"libmmd.dll",
"libifcoremd.dll",
"libifportmd.dll",
"libiomp5md.dll",
"femzip_a_dyna_sidact_generic.dll",
"libfemzip_post_licgenerator_ext_flexlm.dll",
]
else:
bin_dirpath = base_path / "lib" / "linux"
shared_lib_name = "api_extended.so"
self.load_dynamic_library(os.path.join(bin_dirpath, "libiomp5.so"))
self.load_dynamic_library(os.path.join(bin_dirpath, "libintlc.so.5"))
self.load_dynamic_library(os.path.join(bin_dirpath, "libirng.so"))
self.load_dynamic_library(os.path.join(bin_dirpath, "libimf.so"))
self.load_dynamic_library(os.path.join(bin_dirpath, "libsvml.so"))
self.load_dynamic_library(
os.path.join(bin_dirpath, "libfemzip_a_dyna_sidact_generic.so")
)
self.load_dynamic_library(
os.path.join(bin_dirpath, "libfemzip_post_licgenerator_ext_flexlm.so")
)

filepath = os.path.join(bin_dirpath, shared_lib_name)
libs = [
"libiomp5.so",
"libintlc.so.5",
"libirng.so",
"libimf.so",
"libsvml.so",
"libfemzip_a_dyna_sidact_generic.so",
"libfemzip_post_licgenerator_ext_flexlm.so",
]

# Load all the dynamic libraries
for lib in libs:
self.load_dynamic_library(bin_dirpath / lib)

# Load the main shared library
filepath = bin_dirpath / shared_lib_name
self._api = self.load_dynamic_library(filepath)

# license check
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.