Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interlocking Route Exclusion #42

Merged
merged 52 commits into from
Mar 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
d1d25b6
exclusion wip
julianharbarth Jan 12, 2023
5ad9411
exclusion wip
julianharbarth Jan 20, 2023
0616e3d
Story 8: Make UI Tests fail when a JavaScript error occurs (#43)
LogicalOverflow Jan 24, 2023
ea6dcf7
Parse LZB/ETCS (#44)
julianharbarth Jan 25, 2023
b13dbf3
clang tidy
julianharbarth Jan 25, 2023
3fc558f
wip
julianharbarth Mar 1, 2023
bb57289
wip
julianharbarth Mar 3, 2023
fdba872
always rename cereal serialization function
julianharbarth Mar 13, 2023
3e78885
add ymd_to_abs
julianharbarth Mar 13, 2023
f5d2cc8
add serve_element to soro-server
julianharbarth Mar 13, 2023
610f159
clean up tests
julianharbarth Mar 13, 2023
44f4193
clean up css
julianharbarth Mar 13, 2023
6267163
add exclusion set api to soro-server
julianharbarth Mar 13, 2023
d13f248
read exclusion sets from cliques
julianharbarth Mar 13, 2023
672f5a0
add detail to station api
julianharbarth Mar 13, 2023
5381950
fix kss parsing
julianharbarth Mar 13, 2023
78ffcae
fix train iteration
julianharbarth Mar 13, 2023
dead808
construct ordering graph with exclusion sets
julianharbarth Mar 13, 2023
d8c453d
update gitignore
julianharbarth Mar 13, 2023
d6d00e2
add INVALID_ANCHOR
julianharbarth Mar 14, 2023
99a4c41
remove unnecessary include
julianharbarth Mar 14, 2023
008ebc0
fix ordering graph test case
julianharbarth Mar 14, 2023
54aa74d
resolve merge conflicts
julianharbarth Mar 14, 2023
90dabcb
Merge branch 'master' into exclusion
julianharbarth Mar 14, 2023
91387b2
rename expects -> expect to make room for the expects lambda function
julianharbarth Mar 14, 2023
c2d8cc4
fix formatting
julianharbarth Mar 14, 2023
ce8ec7f
print ordering graph statistics
julianharbarth Mar 14, 2023
4ceca0e
update utl
julianharbarth Mar 14, 2023
158e639
put formatter into fmt namespace
julianharbarth Mar 14, 2023
27c92ed
add absolute_time::operator<=>
julianharbarth Mar 14, 2023
537a2b1
update cereal
julianharbarth Mar 14, 2023
c23782c
remove operator<=> and use operator<
julianharbarth Mar 14, 2023
21e94f3
use CISTA_COMPARABLE()
julianharbarth Mar 14, 2023
f8ef47a
add explicit cast
julianharbarth Mar 14, 2023
b0bd131
ignore meta elements for infrastructure stats
julianharbarth Mar 14, 2023
5168167
add explicit cast for trip_to_nodes
julianharbarth Mar 14, 2023
9fd9126
use brace initialization
julianharbarth Mar 14, 2023
79ea683
fix windows build
julianharbarth Mar 14, 2023
b930c59
add cross test
julianharbarth Mar 16, 2023
cb6aaf3
refactor std_wrappers
julianharbarth Mar 16, 2023
ed82fd5
pull cycle detection out of simulation graph
julianharbarth Mar 16, 2023
07f442c
add refactored std_wrapper
julianharbarth Mar 16, 2023
e50dcaf
add ordering graph cross test
julianharbarth Mar 20, 2023
f33a44c
fix windows ci
julianharbarth Mar 20, 2023
fe27205
make inline
julianharbarth Mar 20, 2023
a4240d5
always break lines for template declarations
julianharbarth Mar 20, 2023
989849d
print absolute paths for errors
julianharbarth Mar 20, 2023
b05dfcd
remove exclusion sets api
julianharbarth Mar 20, 2023
360f5bf
consistent naming
julianharbarth Mar 20, 2023
79b575d
fix windows ci
julianharbarth Mar 20, 2023
b7c42e3
tidy up
julianharbarth Mar 20, 2023
3d2bd71
dont start server in constructor
julianharbarth Mar 20, 2023
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
4 changes: 3 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ AccessModifierOffset: -2
ConstructorInitializerAllOnOneLineOrOnePerLine: true
AlignTrailingComments: false
RequiresClausePosition: OwnLine
BreakBeforeConceptDeclarations: Always
# RequiresExpressionIndentation: OuterScope // enable with clang 16
KeepEmptyLinesAtTheStartOfBlocks: true
AllowShortCaseLabelsOnASingleLine: true
AlwaysBreakTemplateDeclarations: true
AlwaysBreakTemplateDeclarations: Yes
SpacesBeforeTrailingComments: 2
IncludeBlocks: Preserve
IncludeCategories:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ jobs:
# ==== WEB TESTS ====
- name: Run Server
run: |
.\build\${{ matrix.config.preset }}\soro-server.exe -t --resource_dir .\resources --server_resource_dir .\build\${{ matrix.config.preset }}\server_resources\
cd build\${{ matrix.config.preset }}\
.\soro-server.exe -t --resource_dir ..\..\resources

# ==== DISTRIBUTION ====
- name: Delete unnecessary files
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
.pkg.mutex
/CMakeSettings.json
resources/infrastructure/de_iss
resources/de_iss
resources/timetable/de_kss
resources/de_kss
# Ignore the file produced by cmake
test/include/test/file_paths.h
16 changes: 14 additions & 2 deletions .pkg
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[cista]
[email protected]:felixguendling/cista.git
branch=master
commit=1ab98b3a3b9b41b12788107325df3d7b7c49efa6
commit=7d56bbdb0f653acdb04f21022e8071d8f67e0c66
[utl]
[email protected]:motis-project/utl.git
branch=master
commit=0be21a91d96f27f2de4583eb5badfd1c873e3f6c
commit=52afc3944fddf974d6875deb690afda58e971771
[doctest]
[email protected]:motis-project/doctest.git
branch=master
Expand Down Expand Up @@ -34,3 +34,15 @@
[email protected]:motis-project/boost.git
branch=master
commit=c90d53bdcd7ff741a416ae122b33c9c2a96e8be7
[net]
[email protected]:motis-project/net.git
branch=master
commit=47a699159ea87e781451ce80e09915e2a8278082
[range-v3]
[email protected]:motis-project/range-v3.git
branch=master
commit=4178d8359d76e3ba612d40a980bc0e5711073ca8
[cereal]
[email protected]:motis-project/cereal.git
branch=master
commit=9e4b49437bc3d47b628a271edd38c1cd7266c669
228 changes: 120 additions & 108 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,50 +8,53 @@ project(soro CXX)
option(SERIALIZE "Enable serialization with cista." OFF)
option(USE_CISTA_RAW "Use cista::raw instead of cista::offset." OFF)

if (SERIALIZE)
set(SORO_COMPILE_DEFINITIONS SERIALIZE ${SORO_COMPILE_DEFINITIONS})
else ()
set(SORO_COMPILE_DEFINITIONS STD ${SORO_COMPILE_DEFINITIONS})
endif ()
if(SERIALIZE)
set(SORO_COMPILE_DEFINITIONS SERIALIZE ${SORO_COMPILE_DEFINITIONS})
else()
set(SORO_COMPILE_DEFINITIONS STD ${SORO_COMPILE_DEFINITIONS})
endif()

if (USE_CISTA_RAW)
set(SORO_COMPILE_DEFINITIONS USE_CISTA_RAW ${SORO_COMPILE_DEFINITIONS})
endif ()
if(USE_CISTA_RAW)
set(SORO_COMPILE_DEFINITIONS USE_CISTA_RAW ${SORO_COMPILE_DEFINITIONS})
endif()

# rename the cereal serialization function to avoid naming conflicts with cista
set(SORO_COMPILE_DEFINITIONS CEREAL_SERIALIZE_FUNCTION_NAME=cereal_serialize ${SORO_COMPILE_DEFINITIONS})

# --- CLANG SUITE OPTIONS --- #
option(SORO_SAN "Run clang with sanitizers." OFF)
option(SORO_LINT "Run clang-tidy with the compiler." OFF)

if (SORO_SAN)
SET(SORO_COMPILE_DEFINITIONS SORO_SAN ${SORO_COMPILE_DEFINITIONS})
SET(SORO_LINK_STATIC "")
else ()
SET(SORO_LINK_STATIC "-static")
endif ()
if(SORO_SAN)
SET(SORO_COMPILE_DEFINITIONS SORO_SAN ${SORO_COMPILE_DEFINITIONS})
SET(SORO_LINK_STATIC "")
else()
SET(SORO_LINK_STATIC "-static")
endif()

if (SORO_LINT)
include(cmake/clang-tidy.cmake)
endif ()
if(SORO_LINT)
include(cmake/clang-tidy.cmake)
endif()

# --- MISC OPTIONS --- #
option(SORO_DEBUG "Build the code with debug information." OFF)
option(SORO_CUDA "Enable GPU-accelerated computing." OFF)

if (SORO_DEBUG)
set(SORO_COMPILE_DEFINITIONS SORO_DEBUG ${SORO_COMPILE_DEFINITIONS})
endif ()
if(SORO_DEBUG)
set(SORO_COMPILE_DEFINITIONS SORO_DEBUG ${SORO_COMPILE_DEFINITIONS})
endif()

if (SORO_CUDA)
set(SORO_COMPILE_DEFINITIONS SORO_CUDA ${SORO_COMPILE_DEFINITIONS})
if(SORO_CUDA)
set(SORO_COMPILE_DEFINITIONS SORO_CUDA ${SORO_COMPILE_DEFINITIONS})

set(SORO_CUDA_ARCH "-gencode arch=compute_75,code=sm_75 -gencode arch=compute_61,code=sm_61")
if (MSVC)
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} ${SORO_CUDA_ARCH} -lcudadevrt")
else ()
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} ${SORO_CUDA_ARCH} --compiler-options -static")
endif ()
enable_language(CUDA)
endif ()
set(SORO_CUDA_ARCH "-gencode arch=compute_75,code=sm_75 -gencode arch=compute_61,code=sm_61")
if(MSVC)
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} ${SORO_CUDA_ARCH} -lcudadevrt")
else()
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} ${SORO_CUDA_ARCH} --compiler-options -static")
endif()
enable_language(CUDA)
endif()

set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")

Expand All @@ -69,52 +72,59 @@ find_package(Threads REQUIRED)
### --- CXX FLAGS --- ###

set(SORO_COMPILE_OPTIONS "")
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(SORO_COMPILE_OPTIONS ${SORO_COMPILE_OPTIONS}
-Weverything
-Wno-c++98-compat
-Wno-c++98-compat-pedantic
-Wno-newline-eof
-Wno-missing-prototypes
-Wno-padded
-Wno-double-promotion
-Wno-undef
-Wno-undefined-reinterpret-cast
-Wno-float-conversion
-Wno-global-constructors
-Wno-exit-time-destructors
-Wno-switch-enum
-Wno-c99-designator
-Wno-zero-as-null-pointer-constant
-Wno-missing-noreturn
-Wno-deprecated-experimental-coroutine
-Werror
-fcoroutines-ts
${SORO_LINK_STATIC}
)

if (CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 15)
set(SORO_COMPILE_OPTIONS ${SORO_COMPILE_OPTIONS}
-Wno-deprecated-non-prototype)
endif ()

if (SORO_SAN)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address,undefined -fno-omit-frame-pointer")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address,undefined, -fno-omit-frame-pointer")
endif ()
elseif (MSVC)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(SORO_COMPILE_OPTIONS ${SORO_COMPILE_OPTIONS}
-Weverything
-Wno-c++98-compat
-Wno-c++98-compat-pedantic
-Wno-newline-eof
-Wno-missing-prototypes
-Wno-padded
-Wno-double-promotion
-Wno-undef
-Wno-undefined-reinterpret-cast
-Wno-float-conversion
-Wno-global-constructors
-Wno-exit-time-destructors
-Wno-switch-enum
-Wno-c99-designator
-Wno-zero-as-null-pointer-constant
-Wno-missing-noreturn
-Wno-deprecated-experimental-coroutine
-Werror
-fcoroutines-ts
-fexperimental-library
${SORO_LINK_STATIC}
)

if(CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 15)
set(SORO_COMPILE_OPTIONS ${SORO_COMPILE_OPTIONS}
/WX
)
else ()
-Wno-deprecated-non-prototype)
endif()

if(CMAKE_CXX_COMPILER_VERSION GREATER_EQUAL 16)
set(SORO_COMPILE_OPTIONS ${SORO_COMPILE_OPTIONS}
-Wall
-Wextra
-Werror
-fcoroutines
${SORO_LINK_STATIC}
)
endif ()
-Wno-unsafe-buffer-usage) # TODO(julian) try enabling this
endif()

if(SORO_SAN)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address,undefined -fno-omit-frame-pointer")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address,undefined, -fno-omit-frame-pointer")
endif()
elseif(MSVC)
set(SORO_COMPILE_OPTIONS ${SORO_COMPILE_OPTIONS}
/WX
)
else()
set(SORO_COMPILE_OPTIONS ${SORO_COMPILE_OPTIONS}
-Wall
-Wextra
-Werror
-fcoroutines
-fconcepts-diagnostics-depth=10
${SORO_LINK_STATIC}
)
endif()

set(SORO_COMPILE_FEATURES cxx_std_20)

Expand All @@ -126,27 +136,27 @@ set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
file(GLOB_RECURSE soro-lib-files src/*.cc)
add_library(soro-lib STATIC EXCLUDE_FROM_ALL ${soro-lib-files})

if (SORO_CUDA)
add_library(infrastructure-cuda src/infrastructure/gpu/exclusion.cu)
set_target_properties(infrastructure-cuda PROPERTIES
WINDOWS_EXPORT_ALL_SYMBOLS ON
CUDA_STANDARD 20
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
INSTALL_RPATH "$ORIGIN/../lib:$ORIGIN/")
target_include_directories(infrastructure-cuda PUBLIC include)
set_property(TARGET infrastructure-cuda PROPERTY CUDA_ARCHITECTURES 75 61)
endif ()
if(SORO_CUDA)
add_library(infrastructure-cuda src/infrastructure/gpu/exclusion.cu)
set_target_properties(infrastructure-cuda PROPERTIES
WINDOWS_EXPORT_ALL_SYMBOLS ON
CUDA_STANDARD 20
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
INSTALL_RPATH "$ORIGIN/../lib:$ORIGIN/")
target_include_directories(infrastructure-cuda PUBLIC include)
set_property(TARGET infrastructure-cuda PROPERTY CUDA_ARCHITECTURES 75 61)
endif()

target_compile_options(soro-lib PRIVATE ${SORO_COMPILE_OPTIONS})
target_compile_features(soro-lib PRIVATE ${SORO_COMPILE_FEATURES})
target_compile_definitions(soro-lib PRIVATE ${SORO_COMPILE_DEFINITIONS})
target_include_directories(soro-lib PUBLIC include)
target_link_libraries(soro-lib PRIVATE utl cista date pugixml Threads::Threads)
target_link_libraries(soro-lib PUBLIC utl cista date pugixml range-v3 Threads::Threads)

if (SORO_CUDA)
target_link_libraries(soro-lib PUBLIC infrastructure-cuda)
endif ()
if(SORO_CUDA)
target_link_libraries(soro-lib PUBLIC infrastructure-cuda)
endif()

# Gets us the soro-server-client target
set(SORO_SERVER_DIR ${CMAKE_CURRENT_BINARY_DIR})
Expand All @@ -155,7 +165,7 @@ add_subdirectory(web/client)

# Generate file_paths.h for locating the test resources
configure_file(test/include/test/file_paths.h.in
${CMAKE_CURRENT_SOURCE_DIR}/test/include/test/file_paths.h)
${CMAKE_CURRENT_SOURCE_DIR}/test/include/test/file_paths.h)

# Build the tests by getting all test files and linking to doctest and soro-lib
file(GLOB_RECURSE soro-test-files test/src/*.cc web/server/test/src/*.cc)
Expand All @@ -172,24 +182,26 @@ target_include_directories(soro-test PUBLIC test/include)

# returns all targets except targets defined in deps/-
function(get_all_targets _result _dir)
get_property(_subdirs DIRECTORY "${_dir}" PROPERTY SUBDIRECTORIES)
foreach (_subdir IN LISTS _subdirs)
if (NOT ${_subdir} MATCHES ".*deps.*")
get_all_targets(${_result} "${_subdir}")
endif ()
endforeach ()

get_directory_property(_sub_targets DIRECTORY "${_dir}" BUILDSYSTEM_TARGETS)
set(${_result} ${${_result}} ${_sub_targets} PARENT_SCOPE)
get_property(_subdirs DIRECTORY "${_dir}" PROPERTY SUBDIRECTORIES)
foreach(_subdir IN LISTS _subdirs)
if(NOT ${_subdir} MATCHES ".*deps.*")
get_all_targets(${_result} "${_subdir}")
endif()
endforeach()

get_directory_property(_sub_targets DIRECTORY "${_dir}" BUILDSYSTEM_TARGETS)
set(${_result} ${${_result}} ${_sub_targets} PARENT_SCOPE)
endfunction()

# if linting is on set the clang tidy property on all defined targets
if (SORO_LINT)
get_all_targets(all-targets ${CMAKE_CURRENT_SOURCE_DIR})

foreach (target ${all-targets})
set_target_properties(${target} PROPERTIES
CXX_CLANG_TIDY ${SORO_CLANG_TIDY}
)
endforeach ()
endif ()
if(SORO_LINT)
get_all_targets(all-targets ${CMAKE_CURRENT_SOURCE_DIR})

foreach(target ${all-targets})
set_target_properties(${target} PROPERTIES
CXX_CLANG_TIDY ${SORO_CLANG_TIDY}
)
endforeach()
endif()

add_subdirectory(tools)
Loading