#build-tool #coin-or #source #cross-compilation #set #vcpkg

build coin-build-tools

coin-build-tools provides a set of tools to build COIN-OR libraries from source

5 releases

0.2.6 Oct 27, 2023
0.2.5 May 18, 2023
0.2.4 May 18, 2023
0.2.2 Mar 28, 2023
0.2.0 Mar 21, 2023

#182 in Build Utils

Download history 32/week @ 2024-07-22 27/week @ 2024-07-29 31/week @ 2024-08-05 24/week @ 2024-08-12 38/week @ 2024-08-19 39/week @ 2024-08-26 28/week @ 2024-09-02 16/week @ 2024-09-09 26/week @ 2024-09-16 34/week @ 2024-09-23 14/week @ 2024-09-30 1/week @ 2024-10-07 45/week @ 2024-10-14 15/week @ 2024-10-21 17/week @ 2024-10-28 27/week @ 2024-11-04

104 downloads per month
Used in 12 crates

Apache-2.0

11KB
170 lines

coin-build-tools

Package Documentation License

coin-build-tools provides a set of tools to build [Coin-OR] libraries from source.

Usage

Just add the following to your Cargo.toml:

[build-dependencies]
coin-build-tools = "0.2"

Configuration

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_${LIB_NAME}_STATIC to link to CoinUtils statically;
  • CARGO_${LIB_NAME}_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, osi-src will use vcpkg to find Osi. Before building, you must have the correct Osi installed for your target triplet and kind of linking. For instance, to link dynamically for the x86_64-pc-windows-msvc toolchain, install osi for the x64-windows triplet:

vcpkg install osi --triplet x64-windows

To link Osi statically, install osi for the x64-windows-static-md triplet:

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

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

vcpkg install osi --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 use it for the other target by providing the --target option to cargo build.

Target supported
arm-unknown-linux-gnueabi
arm-unknown-linux-gnueabihf
armv7-linux-androideabi
armv7-unknown-linux-gnueabi
armv7-unknown-linux-gnueabihf
armv7-unknown-linux-musleabi
armv7-unknown-linux-musleabihf
riscv64gc-unknown-linux-gnu
x86_64-pc-windows-gnu
x86_64-unknown-linux-gnu

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

~670KB
~12K SLoC