Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ build/
.vscode
.DS_Store
.cache
shell.nix
shell.nix
5 changes: 2 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,10 @@ Clone the repository,

the last command should tell you that you are in `develop` branch.

To compile the `C++` code you have to specify the path to external library `liblpsolve55.so/dll/dylib` (see [here](docs/getting_started/install.md) more detail), by running, in folder test:
To compile the `C++` code, run the following from the repository root. The LP solver (HiGHS) is downloaded automatically by CMake, so no external library path is needed:

mkdir -p test/build && cd test/build
cmake -DLP_SOLVE=_PATH_TO_LIB_FILE_ ..
# e.g. on linux: cmake -DLP_SOLVE=/usr/lib/lp_solve/liblpsolve55.so ..
cmake ..
make

You can check [here](/docs/getting_started/install.md) to see more installation guide.
Expand Down
6 changes: 3 additions & 3 deletions docs/getting_started/cpp_example.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,16 @@ endif ()
include("../../external/cmake-files/Boost.cmake")
GetBoost()

include("../../external/cmake-files/LPSolve.cmake")
GetLPSolve()
include("../../external/cmake-files/HiGHS.cmake")
GetHighs()

set(CMAKE_EXPORT_COMPILE_COMMANDS "ON")

include_directories (BEFORE ../../external)
include_directories (BEFORE ../../include)

add_executable (volume_example volume_example.cpp)
target_link_libraries(volume_example PUBLIC lp_solve)
target_link_libraries(volume_example PUBLIC highs::highs)
```

We will use `cmake` to build the makefile and compile our example.
Expand Down
22 changes: 11 additions & 11 deletions examples/autopoint/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ GetEigen()
include("../../external/cmake-files/Boost.cmake")
GetBoost()

include("../../external/cmake-files/LPSolve.cmake")
GetLPSolve()
include("../../external/cmake-files/HiGHS.cmake")
GetHighs()

include("../../external/cmake-files/Spectra.cmake")
GetSpectra()
Expand All @@ -100,13 +100,13 @@ message("Found MKL: ${MKLROOT}")
add_definitions(-DEIGEN_USE_MKL_ALL)
endif(USE_MKL)

# Find lpsolve library
set(LP_SOLVE lp_solve) # use lp_solve CMake target from GetLPSolve()
# Find HiGHS library
set(HIGHS highs::highs) # use HiGHS CMake target from GetHighs()

if (NOT LP_SOLVE)
message(FATAL_ERROR "This program requires the lp_solve library, and will not be compiled.")
if (NOT HIGHS)
message(FATAL_ERROR "This program requires the HiGHS library, and will not be compiled.")
else ()
message(STATUS "Library lp_solve found: ${LP_SOLVE} ${BLAS}")
message(STATUS "Library HiGHS found: ${HIGHS} ${BLAS}")

set(CMAKE_EXPORT_COMPILE_COMMANDS "ON")

Expand Down Expand Up @@ -156,13 +156,13 @@ endif()
#add_definitions( "-O3 -lgsl -lm -ldl -lgslcblas" )

add_executable (userDefinedFunction_manual_gradient userDefinedFunction_manual_gradient.cpp)
TARGET_LINK_LIBRARIES(userDefinedFunction_manual_gradient ${LP_SOLVE} ${BLAS} ${MKL_LINK})
TARGET_LINK_LIBRARIES(userDefinedFunction_manual_gradient ${HIGHS} ${BLAS} ${MKL_LINK})
add_executable (userDefinedFunction_autopoint userDefinedFunction_autopoint.cpp)
TARGET_LINK_LIBRARIES(userDefinedFunction_autopoint ${LP_SOLVE} ${BLAS} ${MKL_LINK})
TARGET_LINK_LIBRARIES(userDefinedFunction_autopoint ${HIGHS} ${BLAS} ${MKL_LINK})
add_executable (Gaussian_mixture_autopoint Gaussian_mixture_autopoint.cpp readData.cpp)
TARGET_LINK_LIBRARIES(Gaussian_mixture_autopoint ${LP_SOLVE} ${BLAS} ${MKL_LINK})
TARGET_LINK_LIBRARIES(Gaussian_mixture_autopoint ${HIGHS} ${BLAS} ${MKL_LINK})
add_executable (MultidimensionalGaussian_mixture_autopoint MultidimensionalGaussian_mixture_autopoint.cpp readData.cpp)
TARGET_LINK_LIBRARIES(MultidimensionalGaussian_mixture_autopoint ${LP_SOLVE} ${BLAS} ${MKL_LINK})
TARGET_LINK_LIBRARIES(MultidimensionalGaussian_mixture_autopoint ${HIGHS} ${BLAS} ${MKL_LINK})


endif()
Expand Down
16 changes: 8 additions & 8 deletions examples/bsb_sampling/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,19 @@ GetEigen()
include("../../external/cmake-files/Boost.cmake")
GetBoost()

include("../../external/cmake-files/LPSolve.cmake")
GetLPSolve()
include("../../external/cmake-files/HiGHS.cmake")
GetHighs()

include("../../external/cmake-files/Spectra.cmake")
GetSpectra()

# Find lpsolve library
set(LP_SOLVE lp_solve) # use lp_solve CMake target from GetLPSolve()
# Find HiGHS library
set(HIGHS highs::highs) # use HiGHS CMake target from GetHighs()

if (NOT LP_SOLVE)
message(FATAL_ERROR "This program requires the lp_solve library, and will not be compiled.")
if (NOT HIGHS)
message(FATAL_ERROR "This program requires the HiGHS library, and will not be compiled.")
else ()
message(STATUS "Library lp_solve found: ${LP_SOLVE}")
message(STATUS "Library HiGHS found: ${HIGHS}")

set(CMAKE_EXPORT_COMPILE_COMMANDS "ON")

Expand All @@ -100,6 +100,6 @@ else ()


add_executable (billiardshakeandbake billiardshakeandbake.cpp)
TARGET_LINK_LIBRARIES(billiardshakeandbake ${LP_SOLVE})
TARGET_LINK_LIBRARIES(billiardshakeandbake ${HIGHS})

endif()
5 changes: 2 additions & 3 deletions examples/bsb_sampling/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ This is an example that illustrates the simplification and preparation process.
Build the example by running the following commands in this directory.

```bash
cmake . -DLP_SOLVE=_PATH_TO_LIB_FILE
cmake .
make
```
You have to specify the path to liblpsolve55.so/dll/dylib.
For example: -DLP_SOLVE=/usr/lib/lpsolve/liblpsolve55.so
HiGHS, the LP solver, is downloaded automatically by CMake.

## Running:
```bash
Expand Down
16 changes: 8 additions & 8 deletions examples/correlation_matrices/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ GetEigen()
include("../../external/cmake-files/Boost.cmake")
GetBoost()

include("../../external/cmake-files/LPSolve.cmake")
GetLPSolve()
include("../../external/cmake-files/HiGHS.cmake")
GetHighs()

include("../../external/cmake-files/Spectra.cmake")
GetSpectra()
Expand All @@ -104,13 +104,13 @@ if (USE_MKL)
set(MKL_LINK "-L${MKLROOT}/lib/intel64 -Wl,-rpath,${MKLROOT}/lib -lmkl_intel_ilp64 -lmkl_sequential -lmkl_core -lgomp -lpthread -llapack -lblas")
endif(USE_MKL)

# Find lpsolve library
set(LP_SOLVE lp_solve) # use lp_solve CMake target from GetLPSolve()
# Find HiGHS library
set(HIGHS highs::highs) # use HiGHS CMake target from GetHighs()

if (NOT LP_SOLVE)
message(FATAL_ERROR "This program requires the lp_solve library, and will not be compiled.")
if (NOT HIGHS)
message(FATAL_ERROR "This program requires the HiGHS library, and will not be compiled.")
else ()
message(STATUS "lp_solve library found: ${LP_SOLVE}")
message(STATUS "HiGHS library found: ${HIGHS}")

set(CMAKE_EXPORT_COMPILE_COMMANDS "ON")

Expand Down Expand Up @@ -145,6 +145,6 @@ else ()
add_definitions(${CXX_COVERAGE_COMPILE_FLAGS} "-DBOOST_NO_AUTO_PTR")

add_executable (sampler sampler.cpp)
TARGET_LINK_LIBRARIES(sampler ${LP_SOLVE} ${BLAS} ${MKL_LINK})
TARGET_LINK_LIBRARIES(sampler ${HIGHS} ${BLAS} ${MKL_LINK})

endif()
5 changes: 2 additions & 3 deletions examples/correlation_matrices/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ Build the example by running the following commands in this directory.

```bash
mkdir -p build && cd build
cmake . -DLP_SOLVE=_PATH_TO_LPSOLVE_LIB ../ && make
cmake .. && make
```
You have to specify the path to liblpsolve55.so/dll/dylib.
For example: -DLP_SOLVE=/usr/lib/lpsolve/liblpsolve55.so
HiGHS, the LP solver, is downloaded automatically by CMake.

## Usage:
```bash
Expand Down
16 changes: 8 additions & 8 deletions examples/count-linear-extensions-using-hpolytope/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,18 @@ GetEigen()
include("../../external/cmake-files/Boost.cmake")
GetBoost()

include("../../external/cmake-files/LPSolve.cmake")
GetLPSolve()
include("../../external/cmake-files/HiGHS.cmake")
GetHighs()

include("../../external/cmake-files/Spectra.cmake")
GetSpectra()
# Find lpsolve library
set(LP_SOLVE lp_solve) # use lp_solve CMake target from GetLPSolve()
# Find HiGHS library
set(HIGHS highs::highs) # use HiGHS CMake target from GetHighs()

if (NOT LP_SOLVE)
message(FATAL_ERROR "This program requires the lp_solve library, and will not be compiled.")
if (NOT HIGHS)
message(FATAL_ERROR "This program requires the HiGHS library, and will not be compiled.")
else ()
message(STATUS "Library lp_solve found: ${LP_SOLVE}")
message(STATUS "Library HiGHS found: ${HIGHS}")

set(CMAKE_EXPORT_COMPILE_COMMANDS "ON")

Expand Down Expand Up @@ -108,6 +108,6 @@ else ()
add_definitions(${CXX_COVERAGE_COMPILE_FLAGS} "-DBOOST_NO_AUTO_PTR")

add_executable (volesti_lecount volesti_lecount.cpp)
TARGET_LINK_LIBRARIES(volesti_lecount ${LP_SOLVE})
TARGET_LINK_LIBRARIES(volesti_lecount ${HIGHS})

endif()
5 changes: 2 additions & 3 deletions examples/count-linear-extensions-using-hpolytope/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
Build the example by running the following commands in this directory.

```bash
cmake . -DLP_SOLVE=_PATH_TO_LIB_FILE
cmake .
make
```
You have to specify the path to liblpsolve55.so/dll/dylib.
For example: -DLP_SOLVE=/usr/lib/lpsolve/liblpsolve55.so
HiGHS, the LP solver, is downloaded automatically by CMake.

## Usage:
```bash
Expand Down
16 changes: 8 additions & 8 deletions examples/crhmc_cooling_gaussians/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,21 +76,21 @@ GetEigen()
include("../../external/cmake-files/Boost.cmake")
GetBoost()

include("../../external/cmake-files/LPSolve.cmake")
GetLPSolve()
include("../../external/cmake-files/HiGHS.cmake")
GetHighs()

include("../../external/cmake-files/Spectra.cmake")
GetSpectra()
include("../../external/cmake-files/QD.cmake")
GetQD()

# Find lpsolve library
set(LP_SOLVE lp_solve) # use lp_solve CMake target from GetLPSolve()
# Find HiGHS library
set(HIGHS highs::highs) # use HiGHS CMake target from GetHighs()

if (NOT LP_SOLVE)
message(FATAL_ERROR "This program requires the lp_solve library, and will not be compiled.")
if (NOT HIGHS)
message(FATAL_ERROR "This program requires the HiGHS library, and will not be compiled.")
else ()
message(STATUS "Library lp_solve found: ${LP_SOLVE}")
message(STATUS "Library HiGHS found: ${HIGHS}")

set(CMAKE_EXPORT_COMPILE_COMMANDS "ON")

Expand Down Expand Up @@ -129,6 +129,6 @@ else ()
add_definitions(${CXX_COVERAGE_COMPILE_FLAGS} "-DBOOST_NO_AUTO_PTR")

add_executable(volume_example volume_example.cpp)
target_link_libraries(volume_example QD_LIB ${MKL_LINK} ${LP_SOLVE})
target_link_libraries(volume_example QD_LIB ${MKL_LINK} ${HIGHS})

endif()
16 changes: 8 additions & 8 deletions examples/crhmc_cooling_nonspherical_gaussians/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,21 +76,21 @@ GetEigen()
include("../../external/cmake-files/Boost.cmake")
GetBoost()

include("../../external/cmake-files/LPSolve.cmake")
GetLPSolve()
include("../../external/cmake-files/HiGHS.cmake")
GetHighs()

include("../../external/cmake-files/Spectra.cmake")
GetSpectra()
include("../../external/cmake-files/QD.cmake")
GetQD()

# Find lpsolve library
set(LP_SOLVE lp_solve) # use lp_solve CMake target from GetLPSolve()
# Find HiGHS library
set(HIGHS highs::highs) # use HiGHS CMake target from GetHighs()

if (NOT LP_SOLVE)
message(FATAL_ERROR "This program requires the lp_solve library, and will not be compiled.")
if (NOT HIGHS)
message(FATAL_ERROR "This program requires the HiGHS library, and will not be compiled.")
else ()
message(STATUS "Library lp_solve found: ${LP_SOLVE}")
message(STATUS "Library HiGHS found: ${HIGHS}")

set(CMAKE_EXPORT_COMPILE_COMMANDS "ON")

Expand Down Expand Up @@ -129,6 +129,6 @@ else ()
add_definitions(${CXX_COVERAGE_COMPILE_FLAGS} "-DBOOST_NO_AUTO_PTR")

add_executable(volume_example volume_example.cpp)
target_link_libraries(volume_example QD_LIB ${MKL_LINK} ${LP_SOLVE})
target_link_libraries(volume_example QD_LIB ${MKL_LINK} ${HIGHS})

endif()
6 changes: 3 additions & 3 deletions examples/crhmc_prepare/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ GetEigen()
include("../../external/cmake-files/Boost.cmake")
GetBoost()

include("../../external/cmake-files/LPSolve.cmake")
GetLPSolve()
include("../../external/cmake-files/HiGHS.cmake")
GetHighs()

include("../../external/cmake-files/Spectra.cmake")
GetSpectra()
Expand Down Expand Up @@ -116,5 +116,5 @@ add_definitions(${CXX_COVERAGE_COMPILE_FLAGS} "-ldl")
add_definitions(${CXX_COVERAGE_COMPILE_FLAGS} "-DBOOST_NO_AUTO_PTR")

add_executable (crhmc_prepare crhmc_prepare.cpp )
TARGET_LINK_LIBRARIES(crhmc_prepare QD_LIB ${MKL_LINK})
TARGET_LINK_LIBRARIES(crhmc_prepare highs::highs QD_LIB ${MKL_LINK})

5 changes: 2 additions & 3 deletions examples/crhmc_prepare/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ Yunbum Kook, Yin Tat Lee, Ruoqi Shen, Santosh S. Vempala. "Sampling with Riemann
Build the example by running the following commands in this directory.

```bash
cmake . -DLP_SOLVE=_PATH_TO_LIB_FILE
cmake .
make
```
You have to specify the path to liblpsolve55.so/dll/dylib.
For example: -DLP_SOLVE=/usr/lib/lpsolve/liblpsolve55.so
HiGHS, the LP solver, is downloaded automatically by CMake.

## Running:
```bash
Expand Down
18 changes: 9 additions & 9 deletions examples/crhmc_sampling/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,21 @@ GetEigen()
include("../../external/cmake-files/Boost.cmake")
GetBoost()

include("../../external/cmake-files/LPSolve.cmake")
GetLPSolve()
include("../../external/cmake-files/HiGHS.cmake")
GetHighs()

include("../../external/cmake-files/Spectra.cmake")
GetSpectra()
include("../../external/cmake-files/QD.cmake")
GetQD()

# Find lpsolve library
set(LP_SOLVE lp_solve) # use lp_solve CMake target from GetLPSolve()
# Find HiGHS library
set(HIGHS highs::highs) # use HiGHS CMake target from GetHighs()

if (NOT LP_SOLVE)
message(FATAL_ERROR "This program requires the lp_solve library, and will not be compiled.")
if (NOT HIGHS)
message(FATAL_ERROR "This program requires the HiGHS library, and will not be compiled.")
else ()
message(STATUS "Library lp_solve found: ${LP_SOLVE}")
message(STATUS "Library HiGHS found: ${HIGHS}")

set(CMAKE_EXPORT_COMPILE_COMMANDS "ON")

Expand Down Expand Up @@ -124,8 +124,8 @@ else ()
add_definitions(${CXX_COVERAGE_COMPILE_FLAGS} "-DBOOST_NO_AUTO_PTR")

add_executable (sampling_functions sampling_functions.cpp)
TARGET_LINK_LIBRARIES(sampling_functions QD_LIB ${MKL_LINK} ${LP_SOLVE})
TARGET_LINK_LIBRARIES(sampling_functions QD_LIB ${MKL_LINK} ${HIGHS})
add_executable (simple_crhmc simple_crhmc.cpp)
TARGET_LINK_LIBRARIES(simple_crhmc QD_LIB ${MKL_LINK} ${LP_SOLVE})
TARGET_LINK_LIBRARIES(simple_crhmc QD_LIB ${MKL_LINK} ${HIGHS})

endif()
5 changes: 2 additions & 3 deletions examples/crhmc_sampling/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@ Yunbum Kook, Yin Tat Lee, Ruoqi Shen, Santosh S. Vempala. "Sampling with Riemann
Build the example by running the following commands in this directory.

```bash
cmake . -DLP_SOLVE=_PATH_TO_LIB_FILE
cmake .
make
```
You have to specify the path to liblpsolve55.so.
For example: -DLP_SOLVE=/usr/lib/lpsolve/liblpsolve55.so
HiGHS, the LP solver, is downloaded automatically by CMake.

## Running:
```bash
Expand Down
Loading
Loading