Skip to content

Commit a6f5bc3

Browse files
committed
finalize windows build
1 parent 1e33a65 commit a6f5bc3

File tree

2 files changed

+28
-12
lines changed

2 files changed

+28
-12
lines changed

.github/workflows/wheels.yml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,26 +66,23 @@ jobs:
6666
with:
6767
output-dir: wheelhouse
6868

69-
- name: Set up conda for Windows
70-
if: runner.os == 'Windows'
71-
uses: conda-incubator/setup-miniconda@v3
72-
with:
73-
activate-environment: gsl
74-
auto-update-conda: true
75-
environment-file: environment.yml
76-
auto-activate-base: false
77-
78-
- name: install gsl for Windows
69+
- name: Install GSL and Set Environment for GSL on Windows
7970
if: runner.os == 'Windows'
71+
shell: pwsh
8072
run: |
81-
conda config --set always_yes yes --set changeps1 no
82-
conda install gsl
73+
git clone https://github.com/microsoft/vcpkg.git C:\vcpkg
74+
cd C:\vcpkg
75+
.\bootstrap-vcpkg.bat
76+
.\vcpkg integrate install
77+
.\vcpkg install gsl gsl:x64-windows
8378
8479
- name: Build wheels for Windows
8580
if: runner.os == 'Windows'
8681
uses: pypa/[email protected]
8782
env:
8883
CIBW_BUILD: ${{ matrix.python[1] }}-${{ matrix.buildplat[1] }}
84+
CIBW_ENVIRONMENT: |
85+
GSL_PATH=C:/vcpkg/installed/x64-windows
8986
CONDA_PREFIX: ${{ env.CONDA_PREFIX }}
9087
with:
9188
output-dir: wheelhouse

setup.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,25 @@ def get_gsl_config_win():
7676
return rv
7777

7878

79+
def get_gsl_config_win():
80+
"""Return dictionary with paths to GSL library on Windows."""
81+
gsl_path = os.environ.get("GSL_PATH")
82+
if gsl_path:
83+
inc = os.path.join(gsl_path, "include")
84+
lib = os.path.join(gsl_path, "lib")
85+
else:
86+
conda_prefix = os.environ.get("CONDA_PREFIX")
87+
if conda_prefix:
88+
inc = os.path.join(conda_prefix, "Library", "include")
89+
lib = os.path.join(conda_prefix, "Library", "lib")
90+
else:
91+
raise EnvironmentError(
92+
"Neither GSL_PATH nor CONDA_PREFIX environment variables are set. "
93+
"Please ensure GSL is installed and GSL_PATH is correctly set."
94+
)
95+
96+
return {"include_dirs": [inc], "library_dirs": [lib]}
97+
7998
# ----------------------------------------------------------------------------
8099

81100
# compile and link options

0 commit comments

Comments
 (0)