Skip to content

Commit

Permalink
update highs to v1.6.0, remove now unnecessary dependency to openmp (#22
Browse files Browse the repository at this point in the history
)

* update highs to v1.6.0, remove now unnecessary dependency to openmp

* remove OpenMP from readme

* remove unused variable

* update to latest development version of HiGHS

* revert to old highs

* update llvm

* fewer threads in tests

* highs-v1.6.0

* disable thread test on windows
  • Loading branch information
lovasoa authored Jan 2, 2024
1 parent 5b51d95 commit bcb0afe
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 23 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ jobs:
- os: windows-latest
steps:
- name: Install LLVM and Clang # required for bindgen to work, see https://github.com/rust-lang/rust-bindgen/issues/1797
uses: KyleMayes/install-llvm-action@f8f2154d96f018dcb600739c4978bfc35f435422
uses: KyleMayes/install-llvm-action@v1.9.0
if: matrix.config.os == 'windows-latest'
with:
version: "11.0"
version: "17"
directory: ${{ runner.temp }}/llvm
- name: Set LIBCLANG_PATH
run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV
if: matrix.config.os == 'windows-latest'
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: recursive
- name: install dependencies
Expand Down
2 changes: 1 addition & 1 deletion HiGHS
Submodule HiGHS updated 164 files
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,22 @@ This crate can either use and link a version of HiGHS that is already installed

## Usage

At runtime, HiGHS depends at the minimum on the C++ standard library and OMP.
They need to be installed both on your system and any system you want to deploy your application to.
At runtime, HiGHS depends at the minimum on the C++ standard library.
It needs to be installed both on your system and any system you want to deploy your application to.

How you install these depends on your operating system.

#### Debian

```
sudo apt-get install libstdc++6 libgomp1
sudo apt-get install libstdc++6
```

(These are probably already installed on your system)
(but it is probably already installed on your system)

#### macOS

```
brew install libomp
```
libc++ comes by default when installing XCode.

### Building HiGHS

Expand Down
7 changes: 0 additions & 7 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,12 @@ fn build() -> bool {

let target = env::var("TARGET").unwrap();
let apple = target.contains("apple");
let windows = target.contains("windows");
let linux = target.contains("linux");
if apple {
println!("cargo:rustc-link-lib=dylib=c++");
} else if linux {
println!("cargo:rustc-link-lib=dylib=stdc++");
}
if apple {
println!("cargo:rustc-link-lib=dylib=omp");
} else if !windows {
// No openmp 3 on windows
println!("cargo:rustc-link-lib=dylib=gomp");
}
println!("cargo:rerun-if-changed=HiGHS/src/interfaces/highs_c_api.h");

true
Expand Down
7 changes: 3 additions & 4 deletions install-dependencies.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
set -x
if test -x "$(which apt-get)"; then
sudo apt-get install libstdc++6 libgomp1 cmake
sudo apt-get install libstdc++6 cmake
elif test -x "$(which dnf)"; then
sudo dnf install libstdc++ libgomp cmake
sudo dnf install libstdc++ cmake
elif test -x "$(which brew)"; then
brew install libomp cmake
brew link --force libomp
brew install cmake
else
echo "system not supported"
exit 1
Expand Down
3 changes: 2 additions & 1 deletion tests/test_highs_functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,10 @@ fn highs_functions() {
}
}

#[cfg(not(target_os = "windows"))] // broken on windows
#[test]
fn highs_functions_multithread() {
let threads: Vec<_> = (0..1000)
let threads: Vec<_> = (0..128)
.map(|_| std::thread::spawn(highs_functions))
.collect();
for t in threads {
Expand Down

0 comments on commit bcb0afe

Please sign in to comment.