diff --git a/benchmarks/linear_programming/cuopt/run_mip.cpp b/benchmarks/linear_programming/cuopt/run_mip.cpp index b20ae26ea..316371948 100644 --- a/benchmarks/linear_programming/cuopt/run_mip.cpp +++ b/benchmarks/linear_programming/cuopt/run_mip.cpp @@ -360,7 +360,7 @@ int main(int argc, char* argv[]) std::string out_dir; std::string result_file; - int batch_num; + int batch_num = -1; bool heuristics_only = program.get("--heuristics-only")[0] == 't'; int num_cpu_threads = program.get("--num-cpu-threads"); @@ -392,8 +392,7 @@ int main(int argc, char* argv[]) for (int i = 0; i < n_gpus; ++i) { gpu_queue.push(i); } - int tests_ran = 0; - int n_instances_solved = 0; + int tests_ran = 0; std::vector paths; if (run_selected) { for (const auto& instance : instances) { @@ -421,11 +420,11 @@ int main(int argc, char* argv[]) bool static_dispatch = false; if (static_dispatch) { - for (int i = 0; i < paths.size(); ++i) { + for (size_t i = 0; i < paths.size(); ++i) { // TODO implement } } else { - for (int i = 0; i < paths.size(); ++i) { + for (size_t i = 0; i < paths.size(); ++i) { task_queue.push(paths[i]); } while (!task_queue.empty()) { diff --git a/benchmarks/linear_programming/run_mps_files.sh b/benchmarks/linear_programming/run_mps_files.sh index 7e423f807..b37882b46 100755 --- a/benchmarks/linear_programming/run_mps_files.sh +++ b/benchmarks/linear_programming/run_mps_files.sh @@ -31,6 +31,7 @@ # --mip-heuristics-only : Run mip heuristics only # --write-log-file : Write log file # --num-cpu-threads : Number of CPU threads to use +# --presolve : Enable presolve (default: true for MIP problems, false for LP problems) # --batch-num : Batch number. This allows to split the work across multiple batches uniformly when resources are limited. # --n-batches : Number of batches # --log-to-console : Log to console @@ -74,6 +75,7 @@ Optional Arguments: --mip-heuristics-only Run mip heuristics only --write-log-file Write log file --num-cpu-threads Number of CPU threads to use + --presolve Enable presolve (default: true for MIP problems, false for LP problems) --batch-num Batch number --n-batches Number of batches --log-to-console Log to console @@ -107,47 +109,62 @@ fi while [[ $# -gt 0 ]]; do case $1 in --path) + echo "MPS_DIR: $2" MPS_DIR="$2" shift 2 ;; --ngpus) + echo "GPU_COUNT: $2" GPU_COUNT="$2" shift 2 ;; --time-limit) + echo "TIME_LIMIT: $2" TIME_LIMIT="$2" shift 2 ;; --output-dir) + echo "OUTPUT_DIR: $2" OUTPUT_DIR="$2" shift 2 ;; --relaxation) - echo "Running relaxation" + echo "RELAXATION: true" RELAXATION=true shift ;; --mip-heuristics-only) + echo "MIP_HEURISTICS_ONLY: true" MIP_HEURISTICS_ONLY=true shift ;; --write-log-file) - WRITE_LOG_FILE="$2" - shift 2 + echo "WRITE_LOG_FILE: true" + WRITE_LOG_FILE=true + shift ;; --num-cpu-threads) + echo "NUM_CPU_THREADS: $2" NUM_CPU_THREADS="$2" shift 2 ;; + --presolve) + echo "PRESOLVE: $2" + PRESOLVE="$2" + shift 2 + ;; --batch-num) + echo "BATCH_NUM: $2" BATCH_NUM="$2" shift 2 ;; --n-batches) + echo "N_BATCHES: $2" N_BATCHES="$2" shift 2 ;; --log-to-console) + echo "LOG_TO_CONSOLE: $2" LOG_TO_CONSOLE="$2" shift 2 ;; @@ -173,6 +190,7 @@ RELAXATION=${RELAXATION:-false} MIP_HEURISTICS_ONLY=${MIP_HEURISTICS_ONLY:-false} WRITE_LOG_FILE=${WRITE_LOG_FILE:-false} NUM_CPU_THREADS=${NUM_CPU_THREADS:-1} +PRESOLVE=${PRESOLVE:-true} BATCH_NUM=${BATCH_NUM:-0} N_BATCHES=${N_BATCHES:-1} LOG_TO_CONSOLE=${LOG_TO_CONSOLE:-true} @@ -261,9 +279,8 @@ worker() { if [ "$RELAXATION" = true ]; then args="$args --relaxation" fi - if [ "$LOG_TO_CONSOLE" = true ]; then - args="$args --log-to-console $LOG_TO_CONSOLE" - fi + args="$args --log-to-console $LOG_TO_CONSOLE" + args="$args --presolve $PRESOLVE" CUDA_VISIBLE_DEVICES=$gpu_id cuopt_cli "$mps_file" --time-limit $TIME_LIMIT $args done @@ -277,4 +294,4 @@ done wait # Remove the index file -rm -f "$INDEX_FILE" \ No newline at end of file +rm -f "$INDEX_FILE" diff --git a/ci/build_wheel_libcuopt.sh b/ci/build_wheel_libcuopt.sh index be78e8963..7651b52f8 100755 --- a/ci/build_wheel_libcuopt.sh +++ b/ci/build_wheel_libcuopt.sh @@ -21,6 +21,9 @@ source rapids-init-pip package_name="libcuopt" package_dir="python/libcuopt" +# Install Boost +bash ci/utils/install_boost.sh + export SKBUILD_CMAKE_ARGS="-DCUOPT_BUILD_WHEELS=ON;-DDISABLE_DEPRECATION_WARNING=ON" # For pull requests we are enabling assert mode. diff --git a/ci/utils/install_boost.sh b/ci/utils/install_boost.sh new file mode 100644 index 000000000..bd85d41e9 --- /dev/null +++ b/ci/utils/install_boost.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +set -euo pipefail + +# Install Boost +if [ -f /etc/os-release ]; then + . /etc/os-release + if [[ "$ID" == "rocky" ]]; then + echo "Detected Rocky Linux. Installing Boost via dnf..." + dnf install -y boost-devel + if [[ "$(uname -m)" == "x86_64" ]]; then + dnf install -y gcc-toolset-14-libquadmath-devel + fi + elif [[ "$ID" == "ubuntu" ]]; then + echo "Detected Ubuntu. Installing Boost via apt..." + apt-get update + apt-get install -y libboost-dev + else + echo "Unknown OS: $ID. Please install Boost development libraries manually." + exit 1 + fi +else + echo "/etc/os-release not found. Cannot determine OS. Please install Boost development libraries manually." + exit 1 +fi diff --git a/conda/environments/all_cuda-128_arch-aarch64.yaml b/conda/environments/all_cuda-128_arch-aarch64.yaml index 9e1e26212..ba6b6945e 100644 --- a/conda/environments/all_cuda-128_arch-aarch64.yaml +++ b/conda/environments/all_cuda-128_arch-aarch64.yaml @@ -5,6 +5,7 @@ channels: - rapidsai-nightly - conda-forge dependencies: +- boost - breathe - c-compiler - ccache diff --git a/conda/environments/all_cuda-128_arch-x86_64.yaml b/conda/environments/all_cuda-128_arch-x86_64.yaml index a8dd9744e..f91c22957 100644 --- a/conda/environments/all_cuda-128_arch-x86_64.yaml +++ b/conda/environments/all_cuda-128_arch-x86_64.yaml @@ -5,6 +5,7 @@ channels: - rapidsai-nightly - conda-forge dependencies: +- boost - breathe - c-compiler - ccache diff --git a/conda/recipes/libcuopt/recipe.yaml b/conda/recipes/libcuopt/recipe.yaml index b507a35fb..9924107d2 100644 --- a/conda/recipes/libcuopt/recipe.yaml +++ b/conda/recipes/libcuopt/recipe.yaml @@ -49,6 +49,7 @@ cache: requirements: build: + - boost - ${{ compiler("c") }} - ${{ compiler("cxx") }} - ${{ compiler("cuda") }} =${{ cuda_version }} @@ -68,6 +69,7 @@ cache: - libcurand-dev - libcusparse-dev - cuda-cudart-dev + - boost outputs: - package: @@ -126,6 +128,7 @@ outputs: - ${{ stdlib("c") }} host: - ${{ pin_subpackage("libmps-parser", exact=True) }} + - boost - cuda-version =${{ cuda_version }} - rapids-logger =0.1 - librmm =${{ dep_minor_version }} @@ -135,6 +138,7 @@ outputs: run: - ${{ pin_compatible("cuda-version", upper_bound="x", lower_bound="x") }} - ${{ pin_subpackage("libmps-parser", exact=True) }} + - boost - librmm =${{ dep_minor_version }} - cuda-nvrtc ignore_run_exports: @@ -146,6 +150,8 @@ outputs: - libcurand - libcusparse - librmm + - libboost + - libboost_iostreams tests: - package_contents: files: @@ -173,6 +179,7 @@ outputs: host: - ${{ pin_subpackage("libcuopt", exact=True) }} - ${{ pin_subpackage("libmps-parser", exact=True) }} + - boost - gmock ${{ gtest_version }} - gtest ${{ gtest_version }} - cuda-cudart-dev @@ -192,6 +199,8 @@ outputs: - libcurand - libcusparse - librmm + - libboost + - libboost_iostreams about: homepage: ${{ load_from_file("python/cuopt/pyproject.toml").project.urls.Homepage }} license: ${{ load_from_file("python/cuopt/pyproject.toml").project.license.text }} diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index c7269deea..53071afae 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -13,7 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.26.4 FATAL_ERROR) +cmake_minimum_required(VERSION 3.30.4 FATAL_ERROR) + +# Add our custom Find modules to the module path +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/thirdparty") include(GNUInstallDirs) @@ -157,6 +160,21 @@ else() find_package(RMM REQUIRED) find_package(RAFT REQUIRED) endif() + +FetchContent_Declare( + papilo + GIT_REPOSITORY "https://github.com/scipopt/papilo.git" + GIT_TAG "v2.4.3" + SYSTEM +) + +set(BUILD_TESTING OFF CACHE BOOL "Disable test build for papilo") +set(TBB OFF CACHE BOOL "Disable TBB") +set(PAPILO_NO_BINARIES ON) +option(LUSOL "Disable LUSOL" OFF) + +FetchContent_MakeAvailable(papilo) + include(${rapids-cmake-dir}/cpm/rapids_logger.cmake) # generate logging macros rapids_cpm_rapids_logger(BUILD_EXPORT_SET cuopt-exports INSTALL_EXPORT_SET cuopt-exports) @@ -204,6 +222,9 @@ target_link_options(cuopt PRIVATE "${CUOPT_BINARY_DIR}/fatbin.ld") add_library(cuopt::cuopt ALIAS cuopt) # ################################################################################################## # - include paths --------------------------------------------------------------------------------- + +target_include_directories(cuopt SYSTEM PRIVATE "${papilo_SOURCE_DIR}/src" "${papilo_BINARY_DIR}") + target_include_directories(cuopt PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../thirdparty" @@ -212,6 +233,7 @@ target_include_directories(cuopt "$" "$" "$" + INTERFACE "$" ) @@ -242,6 +264,7 @@ target_link_libraries(cuopt ${CUOPT_PRIVATE_CUDA_LIBS} ) + # ################################################################################################## # - generate tests -------------------------------------------------------------------------------- if(BUILD_TESTS) @@ -357,6 +380,8 @@ target_link_libraries(cuopt_cli PUBLIC cuopt OpenMP::OpenMP_CXX + PRIVATE + papilo-core ) set_property(TARGET cuopt_cli PROPERTY INSTALL_RPATH "$ORIGIN/../${lib_dir}") @@ -377,6 +402,8 @@ if(BUILD_BENCHMARKS) PUBLIC cuopt OpenMP::OpenMP_CXX + PRIVATE + papilo-core ) endif() diff --git a/cpp/cuopt_cli.cpp b/cpp/cuopt_cli.cpp index 7394dc7e7..ac22cf9fe 100644 --- a/cpp/cuopt_cli.cpp +++ b/cpp/cuopt_cli.cpp @@ -122,9 +122,6 @@ int run_single_file(const std::string& file_path, (op_problem.get_problem_category() == cuopt::linear_programming::problem_category_t::MIP || op_problem.get_problem_category() == cuopt::linear_programming::problem_category_t::IP); - bool sol_found = false; - double obj_val = std::numeric_limits::infinity(); - auto initial_solution = initial_solution_file.empty() ? std::vector() @@ -197,6 +194,11 @@ int main(int argc, char* argv[]) .default_value(false) .implicit_value(true); + program.add_argument("--presolve") + .help("enable/disable presolve (default: true for MIP problems, false for LP problems)") + .default_value(true) + .implicit_value(true); + std::map arg_name_to_param_name; { // Add all solver settings as arguments diff --git a/cpp/include/cuopt/linear_programming/constants.h b/cpp/include/cuopt/linear_programming/constants.h index ca4377de9..72d05a6ad 100644 --- a/cpp/include/cuopt/linear_programming/constants.h +++ b/cpp/include/cuopt/linear_programming/constants.h @@ -50,6 +50,7 @@ #define CUOPT_LOG_FILE "log_file" #define CUOPT_LOG_TO_CONSOLE "log_to_console" #define CUOPT_CROSSOVER "crossover" +#define CUOPT_PRESOLVE "presolve" #define CUOPT_MIP_ABSOLUTE_TOLERANCE "mip_absolute_tolerance" #define CUOPT_MIP_RELATIVE_TOLERANCE "mip_relative_tolerance" #define CUOPT_MIP_INTEGRALITY_TOLERANCE "mip_integrality_tolerance" @@ -57,6 +58,7 @@ #define CUOPT_MIP_RELATIVE_GAP "mip_relative_gap" #define CUOPT_MIP_HEURISTICS_ONLY "mip_heuristics_only" #define CUOPT_MIP_SCALING "mip_scaling" +#define CUOPT_MIP_PRESOLVE "mip_presolve" #define CUOPT_SOLUTION_FILE "solution_file" #define CUOPT_NUM_CPU_THREADS "num_cpu_threads" #define CUOPT_USER_PROBLEM_FILE "user_problem_file" diff --git a/cpp/include/cuopt/linear_programming/mip/solver_settings.hpp b/cpp/include/cuopt/linear_programming/mip/solver_settings.hpp index fbb75d80b..4d4d29eaf 100644 --- a/cpp/include/cuopt/linear_programming/mip/solver_settings.hpp +++ b/cpp/include/cuopt/linear_programming/mip/solver_settings.hpp @@ -54,9 +54,9 @@ class mip_solver_settings_t { * * @note This function can be called multiple times to add more solutions. * - * @param[in] initial_solution Device or host memory pointer to a floating point array of - * size size. - * cuOpt copies this data. Copy happens on the stream of the raft:handler passed to the problem. + * @param[in] initial_solution Device or host memory pointer to a floating + * point array of size size. cuOpt copies this data. Copy happens on the + * stream of the raft:handler passed to the problem. * @param size Size of the initial_solution array. */ void add_initial_solution(const f_t* initial_solution, @@ -99,7 +99,9 @@ class mip_solver_settings_t { /** Initial primal solutions */ std::vector>> initial_solutions; bool mip_scaling = true; - // this is for extracting info from different places of the solver during benchmarks + bool presolve = true; + // this is for extracting info from different places of the solver during + // benchmarks benchmark_info_t* benchmark_info_ptr = nullptr; private: diff --git a/cpp/include/cuopt/linear_programming/mip/solver_solution.hpp b/cpp/include/cuopt/linear_programming/mip/solver_solution.hpp index b29db43db..fc98e9aff 100644 --- a/cpp/include/cuopt/linear_programming/mip/solver_solution.hpp +++ b/cpp/include/cuopt/linear_programming/mip/solver_solution.hpp @@ -64,6 +64,7 @@ class mip_solution_t : public base_solution_t { bool is_mip() const override { return true; } const rmm::device_uvector& get_solution() const; rmm::device_uvector& get_solution(); + f_t get_objective_value() const; f_t get_mip_gap() const; f_t get_solution_bound() const; @@ -76,11 +77,13 @@ class mip_solution_t : public base_solution_t { f_t get_max_constraint_violation() const; f_t get_max_int_violation() const; f_t get_max_variable_bound_violation() const; + solver_stats_t get_stats() const; i_t get_num_nodes() const; i_t get_num_simplex_iterations() const; const std::vector& get_variable_names() const; const std::vector>& get_solution_pool() const; void write_to_sol_file(std::string_view filename, rmm::cuda_stream_view stream_view) const; + void log_summary() const; private: rmm::device_uvector solution_; diff --git a/cpp/include/cuopt/linear_programming/optimization_problem.hpp b/cpp/include/cuopt/linear_programming/optimization_problem.hpp index 77686a337..db6172367 100644 --- a/cpp/include/cuopt/linear_programming/optimization_problem.hpp +++ b/cpp/include/cuopt/linear_programming/optimization_problem.hpp @@ -42,7 +42,8 @@ enum class problem_category_t : int8_t { LP = 0, MIP = 1, IP = 2 }; * * @tparam f_t Data type of the variables and their weights in the equations * - * This structure stores all the information necessary to represent the following LP: + * This structure stores all the information necessary to represent the + * following LP: * *
  * Minimize:
@@ -61,7 +62,8 @@ enum class problem_category_t : int8_t { LP = 0, MIP = 1, IP = 2 };
  *
  * Objective value can be scaled and offset accordingly:
  * objective_scaling_factor * (dot(c, x) + objective_offset)
- * please refer to the `set_objective_scaling_factor()` and `set_objective_offset()` methods.
+ * please refer to the `set_objective_scaling_factor()` and
+ * `set_objective_offset()` methods.
  */
 template 
 class optimization_problem_t {
@@ -329,6 +331,7 @@ class optimization_problem_t {
   const rmm::device_uvector& get_row_types() const;
   const rmm::device_uvector& get_variable_types() const;
   bool get_sense() const;
+  bool empty() const;
 
   std::string get_objective_name() const;
   std::string get_problem_name() const;
diff --git a/cpp/include/cuopt/linear_programming/pdlp/solver_settings.hpp b/cpp/include/cuopt/linear_programming/pdlp/solver_settings.hpp
index 9dcccf7a7..f4e515288 100644
--- a/cpp/include/cuopt/linear_programming/pdlp/solver_settings.hpp
+++ b/cpp/include/cuopt/linear_programming/pdlp/solver_settings.hpp
@@ -1,6 +1,6 @@
 /*
- * SPDX-FileCopyrightText: Copyright (c) 2023-2025 NVIDIA CORPORATION & AFFILIATES. All rights
- * reserved. SPDX-License-Identifier: Apache-2.0
+ * SPDX-FileCopyrightText: Copyright (c) 2023-2025 NVIDIA CORPORATION &
+ * AFFILIATES. All rights reserved. SPDX-License-Identifier: Apache-2.0
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -32,7 +32,8 @@ template 
 class solver_settings_t;
 
 /**
- * @brief Enum representing the different solver modes under which PDLP can operate.
+ * @brief Enum representing the different solver modes under which PDLP can
+ * operate.
  *
  * Stable2: Best overall mode from experiments; balances speed and convergence
  * success. If you want to use the legacy version, use Stable1.
@@ -42,7 +43,8 @@ class solver_settings_t;
  *
  * @note Default mode is Stable2.
  */
-// Forced to use an enum instead of an enum class for compatibility with the Cython layer
+// Forced to use an enum instead of an enum class for compatibility with the
+// Cython layer
 enum pdlp_solver_mode_t : int {
   Stable1     = CUOPT_PDLP_SOLVER_MODE_STABLE1,
   Stable2     = CUOPT_PDLP_SOLVER_MODE_STABLE2,
@@ -51,8 +53,8 @@ enum pdlp_solver_mode_t : int {
 };
 
 /**
- * @brief Enum representing the different methods that can be used to solve the linear programming
- * problem.
+ * @brief Enum representing the different methods that can be used to solve the
+ * linear programming problem.
  *
  * Concurrent: Use both PDLP and DualSimplex in parallel.
  * PDLP: Use the PDLP method.
@@ -74,15 +76,15 @@ class pdlp_solver_settings_t {
   // Copy constructor for when copying in the PDLP object
   pdlp_solver_settings_t(const pdlp_solver_settings_t& other, rmm::cuda_stream_view stream_view);
   /**
-   * @brief Set both absolute and relative tolerance on the primal feasibility, dual feasibility
-   and gap.
+   * @brief Set both absolute and relative tolerance on the primal feasibility,
+   dual feasibility and gap.
    * Changing this value has a significant impact on accuracy and runtime.
    *
    * Optimality is computed as follows:
    * - dual_feasiblity < absolute_dual_tolerance + relative_dual_tolerance *
    norm_objective_coefficient (l2_norm(c))
-   * - primal_feasiblity < absolute_primal_tolerance + relative_primal_tolerance *
-   norm_constraint_bounds (l2_norm(b))
+   * - primal_feasiblity < absolute_primal_tolerance + relative_primal_tolerance
+   * norm_constraint_bounds (l2_norm(b))
    * - duality_gap < absolute_gap_tolerance + relative_gap_tolerance *
    (|primal_objective| + |dual_objective|)
    *
@@ -101,9 +103,9 @@ class pdlp_solver_settings_t {
    *
    * @note Default value is all 0.
    *
-   * @param[in] initial_primal_solution Device or host memory pointer to a floating point array of
-   * size size.
-   * cuOpt copies this data. Copy happens on the stream of the raft:handler passed to the problem.
+   * @param[in] initial_primal_solution Device or host memory pointer to a
+   * floating point array of size size. cuOpt copies this data. Copy happens on
+   * the stream of the raft:handler passed to the problem.
    * @param size Size of the initial_primal_solution array.
    */
   void set_initial_primal_solution(const f_t* initial_primal_solution,
@@ -115,9 +117,9 @@ class pdlp_solver_settings_t {
    *
    * @note Default value is all 0.
    *
-   * @param[in] initial_dual_solution Device or host memory pointer to a floating point array of
-   * size size.
-   * cuOpt copies this data. Copy happens on the stream of the raft:handler passed to the problem.
+   * @param[in] initial_dual_solution Device or host memory pointer to a
+   * floating point array of size size. cuOpt copies this data. Copy happens on
+   * the stream of the raft:handler passed to the problem.
    * @param size Size of the initial_dual_solution array.
    */
   void set_initial_dual_solution(const f_t* initial_dual_solution,
@@ -125,15 +127,17 @@ class pdlp_solver_settings_t {
                                  rmm::cuda_stream_view stream = rmm::cuda_stream_default);
 
   /**
-   * @brief Set the pdlp warm start data. This allows to restart PDLP with a previous solution
+   * @brief Set the pdlp warm start data. This allows to restart PDLP with a
+   * previous solution
    *
    * @note Interface for the C++ side. Only Stable2 and Fast1 are supported.
    *
-   * @param pdlp_warm_start_data_view Pdlp warm start data from your solution object to warm start
-   * from
-   * @param var_mapping Variables indices to scatter to in case the new problem has less variables
-   * @param constraint_mapping Constraints indices to scatter to in case the new problem has less
-   * constraints
+   * @param pdlp_warm_start_data_view Pdlp warm start data from your solution
+   * object to warm start from
+   * @param var_mapping Variables indices to scatter to in case the new problem
+   * has less variables
+   * @param constraint_mapping Constraints indices to scatter to in case the new
+   * problem has less constraints
    */
   void set_pdlp_warm_start_data(pdlp_warm_start_data_t& pdlp_warm_start_data_view,
                                 const rmm::device_uvector& var_mapping =
@@ -205,6 +209,7 @@ class pdlp_solver_settings_t {
   bool crossover{false};
   bool save_best_primal_so_far{false};
   bool first_primal_feasible{false};
+  bool presolve{false};
   method_t method{method_t::Concurrent};
   // For concurrent termination
   std::atomic* concurrent_halt;
diff --git a/cpp/src/dual_simplex/sparse_matrix.hpp b/cpp/src/dual_simplex/sparse_matrix.hpp
index 9cc3d6380..1fa898b61 100644
--- a/cpp/src/dual_simplex/sparse_matrix.hpp
+++ b/cpp/src/dual_simplex/sparse_matrix.hpp
@@ -90,9 +90,9 @@ class csc_matrix_t {
   // Compute || A ||_1 = max_j (sum {i = 1 to m} | A(i, j) | )
   f_t norm1() const;
 
-  i_t nz_max;                  // maximum number of entries
   i_t m;                       // number of rows
   i_t n;                       // number of columns
+  i_t nz_max;                  // maximum number of entries
   std::vector col_start;  // column pointers (size n + 1)
   std::vector i;          // row indices, size nz_max
   std::vector x;          // numerical values, size nz_max
diff --git a/cpp/src/linear_programming/cuopt_c.cpp b/cpp/src/linear_programming/cuopt_c.cpp
index ce8b70d39..fc77e2323 100644
--- a/cpp/src/linear_programming/cuopt_c.cpp
+++ b/cpp/src/linear_programming/cuopt_c.cpp
@@ -437,7 +437,7 @@ cuopt_int_t cuOptGetVariableTypes(cuOptOptimizationProblem problem, char* variab
              variable_types.size(),
              problem_and_stream_view->stream_view);
   problem_and_stream_view->stream_view.synchronize();
-  for (int j = 0; j < variable_types_host.size(); j++) {
+  for (size_t j = 0; j < variable_types_host.size(); j++) {
     variable_types_ptr[j] =
       variable_types_host[j] == var_t::INTEGER ? CUOPT_INTEGER : CUOPT_CONTINUOUS;
   }
diff --git a/cpp/src/linear_programming/optimization_problem.cu b/cpp/src/linear_programming/optimization_problem.cu
index ad33eb9b4..cdd6cf293 100644
--- a/cpp/src/linear_programming/optimization_problem.cu
+++ b/cpp/src/linear_programming/optimization_problem.cu
@@ -450,6 +450,12 @@ bool optimization_problem_t::get_sense() const
   return maximize_;
 }
 
+template 
+bool optimization_problem_t::empty() const
+{
+  return n_vars_ == 0 && n_constraints_ == 0;
+}
+
 template 
 typename optimization_problem_t::view_t optimization_problem_t::view() const
 {
diff --git a/cpp/src/linear_programming/solve.cu b/cpp/src/linear_programming/solve.cu
index c06985997..504d87bd3 100644
--- a/cpp/src/linear_programming/solve.cu
+++ b/cpp/src/linear_programming/solve.cu
@@ -25,6 +25,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 
@@ -39,6 +40,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -577,7 +579,41 @@ optimization_problem_solution_t solve_lp(optimization_problem_t::check_problem_representation(op_problem);
       problem_checking_t::check_initial_solution_representation(op_problem, settings);
     }
+
+    auto presolve_timer = cuopt::timer_t(settings.time_limit);
     detail::problem_t problem(op_problem);
+
+    if (settings.user_problem_file != "") {
+      CUOPT_LOG_INFO("Writing user problem to file: %s", settings.user_problem_file.c_str());
+      problem.write_as_mps(settings.user_problem_file);
+    }
+
+    double presolve_time = 0.0;
+    std::unique_ptr> presolver;
+    auto run_presolve = settings.presolve;
+    run_presolve      = run_presolve && op_problem.get_sense() == false;
+    run_presolve = run_presolve && settings.get_pdlp_warm_start_data().total_pdlp_iterations_ == -1;
+    if (!run_presolve) { CUOPT_LOG_INFO("Presolve is disabled, skipping"); }
+
+    if (run_presolve) {
+      // allocate no more than 10% of the time limit to presolve.
+      // Note that this is not the presolve time, but the time limit for presolve.
+      const double presolve_time_limit = 0.1 * settings.time_limit;
+      presolver = std::make_unique>();
+      auto [reduced_problem, feasible] =
+        presolver->apply(op_problem,
+                         cuopt::linear_programming::problem_category_t::LP,
+                         settings.tolerances.absolute_primal_tolerance,
+                         presolve_time_limit);
+      if (!feasible) {
+        return optimization_problem_solution_t(
+          pdlp_termination_status_t::PrimalInfeasible, op_problem.get_handle_ptr()->get_stream());
+      }
+      problem       = detail::problem_t(reduced_problem);
+      presolve_time = presolve_timer.elapsed_time();
+      CUOPT_LOG_INFO("Third party presolve time: %f", presolve_time);
+    }
+
     CUOPT_LOG_INFO(
       "Solving a problem with %d constraints %d variables (%d integers) and %d nonzeros",
       problem.n_constraints,
@@ -588,24 +624,60 @@ optimization_problem_solution_t solve_lp(optimization_problem_tget_stream());
 
-    auto sol = solve_lp_with_method(op_problem, problem, settings, is_batch_mode);
+    auto solution = solve_lp_with_method(op_problem, problem, settings, is_batch_mode);
+
+    if (run_presolve) {
+      auto primal_solution = cuopt::device_copy(solution.get_primal_solution(),
+                                                op_problem.get_handle_ptr()->get_stream());
+      auto dual_solution =
+        cuopt::device_copy(solution.get_dual_solution(), op_problem.get_handle_ptr()->get_stream());
+      auto reduced_costs =
+        cuopt::device_copy(solution.get_reduced_cost(), op_problem.get_handle_ptr()->get_stream());
+      bool status_to_skip = false;
+
+      presolver->undo(primal_solution,
+                      dual_solution,
+                      reduced_costs,
+                      cuopt::linear_programming::problem_category_t::LP,
+                      status_to_skip,
+                      op_problem.get_handle_ptr()->get_stream());
+
+      thrust::fill(rmm::exec_policy(op_problem.get_handle_ptr()->get_stream()),
+                   dual_solution.data(),
+                   dual_solution.data() + dual_solution.size(),
+                   std::numeric_limits::signaling_NaN());
+      thrust::fill(rmm::exec_policy(op_problem.get_handle_ptr()->get_stream()),
+                   reduced_costs.data(),
+                   reduced_costs.data() + reduced_costs.size(),
+                   std::numeric_limits::signaling_NaN());
+
+      auto full_stats = solution.get_additional_termination_information();
+      // add third party presolve time to cuopt presolve time
+      full_stats.solve_time += presolve_time;
+
+      // Create a new solution with the full problem solution
+      solution = optimization_problem_solution_t(primal_solution,
+                                                           dual_solution,
+                                                           reduced_costs,
+                                                           solution.get_pdlp_warm_start_data(),
+                                                           op_problem.get_objective_name(),
+                                                           op_problem.get_variable_names(),
+                                                           op_problem.get_row_names(),
+                                                           full_stats,
+                                                           solution.get_termination_status());
+    }
 
     if (settings.sol_file != "") {
       CUOPT_LOG_INFO("Writing solution to file %s", settings.sol_file.c_str());
-      sol.write_to_sol_file(settings.sol_file, op_problem.get_handle_ptr()->get_stream());
+      solution.write_to_sol_file(settings.sol_file, op_problem.get_handle_ptr()->get_stream());
     }
 
-    return sol;
+    return solution;
   } catch (const cuopt::logic_error& e) {
     CUOPT_LOG_ERROR("Error in solve_lp: %s", e.what());
     return optimization_problem_solution_t{e, op_problem.get_handle_ptr()->get_stream()};
@@ -718,7 +790,7 @@ optimization_problem_solution_t solve_lp(
     const optimization_problem_t& op_problem,                             \
     detail::problem_t& problem,                                           \
     pdlp_solver_settings_t const& settings,                               \
-    bool is_batch_mode = false);                                                       \
+    bool is_batch_mode);                                                               \
                                                                                        \
   template optimization_problem_t mps_data_model_to_optimization_problem( \
     raft::handle_t const* handle_ptr,                                                  \
diff --git a/cpp/src/math_optimization/solver_settings.cu b/cpp/src/math_optimization/solver_settings.cu
index 0e148610c..a049d0d09 100644
--- a/cpp/src/math_optimization/solver_settings.cu
+++ b/cpp/src/math_optimization/solver_settings.cu
@@ -104,7 +104,9 @@ solver_settings_t::solver_settings_t() : pdlp_settings(), mip_settings
     {CUOPT_MIP_HEURISTICS_ONLY, &mip_settings.heuristics_only, false},
     {CUOPT_LOG_TO_CONSOLE, &pdlp_settings.log_to_console, true},
     {CUOPT_LOG_TO_CONSOLE, &mip_settings.log_to_console, true},
-    {CUOPT_CROSSOVER, &pdlp_settings.crossover, false}
+    {CUOPT_CROSSOVER, &pdlp_settings.crossover, false},
+    {CUOPT_PRESOLVE, &pdlp_settings.presolve, false},
+    {CUOPT_PRESOLVE, &mip_settings.presolve, true}
   };
   // String parameters
   string_parameters = {
diff --git a/cpp/src/mip/CMakeLists.txt b/cpp/src/mip/CMakeLists.txt
index 25c9a18bf..43c007280 100644
--- a/cpp/src/mip/CMakeLists.txt
+++ b/cpp/src/mip/CMakeLists.txt
@@ -42,6 +42,7 @@ list(PREPEND
   ${CMAKE_CURRENT_SOURCE_DIR}/presolve/load_balanced_bounds_presolve.cu
   ${CMAKE_CURRENT_SOURCE_DIR}/presolve/multi_probe.cu
   ${CMAKE_CURRENT_SOURCE_DIR}/presolve/probing_cache.cu
+  ${CMAKE_CURRENT_SOURCE_DIR}/presolve/third_party_presolve.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/presolve/trivial_presolve.cu
   ${CMAKE_CURRENT_SOURCE_DIR}/problem/load_balanced_problem.cu
   ${CMAKE_CURRENT_SOURCE_DIR}/feasibility_jump/feasibility_jump.cu
diff --git a/cpp/src/mip/presolve/third_party_presolve.cpp b/cpp/src/mip/presolve/third_party_presolve.cpp
new file mode 100644
index 000000000..3d8700756
--- /dev/null
+++ b/cpp/src/mip/presolve/third_party_presolve.cpp
@@ -0,0 +1,389 @@
+/*
+ * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include 
+#include 
+#include 
+#include 
+// #include 
+#include 
+#include 
+
+namespace cuopt::linear_programming::detail {
+
+static papilo::PostsolveStorage post_solve_storage_;
+static int presolve_calls_ = 0;
+
+template 
+papilo::Problem build_papilo_problem(const optimization_problem_t& op_problem)
+{
+  // Build papilo problem from optimization problem
+  papilo::ProblemBuilder builder;
+
+  // Get problem dimensions
+  const i_t num_cols = op_problem.get_n_variables();
+  const i_t num_rows = op_problem.get_n_constraints();
+  const i_t nnz      = op_problem.get_nnz();
+
+  cuopt_expects(op_problem.get_sense() == false,
+                error_type_t::ValidationError,
+                "Papilo does not support maximization problems");
+
+  builder.reserve(nnz, num_rows, num_cols);
+
+  // Get problem data from optimization problem
+  const auto& coefficients = op_problem.get_constraint_matrix_values();
+  const auto& offsets      = op_problem.get_constraint_matrix_offsets();
+  const auto& variables    = op_problem.get_constraint_matrix_indices();
+  const auto& obj_coeffs   = op_problem.get_objective_coefficients();
+  const auto& var_lb       = op_problem.get_variable_lower_bounds();
+  const auto& var_ub       = op_problem.get_variable_upper_bounds();
+  const auto& bounds       = op_problem.get_constraint_bounds();
+  const auto& row_types    = op_problem.get_row_types();
+  const auto& constr_lb    = op_problem.get_constraint_lower_bounds();
+  const auto& constr_ub    = op_problem.get_constraint_upper_bounds();
+  const auto& var_types    = op_problem.get_variable_types();
+
+  // Copy data to host
+  std::vector h_coefficients(coefficients.size());
+  auto stream_view = op_problem.get_handle_ptr()->get_stream();
+  raft::copy(h_coefficients.data(), coefficients.data(), coefficients.size(), stream_view);
+  std::vector h_offsets(offsets.size());
+  raft::copy(h_offsets.data(), offsets.data(), offsets.size(), stream_view);
+  std::vector h_variables(variables.size());
+  raft::copy(h_variables.data(), variables.data(), variables.size(), stream_view);
+  std::vector h_obj_coeffs(obj_coeffs.size());
+  raft::copy(h_obj_coeffs.data(), obj_coeffs.data(), obj_coeffs.size(), stream_view);
+  std::vector h_var_lb(var_lb.size());
+  raft::copy(h_var_lb.data(), var_lb.data(), var_lb.size(), stream_view);
+  std::vector h_var_ub(var_ub.size());
+  raft::copy(h_var_ub.data(), var_ub.data(), var_ub.size(), stream_view);
+  std::vector h_bounds(bounds.size());
+  raft::copy(h_bounds.data(), bounds.data(), bounds.size(), stream_view);
+  std::vector h_row_types(row_types.size());
+  raft::copy(h_row_types.data(), row_types.data(), row_types.size(), stream_view);
+  std::vector h_constr_lb(constr_lb.size());
+  raft::copy(h_constr_lb.data(), constr_lb.data(), constr_lb.size(), stream_view);
+  std::vector h_constr_ub(constr_ub.size());
+  raft::copy(h_constr_ub.data(), constr_ub.data(), constr_ub.size(), stream_view);
+  std::vector h_var_types(var_types.size());
+  raft::copy(h_var_types.data(), var_types.data(), var_types.size(), stream_view);
+
+  auto constr_bounds_empty = h_constr_lb.empty() && h_constr_ub.empty();
+  if (constr_bounds_empty) {
+    for (size_t i = 0; i < h_row_types.size(); ++i) {
+      if (h_row_types[i] == 'L') {
+        h_constr_lb.push_back(-std::numeric_limits::infinity());
+        h_constr_ub.push_back(h_bounds[i]);
+      } else if (h_row_types[i] == 'G') {
+        h_constr_lb.push_back(h_bounds[i]);
+        h_constr_ub.push_back(std::numeric_limits::infinity());
+      } else if (h_row_types[i] == 'E') {
+        h_constr_lb.push_back(h_bounds[i]);
+        h_constr_ub.push_back(h_bounds[i]);
+      }
+    }
+  }
+
+  builder.setNumCols(num_cols);
+  builder.setNumRows(num_rows);
+
+  builder.setObjAll(h_obj_coeffs);
+  builder.setObjOffset(op_problem.get_objective_offset());
+
+  if (!h_var_lb.empty() && !h_var_ub.empty()) {
+    builder.setColLbAll(h_var_lb);
+    builder.setColUbAll(h_var_ub);
+  }
+
+  for (size_t i = 0; i < h_var_types.size(); ++i) {
+    builder.setColIntegral(i, h_var_types[i] == var_t::INTEGER);
+  }
+
+  if (!h_constr_lb.empty() && !h_constr_ub.empty()) {
+    builder.setRowLhsAll(h_constr_lb);
+    builder.setRowRhsAll(h_constr_ub);
+  }
+
+  // Add constraints row by row
+  for (size_t i = 0; i < h_constr_lb.size(); ++i) {
+    // Get row entries
+    i_t row_start   = h_offsets[i];
+    i_t row_end     = h_offsets[i + 1];
+    i_t num_entries = row_end - row_start;
+    builder.addRowEntries(
+      i, num_entries, h_variables.data() + row_start, h_coefficients.data() + row_start);
+    builder.setRowLhsInf(i, h_constr_lb[i] == -std::numeric_limits::infinity());
+    builder.setRowRhsInf(i, h_constr_ub[i] == std::numeric_limits::infinity());
+    if (h_constr_lb[i] == -std::numeric_limits::infinity()) { builder.setRowLhs(i, 0); }
+    if (h_constr_ub[i] == std::numeric_limits::infinity()) { builder.setRowRhs(i, 0); }
+  }
+
+  for (size_t i = 0; i < h_var_lb.size(); ++i) {
+    builder.setColLbInf(i, h_var_lb[i] == -std::numeric_limits::infinity());
+    builder.setColUbInf(i, h_var_ub[i] == std::numeric_limits::infinity());
+    if (h_var_lb[i] == -std::numeric_limits::infinity()) { builder.setColLb(i, 0); }
+    if (h_var_ub[i] == std::numeric_limits::infinity()) { builder.setColUb(i, 0); }
+  }
+  return builder.build();
+}
+
+template 
+optimization_problem_t build_optimization_problem(
+  papilo::Problem const& papilo_problem, raft::handle_t const* handle_ptr)
+{
+  optimization_problem_t op_problem(handle_ptr);
+
+  auto obj = papilo_problem.getObjective();
+  op_problem.set_objective_offset(obj.offset);
+
+  if (papilo_problem.getNRows() == 0 && papilo_problem.getNCols() == 0) {
+    // FIXME: Shouldn't need to set offsets
+    std::vector h_offsets{0};
+    std::vector h_indices{};
+    std::vector h_values{};
+    op_problem.set_csr_constraint_matrix(h_values.data(),
+                                         h_values.size(),
+                                         h_indices.data(),
+                                         h_indices.size(),
+                                         h_offsets.data(),
+                                         h_offsets.size());
+
+    return op_problem;
+  }
+
+  op_problem.set_objective_coefficients(obj.coefficients.data(), obj.coefficients.size());
+
+  auto& constraint_matrix = papilo_problem.getConstraintMatrix();
+  auto row_lower          = constraint_matrix.getLeftHandSides();
+  auto row_upper          = constraint_matrix.getRightHandSides();
+  auto col_lower          = papilo_problem.getLowerBounds();
+  auto col_upper          = papilo_problem.getUpperBounds();
+
+  auto row_flags = constraint_matrix.getRowFlags();
+  for (size_t i = 0; i < row_flags.size(); i++) {
+    if (row_flags[i].test(papilo::RowFlag::kLhsInf)) {
+      row_lower[i] = -std::numeric_limits::infinity();
+    }
+    if (row_flags[i].test(papilo::RowFlag::kRhsInf)) {
+      row_upper[i] = std::numeric_limits::infinity();
+    }
+  }
+
+  op_problem.set_constraint_lower_bounds(row_lower.data(), row_lower.size());
+  op_problem.set_constraint_upper_bounds(row_upper.data(), row_upper.size());
+
+  auto [index_range, nrows] = constraint_matrix.getRangeInfo();
+
+  std::vector offsets(nrows + 1);
+  // papilo indices do not start from 0 after presolve
+  size_t start = index_range[0].start;
+  for (i_t i = 0; i < nrows; i++) {
+    offsets[i] = index_range[i].start - start;
+  }
+  offsets[nrows] = index_range[nrows - 1].end - start;
+
+  i_t nnz = constraint_matrix.getNnz();
+  assert(offsets[nrows] == nnz);
+
+  const int* cols   = constraint_matrix.getConstraintMatrix().getColumns();
+  const f_t* coeffs = constraint_matrix.getConstraintMatrix().getValues();
+  op_problem.set_csr_constraint_matrix(
+    &(coeffs[start]), nnz, &(cols[start]), nnz, offsets.data(), nrows + 1);
+
+  auto col_flags = papilo_problem.getColFlags();
+  std::vector var_types(col_flags.size());
+  for (size_t i = 0; i < col_flags.size(); i++) {
+    var_types[i] =
+      col_flags[i].test(papilo::ColFlag::kIntegral) ? var_t::INTEGER : var_t::CONTINUOUS;
+    if (col_flags[i].test(papilo::ColFlag::kLbInf)) {
+      col_lower[i] = -std::numeric_limits::infinity();
+    }
+    if (col_flags[i].test(papilo::ColFlag::kUbInf)) {
+      col_upper[i] = std::numeric_limits::infinity();
+    }
+  }
+
+  op_problem.set_variable_lower_bounds(col_lower.data(), col_lower.size());
+  op_problem.set_variable_upper_bounds(col_upper.data(), col_upper.size());
+  op_problem.set_variable_types(var_types.data(), var_types.size());
+
+  return op_problem;
+}
+
+void check_presolve_status(const papilo::PresolveStatus& status)
+{
+  switch (status) {
+    case papilo::PresolveStatus::kUnchanged:
+      CUOPT_LOG_INFO("Presolve status:: did not result in any changes");
+      break;
+    case papilo::PresolveStatus::kReduced:
+      CUOPT_LOG_INFO("Presolve status:: reduced the problem");
+      break;
+    case papilo::PresolveStatus::kUnbndOrInfeas:
+      CUOPT_LOG_INFO("Presolve status:: found an unbounded or infeasible problem");
+      break;
+    case papilo::PresolveStatus::kInfeasible:
+      CUOPT_LOG_INFO("Presolve status:: found an infeasible problem");
+      break;
+    case papilo::PresolveStatus::kUnbounded:
+      CUOPT_LOG_INFO("Presolve status:: found an unbounded problem");
+      break;
+  }
+}
+
+void check_postsolve_status(const papilo::PostsolveStatus& status)
+{
+  switch (status) {
+    case papilo::PostsolveStatus::kOk: CUOPT_LOG_INFO("Post-solve status:: succeeded"); break;
+    case papilo::PostsolveStatus::kFailed: CUOPT_LOG_INFO("Post-solve status:: failed"); break;
+  }
+}
+
+template 
+void set_presolve_methods(papilo::Presolve& presolver, problem_category_t category)
+{
+  using uptr = std::unique_ptr>;
+
+  // fast presolvers
+  presolver.addPresolveMethod(uptr(new papilo::SingletonCols()));
+  presolver.addPresolveMethod(uptr(new papilo::CoefficientStrengthening()));
+  presolver.addPresolveMethod(uptr(new papilo::ConstraintPropagation()));
+
+  // medium presolvers
+  presolver.addPresolveMethod(uptr(new papilo::FixContinuous()));
+  presolver.addPresolveMethod(uptr(new papilo::SimpleProbing()));
+  presolver.addPresolveMethod(uptr(new papilo::ParallelRowDetection()));
+  presolver.addPresolveMethod(uptr(new papilo::ParallelColDetection()));
+  // FIXME: Postsolve fails with this method
+  // presolver.addPresolveMethod(uptr(new papilo::SingletonStuffing()));
+  presolver.addPresolveMethod(uptr(new papilo::DualFix()));
+  presolver.addPresolveMethod(uptr(new papilo::SimplifyInequalities()));
+
+  // exhaustive presolvers
+  presolver.addPresolveMethod(uptr(new papilo::ImplIntDetection()));
+  presolver.addPresolveMethod(uptr(new papilo::DominatedCols()));
+  presolver.addPresolveMethod(uptr(new papilo::Probing()));
+
+  presolver.addPresolveMethod(uptr(new papilo::DualInfer));
+  presolver.addPresolveMethod(uptr(new papilo::SimpleSubstitution()));
+  presolver.addPresolveMethod(uptr(new papilo::Sparsify()));
+  presolver.addPresolveMethod(uptr(new papilo::Substitution()));
+}
+
+template 
+void set_presolve_options(papilo::Presolve& presolver,
+                          problem_category_t category,
+                          f_t absolute_tolerance,
+                          double time_limit)
+{
+  presolver.getPresolveOptions().tlim    = time_limit;
+  presolver.getPresolveOptions().epsilon = absolute_tolerance;
+  presolver.getPresolveOptions().feastol = absolute_tolerance;
+}
+
+template 
+std::pair, bool> third_party_presolve_t::apply(
+  optimization_problem_t const& op_problem,
+  problem_category_t category,
+  f_t absolute_tolerance,
+  double time_limit)
+{
+  cuopt_expects(
+    presolve_calls_ == 0, error_type_t::ValidationError, "Presolve can only be called once");
+  presolve_calls_++;
+
+  papilo::Problem papilo_problem = build_papilo_problem(op_problem);
+
+  CUOPT_LOG_INFO("Unpresolved problem:: %d constraints, %d variables, %d nonzeros",
+                 papilo_problem.getNRows(),
+                 papilo_problem.getNCols(),
+                 papilo_problem.getConstraintMatrix().getNnz());
+
+  papilo::Presolve presolver;
+  set_presolve_methods(presolver, category);
+  set_presolve_options(presolver, category, absolute_tolerance, time_limit);
+
+  // Disable papilo logs
+  presolver.setVerbosityLevel(papilo::VerbosityLevel::kQuiet);
+
+  auto result = presolver.apply(papilo_problem);
+  check_presolve_status(result.status);
+  if (result.status == papilo::PresolveStatus::kInfeasible ||
+      result.status == papilo::PresolveStatus::kUnbndOrInfeas) {
+    --presolve_calls_;
+    return std::make_pair(optimization_problem_t(op_problem.get_handle_ptr()), false);
+  }
+  post_solve_storage_ = result.postsolve;
+  CUOPT_LOG_INFO("Presolve removed:: %d constraints, %d variables, %d nonzeros",
+                 op_problem.get_n_constraints() - papilo_problem.getNRows(),
+                 op_problem.get_n_variables() - papilo_problem.getNCols(),
+                 op_problem.get_nnz() - papilo_problem.getConstraintMatrix().getNnz());
+  CUOPT_LOG_INFO("Presolved problem:: %d constraints, %d variables, %d nonzeros",
+                 papilo_problem.getNRows(),
+                 papilo_problem.getNCols(),
+                 papilo_problem.getConstraintMatrix().getNnz());
+
+  return std::make_pair(
+    build_optimization_problem(papilo_problem, op_problem.get_handle_ptr()), true);
+}
+
+template 
+void third_party_presolve_t::undo(rmm::device_uvector& primal_solution,
+                                            rmm::device_uvector& dual_solution,
+                                            rmm::device_uvector& reduced_costs,
+                                            problem_category_t category,
+                                            bool status_to_skip,
+                                            rmm::cuda_stream_view stream_view)
+{
+  --presolve_calls_;
+  cuopt_expects(
+    presolve_calls_ == 0, error_type_t::ValidationError, "Postsolve can only be called once");
+  if (status_to_skip) { return; }
+  std::vector primal_sol_vec_h(primal_solution.size());
+  raft::copy(primal_sol_vec_h.data(), primal_solution.data(), primal_solution.size(), stream_view);
+  std::vector dual_sol_vec_h(dual_solution.size());
+  raft::copy(dual_sol_vec_h.data(), dual_solution.data(), dual_solution.size(), stream_view);
+  std::vector reduced_costs_vec_h(reduced_costs.size());
+  raft::copy(reduced_costs_vec_h.data(), reduced_costs.data(), reduced_costs.size(), stream_view);
+
+  papilo::Solution reduced_sol(primal_sol_vec_h);
+  papilo::Solution full_sol;
+
+  papilo::Message Msg{};
+  Msg.setVerbosityLevel(papilo::VerbosityLevel::kQuiet);
+  papilo::Postsolve post_solver{Msg, post_solve_storage_.getNum()};
+
+  bool is_optimal = false;
+  auto status     = post_solver.undo(reduced_sol, full_sol, post_solve_storage_, is_optimal);
+  check_postsolve_status(status);
+
+  primal_solution.resize(full_sol.primal.size(), stream_view);
+  dual_solution.resize(full_sol.primal.size(), stream_view);
+  reduced_costs.resize(full_sol.primal.size(), stream_view);
+  raft::copy(primal_solution.data(), full_sol.primal.data(), full_sol.primal.size(), stream_view);
+}
+
+#if MIP_INSTANTIATE_FLOAT
+template class third_party_presolve_t;
+#endif
+
+#if MIP_INSTANTIATE_DOUBLE
+template class third_party_presolve_t;
+#endif
+
+}  // namespace cuopt::linear_programming::detail
diff --git a/cpp/src/mip/presolve/third_party_presolve.hpp b/cpp/src/mip/presolve/third_party_presolve.hpp
new file mode 100644
index 000000000..19a2c71cc
--- /dev/null
+++ b/cpp/src/mip/presolve/third_party_presolve.hpp
@@ -0,0 +1,43 @@
+/*
+ * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include 
+
+namespace cuopt::linear_programming::detail {
+
+template 
+class third_party_presolve_t {
+ public:
+  third_party_presolve_t() = default;
+
+  std::pair, bool> apply(
+    optimization_problem_t const& op_problem,
+    problem_category_t category,
+    f_t absolute_tolerance,
+    double time_limit);
+
+  void undo(rmm::device_uvector& primal_solution,
+            rmm::device_uvector& dual_solution,
+            rmm::device_uvector& reduced_costs,
+            problem_category_t category,
+            bool status_to_skip,
+            rmm::cuda_stream_view stream_view);
+};
+
+}  // namespace cuopt::linear_programming::detail
diff --git a/cpp/src/mip/solution/solution.cu b/cpp/src/mip/solution/solution.cu
index b3a7f6dbb..cabb0edda 100644
--- a/cpp/src/mip/solution/solution.cu
+++ b/cpp/src/mip/solution/solution.cu
@@ -562,7 +562,8 @@ f_t solution_t::compute_max_variable_violation()
 // returns the solution after applying the conversions
 template 
 mip_solution_t solution_t::get_solution(bool output_feasible,
-                                                            solver_stats_t stats)
+                                                            solver_stats_t stats,
+                                                            bool log_stats)
 {
   cuopt::default_logger().flush();
   cuopt_expects(
@@ -581,22 +582,23 @@ mip_solution_t solution_t::get_solution(bool output_feasible
     i_t num_nodes                    = stats.num_nodes;
     i_t num_simplex_iterations       = stats.num_simplex_iterations;
     handle_ptr->sync_stream();
-    CUOPT_LOG_INFO(
-      "Solution objective: %f , relative_mip_gap %f solution_bound %f presolve_time %f "
-      "total_solve_time %f "
-      "max constraint violation %f max int violation %f max var bounds violation %f "
-      "nodes %d simplex_iterations %d",
-      h_user_obj,
-      rel_mip_gap,
-      solution_bound,
-      presolve_time,
-      total_solve_time,
-      max_constraint_violation,
-      max_int_violation,
-      max_variable_bound_violation,
-      num_nodes,
-      num_simplex_iterations);
-
+    if (log_stats) {
+      CUOPT_LOG_INFO(
+        "Solution objective: %f , relative_mip_gap %f solution_bound %f presolve_time %f "
+        "total_solve_time %f "
+        "max constraint violation %f max int violation %f max var bounds violation %f "
+        "nodes %d simplex_iterations %d",
+        h_user_obj,
+        rel_mip_gap,
+        solution_bound,
+        presolve_time,
+        total_solve_time,
+        max_constraint_violation,
+        max_int_violation,
+        max_variable_bound_violation,
+        num_nodes,
+        num_simplex_iterations);
+    }
     const bool not_optimal = rel_mip_gap > problem_ptr->tolerances.relative_mip_gap &&
                              abs_mip_gap > problem_ptr->tolerances.absolute_mip_gap;
     auto term_reason =
diff --git a/cpp/src/mip/solution/solution.cuh b/cpp/src/mip/solution/solution.cuh
index 729a5c0e5..0774bdef2 100644
--- a/cpp/src/mip/solution/solution.cuh
+++ b/cpp/src/mip/solution/solution.cuh
@@ -100,7 +100,9 @@ class solution_t {
   f_t get_total_excess();
   // brings all vars within bounds
   void clamp_within_bounds();
-  mip_solution_t get_solution(bool output_feasible, solver_stats_t stats);
+  mip_solution_t get_solution(bool output_feasible,
+                                        solver_stats_t stats,
+                                        bool log_stats = true);
   f_t compute_max_constraint_violation();
   f_t compute_max_int_violation();
   f_t compute_max_variable_violation();
diff --git a/cpp/src/mip/solve.cu b/cpp/src/mip/solve.cu
index 841770c4d..7071c33fe 100644
--- a/cpp/src/mip/solve.cu
+++ b/cpp/src/mip/solve.cu
@@ -18,6 +18,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -65,17 +66,9 @@ static void setup_device_symbols(rmm::cuda_stream_view stream_view)
 
 template 
 mip_solution_t run_mip(detail::problem_t& problem,
-                                 mip_solver_settings_t const& settings)
+                                 mip_solver_settings_t const& settings,
+                                 cuopt::timer_t& timer)
 {
-  const f_t time_limit =
-    settings.time_limit == 0 ? std::numeric_limits::max() : settings.time_limit;
-  if (settings.heuristics_only && time_limit == std::numeric_limits::max()) {
-    CUOPT_LOG_ERROR("Time limit cannot be infinity when heuristics only is set");
-    cuopt_expects(false,
-                  error_type_t::RuntimeError,
-                  "Time limit cannot be infinity when heuristics only is set");
-  }
-  auto timer                       = cuopt::timer_t(time_limit);
   auto constexpr const running_mip = true;
 
   pdlp_hyper_params::update_primal_weight_on_initial_solution = false;
@@ -96,7 +89,7 @@ mip_solution_t run_mip(detail::problem_t& problem,
     solution.compute_objective();  // just to ensure h_user_obj is set
     auto stats           = solver_stats_t{};
     stats.solution_bound = solution.get_user_objective();
-    return solution.get_solution(true, stats);
+    return solution.get_solution(true, stats, false);
   }
   // problem contains unpreprocessed data
   detail::problem_t scaled_problem(problem);
@@ -151,8 +144,8 @@ mip_solution_t run_mip(detail::problem_t& problem,
       "please provide a more numerically stable problem.");
   }
 
-  auto sol = scaled_sol.get_solution(is_feasible_before_scaling || is_feasible_after_unscaling,
-                                     solver.get_solver_stats());
+  auto sol = scaled_sol.get_solution(
+    is_feasible_before_scaling || is_feasible_after_unscaling, solver.get_solver_stats(), false);
   detail::print_solution(scaled_problem.handle_ptr, sol.get_solution());
   return sol;
 }
@@ -162,6 +155,15 @@ mip_solution_t solve_mip(optimization_problem_t& op_problem,
                                    mip_solver_settings_t const& settings)
 {
   try {
+    const f_t time_limit =
+      settings.time_limit == 0 ? std::numeric_limits::max() : settings.time_limit;
+    if (settings.heuristics_only && time_limit == std::numeric_limits::max()) {
+      CUOPT_LOG_ERROR("Time limit cannot be infinity when heuristics only is set");
+      cuopt_expects(false,
+                    error_type_t::RuntimeError,
+                    "Time limit cannot be infinity when heuristics only is set");
+    }
+
     // Create log stream for file logging and add it to default logger
     init_logger_t log(settings.log_file, settings.log_to_console);
     // Init libraies before to not include it in solve time
@@ -174,8 +176,38 @@ mip_solution_t solve_mip(optimization_problem_t& op_problem,
     problem_checking_t::check_problem_representation(op_problem);
     problem_checking_t::check_initial_solution_representation(op_problem, settings);
 
-    // have solve, problem, solution, utils etc. in common dir
+    auto timer = cuopt::timer_t(time_limit);
+
+    double presolve_time = 0.0;
+    std::unique_ptr> presolver;
     detail::problem_t problem(op_problem, settings.get_tolerances());
+
+    auto run_presolve = settings.presolve;
+    run_presolve      = run_presolve && op_problem.get_sense() == false;
+    run_presolve      = run_presolve && settings.get_mip_callbacks().empty();
+
+    if (!run_presolve) { CUOPT_LOG_INFO("Presolve is disabled, skipping"); }
+
+    if (run_presolve) {
+      // allocate not more than 10% of the time limit to presolve.
+      // Note that this is not the presolve time, but the time limit for presolve.
+      const double presolve_time_limit = 0.1 * time_limit;
+      presolver = std::make_unique>();
+      auto [reduced_op_problem, feasible] =
+        presolver->apply(op_problem,
+                         cuopt::linear_programming::problem_category_t::MIP,
+                         settings.tolerances.absolute_tolerance,
+                         presolve_time_limit);
+      if (!feasible) {
+        return mip_solution_t(mip_termination_status_t::Infeasible,
+                                        solver_stats_t{},
+                                        op_problem.get_handle_ptr()->get_stream());
+      }
+
+      problem       = detail::problem_t(reduced_op_problem);
+      presolve_time = timer.elapsed_time();
+      CUOPT_LOG_INFO("Third party presolve time: %f", presolve_time);
+    }
     if (settings.user_problem_file != "") {
       CUOPT_LOG_INFO("Writing user problem to file: %s", settings.user_problem_file.c_str());
       problem.write_as_mps(settings.user_problem_file);
@@ -184,13 +216,53 @@ mip_solution_t solve_mip(optimization_problem_t& op_problem,
     // this is for PDLP, i think this should be part of pdlp solver
     setup_device_symbols(op_problem.get_handle_ptr()->get_stream());
 
-    auto sol = run_mip(problem, settings);
+    auto sol = run_mip(problem, settings, timer);
+
+    if (run_presolve) {
+      auto status_to_skip = sol.get_termination_status() == mip_termination_status_t::TimeLimit ||
+                            sol.get_termination_status() == mip_termination_status_t::Infeasible;
+      auto primal_solution =
+        cuopt::device_copy(sol.get_solution(), op_problem.get_handle_ptr()->get_stream());
+      rmm::device_uvector dual_solution(0, op_problem.get_handle_ptr()->get_stream());
+      rmm::device_uvector reduced_costs(0, op_problem.get_handle_ptr()->get_stream());
+      presolver->undo(primal_solution,
+                      dual_solution,
+                      reduced_costs,
+                      cuopt::linear_programming::problem_category_t::MIP,
+                      status_to_skip,
+                      op_problem.get_handle_ptr()->get_stream());
+      if (!status_to_skip) {
+        thrust::fill(rmm::exec_policy(op_problem.get_handle_ptr()->get_stream()),
+                     dual_solution.data(),
+                     dual_solution.data() + dual_solution.size(),
+                     std::numeric_limits::signaling_NaN());
+        thrust::fill(rmm::exec_policy(op_problem.get_handle_ptr()->get_stream()),
+                     reduced_costs.data(),
+                     reduced_costs.data() + reduced_costs.size(),
+                     std::numeric_limits::signaling_NaN());
+        detail::problem_t full_problem(op_problem);
+        detail::solution_t full_sol(full_problem);
+        full_sol.copy_new_assignment(cuopt::host_copy(primal_solution));
+        full_sol.compute_feasibility();
+        if (!full_sol.get_feasible()) {
+          CUOPT_LOG_WARN("The solution is not feasible after post solve");
+        }
+
+        auto full_stats = sol.get_stats();
+        // add third party presolve time to cuopt presolve time
+        full_stats.presolve_time += presolve_time;
+
+        // FIXME:: reduced_solution.get_stats() is not correct, we need to compute the stats for the
+        // full problem
+        full_sol.post_process_completed = true;  // hack
+        sol                             = full_sol.get_solution(true, full_stats);
+      }
+    }
 
     if (settings.sol_file != "") {
       CUOPT_LOG_INFO("Writing solution to file %s", settings.sol_file.c_str());
       sol.write_to_sol_file(settings.sol_file, op_problem.get_handle_ptr()->get_stream());
     }
-
     return sol;
   } catch (const cuopt::logic_error& e) {
     CUOPT_LOG_ERROR("Error in solve_mip: %s", e.what());
diff --git a/cpp/src/mip/solver_solution.cu b/cpp/src/mip/solver_solution.cu
index a6761aaff..f1f00dc80 100644
--- a/cpp/src/mip/solver_solution.cu
+++ b/cpp/src/mip/solver_solution.cu
@@ -177,6 +177,12 @@ f_t mip_solution_t::get_max_variable_bound_violation() const
   return max_variable_bound_violation_;
 }
 
+template 
+solver_stats_t mip_solution_t::get_stats() const
+{
+  return stats_;
+}
+
 template 
 i_t mip_solution_t::get_num_nodes() const
 {
@@ -223,6 +229,20 @@ void mip_solution_t::write_to_sol_file(std::string_view filename,
     std::string(filename), status, objective_value, var_names, solution);
 }
 
+template 
+void mip_solution_t::log_summary() const
+{
+  CUOPT_LOG_INFO("Termination Status: {}", get_termination_status_string());
+  CUOPT_LOG_INFO("Objective Value: %f", get_objective_value());
+  CUOPT_LOG_INFO("Max constraint violation: %f", get_max_constraint_violation());
+  CUOPT_LOG_INFO("Max integer violation: %f", get_max_int_violation());
+  CUOPT_LOG_INFO("Max variable bound violation: %f", get_max_variable_bound_violation());
+  CUOPT_LOG_INFO("MIP Gap: %f", get_mip_gap());
+  CUOPT_LOG_INFO("Solution Bound: %f", get_solution_bound());
+  CUOPT_LOG_INFO("Presolve Time: %f", get_presolve_time());
+  CUOPT_LOG_INFO("Total Solve Time: %f", get_total_solve_time());
+}
+
 #if MIP_INSTANTIATE_FLOAT
 template class mip_solution_t;
 #endif
diff --git a/cpp/src/utilities/copy_helpers.hpp b/cpp/src/utilities/copy_helpers.hpp
index 611e7811a..78593d3e1 100644
--- a/cpp/src/utilities/copy_helpers.hpp
+++ b/cpp/src/utilities/copy_helpers.hpp
@@ -114,6 +114,23 @@ auto host_copy(rmm::device_uvector const& device_vec, rmm::cuda_stream_view s
   return host_copy(device_vec.data(), device_vec.size(), stream_view);
 }
 
+/**
+ * @brief Simple utility function to copy std::vector to device
+ *
+ * @tparam T
+ * @param[in] device_vec
+ * @param[in] stream_view
+ * @return device_vec
+ */
+template 
+inline rmm::device_uvector device_copy(rmm::device_uvector const& device_vec,
+                                          rmm::cuda_stream_view stream_view)
+{
+  rmm::device_uvector device_vec_copy(device_vec.size(), stream_view);
+  raft::copy(device_vec_copy.data(), device_vec.data(), device_vec.size(), stream_view);
+  return device_vec_copy;
+}
+
 /**
  * @brief Simple utility function to copy std::vector to device
  *
diff --git a/cpp/tests/CMakeLists.txt b/cpp/tests/CMakeLists.txt
index 50323dc7e..6e413319b 100644
--- a/cpp/tests/CMakeLists.txt
+++ b/cpp/tests/CMakeLists.txt
@@ -33,6 +33,7 @@ target_link_libraries(cuopttestutils
     cuopt
     GTest::gmock
     GTest::gtest
+    papilo-core
 )
 
 set(CUOPT_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR})
@@ -49,7 +50,7 @@ function(ConfigureTest CMAKE_TEST_NAME)
     )
 
     target_link_libraries(${CMAKE_TEST_NAME}
-        PRIVATE
+       PRIVATE
         mps_parser
         cuopt
         cuopttestutils
diff --git a/cpp/tests/distance_engine/waypoint_matrix_test.cpp b/cpp/tests/distance_engine/waypoint_matrix_test.cpp
index d574b7c0e..402b608a4 100644
--- a/cpp/tests/distance_engine/waypoint_matrix_test.cpp
+++ b/cpp/tests/distance_engine/waypoint_matrix_test.cpp
@@ -71,7 +71,7 @@ class waypoint_matrix_waypoints_sequence_test_t
     raft::copy(h_cost_matrix.data(), d_cost_matrix.data(), h_cost_matrix.size(), stream);
     RAFT_CUDA_TRY(cudaStreamSynchronize(stream));
 
-    for (i_t i = 0; i != h_cost_matrix.size(); ++i)
+    for (size_t i = 0; i != h_cost_matrix.size(); ++i)
       EXPECT_EQ(h_cost_matrix[i], expected_cost_matrix[i]);
 
     auto [d_sequence_offsets, d_full_path] =
@@ -90,9 +90,9 @@ class waypoint_matrix_waypoints_sequence_test_t
     raft::copy(h_full_path.data(), (i_t*)d_full_path.get()->data(), h_full_path.size(), stream);
     RAFT_CUDA_TRY(cudaStreamSynchronize(stream));
 
-    for (i_t i = 0; i != h_sequence_offsets.size(); ++i)
+    for (size_t i = 0; i != h_sequence_offsets.size(); ++i)
       EXPECT_EQ(h_sequence_offsets[i], expected_sequence_offsets[i]);
-    for (i_t i = 0; i != h_full_path.size(); ++i)
+    for (size_t i = 0; i != h_full_path.size(); ++i)
       EXPECT_EQ(h_full_path[i], expected_full_path[i]);
   }
 
@@ -166,7 +166,7 @@ class waypoint_matrix_shortest_path_cost_t
     raft::copy(h_custom_matrix.data(), d_custom_matrix.data(), h_custom_matrix.size(), stream);
     RAFT_CUDA_TRY(cudaStreamSynchronize(stream));
 
-    for (i_t i = 0; i != h_custom_matrix.size(); ++i)
+    for (size_t i = 0; i != h_custom_matrix.size(); ++i)
       EXPECT_EQ(h_custom_matrix[i], ref_custom_matrix[i]);
   }
 
@@ -219,7 +219,7 @@ class waypoint_matrix_cost_matrix_test_t
     raft::copy(h_cost_matrix.data(), d_cost_matrix.data(), h_cost_matrix.size(), stream);
     RAFT_CUDA_TRY(cudaStreamSynchronize(stream));
 
-    for (i_t i = 0; i != h_cost_matrix.size(); ++i)
+    for (size_t i = 0; i != h_cost_matrix.size(); ++i)
       EXPECT_NEAR(h_cost_matrix[i], this->ref_cost_matrix[i], 0.001f);
   }
 
diff --git a/cpp/tests/distance_engine/waypoint_matrix_test.hpp b/cpp/tests/distance_engine/waypoint_matrix_test.hpp
index 239039ae2..59db9554f 100644
--- a/cpp/tests/distance_engine/waypoint_matrix_test.hpp
+++ b/cpp/tests/distance_engine/waypoint_matrix_test.hpp
@@ -38,7 +38,7 @@ std::vector parse_vector(std::vector const& vect)
 {
   std::vector out(vect.size());
 
-  for (auto i = 0; i != vect.size(); ++i) {
+  for (size_t i = 0; i != vect.size(); ++i) {
     if constexpr (std::is_same_v)
       out[i] = std::stoi(vect[i]);
     else if constexpr (std::is_same_v)
diff --git a/cpp/tests/dual_simplex/unit_tests/solve.cpp b/cpp/tests/dual_simplex/unit_tests/solve.cpp
index 0743c08d7..923ad8c90 100644
--- a/cpp/tests/dual_simplex/unit_tests/solve.cpp
+++ b/cpp/tests/dual_simplex/unit_tests/solve.cpp
@@ -87,7 +87,6 @@ TEST(dual_simplex, chess_set)
   user_problem.var_types[0] = dual_simplex::variable_type_t::CONTINUOUS;
   user_problem.var_types[1] = dual_simplex::variable_type_t::CONTINUOUS;
 
-  double start_time = dual_simplex::tic();
   dual_simplex::simplex_solver_settings_t settings;
   dual_simplex::lp_solution_t solution(user_problem.num_rows, user_problem.num_cols);
   EXPECT_EQ((dual_simplex::solve_linear_program(user_problem, settings, solution)),
diff --git a/cpp/tests/examples/routing/CMakeLists.txt b/cpp/tests/examples/routing/CMakeLists.txt
index 52bc3e682..3b29d259d 100644
--- a/cpp/tests/examples/routing/CMakeLists.txt
+++ b/cpp/tests/examples/routing/CMakeLists.txt
@@ -48,5 +48,6 @@ foreach(target
       cuopt
       cuopttestutils
       OpenMP::OpenMP_CXX
+      papilo-core
   )
 endforeach()
diff --git a/cpp/tests/linear_programming/pdlp_test.cu b/cpp/tests/linear_programming/pdlp_test.cu
index c15d9d6d9..dbeb5beda 100644
--- a/cpp/tests/linear_programming/pdlp_test.cu
+++ b/cpp/tests/linear_programming/pdlp_test.cu
@@ -209,7 +209,8 @@ TEST(pdlp_class, run_sub_mittleman)
     cuopt::mps_parser::mps_data_model_t op_problem =
       cuopt::mps_parser::parse_mps(path);
 
-    // Testing for each solver_mode is ok as it's parsing that is the bottleneck here, not solving
+    // Testing for each solver_mode is ok as it's parsing that is the bottleneck here, not
+    // solving
     auto solver_mode_list = {
       cuopt::linear_programming::pdlp_solver_mode_t::Stable2,
       cuopt::linear_programming::pdlp_solver_mode_t::Methodical1,
@@ -218,7 +219,6 @@ TEST(pdlp_class, run_sub_mittleman)
     for (auto solver_mode : solver_mode_list) {
       auto settings             = pdlp_solver_settings_t{};
       settings.pdlp_solver_mode = solver_mode;
-      settings.method           = cuopt::linear_programming::method_t::PDLP;
       const raft::handle_t handle_{};
       optimization_problem_solution_t solution =
         solve_lp(&handle_, op_problem, settings);
diff --git a/cpp/tests/linear_programming/utilities/pdlp_test_utilities.cuh b/cpp/tests/linear_programming/utilities/pdlp_test_utilities.cuh
index 190c0e751..7a624e023 100644
--- a/cpp/tests/linear_programming/utilities/pdlp_test_utilities.cuh
+++ b/cpp/tests/linear_programming/utilities/pdlp_test_utilities.cuh
@@ -69,7 +69,8 @@ static void test_objective_sanity(
 static void test_constraint_sanity(
   const cuopt::mps_parser::mps_data_model_t& op_problem,
   const optimization_problem_solution_t& solution,
-  double epsilon = tolerance)
+  double epsilon        = tolerance,
+  bool presolve_enabled = true)
 {
   const std::vector primal_vars              = host_copy(solution.get_primal_solution());
   const std::vector& values                  = op_problem.get_constraint_matrix_values();
@@ -82,51 +83,53 @@ static void test_constraint_sanity(
   std::vector residual(solution.get_dual_solution().size(), 0.0);
   std::vector viol(solution.get_dual_solution().size(), 0.0);
 
-  // CSR SpMV
-  for (size_t i = 0; i < offsets.size() - 1; ++i) {
-    for (int j = offsets[i]; j < offsets[i + 1]; ++j) {
-      residual[i] += values[j] * primal_vars[indices[j]];
+  if (!presolve_enabled) {
+    // CSR SpMV
+    for (size_t i = 0; i < offsets.size() - 1; ++i) {
+      for (int j = offsets[i]; j < offsets[i + 1]; ++j) {
+        residual[i] += values[j] * primal_vars[indices[j]];
+      }
     }
-  }
 
-  auto functor = cuopt::linear_programming::detail::violation{};
+    auto functor = cuopt::linear_programming::detail::violation{};
 
-  // Compute violation to lower/upper bound
+    // Compute violation to lower/upper bound
 
-  // std::transform can't take 3 inputs
-  for (size_t i = 0; i < residual.size(); ++i) {
-    viol[i] = functor(residual[i], constraint_lower_bounds[i], constraint_upper_bounds[i]);
-  }
+    // std::transform can't take 3 inputs
+    for (size_t i = 0; i < residual.size(); ++i) {
+      viol[i] = functor(residual[i], constraint_lower_bounds[i], constraint_upper_bounds[i]);
+    }
 
-  // Compute the l2 primal residual
-  double l2_primal_residual = std::accumulate(
-    viol.cbegin(), viol.cend(), 0.0, [](double acc, double val) { return acc + val * val; });
-  l2_primal_residual = std::sqrt(l2_primal_residual);
+    // Compute the l2 primal residual
+    double l2_primal_residual = std::accumulate(
+      viol.cbegin(), viol.cend(), 0.0, [](double acc, double val) { return acc + val * val; });
+    l2_primal_residual = std::sqrt(l2_primal_residual);
 
-  EXPECT_NEAR(l2_primal_residual,
-              solution.get_additional_termination_information().l2_primal_residual,
-              epsilon);
+    EXPECT_NEAR(l2_primal_residual,
+                solution.get_additional_termination_information().l2_primal_residual,
+                epsilon);
 
-  // Check if primal residual is indeed respecting the default tolerance
-  pdlp_solver_settings_t solver_settings = pdlp_solver_settings_t{};
+    // Check if primal residual is indeed respecting the default tolerance
+    pdlp_solver_settings_t solver_settings = pdlp_solver_settings_t{};
 
-  std::vector combined_bounds(constraint_lower_bounds.size());
+    std::vector combined_bounds(constraint_lower_bounds.size());
 
-  std::transform(constraint_lower_bounds.cbegin(),
-                 constraint_lower_bounds.cend(),
-                 constraint_upper_bounds.cbegin(),
-                 combined_bounds.begin(),
-                 cuopt::linear_programming::detail::combine_finite_abs_bounds{});
+    std::transform(constraint_lower_bounds.cbegin(),
+                   constraint_lower_bounds.cend(),
+                   constraint_upper_bounds.cbegin(),
+                   combined_bounds.begin(),
+                   cuopt::linear_programming::detail::combine_finite_abs_bounds{});
 
-  double l2_norm_primal_right_hand_side = std::accumulate(
-    combined_bounds.cbegin(), combined_bounds.cend(), 0.0, [](double acc, double val) {
-      return acc + val * val;
-    });
-  l2_norm_primal_right_hand_side = std::sqrt(l2_norm_primal_right_hand_side);
+    double l2_norm_primal_right_hand_side = std::accumulate(
+      combined_bounds.cbegin(), combined_bounds.cend(), 0.0, [](double acc, double val) {
+        return acc + val * val;
+      });
+    l2_norm_primal_right_hand_side = std::sqrt(l2_norm_primal_right_hand_side);
 
-  EXPECT_TRUE(l2_primal_residual <= solver_settings.tolerances.absolute_primal_tolerance +
-                                      solver_settings.tolerances.relative_primal_tolerance *
-                                        l2_norm_primal_right_hand_side);
+    EXPECT_TRUE(l2_primal_residual <= solver_settings.tolerances.absolute_primal_tolerance +
+                                        solver_settings.tolerances.relative_primal_tolerance *
+                                          l2_norm_primal_right_hand_side);
+  }
 
   // Checking variable bounds
 
diff --git a/cpp/tests/mip/integer_with_real_bounds.cu b/cpp/tests/mip/integer_with_real_bounds.cu
index 0991a0f2a..530514c7b 100644
--- a/cpp/tests/mip/integer_with_real_bounds.cu
+++ b/cpp/tests/mip/integer_with_real_bounds.cu
@@ -26,8 +26,12 @@
 namespace cuopt::linear_programming::test {
 TEST(mip_solve, integer_with_real_bounds_test)
 {
-  auto [termination_status, obj_val, lb] = test_mps_file("mip/integer-with-real-bounds.mps");
+  auto time_limit      = 1;
+  auto heuristics_only = true;
+  auto presolve        = false;
+  auto [termination_status, obj_val, lb] =
+    test_mps_file("mip/integer-with-real-bounds.mps", time_limit, heuristics_only, presolve);
   EXPECT_EQ(termination_status, mip_termination_status_t::Optimal);
   EXPECT_NEAR(obj_val, 4, 1e-5);
 }
-}  // namespace cuopt::linear_programming::test
\ No newline at end of file
+}  // namespace cuopt::linear_programming::test
diff --git a/cpp/tests/mip/mip_utils.cuh b/cpp/tests/mip/mip_utils.cuh
index ffece118e..b53952e12 100644
--- a/cpp/tests/mip/mip_utils.cuh
+++ b/cpp/tests/mip/mip_utils.cuh
@@ -112,7 +112,10 @@ static void test_constraint_sanity_per_row(
 }
 
 static std::tuple test_mps_file(
-  std::string test_instance, double time_limit = 1, bool heuristics_only = true)
+  std::string test_instance,
+  double time_limit    = 1,
+  bool heuristics_only = true,
+  bool presolve        = true)
 {
   const raft::handle_t handle_{};
 
@@ -123,6 +126,7 @@ static std::tuple test_mps_file(
   mip_solver_settings_t settings;
   settings.time_limit                  = time_limit;
   settings.heuristics_only             = heuristics_only;
+  settings.presolve                    = presolve;
   mip_solution_t solution = solve_mip(&handle_, problem, settings);
   return std::make_tuple(solution.get_termination_status(),
                          solution.get_objective_value(),
diff --git a/cpp/tests/mip/unit_test.cu b/cpp/tests/mip/unit_test.cu
index e87efd860..b7eb24222 100644
--- a/cpp/tests/mip/unit_test.cu
+++ b/cpp/tests/mip/unit_test.cu
@@ -140,6 +140,7 @@ TEST(LPTest, TestSampleLP)
   cuopt::linear_programming::pdlp_solver_settings_t settings{};
   settings.set_optimality_tolerance(1e-4);
   settings.time_limit = 5;
+  settings.presolve   = false;
 
   auto result = cuopt::linear_programming::solve_lp(&handle, problem, settings);
 
@@ -154,6 +155,8 @@ TEST(ErrorTest, TestError)
 
   cuopt::linear_programming::mip_solver_settings_t settings{};
   settings.time_limit = 5;
+  settings.presolve   = false;
+
   // Set constraint bounds
   std::vector lower_bounds = {1.0};
   std::vector upper_bounds = {0.0};
@@ -184,6 +187,7 @@ TEST_P(MILPTestParams, TestSampleMILP)
   settings.time_limit      = 5;
   settings.mip_scaling     = scaling;
   settings.heuristics_only = heuristics_only;
+  settings.presolve        = false;
 
   auto result = cuopt::linear_programming::solve_mip(&handle, problem, settings);
 
@@ -204,6 +208,7 @@ TEST_P(MILPTestParams, TestSingleVarMILP)
   settings.time_limit      = 5;
   settings.mip_scaling     = scaling;
   settings.heuristics_only = heuristics_only;
+  settings.presolve        = false;
 
   auto result = cuopt::linear_programming::solve_mip(&handle, problem, settings);
 
diff --git a/dependencies.yaml b/dependencies.yaml
index 69dbf6c63..07de52533 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -309,6 +309,7 @@ dependencies:
     common:
       - output_types: conda
         packages:
+          - boost
           - cpp-argparse
           - librmm==25.10.*
           - libraft-headers==25.10.*
diff --git a/docs/cuopt/source/cuopt-c/lp-milp/lp-milp-c-api.rst b/docs/cuopt/source/cuopt-c/lp-milp/lp-milp-c-api.rst
index 11e576300..4743584d9 100644
--- a/docs/cuopt/source/cuopt-c/lp-milp/lp-milp-c-api.rst
+++ b/docs/cuopt/source/cuopt-c/lp-milp/lp-milp-c-api.rst
@@ -158,6 +158,7 @@ These constants are used as parameter names in the :c:func:`cuOptSetParameter`,
 .. doxygendefine:: CUOPT_MIP_INTEGRALITY_TOLERANCE
 .. doxygendefine:: CUOPT_MIP_SCALING
 .. doxygendefine:: CUOPT_MIP_HEURISTICS_ONLY
+.. doxygendefine:: CUOPT_PRESOLVE
 .. doxygendefine:: CUOPT_SOLUTION_FILE
 .. doxygendefine:: CUOPT_NUM_CPU_THREADS
 .. doxygendefine:: CUOPT_USER_PROBLEM_FILE
diff --git a/docs/cuopt/source/faq.rst b/docs/cuopt/source/faq.rst
index 881a8fe15..70ec00845 100644
--- a/docs/cuopt/source/faq.rst
+++ b/docs/cuopt/source/faq.rst
@@ -350,6 +350,7 @@ Linear Programming FAQs
     - Tolerance: The set tolerance usually has a massive impact on performance. Try the lowest possible value using ``set_optimality_tolerance`` until you have reached your lowest possible acceptable accuracy.
     - PDLP Solver mode: PDLP solver mode will change the way PDLP internally optimizes the problem. The mode choice can drastically impact how fast a specific problem will be solved. You should test the different modes to see which one fits your problem best.
     - Batch mode: In case you know upfront that you need to solve multiple LP problems, instead of solving them sequentially, you should use the batch mode which can solve multiple LPs in parallel.
+    - Presolve: Presolve can reduce problem size and improve solve time.
 
 .. dropdown:: What solver mode should I choose?
 
@@ -369,6 +370,12 @@ Linear Programming FAQs
         - 10M rows/constraints, 10M columns/variables, and 2B non-zeros in the constraint matrix.
         - 74.5M rows/constraints, 74.5M columns/variables, and 1.49B non-zeros in the constraint matrix.
 
+.. dropdown:: Does cuOpt implement presolve reductions?
+
+    We use PaPILO presolve at the root node. It is enabled by default for MIP and disabled by default for LP.
+    For LP, dual postsolve is not supported, for this reason dual solution and reduced costs are filled with Nans.
+
+
 Mixed Integer Linear Programming FAQs
 --------------------------------------
 
diff --git a/docs/cuopt/source/lp-milp-settings.rst b/docs/cuopt/source/lp-milp-settings.rst
index 8e15f36c7..bb9541f4a 100644
--- a/docs/cuopt/source/lp-milp-settings.rst
+++ b/docs/cuopt/source/lp-milp-settings.rst
@@ -61,6 +61,9 @@ parallel parts of the solvers.
 
 Note: by default the number of CPU threads is automatically determined based on the number of CPU cores.
 
+Presolve
+^^^^^^^^
+``CUOPT_PRESOLVE`` controls whether presolve is enabled. Presolve can reduce problem size and improve solve time. Enabled by default for MIP, disabled by default for LP.
 
 Linear Programming
 ------------------
@@ -321,5 +324,3 @@ If the Best Objective and the Dual Bound are both zero the gap is zero. If the b
 gap is infinity.
 
 Note: the default value is ``1e-4``.
-
-
diff --git a/python/cuopt/cuopt/linear_programming/solver/solver_parameters.pyx b/python/cuopt/cuopt/linear_programming/solver/solver_parameters.pyx
index 5783d8f4e..413ec6e75 100644
--- a/python/cuopt/cuopt/linear_programming/solver/solver_parameters.pyx
+++ b/python/cuopt/cuopt/linear_programming/solver/solver_parameters.pyx
@@ -59,6 +59,7 @@ cdef extern from "cuopt/linear_programming/constants.h": # noqa
     cdef const char* c_CUOPT_LOG_FILE "CUOPT_LOG_FILE" # noqa
     cdef const char* c_CUOPT_LOG_TO_CONSOLE "CUOPT_LOG_TO_CONSOLE" # noqa
     cdef const char* c_CUOPT_CROSSOVER "CUOPT_CROSSOVER" # noqa
+    cdef const char* c_CUOPT_PRESOLVE "CUOPT_PRESOLVE" # noqa
     cdef const char* c_CUOPT_MIP_ABSOLUTE_TOLERANCE "CUOPT_MIP_ABSOLUTE_TOLERANCE" # noqa
     cdef const char* c_CUOPT_MIP_RELATIVE_TOLERANCE "CUOPT_MIP_RELATIVE_TOLERANCE" # noqa
     cdef const char* c_CUOPT_MIP_INTEGRALITY_TOLERANCE "CUOPT_MIP_INTEGRALITY_TOLERANCE" # noqa
@@ -92,6 +93,7 @@ CUOPT_FIRST_PRIMAL_FEASIBLE = c_CUOPT_FIRST_PRIMAL_FEASIBLE.decode('utf-8') # no
 CUOPT_LOG_FILE = c_CUOPT_LOG_FILE.decode('utf-8') # noqa
 CUOPT_LOG_TO_CONSOLE = c_CUOPT_LOG_TO_CONSOLE.decode('utf-8') # noqa
 CUOPT_CROSSOVER = c_CUOPT_CROSSOVER.decode('utf-8') # noqa
+CUOPT_PRESOLVE = c_CUOPT_PRESOLVE.decode('utf-8') # noqa
 CUOPT_MIP_ABSOLUTE_TOLERANCE = c_CUOPT_MIP_ABSOLUTE_TOLERANCE.decode('utf-8') # noqa
 CUOPT_MIP_RELATIVE_TOLERANCE = c_CUOPT_MIP_RELATIVE_TOLERANCE.decode('utf-8') # noqa
 CUOPT_MIP_INTEGRALITY_TOLERANCE = c_CUOPT_MIP_INTEGRALITY_TOLERANCE.decode('utf-8') # noqa
diff --git a/python/cuopt_server/cuopt_server/utils/linear_programming/data_definition.py b/python/cuopt_server/cuopt_server/utils/linear_programming/data_definition.py
index be7daf924..5c5ee7e6e 100644
--- a/python/cuopt_server/cuopt_server/utils/linear_programming/data_definition.py
+++ b/python/cuopt_server/cuopt_server/utils/linear_programming/data_definition.py
@@ -535,6 +535,12 @@ class SolverConfig(StrictModel):
         default=False,
         description="Set True to use crossover, False to not use crossover.",
     )
+    presolve: Optional[bool] = Field(
+        default=None,
+        description="Set True to enable presolve, False to disable presolve. "
+        "Presolve can reduce problem size and improve solve time. "
+        "Default is True for MIP problems and False for LP problems.",
+    )
     log_to_console: Optional[bool] = Field(
         default=True,
         description="Set True to write logs to console, False to "
diff --git a/python/cuopt_server/cuopt_server/utils/linear_programming/solver.py b/python/cuopt_server/cuopt_server/utils/linear_programming/solver.py
index ccb5b1514..05ef2e2ad 100644
--- a/python/cuopt_server/cuopt_server/utils/linear_programming/solver.py
+++ b/python/cuopt_server/cuopt_server/utils/linear_programming/solver.py
@@ -43,6 +43,7 @@
     CUOPT_NUM_CPU_THREADS,
     CUOPT_PDLP_SOLVER_MODE,
     CUOPT_PER_CONSTRAINT_RESIDUAL,
+    CUOPT_PRESOLVE,
     CUOPT_PRIMAL_INFEASIBLE_TOLERANCE,
     CUOPT_RELATIVE_DUAL_TOLERANCE,
     CUOPT_RELATIVE_GAP_TOLERANCE,
@@ -377,6 +378,26 @@ def create_solver(LP_data, warmstart_data):
             solver_settings.set_parameter(
                 CUOPT_CROSSOVER, solver_config.crossover
             )
+
+        def is_mip(var_types):
+            if var_types is None or len(var_types) == 0:
+                return False
+            elif "I" in var_types:
+                return True
+
+            return False
+
+        if solver_config.presolve is None:
+            if is_mip(LP_data.variable_types):
+                solver_config.presolve = True
+            else:
+                solver_config.presolve = False
+
+        if solver_config.presolve is not None:
+            solver_settings.set_parameter(
+                CUOPT_PRESOLVE, solver_config.presolve
+            )
+
         if solver_config.log_to_console is not None:
             solver_settings.set_parameter(
                 CUOPT_LOG_TO_CONSOLE, solver_config.log_to_console
diff --git a/python/libcuopt/CMakeLists.txt b/python/libcuopt/CMakeLists.txt
index 6e7c81be0..b99770887 100644
--- a/python/libcuopt/CMakeLists.txt
+++ b/python/libcuopt/CMakeLists.txt
@@ -37,7 +37,6 @@ endif()
 
 unset(cuopt_FOUND)
 
-
 include(FetchContent)
 FetchContent_Declare(
   argparse
@@ -46,6 +45,11 @@ FetchContent_Declare(
 )
 FetchContent_MakeAvailable(argparse)
 
+set(TBB OFF CACHE BOOL "Disable TBB")
+set(BUILD_TESTING OFF CACHE BOOL "Disable test build for papilo")
+set(PAPILO_NO_BINARIES ON)
+option(LUSOL "Disable LUSOL" OFF)
+
 set(BUILD_TESTS OFF)
 set(BUILD_BENCHMARKS OFF)
 set(CUOPT_BUILD_TESTUTIL OFF)
@@ -53,8 +57,12 @@ set(CUDA_STATIC_RUNTIME ON)
 
 add_subdirectory(../../cpp cuopt-cpp)
 
-target_link_libraries(cuopt PRIVATE argparse)
-target_link_libraries(cuopt_cli PRIVATE argparse)
+target_link_libraries(cuopt PRIVATE
+    argparse
+)
+target_link_libraries(cuopt_cli PRIVATE
+    argparse
+)
 
 set(rpaths
   "$ORIGIN/../lib64"
diff --git a/thirdparty/THIRD_PARTY_LICENSES b/thirdparty/THIRD_PARTY_LICENSES
index 665324e10..e6cb70a11 100644
--- a/thirdparty/THIRD_PARTY_LICENSES
+++ b/thirdparty/THIRD_PARTY_LICENSES
@@ -1,11 +1,11 @@
-==================================================
-Third Party Licenses
-==================================================
-
------------------------------------------------------------------------------------------
-== cxxopts
-
-Files: cpp/tests/utilities/cxxopts.hpp
+==================================================
+Third Party Licenses
+==================================================
+
+-----------------------------------------------------------------------------------------
+== cxxopts
+
+Files: cpp/tests/utilities/cxxopts.hpp
 Copyright (c) 2014 Jarryd Beck
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -25,3 +25,856 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 THE SOFTWARE.
+
+
+-----------------------------------------------------------------------------------------
+== papilo LGPL-3.0
+
+Files: cpp/build/_deps/papilo-src
+
+                   GNU LESSER GENERAL PUBLIC LICENSE
+                       Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. 
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+  This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+  0. Additional Definitions.
+
+  As used herein, "this License" refers to version 3 of the GNU Lesser
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
+General Public License.
+
+  "The Library" refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+  An "Application" is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+  A "Combined Work" is a work produced by combining or linking an
+Application with the Library.  The particular version of the Library
+with which the Combined Work was made is also called the "Linked
+Version".
+
+  The "Minimal Corresponding Source" for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+  The "Corresponding Application Code" for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+  1. Exception to Section 3 of the GNU GPL.
+
+  You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+  2. Conveying Modified Versions.
+
+  If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+   a) under this License, provided that you make a good faith effort to
+   ensure that, in the event an Application does not supply the
+   function or data, the facility still operates, and performs
+   whatever part of its purpose remains meaningful, or
+
+   b) under the GNU GPL, with none of the additional permissions of
+   this License applicable to that copy.
+
+  3. Object Code Incorporating Material from Library Header Files.
+
+  The object code form of an Application may incorporate material from
+a header file that is part of the Library.  You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+   a) Give prominent notice with each copy of the object code that the
+   Library is used in it and that the Library and its use are
+   covered by this License.
+
+   b) Accompany the object code with a copy of the GNU GPL and this license
+   document.
+
+  4. Combined Works.
+
+  You may convey a Combined Work under terms of your choice that,
+taken together, effectively do not restrict modification of the
+portions of the Library contained in the Combined Work and reverse
+engineering for debugging such modifications, if you also do each of
+the following:
+
+   a) Give prominent notice with each copy of the Combined Work that
+   the Library is used in it and that the Library and its use are
+   covered by this License.
+
+   b) Accompany the Combined Work with a copy of the GNU GPL and this license
+   document.
+
+   c) For a Combined Work that displays copyright notices during
+   execution, include the copyright notice for the Library among
+   these notices, as well as a reference directing the user to the
+   copies of the GNU GPL and this license document.
+
+   d) Do one of the following:
+
+       0) Convey the Minimal Corresponding Source under the terms of this
+       License, and the Corresponding Application Code in a form
+       suitable for, and under terms that permit, the user to
+       recombine or relink the Application with a modified version of
+       the Linked Version to produce a modified Combined Work, in the
+       manner specified by section 6 of the GNU GPL for conveying
+       Corresponding Source.
+
+       1) Use a suitable shared library mechanism for linking with the
+       Library.  A suitable mechanism is one that (a) uses at run time
+       a copy of the Library already present on the user's computer
+       system, and (b) will operate properly with a modified version
+       of the Library that is interface-compatible with the Linked
+       Version.
+
+   e) Provide Installation Information, but only if you would otherwise
+   be required to provide such information under section 6 of the
+   GNU GPL, and only to the extent that such information is
+   necessary to install and execute a modified version of the
+   Combined Work produced by recombining or relinking the
+   Application with a modified version of the Linked Version. (If
+   you use option 4d0, the Installation Information must accompany
+   the Minimal Corresponding Source and Corresponding Application
+   Code. If you use option 4d1, you must provide the Installation
+   Information in the manner specified by section 6 of the GNU GPL
+   for conveying Corresponding Source.)
+
+  5. Combined Libraries.
+
+  You may place library facilities that are a work based on the
+Library side by side in a single library together with other library
+facilities that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+   a) Accompany the combined library with a copy of the same work based
+   on the Library, uncombined with any other library facilities,
+   conveyed under the terms of this License.
+
+   b) Give prominent notice with the combined library that part of it
+   is a work based on the Library, and explaining where to find the
+   accompanying uncombined form of the same work.
+
+  6. Revised Versions of the GNU Lesser General Public License.
+
+  The Free Software Foundation may publish revised and/or new versions
+of the GNU Lesser General Public License from time to time. Such new
+versions will be similar in spirit to the present version, but may
+differ in detail to address new problems or concerns.
+
+  Each version is given a distinguishing version number. If the
+Library as you received it specifies that a certain numbered version
+of the GNU Lesser General Public License "or any later version"
+applies to it, you have the option of following the terms and
+conditions either of that published version or of any later version
+published by the Free Software Foundation. If the Library as you
+received it does not specify a version number of the GNU Lesser
+General Public License, you may choose any version of the GNU Lesser
+General Public License ever published by the Free Software Foundation.
+
+  If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the
+Library.
+
+
+-----------------------------------------------------------------------------------------
+== papilo GPL-3.0
+
+Files: cpp/build/_deps/papilo-src
+
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. 
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.  We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors.  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+  To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights.  Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received.  You must make sure that they, too, receive
+or can get the source code.  And you must show them these terms so they
+know their rights.
+
+  Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+  For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software.  For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+  Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so.  This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software.  The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable.  Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products.  If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+  Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary.  To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                       TERMS AND CONDITIONS
+
+  0. Definitions.
+
+  "This License" refers to version 3 of the GNU General Public License.
+
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+  "The Program" refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as "you".  "Licensees" and
+"recipients" may be individuals or organizations.
+
+  To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy.  The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+  A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+  To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy.  Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+  To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies.  Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+  An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License.  If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+  1. Source Code.
+
+  The "source code" for a work means the preferred form of the work
+for making modifications to it.  "Object code" means any non-source
+form of a work.
+
+  A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+  The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form.  A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+  The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities.  However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work.  For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+  The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+  The Corresponding Source for a work in source code form is that
+same work.
+
+  2. Basic Permissions.
+
+  All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met.  This License explicitly affirms your unlimited
+permission to run the unmodified Program.  The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work.  This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+  You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force.  You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright.  Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+  Conveying under any other circumstances is permitted solely under
+the conditions stated below.  Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+  No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+  When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+  4. Conveying Verbatim Copies.
+
+  You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+  You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+  5. Conveying Modified Source Versions.
+
+  You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+    a) The work must carry prominent notices stating that you modified
+    it, and giving a relevant date.
+
+    b) The work must carry prominent notices stating that it is
+    released under this License and any conditions added under section
+    7.  This requirement modifies the requirement in section 4 to
+    "keep intact all notices".
+
+    c) You must license the entire work, as a whole, under this
+    License to anyone who comes into possession of a copy.  This
+    License will therefore apply, along with any applicable section 7
+    additional terms, to the whole of the work, and all its parts,
+    regardless of how they are packaged.  This License gives no
+    permission to license the work in any other way, but it does not
+    invalidate such permission if you have separately received it.
+
+    d) If the work has interactive user interfaces, each must display
+    Appropriate Legal Notices; however, if the Program has interactive
+    interfaces that do not display Appropriate Legal Notices, your
+    work need not make them do so.
+
+  A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit.  Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+  6. Conveying Non-Source Forms.
+
+  You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+    a) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by the
+    Corresponding Source fixed on a durable physical medium
+    customarily used for software interchange.
+
+    b) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by a
+    written offer, valid for at least three years and valid for as
+    long as you offer spare parts or customer support for that product
+    model, to give anyone who possesses the object code either (1) a
+    copy of the Corresponding Source for all the software in the
+    product that is covered by this License, on a durable physical
+    medium customarily used for software interchange, for a price no
+    more than your reasonable cost of physically performing this
+    conveying of source, or (2) access to copy the
+    Corresponding Source from a network server at no charge.
+
+    c) Convey individual copies of the object code with a copy of the
+    written offer to provide the Corresponding Source.  This
+    alternative is allowed only occasionally and noncommercially, and
+    only if you received the object code with such an offer, in accord
+    with subsection 6b.
+
+    d) Convey the object code by offering access from a designated
+    place (gratis or for a charge), and offer equivalent access to the
+    Corresponding Source in the same way through the same place at no
+    further charge.  You need not require recipients to copy the
+    Corresponding Source along with the object code.  If the place to
+    copy the object code is a network server, the Corresponding Source
+    may be on a different server (operated by you or a third party)
+    that supports equivalent copying facilities, provided you maintain
+    clear directions next to the object code saying where to find the
+    Corresponding Source.  Regardless of what server hosts the
+    Corresponding Source, you remain obligated to ensure that it is
+    available for as long as needed to satisfy these requirements.
+
+    e) Convey the object code using peer-to-peer transmission, provided
+    you inform other peers where the object code and Corresponding
+    Source of the work are being offered to the general public at no
+    charge under subsection 6d.
+
+  A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+  A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling.  In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage.  For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product.  A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+  "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source.  The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+  If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information.  But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+  The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed.  Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+  Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+  7. Additional Terms.
+
+  "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law.  If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+  When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it.  (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.)  You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+  Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+    a) Disclaiming warranty or limiting liability differently from the
+    terms of sections 15 and 16 of this License; or
+
+    b) Requiring preservation of specified reasonable legal notices or
+    author attributions in that material or in the Appropriate Legal
+    Notices displayed by works containing it; or
+
+    c) Prohibiting misrepresentation of the origin of that material, or
+    requiring that modified versions of such material be marked in
+    reasonable ways as different from the original version; or
+
+    d) Limiting the use for publicity purposes of names of licensors or
+    authors of the material; or
+
+    e) Declining to grant rights under trademark law for use of some
+    trade names, trademarks, or service marks; or
+
+    f) Requiring indemnification of licensors and authors of that
+    material by anyone who conveys the material (or modified versions of
+    it) with contractual assumptions of liability to the recipient, for
+    any liability that these contractual assumptions directly impose on
+    those licensors and authors.
+
+  All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10.  If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term.  If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+  If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+  Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+  8. Termination.
+
+  You may not propagate or modify a covered work except as expressly
+provided under this License.  Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+  However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+  Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+  Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License.  If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+  9. Acceptance Not Required for Having Copies.
+
+  You are not required to accept this License in order to receive or
+run a copy of the Program.  Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance.  However,
+nothing other than this License grants you permission to propagate or
+modify any covered work.  These actions infringe copyright if you do
+not accept this License.  Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+  10. Automatic Licensing of Downstream Recipients.
+
+  Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License.  You are not responsible
+for enforcing compliance by third parties with this License.
+
+  An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations.  If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+  You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License.  For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+  11. Patents.
+
+  A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based.  The
+work thus licensed is called the contributor's "contributor version".
+
+  A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version.  For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+  In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement).  To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+  If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients.  "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+  If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+  A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License.  You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+  Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+  12. No Surrender of Others' Freedom.
+
+  If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all.  For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+  13. Use with the GNU Affero General Public License.
+
+  Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work.  The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+  14. Revised Versions of this License.
+
+  The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+  Each version is given a distinguishing version number.  If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation.  If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+  If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+  Later license versions may give you additional or different
+permissions.  However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+  15. Disclaimer of Warranty.
+
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. Limitation of Liability.
+
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+  17. Interpretation of Sections 15 and 16.
+
+  If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    
+    Copyright (C)   
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see .
+
+Also add information on how to contact you by electronic and paper mail.
+
+  If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+      Copyright (C)   
+    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+  You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+.
+
+  The GNU General Public License does not permit incorporating your program
+into proprietary programs.  If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.  But first, please read
+.