#coin-or #link #class #src #collection #projects #coin-utils

sys coinutils-src

Redistribution of Coin-OR CoinUtils as a crate

9 releases

0.2.9+2.11.12 Aug 20, 2024
0.2.8+2.11.11 Apr 7, 2024
0.2.6+2.11.10 Oct 27, 2023
0.2.4+2.11.9 May 18, 2023
0.1.0+2.11.6 Mar 18, 2023

#978 in Algorithms

Download history 11/week @ 2024-07-08 27/week @ 2024-07-15 58/week @ 2024-07-22 16/week @ 2024-07-29 20/week @ 2024-08-05 15/week @ 2024-08-12 173/week @ 2024-08-19 31/week @ 2024-08-26 23/week @ 2024-09-02 13/week @ 2024-09-09 19/week @ 2024-09-16 29/week @ 2024-09-23 12/week @ 2024-09-30 1/week @ 2024-10-07 38/week @ 2024-10-14

80 downloads per month
Used in 8 crates (4 directly)

Apache-2.0

2MB
58K SLoC

C++ 58K SLoC // 0.2% comments Automake 149 SLoC // 0.1% comments Rust 55 SLoC Shell 11 SLoC // 0.3% comments

CoinUtils-src

Package Documentation License

CoinUtils-src crate is a *-src crate. This links CoinUtils libraries to executable build by cargo, but does not provide Rust bindings.

By this package, you don't need to worry about installing CoinUtils in the system, and it's a package for all platforms.

CoinUtils is an open-source collection of classes and helper functions that are generally useful to multiple COIN-OR projects.

Usage

  1. Add the following to your Cargo.toml:

    [dependencies]
    coinutils-src = "\*"
    
  2. Add the following to your lib.rs:

    extern crate coinutils_src;
    

This package does not provide bindings. Please use coincbc-sys, coinclp-sys to use Cbc, Clp, e.g.

[dependencies]
coincbc-sys = { version = "\*" }

Configuration

Environment

The package build from the source and link statically by default. It also provide the following environment variables to allow users to link to system library customly:

  • CARGO_COINUTILS_STATIC to link to CoinUtils statically;
  • CARGO_COINUTILS_SYSTEM to link to CoinUtils system library;

Set the environment variable to 1 to enable the feature. For example, to link to system library dynamically, set CARGO_${LIB_NAME}_SYSTEM to 1; to link to system library statically, set both CARGO_${LIB_NAME}_SYSTEM and CARGO_${LIB_NAME}_STATIC to 1.

Windows and vcpkg

On Windows, if ${LIB_NAME}_SYSTEM is set to 1, coinutils-src will use vcpkg to find CoinUtils. Before building, you must have the correct CoinUtils installed for your target triplet and kind of linking. For instance, to link dynamically for the x86_64-pc-windows-msvc toolchain, install coinutils for the x64-windows triplet:

vcpkg install coinutils --triplet x64-windows

To link CoinUtils statically, install coinutils for the x64-windows-static-md triplet:

vcpkg install coinutils --triplet x64-windows-static-md

To link CoinUtils and C Runtime (CRT) statically, install coinutils for the x64-windows-static triplet:

vcpkg install coinutils --triplet x64-windows-static

and build with +crt-static option

RUSTFLAGS='-C target-feature=+crt-static' cargo build --target x86_64-pc-windows-msvc

Please see the "Static and dynamic C runtimes" in The Rust reference for detail.

Cross Compilation

you can compile it for the other target by providing the --target option to cargo build.

Target supported
arm-unknown-linux-gnueabi
arm-unknown-linux-gnueabihf
armv7-unknown-linux-gnueabi
armv7-unknown-linux-gnueabihf
armv7-unknown-linux-musleabi
armv7-unknown-linux-musleabihf
aarch64-unknown-linux-gnu
aarch64-unknown-linux-musl
riscv64gc-unknown-linux-gnu
x86_64-pc-windows-msvc
x86_64-unknown-linux-gnu
x86_64-unknown-linux-musl
others not test

Contribution

Your contribution is highly appreciated. Do not hesitate to open an issue or a pull request. Note that any contribution submitted for inclusion in the project will be licensed according to the terms given in LICENSE.

Dependencies