Skip to content

Commit 24fc13d

Browse files
committed
Merge remote-tracking branch 'upstream/main' into mux-tree
2 parents 14b047c + 92ebed0 commit 24fc13d

153 files changed

Lines changed: 10317 additions & 4712 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
push:
1111
branches: ["main"]
1212

13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
15+
cancel-in-progress: true
16+
1317
jobs:
1418
check-format:
1519
runs-on: ubuntu-latest

CMakeLists.txt

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@ set(CMAKE_CXX_STANDARD_REQUIRED YES)
2525
if (MSVC)
2626
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHs-c- /GR-")
2727
else ()
28-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -fno-rtti")
28+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -frtti")
2929
endif ()
3030

3131
include(FindPackageHandleStandardArgs)
3232
find_package(Python3 3.6 REQUIRED COMPONENTS Interpreter)
33+
find_package(Boost REQUIRED COMPONENTS)
3334

3435
# Build Dynamatic with ccache if the package is present
3536
set(DYNAMATIC_CCACHE_BUILD OFF CACHE BOOL "Set to ON for a ccache enabled build")
@@ -143,13 +144,62 @@ endfunction()
143144
find_package(GUROBI)
144145
if (GUROBI_FOUND)
145146
include_directories(${GUROBI_INCLUDE_DIRS})
147+
148+
# [START Check if the gurobi license is correctly set]
149+
execute_process(
150+
COMMAND gurobi_cl --license
151+
OUTPUT_VARIABLE GRB_LICENSE_VERSION
152+
RESULT_VARIABLE GRB_LICENSE_RESULT
153+
OUTPUT_STRIP_TRAILING_WHITESPACE
154+
)
155+
156+
if(GRB_LICENSE_RESULT EQUAL 0)
157+
message(STATUS "gurobi_cl found and the license is correctly set.")
158+
else()
159+
message(FATAL_ERROR "gurobi_cl not found or the license is not correctly
160+
set. Please check out
161+
https://github.com/EPFL-LAP/dynamatic/blob/main/docs/UserGuide/AdvancedBuild.md#1-gurobi")
162+
endif()
163+
# [END Check if the gurobi license is correctly set]
164+
146165
else()
147166
message(WARNING "Gurobi wasn't found, the buffer placement algorithms \
148167
that requires solving MILPs will not be built with the \
149168
project.")
150169
add_compile_definitions(DYNAMATIC_GUROBI_NOT_INSTALLED)
151170
endif()
152171

172+
#-------------------------------------------------------------------------------
173+
# CBC solver setup
174+
#-------------------------------------------------------------------------------
175+
176+
# Find the CBC, Osi, Clp libraries
177+
find_package(PkgConfig REQUIRED)
178+
179+
# Use pkg-config to get include dirs and libs
180+
# This command sets
181+
# - *_INCLUDE_DIRS
182+
# - *_LIBRARY_DIRS
183+
# But these variable will not be automatically discovered by the target.
184+
pkg_check_modules(CBC REQUIRED cbc)
185+
pkg_check_modules(CLPCORE REQUIRED clp)
186+
pkg_check_modules(OSI REQUIRED osi)
187+
188+
# This command makes the include directory of CBC discoverable
189+
include_directories(dynamatic-opt PRIVATE
190+
${CBC_INCLUDE_DIRS}
191+
${CLPCORE_INCLUDE_DIRS}
192+
${OSI_INCLUDE_DIRS}
193+
)
194+
195+
# This command makes the link directory of CBC discoverable
196+
# Without this, -lCbc would not work on some distros
197+
link_directories(dynamatic-opt PRIVATE
198+
${CBC_LIBRARY_DIRS}
199+
${CLPCORE_LIBRARY_DIRS}
200+
${OSI_LIBRARY_DIRS}
201+
)
202+
153203
#-------------------------------------------------------------------------------
154204
# XLS Integration (experimental)
155205
#-------------------------------------------------------------------------------
@@ -218,3 +268,4 @@ add_subdirectory(${DYNAMATIC_SOURCE_DIR}/lib)
218268
add_subdirectory(${DYNAMATIC_SOURCE_DIR}/test)
219269
add_subdirectory(${DYNAMATIC_SOURCE_DIR}/tools)
220270
add_subdirectory(${DYNAMATIC_SOURCE_DIR}/tutorials)
271+
add_subdirectory(${DYNAMATIC_SOURCE_DIR}/unittests)

Dockerfile

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# The Dockerfile for building the latest Dynamatic
2+
#
3+
# Usage:
4+
#
5+
# 1. Creating a docker image:
6+
#
7+
# ```bash
8+
# $ docker build -t dynamatic-image .
9+
# ```
10+
#
11+
# 2. Running the docker image:
12+
#
13+
# ```bash
14+
# $ docker run -it -u dynamatic:dynamatic dynamatic-image /bin/bash
15+
# ```
16+
#
17+
18+
# [START Installing the dependency]
19+
FROM ubuntu:22.04
20+
ENV DEBIAN_FRONTEND=noninteractive
21+
RUN apt-get -y update && apt-get -y upgrade
22+
RUN \
23+
apt-get install -y \
24+
--option APT::Immediate-Configure=false \
25+
clang lld ccache cmake \
26+
ninja-build python3 openjdk-21-jdk \
27+
graphviz git curl gzip libreadline-dev \
28+
libboost-all-dev pkg-config coinor-cbc \
29+
coinor-libcbc-dev
30+
# [END Installing the dependency]
31+
32+
# [START Create a user called "dynamatic"]
33+
# Add a user
34+
RUN useradd -m dynamatic
35+
USER dynamatic
36+
ARG workdir="/home/dynamatic"
37+
WORKDIR $workdir
38+
# [END Create a user called "dynamatic"]
39+
40+
# [START Install SBT]
41+
RUN \
42+
curl -fL "https://github.com/coursier/coursier/releases/latest/download/cs-x86_64-pc-linux.gz" | \
43+
gzip -d > cs && chmod +x cs && ./cs setup -y && rm cs
44+
45+
ENV PATH="$PATH:$workdir/.local/share/coursier/bin"
46+
47+
RUN sbt --version
48+
# [END Install SBT]
49+
50+
# [START Clone and build the latest Dynamatic]
51+
RUN git clone \
52+
--recurse-submodules \
53+
"https://github.com/EPFL-LAP/dynamatic.git" "$workdir/dynamatic"
54+
55+
RUN cd "$workdir/dynamatic" && \
56+
bash "./build.sh" --release
57+
# [END Clone and build the latest Dynamatic]

build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ if [[ $SKIP_POLYGEIST -eq 0 ]]; then
236236
cmake -G Ninja ../llvm \
237237
-DLLVM_ENABLE_PROJECTS="mlir;clang;polly" \
238238
-DLLVM_TARGETS_TO_BUILD="host" \
239+
-DLLVM_ENABLE_RTTI=ON \
239240
-DBUILD_SHARED_LIBS=ON \
240241
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
241242
-DLLVM_PARALLEL_LINK_JOBS=$LLVM_PARALLEL_LINK_JOBS \

0 commit comments

Comments
 (0)