|
5 | 5 | HiGHS uses CMake as build system, and requires at least version |
6 | 6 | 3.15. Details about building from source using CMake can be found in `HiGHS/cmake/README.md`. |
7 | 7 |
|
| 8 | +## HiGHS with HiPO |
| 9 | + |
| 10 | +HiGHS does not have any external dependencies, however, the new interior point solver HiPO uses BLAS and Metis. At the moment HiPO is optional and can be enabled via CMake. To build HiPO, you need to have Metis and BLAS installed on your machine. Please follow the instructions below. |
| 11 | + |
| 12 | +#### BLAS |
| 13 | + |
| 14 | +On Linux, libblas and libopenblas are supported. We recomment libopenblas for its better performance. Install with |
| 15 | + |
| 16 | +``` |
| 17 | +sudo apt update |
| 18 | +sudo apt install libopenblas-dev |
| 19 | +``` |
| 20 | + |
| 21 | +On MacOS no BLAS installation is required because HiPO uses [Apple Accelerate](https://developer.apple.com/accelerate/). |
| 22 | + |
| 23 | +On Windows, OpenBLAS is required. It could be installed via [vcpkg](https://learn.microsoft.com/en-us/vcpkg/get_started/overview) with |
| 24 | + |
| 25 | +``` |
| 26 | +vcpkg install openblas[threads] |
| 27 | +``` |
| 28 | +Note, that `[threads]` is required for HiPO. |
| 29 | + |
| 30 | +#### Metis |
| 31 | +There are some known issues with Metis so the recommented version is in [this fork](https://github.com/galabovaa/METIS/tree/510-ts), branch 510-ts. This is version 5.10 with several patches for more reliable build and execution. Clone the repository with |
| 32 | +``` |
| 33 | +git clone https://github.com/galabovaa/METIS.git |
| 34 | +cd METIS |
| 35 | +git checkout 510-ts |
| 36 | +``` |
| 37 | + |
| 38 | +Then build with |
| 39 | +``` |
| 40 | +cmake -S. -B build |
| 41 | +-DGKLIB_PATH=/path_to_METIS_repo/GKlib |
| 42 | +-DCMAKE_INSTALL_PREFIX=path_to_installs_dir |
| 43 | +cmake --build build |
| 44 | +cmake --install build |
| 45 | +``` |
| 46 | + |
| 47 | +On Windows, do not forget to specify configuration type |
| 48 | +``` |
| 49 | +cmake --build build --config Release |
| 50 | +``` |
| 51 | + |
| 52 | +### HiPO |
| 53 | + |
| 54 | +To install HiPO, on Linux and MacOS, run |
| 55 | +``` |
| 56 | +cmake -S. -B build -DHIPO=ON -DMETIS_ROOT=path_to_installs_dir |
| 57 | +``` |
| 58 | +On Windows, you also need to specify the path to OpenBLAS. If it was installed with vcpkg as suggested above, add the path to `vcpkg.cmake` to the CMake flags, e.g. |
| 59 | +``` |
| 60 | +-DCMAKE_TOOLCHAIN_FILE="C:/vcpkg/scripts/buildsystems/vcpkg.cmake" |
| 61 | +``` |
| 62 | + |
| 63 | +## Bazel build |
| 64 | + |
| 65 | +Alternatively, building with Bazel is supported for Bazel-based projects. To build HiGHS, from the root directory, run |
| 66 | + |
| 67 | +``` |
| 68 | +bazel build //... |
| 69 | +``` |
| 70 | + |
8 | 71 | ## Install via a package manager |
9 | 72 |
|
10 | 73 | HiGHS can be installed using a package manager in the cases of |
@@ -39,3 +102,36 @@ filename. |
39 | 102 | * For Windows users: choose the file ending in `x86_64-w64-mingw32-cxx11.tar.gz` |
40 | 103 | * For M1 macOS users: choose the file ending in `aarch64-apple-darwin.tar.gz` |
41 | 104 | * For Intel macOS users: choose the file ending in `x86_64-apple-darwin.tar.gz` |
| 105 | + |
| 106 | +## [Building HiGHS with NVidia GPU support](@id gpu-build) |
| 107 | + |
| 108 | +HiGHS must be built, from the root directory, with |
| 109 | + |
| 110 | +``` |
| 111 | +cmake -S. -Bbuild -DCUPDLP_GPU=ON |
| 112 | +cmake --build build --parallel |
| 113 | +``` |
| 114 | + |
| 115 | +This uses [FindCUDAToolkit](https://cmake.org/cmake/help/latest/module/FindCUDAToolkit.html) to find a CUDA installation locally. For more details on HiGHS with CMake, see `HiGHS/cmake/README.md`. |
| 116 | + |
| 117 | + |
| 118 | +#### Find CUDA |
| 119 | + |
| 120 | +If CUDA is not found automatically, there is an extra option `-DCUPDLP_FIND_CUDA=ON`, to be used with `-DCUPDLP_GPU=ON`, which instead uses `cuPDLP-C`'s `FindCUDAConf.cmake`. |
| 121 | + |
| 122 | +This requires the environment variable `CUDA_HOME` to be set to the directory with the CUDA installation. Having set this, run |
| 123 | + |
| 124 | +``` |
| 125 | +cmake -S. -Bbuild -DCUPDLP_GPU=ON -DCUPDLP_FIND_CUDA=ON |
| 126 | +cmake --build build --parallel |
| 127 | +``` |
| 128 | + |
| 129 | +to build HiGHS. |
| 130 | + |
| 131 | +### Bazel build with Cuda |
| 132 | + |
| 133 | +Alternatively, for Bazel run |
| 134 | + |
| 135 | +``` |
| 136 | +bazel build //... --//:cupdlp_gpu |
| 137 | +``` |
0 commit comments