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
77 changes: 40 additions & 37 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Build
'on':
- push
jobs:
ubuntu-20-04-build-gcc:
runs-on: ubuntu-20.04
ubuntu-22-04-build-gcc:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository code
uses: actions/checkout@v2
Expand All @@ -19,8 +19,8 @@ jobs:
run: cd build && make
- name: tests
run: cd build && ctest --output-on-failure
ubuntu-22-04-build-gcc:
runs-on: ubuntu-22.04
ubuntu-latest-build-gcc:
runs-on: ubuntu-latest
steps:
- name: Checkout repository code
uses: actions/checkout@v2
Expand All @@ -36,8 +36,8 @@ jobs:
run: cd build && make
- name: tests
run: cd build && ctest --output-on-failure
ubuntu-24-04-build-gcc:
runs-on: ubuntu-24.04
ubuntu-latest-full-protobuf-build-gcc:
runs-on: ubuntu-latest
steps:
- name: Checkout repository code
uses: actions/checkout@v2
Expand All @@ -46,14 +46,14 @@ jobs:
- name: update apt
run: sudo apt update
- name: install dependencies
run: sudo apt install -y cmake gcc g++ libglpk-dev coinor-cbc coinor-libcbc-dev
run: sudo apt install -y cmake gcc g++ libglpk-dev coinor-cbc coinor-libcbc-dev libprotobuf-dev protobuf-compiler
- name: cmake
run: mkdir build && cd build && cmake ..
- name: make
run: cd build && make
- name: tests
run: cd build && ctest --output-on-failure
ubuntu-latest-build-gcc:
ubuntu-latest-partial-protobuf-build-gcc:
runs-on: ubuntu-latest
steps:
- name: Checkout repository code
Expand All @@ -63,15 +63,15 @@ jobs:
- name: update apt
run: sudo apt update
- name: install dependencies
run: sudo apt install -y cmake gcc g++ libglpk-dev coinor-cbc coinor-libcbc-dev
run: sudo apt install -y cmake gcc g++ libglpk-dev coinor-cbc coinor-libcbc-dev libprotobuf-dev
- name: cmake
run: mkdir build && cd build && cmake ..
- name: make
run: cd build && make
- name: tests
run: cd build && ctest --output-on-failure
ubuntu-20-04-build-clang:
runs-on: ubuntu-20.04
ubuntu-22-04-build-clang:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository code
uses: actions/checkout@v2
Expand All @@ -80,7 +80,7 @@ jobs:
- name: update apt
run: sudo apt update
- name: install dependencies
run: sudo apt install -y cmake clang libglpk-dev coinor-cbc coinor-libcbc-dev
run: sudo apt install -y cmake clang libglpk-dev
- name: cmake
run: mkdir build && cd build && cmake ..
shell: bash
Expand All @@ -91,8 +91,8 @@ jobs:
run: cd build && make
- name: tests
run: cd build && ctest --output-on-failure
ubuntu-22-04-build-clang:
runs-on: ubuntu-22.04
ubuntu-latest-build-clang:
runs-on: ubuntu-latest
steps:
- name: Checkout repository code
uses: actions/checkout@v2
Expand All @@ -112,65 +112,68 @@ jobs:
run: cd build && make
- name: tests
run: cd build && ctest --output-on-failure
ubuntu-24-04-build-clang:
runs-on: ubuntu-24.04
macos-14-build:
runs-on: macos-14
steps:
- name: Checkout repository code
uses: actions/checkout@v2
- name: Checkout submodules
run: git submodule update --init --recursive
- name: update apt
run: sudo apt update
- name: install dependencies
run: sudo apt install -y cmake clang libglpk-dev coinor-cbc coinor-libcbc-dev
run: brew install --force --overwrite cmake && brew install --force --overwrite glpk
- name: cmake
run: mkdir build && cd build && cmake ..
shell: bash
env:
CC: clang
CXX: clang++
- name: make
run: cd build && make
- name: tests
run: cd build && ctest --output-on-failure
ubuntu-latest-build-clang:
runs-on: ubuntu-latest
macos-15-large-build:
runs-on: macos-15-large
steps:
- name: Checkout repository code
uses: actions/checkout@v2
- name: Checkout submodules
run: git submodule update --init --recursive
- name: update apt
run: sudo apt update
- name: install dependencies
run: sudo apt install -y cmake clang libglpk-dev coinor-cbc coinor-libcbc-dev
run: brew install --force --overwrite cmake && brew install --force --overwrite glpk && brew tap coin-or-tools/coinor && brew install --force --overwrite coin-or-tools/coinor/cbc
- name: cmake
run: mkdir build && cd build && cmake ..
shell: bash
env:
CC: clang
CXX: clang++
- name: make
run: cd build && make
- name: tests
run: cd build && ctest --output-on-failure
macos-14-build:
runs-on: macos-14
macos-15-large-protobuf-build:
runs-on: macos-15-large
steps:
- name: Checkout repository code
uses: actions/checkout@v2
- name: Checkout submodules
run: git submodule update --init --recursive
- name: install dependencies
run: brew install --force --overwrite cmake && brew install --force --overwrite glpk
run: brew install --force --overwrite cmake && brew install --force --overwrite glpk && brew tap coin-or-tools/coinor && brew install --force --overwrite coin-or-tools/coinor/cbc && brew install protobuf
- name: cmake
run: mkdir build && cd build && cmake ..
- name: make
run: cd build && make
- name: tests
run: cd build && ctest --output-on-failure
macos-15-xlarge-build:
runs-on: macos-15-xlarge
steps:
- name: Checkout repository code
uses: actions/checkout@v2
- name: Checkout submodules
run: git submodule update --init --recursive
- name: install dependencies
run: brew install --force --overwrite cmake && brew install --force --overwrite glpk && brew tap coin-or-tools/coinor && brew install --force --overwrite coin-or-tools/coinor/cbc
- name: cmake
run: mkdir build && cd build && cmake ..
- name: make
run: cd build && make
- name: tests
run: cd build && ctest --output-on-failure
macos-13-build:
runs-on: macos-13
macos-26-xlarge-build:
runs-on: macos-26-xlarge
steps:
- name: Checkout repository code
uses: actions/checkout@v2
Expand Down
18 changes: 16 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,42 @@ if(OPENMP_FOUND)
set(CMAKE_CXX_FLAGS "${OpenMP_CXX_FLAGS} -O3 -Wall -Wno-format-extra-args -Wextra -Wformat-nonliteral -Wno-keyword-macro -Wformat-security -Wformat=2")

else()
message(WARNING "Configuring without OpenMP!")
message(STATUS "Configuring without OpenMP")
set(CMAKE_CXX_FLAGS "-O3 -Wall -Wno-format-extra-args -Wextra -Wformat-nonliteral -Wno-keyword-macro -Wformat-security -Wformat=2")
endif()

if(GUROBI_FOUND)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGUROBI_FOUND=1")
else()
message(STATUS "Configuring without Gurobi, library was not found")
endif()

if(Protobuf_FOUND)
if(Protobuf_FOUND AND Protobuf_PROTOC_EXECUTABLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DPROTOBUF_FOUND=1")
else()
if (NOT Protobuf_FOUND)
message(STATUS "Configuring without protbuf support, libprotobuf was not found")
elseif (NOT Protobuf_PROTOC_EXECUTABLE)
message(STATUS "Configuring without protbuf support, protobuf compiler was not found")
endif()
endif()

if(GLPK_FOUND)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DGLPK_FOUND=1")
else()
message(STATUS "Configuring without GLPK")
endif()

if(COIN_FOUND)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCOIN_FOUND=1")
else()
message(STATUS "Configuring without COIN-OR")
endif()

if (LIBZIP_FOUND)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DLIBZIP_FOUND=1")
else()
message(STATUS "Configuring without libzip")
endif()

set(CMAKE_CXX_FLAGS_DEBUG "-Og -g -DLOGLEVEL=3")
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Requirements

* `cmake`
* `gcc >= 5.0` (or `clang >= 3.9`)
* Optional: `libglpk-dev`, `coinor-libcbc-dev`, `gurobi`, `libzip-dev`, `libprotobuf-dev`
* Optional: `libglpk-dev` (ILP solver), `coinor-libcbc-dev` (ILP solver), `gurobi` (ILP solver), `libzip-dev`, `libprotobuf-dev` + `protobuf-compiler` (for vector tile output)


Building and Installation
Expand Down
19 changes: 12 additions & 7 deletions src/loom/optim/Optimizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,15 @@ typedef std::pair<PosCom, PosCom> PosComPair;
typedef std::pair<OptEdge*, OptEdge*> EdgePair;

struct OptResStats {
size_t numNodesOrig, numStationsOrig, numEdgesOrig, maxLineCardOrig, numLinesOrig, maxDegOrig;
size_t numStations, numNodes, numEdges, maxLineCard, nonTrivialComponents, numCompsSolSpaceOne, maxNumNodesPerComp, maxNumEdgesPerComp, maxCardPerComp, numCompsOrig, maxNumRowsPerComp, maxNumColsPerComp;
size_t numNodesOrig, numStationsOrig, numEdgesOrig, maxLineCardOrig,
numLinesOrig, maxDegOrig;
size_t numStations, numNodes, numEdges, maxLineCard, nonTrivialComponents,
numCompsSolSpaceOne, maxNumNodesPerComp, maxNumEdgesPerComp,
maxCardPerComp, numCompsOrig, maxNumRowsPerComp, maxNumColsPerComp;
size_t runs;
double avgSolveTime, avgIterations, avgScore, avgCross, avgSameSegCross, avgDiffSegCross, avgSeps, solutionSpaceSize, solutionSpaceSizeOrig, maxCompSolSpace, simplificationTime;
double avgSolveTime, avgIterations, avgScore, avgCross, avgSameSegCross,
avgDiffSegCross, avgSeps, solutionSpaceSize, solutionSpaceSizeOrig,
maxCompSolSpace, simplificationTime;

// best score for multiple runs
size_t sameSegCrossings;
Expand All @@ -40,11 +45,11 @@ class Optimizer {

virtual OptResStats optimize(shared::rendergraph::RenderGraph* rg) const;
double optimizeComp(OptGraph* g, const std::set<OptNode*>& cmp,
shared::rendergraph::HierarOrderCfg* c,
OptResStats& stats) const;
shared::rendergraph::HierarOrderCfg* c,
OptResStats& stats) const;
virtual double optimizeComp(OptGraph* g, const std::set<OptNode*>& cmp,
shared::rendergraph::HierarOrderCfg* c,
size_t depth, OptResStats& stats) const = 0;
shared::rendergraph::HierarOrderCfg* c,
size_t depth, OptResStats& stats) const = 0;

static std::vector<LinePair> getLinePairs(OptEdge* segment);
static std::vector<LinePair> getLinePairs(OptEdge* segment, bool unique);
Expand Down
2 changes: 1 addition & 1 deletion src/transitmap/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ configure_file (
add_executable(transitmap ${transitmap_main})
add_library(transitmap_dep ${transitmap_SRC})

if (Protobuf_FOUND)
if (Protobuf_FOUND AND Protobuf_PROTOC_EXECUTABLE)
add_dependencies(transitmap_dep proto)
target_link_libraries(transitmap transitmap_dep shared_dep dot_dep util proto ${Protobuf_LIBRARIES})
else()
Expand Down
2 changes: 1 addition & 1 deletion src/transitmap/output/protobuf/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
if (Protobuf_FOUND)
if (Protobuf_FOUND AND Protobuf_PROTOC_EXECUTABLE)
include_directories(${Protobuf_INCLUDE_DIR})

protobuf_generate_cpp(PROTO_SRC PROTO_HEADER vector_tile.proto)
Expand Down
Loading