Skip to content

Commit

Permalink
Trying to dynamically find DLLs for Windows PyInstaller
Browse files Browse the repository at this point in the history
  • Loading branch information
jmwright committed Oct 30, 2023
1 parent 4783d38 commit 92fb68e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/pyinstaller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ jobs:
- name: Run build
run: |
# Get-ChildItem -Path C:\ -Filter libcasadi.dll -Recurse
CPATH=$pythonLocation/include/python${{ matrix.python-version }}m
echo "CPATH=$CPATH" >> $GITHUB_ENV
pyinstaller pyinstaller.spec ${{ github.event.inputs.type }}
- uses: actions/upload-artifact@v2
with:
Expand Down
9 changes: 5 additions & 4 deletions pyinstaller.spec
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,11 @@ hidden_imports_numpy = collect_submodules('numpy')
hidden_imports = hidden_imports + hidden_imports_numpy

if sys.platform == 'win32':
dlls = [('libcasadi.dll', '.'),
('libcasadi_nlpsol_ipopt.dll', '.'),
('libgfortran-3.dll', '.'),
('libquadmath-0.dll', '.')]
print(os.path.join(os.environ['CPATH']))
dlls = [(os.path.join(os.environ['CPATH'], 'libcasadi.dll'), '.'),
(os.path.join(os.environ['CPATH'], 'libcasadi_nlpsol_ipopt.dll'), '.'),
(os.path.join(os.environ['CPATH'], 'libgfortran-3.dll'), '.'),
(os.path.join(os.environ['CPATH'], 'libquadmath-0.dll'), '.')]
else:
dlls = []

Expand Down

0 comments on commit 92fb68e

Please sign in to comment.