From 4d559d0aadb7d07a3bc6df5e1eae71159a0e51b2 Mon Sep 17 00:00:00 2001 From: BoolBada Date: Sat, 16 Mar 2019 10:12:41 +0900 Subject: [PATCH] FIX compile issues with modern gcc Tested with gcc version 8.2.1 20181127 (GCC) --- INSTALL | 26 +++++++++++++++++++++ src/CMakeLists.txt | 6 ++++- src/coloquinte/circuit_helper.hxx | 1 + src/coloquinte/optimization_subproblems.hxx | 1 + src/optimization_subproblems.cxx | 2 +- src/solvers.cxx | 1 + 6 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 INSTALL diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..659a87d --- /dev/null +++ b/INSTALL @@ -0,0 +1,26 @@ +# Prerequisites + +## LEMON +* https://lemon.cs.elte.hu/trac/lemon +* Get lemon. Build it by reading its INSTALL documents. +* The version (as of 2019-03-16) tested with is 1.3.1. +* In my case, I did (not system-wide install.) + * mkdir build # make build directory for cmake to work + * cd build # get inside it + * cmake -DCMAKE_INSTALL_PREFIX=$HOME/usr/lemon .. + * Install prefix is specified as above command. + * make # compile LEMON + * make install # install LEMON. +* check coloquinte/src/CMakeFiles.txt, make sure + `include_directories($ENV{HOME}/usr/lemon/include)` points to where + you configured/installed lemon. + + +# Compiling + +Build just like other cmake projects. + +* mkdir build +* cd build +* cmake -DCMAKE_INSTALL_PREFIX=$HOME/usr/etesian .. +* make # or make -j for multi-threaded build diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a57f19a..3ee188e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -26,10 +26,14 @@ set ( cpps circuit.cxx legalizer.cxx ) set ( coloquintecpps main.cxx ) - + +# Make sure this points to where lemon is installed! +include_directories($ENV{HOME}/usr/lemon/include) + add_library ( coloquinte ${cpps} ) add_executable ( coloquinte.bin ${coloquintecpps}) target_link_libraries ( coloquinte.bin coloquinte ) +set_property(TARGET coloquinte PROPERTY CXX_STANDARD 11) install( TARGETS coloquinte DESTINATION lib${LIB_SUFFIX} ) install( FILES ${includes} DESTINATION include/coloquinte ) diff --git a/src/coloquinte/circuit_helper.hxx b/src/coloquinte/circuit_helper.hxx index e19994c..b185c47 100644 --- a/src/coloquinte/circuit_helper.hxx +++ b/src/coloquinte/circuit_helper.hxx @@ -2,6 +2,7 @@ #ifndef COLOQUINTE_GP_HELPERCIRCUIT #define COLOQUINTE_GP_HELPERCIRCUIT +#include #include "common.hxx" #include "netlist.hxx" diff --git a/src/coloquinte/optimization_subproblems.hxx b/src/coloquinte/optimization_subproblems.hxx index 8c9ff46..f2085c1 100644 --- a/src/coloquinte/optimization_subproblems.hxx +++ b/src/coloquinte/optimization_subproblems.hxx @@ -4,6 +4,7 @@ #include "common.hxx" +#include #include #include #include diff --git a/src/optimization_subproblems.cxx b/src/optimization_subproblems.cxx index 48aaeac..f38498d 100644 --- a/src/optimization_subproblems.cxx +++ b/src/optimization_subproblems.cxx @@ -132,7 +132,7 @@ std::vector transport_1D(std::vector sources, std::vector< namespace{ // Anonymous namespace to hide the transportation structures class current_allocation{ - static const index_t null_ind = std::numeric_limits::max(); + const index_t null_ind = std::numeric_limits::max(); // Internal data structures diff --git a/src/solvers.cxx b/src/solvers.cxx index 6838d85..af3f2dc 100644 --- a/src/solvers.cxx +++ b/src/solvers.cxx @@ -2,6 +2,7 @@ #include "coloquinte/solvers.hxx" #include +#include #include namespace coloquinte{