Skip to content

Latest commit

 

History

History
53 lines (43 loc) · 1.85 KB

cpp.md

File metadata and controls

53 lines (43 loc) · 1.85 KB
Linux macOS Windows
Status Status Status

Introduction

For building OR-Tools as a CMake standalone project, you can read the following instructions.

This project should run on GNU/Linux, MacOS and Windows.

C++ Project Build

  1. Get the source code and change to it.
git clone https://github.com/google/or-tools.git
cd or-tools
  1. Run CMake to configure the build tree.
cmake -S. -Bbuild -G "Unix Makefiles" -DBUILD_DEPS=ON

note: To get the list of available generators (e.g. Visual Studio), use -G ""

  1. Afterwards, generated files can be used to compile the project.
cmake --build build -v
  1. Test the build software (optional).
cmake --build build --target test
  1. Install the built files (optional).
cmake --build build --target install

Technical Notes

Managing RPATH

Since we want to use the CMAKE_BINARY_DIR to generate the wrapper package (e.g. python wheel package) as well as be able to test from the build directory. We need to enable:

set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)

And have a finely tailored rpath for each library.