Skip to content

Commit

Permalink
Merge pull request #23 from scipopt/fix-conda-setup
Browse files Browse the repository at this point in the history
Link to soplex in from-source only
  • Loading branch information
mmghannam authored Oct 30, 2024
2 parents 90f6fc4 + 4faf718 commit 47f89df
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,27 @@ jobs:
cargo t --features from-source create
cargo t --features from-source --examples
linux-conda-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test
allow-softlinks: true

- name: Install dependencies (SCIPOptSuite)
run: |
conda install -y --prefix $CONDA/envs/test --channel conda-forge scip
echo "LD_LIBRARY_PATH=$CONDA/envs/test/lib" >> "${GITHUB_ENV}"
echo "CONDA_PREFIX=$CONDA/envs/test" >> "${GITHUB_ENV}"
- name: Test
run: |
cargo b -vv
cargo t create
cargo t --examples
# from-source-linux-arm-test:
# runs-on: ubuntu-latest
# steps:
Expand Down
9 changes: 7 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,9 @@ fn main() -> Result<(), Box<dyn Error>> {

#[cfg(windows)] {
println!("cargo:rustc-link-lib=libscip");
println!("cargo:rustc-link-lib=libsoplex");
}
#[cfg(not(windows))] {
println!("cargo:rustc-link-lib=scip");
println!("cargo:rustc-link-lib=soplex");
}

#[cfg(feature = "from-source")] {
Expand All @@ -154,6 +152,13 @@ fn main() -> Result<(), Box<dyn Error>> {
} else if linux || mingw {
println!("cargo:rustc-link-lib=dylib=stdc++");
}

#[cfg(windows)] {
println!("cargo:rustc-link-lib=libsoplex");
}
#[cfg(not(windows))] {
println!("cargo:rustc-link-lib=soplex");
}
}

let builder = builder
Expand Down

0 comments on commit 47f89df

Please sign in to comment.