Skip to content

Commit 44ecd56

Browse files
committed
wip
1 parent eb3352f commit 44ecd56

File tree

7 files changed

+25
-136
lines changed

7 files changed

+25
-136
lines changed

.github/workflows/test-python-macos.yml

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -50,34 +50,10 @@ jobs:
5050
METIS_ROOT="${{ runner.workspace }}/installs"
5151
sed -i '' '/cmake\.args = \[/,/\]/{
5252
s|"-DPYTHON_BUILD_SETUP=ON"|"-DPYTHON_BUILD_SETUP=ON",\
53-
"-DHIPO=ON",\
54-
"-DMETIS_ROOT='"$METIS_ROOT"'"|
53+
"-DHIPO=ON"|
5554
}' pyproject.toml
5655
cat pyproject.toml
5756
58-
- name: Checkout METIS
59-
uses: actions/checkout@v4
60-
with:
61-
repository: galabovaa/METIS
62-
ref: 521-ts
63-
path: METIS
64-
65-
- name: Create installs dir
66-
working-directory: ${{runner.workspace}}
67-
run: |
68-
mkdir installs
69-
ls
70-
71-
- name: Install METIS
72-
run: |
73-
cmake \
74-
-S $GITHUB_WORKSPACE/METIS \
75-
-B build \
76-
-DGKLIB_PATH=${{ github.workspace }}/METIS/GKlib \
77-
-DCMAKE_INSTALL_PREFIX=${{ runner.workspace }}/installs
78-
cmake --build build --parallel
79-
cmake --install build
80-
8157
- name: Install build dependencies
8258
run: python3 -m pip install numpy wheel pytest
8359

.github/workflows/test-python-ubuntu.yml

Lines changed: 1 addition & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -46,53 +46,13 @@ jobs:
4646
- name: Edit pyproject
4747
run: |
4848
ls
49-
METIS_ROOT="${{ runner.workspace }}/installs"
5049
sed -i '/cmake\.args = \[/,/\]/{
5150
s|"-DPYTHON_BUILD_SETUP=ON"|"-DPYTHON_BUILD_SETUP=ON",\
5251
"-DHIPO=ON",\
53-
"-DMETIS_ROOT='"$METIS_ROOT"'"|
52+
"-DBUILD_OPENBLAS=ON"|
5453
}' pyproject.toml
5554
cat pyproject.toml
5655
57-
- name: Checkout METIS
58-
uses: actions/checkout@v4
59-
with:
60-
repository: galabovaa/METIS
61-
ref: 521-ts
62-
path: METIS
63-
64-
- name: Create installs dir
65-
working-directory: ${{runner.workspace}}
66-
run: |
67-
mkdir installs
68-
ls
69-
70-
- name: Install METIS
71-
run: |
72-
cmake \
73-
-S $GITHUB_WORKSPACE/METIS \
74-
-B build \
75-
-DGKLIB_PATH=${{ github.workspace }}/METIS/GKlib \
76-
-DCMAKE_INSTALL_PREFIX=${{ runner.workspace }}/installs
77-
cmake --build build --parallel
78-
cmake --install build
79-
80-
# no default blas available on runner
81-
82-
- name: Cache APT packages
83-
uses: actions/cache@v4
84-
with:
85-
path: |
86-
/var/cache/apt/archives
87-
/var/lib/apt/lists
88-
key: ${{ runner.os }}-apt-libopenblas
89-
90-
- name: Install OpenBLAS
91-
shell: bash
92-
run: |
93-
sudo apt update
94-
sudo apt install libopenblas-dev
95-
9656
- name: Install build dependencies
9757
run: python3 -m pip install numpy wheel pytest
9858

.github/workflows/test-python-win.yml

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,10 @@ jobs:
4848
- name: Edit pyproject
4949
run: |
5050
ls
51-
$VCPKG_ROOT = "C:/vcpkg/scripts/buildsystems/vcpkg.cmake"
52-
$METIS_ROOT = "${{ runner.workspace }}/installs" -replace '\\', '/'
53-
$TRIPLET = "x64-windows-static"
54-
$content = Get-Content pyproject.toml -Raw
55-
$newContent = $content -replace 'cmake\.args = \[\s*"-DPYTHON_BUILD_SETUP=ON"\s*\]', @"
5651
cmake.args = [
5752
"-DPYTHON_BUILD_SETUP=ON",
5853
"-DHIPO=ON",
59-
"-DCMAKE_TOOLCHAIN_FILE='$VCPKG_ROOT'",
60-
"-DVCPKG_TARGET_TRIPLET=$TRIPLET",
61-
"-DMETIS_ROOT='$METIS_ROOT'"
54+
"-DBUILD_OPENBLAS=ON"
6255
]
6356
"@
6457
$newContent | Set-Content pyproject.toml
@@ -67,35 +60,6 @@ jobs:
6760
- name: Install build dependencies
6861
run: python -m pip install numpy wheel pytest
6962

70-
- name: Checkout METIS
71-
uses: actions/checkout@v4
72-
with:
73-
repository: galabovaa/METIS
74-
ref: 521-ts
75-
path: METIS
76-
77-
- name: Create installs dir
78-
working-directory: ${{runner.workspace}}
79-
run: |
80-
ls
81-
mkdir installs
82-
ls
83-
84-
- name: Install METIS
85-
shell: pwsh
86-
run: |
87-
cd METIS
88-
pwd
89-
cmake -S. -B build `
90-
-DGKLIB_PATH="$env:GITHUB_WORKSPACE/METIS/GKlib" `
91-
-DCMAKE_INSTALL_PREFIX="${{ runner.workspace }}/installs"
92-
cmake --build build --parallel --config Release
93-
cmake --install build --config Release
94-
95-
- name: Install OpenBLAS
96-
shell: pwsh
97-
run: vcpkg install openblas[threads]:x64-windows-static
98-
9963
- name: Test python install
10064
run: |
10165
python -m pip install .

cmake/python-highs.cmake

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@ if(HIPO)
2020
set(sources_python ${sources_python}
2121
${hipo_sources_python}
2222
${factor_highs_sources_python}
23-
${hipo_util_sources_python})
23+
${hipo_util_sources_python}
24+
${hipo_orderings_sources})
2425

2526
set(headers_python ${headers_python}
2627
${hipo_headers_python}
2728
${factor_highs_headers_python}
28-
${hipo_util_headers_python})
29+
${hipo_util_headers_python}
30+
${hipo_orderings_headers})
2931

3032
endif()
3133

@@ -56,31 +58,11 @@ python_add_library(_core MODULE highs/highs_bindings.cpp WITH_SOABI)
5658
target_link_libraries(_core PRIVATE pybind11::headers)
5759

5860
if (HIPO)
59-
if (WIN32)
60-
target_link_libraries(_core PRIVATE OpenBLAS::OpenBLAS)
61+
if (WIN32 OR LINUX)
62+
target_link_libraries(_core PRIVATE openblas)
6163
target_compile_definitions(_core PRIVATE HIPO_USES_OPENBLAS)
62-
else()
63-
# if (NOT METIS_ROOT STREQUAL "")
64-
# target_include_directories(_core PRIVATE ${METIS_DST_DIR}/include)
65-
# target_link_libraries(_core PRIVATE ${METIS_DST_DIR}/lib/metis.lib)
66-
# else()
67-
68-
target_link_libraries(_core PRIVATE BLAS::BLAS)
69-
70-
string(TOLOWER "${BLAS_LIBRARIES}" blas_lower)
71-
if(blas_lower MATCHES "openblas")
72-
target_compile_definitions(_core PRIVATE HIPO_USES_OPENBLAS)
73-
elseif(blas_lower MATCHES "accelerate")
74-
target_compile_definitions(_core PRIVATE HIPO_USES_APPLE_BLAS)
75-
endif()
76-
77-
endif()
78-
79-
if(metis_FOUND)
80-
target_link_libraries(_core PRIVATE metis)
81-
else()
82-
target_include_directories(_core PRIVATE "${METIS_PATH}")
83-
target_link_libraries(_core PRIVATE "${METIS_LIB}")
64+
else() # APPLE
65+
target_compile_definitions(_core PRIVATE HIPO_USES_APPLE_BLAS)
8466
endif()
8567

8668
endif()

cmake/sources-python.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
set(include_dirs_python
22
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/extern>
3+
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/extern/amd>
34
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/extern/filereader>
5+
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/extern/metis>
46
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/extern/pdqsort>
7+
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/extern/rcm>
58
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/extern/zstr>
69
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/highs>
710
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/highs/interfaces>

cmake/sources.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
set(include_dirs
22
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/extern>
3+
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/extern/amd>
34
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/extern/filereader>
5+
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/extern/metis>
46
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/extern/pdqsort>
7+
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/extern/rcm>
58
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/extern/zstr>
69
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/highs>
710
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/highs/interfaces>

pyproject.toml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ build-backend = "scikit_build_core.build"
88

99
[project]
1010
name = "highspy"
11-
version = "1.12.0.dev2"
11+
version = "1.12.0.dev3"
1212
description = "A thin set of pybind11 wrappers to HiGHS"
1313
authors = [{ name = "HiGHS developers", email = "[email protected]" }]
1414
readme = "README.md"
@@ -34,14 +34,15 @@ test = ["pytest", "numpy"]
3434

3535
[tool.scikit-build]
3636
cmake.args = [
37-
"-DPYTHON_BUILD_SETUP=ON"
37+
"-DPYTHON_BUILD_SETUP=ON",
38+
"-DHIPO=ON",
39+
"-DBUILD_OPENBLAS=ON"
3840
]
3941

40-
# To build locally, on windows, specify
41-
# "-DHIPO=ON",
42-
# "-DCMAKE_TOOLCHAIN_FILE='C:/Users/galab/code/repos/vcpkg/scripts/buildsystems/vcpkg.cmake'",
43-
# "-DVCPKG_TARGET_TRIPLET='x64-windows-static'",
44-
# "-DMETIS_ROOT='C:/Users/galab/installs/metis-521-ts'"
42+
# To build locally, specify
43+
# "-DHIPO=ON"
44+
# On Windows and macOS also
45+
# "-DBUILD_OPENBLAS=ON"
4546

4647
wheel.expand-macos-universal-tags = true
4748

0 commit comments

Comments
 (0)