Skip to content

Commit 5ef10ab

Browse files
committed
some link errors
1 parent 24e16e6 commit 5ef10ab

File tree

7 files changed

+131
-128
lines changed

7 files changed

+131
-128
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ if (HIPO AND FORTRAN)
155155
message(ERROR "HIPO is only available in C++. Not yet supported in FORTRAN")
156156
endif()
157157
if (HIPO AND PYTHON_BUILD_SETUP)
158-
message(ERROR "HIPO is only available in C++. Not yet supported in Python.")
158+
message(STATUS "HIPO in Python: ON.")
159159
endif()
160160
if (HIPO AND NOT FAST_BUILD)
161161
message(ERROR "HIPO is only available with FAST_BUILD=ON.")

HiGHS.sln

Lines changed: 0 additions & 24 deletions
This file was deleted.

cmake/FindHipoDeps.cmake

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,19 @@ endif()
145145
set(METIS_ROOT "" CACHE STRING "Root directory of METIS")
146146
message(STATUS "METIS_ROOT is " ${METIS_ROOT})
147147

148+
if (PYTHON_BUILD_SETUP)
149+
150+
set(METIS_SRC_DIR ${METIS_ROOT})
151+
set(METIS_DST_DIR ${CMAKE_BINARY_DIR}/metis)
152+
153+
file(COPY ${METIS_SRC_DIR}/include DESTINATION ${METIS_DST_DIR})
154+
file(COPY ${METIS_SRC_DIR}/lib DESTINATION ${METIS_DST_DIR})
155+
156+
return()
157+
158+
endif()
159+
160+
148161
# If a METIS install was specified try to use it first.
149162
if (NOT (METIS_ROOT STREQUAL ""))
150163
message(STATUS "Looking for METIS CMake targets file in " ${METIS_ROOT})

cmake/python-highs.cmake

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,29 @@ endif()
66

77
include(sources-python)
88

9-
set(sources_python ${highs_sources_python}
10-
${cupdlp_sources_python}
11-
${ipx_sources_python}
9+
set(sources_python ${highs_sources_python}
10+
${cupdlp_sources_python}
11+
${ipx_sources_python}
1212
${basiclu_sources_python})
1313

14-
set(headers_python ${highs_headers_python}
15-
${cupdlp_headers_python}
16-
${ipx_headers_python}
14+
set(headers_python ${highs_headers_python}
15+
${cupdlp_headers_python}
16+
${ipx_headers_python}
1717
${basiclu_headers_python})
1818

19+
if(HIPO)
20+
set(sources_python ${sources}
21+
${hipo_sources_python}
22+
${factor_highs_sources_python}
23+
${hipo_util_sources_python})
24+
25+
set(headers_python ${headers}
26+
${hipo_headers_python}
27+
${factor_highs_headers_python}
28+
${hipo_util_headers_python})
29+
30+
endif()
31+
1932
# Find Python 3
2033
find_package(Python COMPONENTS Interpreter Development.Module REQUIRED)
2134
find_package(pybind11 CONFIG)
@@ -42,10 +55,16 @@ python_add_library(_core MODULE highs/highs_bindings.cpp WITH_SOABI)
4255

4356
target_link_libraries(_core PRIVATE pybind11::headers)
4457

45-
# sources for python
58+
if (HIPO)
59+
target_include_directories(_core PRIVATE ${METIS_DST_DIR}/include)
60+
target_link_libraries(_core PRIVATE OpenBLAS::OpenBLAS)
61+
target_link_libraries(_core PRIVATE ${METIS_DST_DIR}/lib/metis.lib)
62+
endif()
63+
64+
# sources for python
4665
target_sources(_core PUBLIC ${sources_python} ${headers_python})
4766

48-
# include directories for python
67+
# include directories for python
4968
target_include_directories(_core PUBLIC ${include_dirs_python})
5069

5170
# This is passing in the version as a define just as an example
@@ -55,12 +74,12 @@ if(MSVC)
5574
target_compile_options(_core PRIVATE "/bigobj")
5675
endif()
5776

58-
if (NOT MSVC)
77+
if (NOT MSVC)
5978
target_compile_options(_core PRIVATE "-ftemplate-depth=2048")
6079
endif()
6180

6281
# if(MSVC)
63-
# # Try to split large pdb files into objects.
82+
# # Try to split large pdb files into objects.
6483
# # https://github.com/tensorflow/tensorflow/issues/31610
6584
# add_compile_options("/Z7")
6685
# add_link_options("/DEBUG:FASTLINK")

cmake/sources-python.cmake

Lines changed: 80 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ set(ipx_sources_python
134134
highs/ipm/ipx/symbolic_invert.cc
135135
highs/ipm/ipx/timer.cc
136136
highs/ipm/ipx/utils.cc)
137-
137+
138138
set(ipx_headers_python
139139
highs/ipm/ipx/basiclu_kernel.h
140140
highs/ipm/ipx/basiclu_wrapper.h
@@ -175,6 +175,85 @@ set(ipx_sources_python
175175
highs/ipm/ipx/timer.h
176176
highs/ipm/ipx/utils.h)
177177

178+
set(hipo_sources_python
179+
highs/ipm/hipo/ipm/CurtisReidScaling.cpp
180+
highs/ipm/hipo/ipm/IpmData.cpp
181+
highs/ipm/hipo/ipm/FactorHiGHSSolver.cpp
182+
highs/ipm/hipo/ipm/Control.cpp
183+
highs/ipm/hipo/ipm/Iterate.cpp
184+
highs/ipm/hipo/ipm/LogHighs.cpp
185+
highs/ipm/hipo/ipm/Model.cpp
186+
highs/ipm/hipo/ipm/Solver.cpp)
187+
188+
set(hipo_headers_python
189+
highs/ipm/hipo/ipm/CurtisReidScaling.h
190+
highs/ipm/hipo/ipm/IpmData.h
191+
highs/ipm/hipo/ipm/FactorHiGHSSolver.h
192+
highs/ipm/hipo/ipm/Parameters.h
193+
highs/ipm/hipo/ipm/Control.h
194+
highs/ipm/hipo/ipm/Info.h
195+
highs/ipm/hipo/ipm/Iterate.h
196+
highs/ipm/hipo/ipm/LinearSolver.h
197+
highs/ipm/hipo/ipm/LogHighs.h
198+
highs/ipm/hipo/ipm/Model.h
199+
highs/ipm/hipo/ipm/Options.h
200+
highs/ipm/hipo/ipm/Solver.h
201+
highs/ipm/hipo/ipm/Status.h)
202+
203+
set(factor_highs_sources_python
204+
highs/ipm/hipo/factorhighs/Analyse.cpp
205+
highs/ipm/hipo/factorhighs/CallAndTimeBlas.cpp
206+
highs/ipm/hipo/factorhighs/DataCollector.cpp
207+
highs/ipm/hipo/factorhighs/DenseFactHybrid.cpp
208+
highs/ipm/hipo/factorhighs/DenseFactKernel.cpp
209+
highs/ipm/hipo/factorhighs/DgemmParallel.cpp
210+
highs/ipm/hipo/factorhighs/FactorHiGHS.cpp
211+
highs/ipm/hipo/factorhighs/Factorise.cpp
212+
highs/ipm/hipo/factorhighs/FormatHandler.cpp
213+
highs/ipm/hipo/factorhighs/HybridHybridFormatHandler.cpp
214+
highs/ipm/hipo/factorhighs/HybridSolveHandler.cpp
215+
highs/ipm/hipo/factorhighs/KrylovMethodsIpm.cpp
216+
highs/ipm/hipo/factorhighs/Numeric.cpp
217+
highs/ipm/hipo/factorhighs/SolveHandler.cpp
218+
highs/ipm/hipo/factorhighs/Swaps.cpp
219+
highs/ipm/hipo/factorhighs/SymScaling.cpp
220+
highs/ipm/hipo/factorhighs/Symbolic.cpp)
221+
222+
set(factor_highs_headers_python
223+
highs/ipm/hipo/factorhighs/Analyse.h
224+
highs/ipm/hipo/factorhighs/CallAndTimeBlas.h
225+
highs/ipm/hipo/factorhighs/DataCollector.h
226+
highs/ipm/hipo/factorhighs/DenseFact.h
227+
highs/ipm/hipo/factorhighs/DgemmParallel.h
228+
highs/ipm/hipo/factorhighs/FactorHiGHS.h
229+
highs/ipm/hipo/factorhighs/FactorHiGHSSettings.h
230+
highs/ipm/hipo/factorhighs/Factorise.h
231+
highs/ipm/hipo/factorhighs/FormatHandler.h
232+
highs/ipm/hipo/factorhighs/HybridHybridFormatHandler.h
233+
highs/ipm/hipo/factorhighs/HybridSolveHandler.h
234+
highs/ipm/hipo/factorhighs/KrylovMethodsIpm.h
235+
highs/ipm/hipo/factorhighs/Numeric.h
236+
highs/ipm/hipo/factorhighs/ReturnValues.h
237+
highs/ipm/hipo/factorhighs/SolveHandler.h
238+
highs/ipm/hipo/factorhighs/Swaps.h
239+
highs/ipm/hipo/factorhighs/SymScaling.h
240+
highs/ipm/hipo/factorhighs/Symbolic.h
241+
highs/ipm/hipo/factorhighs/Timing.h)
242+
243+
set(hipo_util_sources_python
244+
highs/ipm/hipo/auxiliary/Auxiliary.cpp
245+
highs/ipm/hipo/auxiliary/KrylovMethods.cpp
246+
highs/ipm/hipo/auxiliary/Log.cpp
247+
highs/ipm/hipo/auxiliary/VectorOperations.cpp)
248+
249+
set(hipo_util_headers_python
250+
highs/ipm/hipo/auxiliary/Auxiliary.h
251+
highs/ipm/hipo/auxiliary/IntConfig.h
252+
highs/ipm/hipo/auxiliary/KrylovMethods.h
253+
highs/ipm/hipo/auxiliary/Log.h
254+
highs/ipm/hipo/auxiliary/mycblas.h
255+
highs/ipm/hipo/auxiliary/VectorOperations.h)
256+
178257
set(highs_sources_python
179258
extern/filereaderlp/reader.cpp
180259
highs/interfaces/highs_c_api.cpp

highs/highspy/__init__.pyi

Lines changed: 0 additions & 91 deletions
This file was deleted.

pyproject.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,14 @@ classifiers = [
3333
test = ["pytest", "numpy"]
3434

3535
[tool.scikit-build]
36-
cmake.args = ["-DPYTHON_BUILD_SETUP=ON"]
36+
cmake.args = [
37+
"-DPYTHON_BUILD_SETUP=ON",
38+
"-DHIPO=ON",
39+
"-DCMAKE_TOOLCHAIN_FILE='C:/Users/galab/code/repos/vcpkg/scripts/buildsystems/vcpkg.cmake'",
40+
"-DVCPKG_TARGET_TRIPLET='x64-windows-static'",
41+
"-DMETIS_ROOT='C:/Users/galab/installs/metis-521-ts'"
42+
]
43+
3744
wheel.expand-macos-universal-tags = true
3845

3946
# A list of packages to auto-copy into the wheel. If this is not set, it will

0 commit comments

Comments
 (0)