Skip to content
Closed
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
c7b3f24
Init adding spdlog to dsm project
Grufoony Nov 20, 2024
6f09527
Working logger
Grufoony Nov 20, 2024
1518ac6
Fix some messages
Grufoony Nov 20, 2024
765328f
Enhance logging
Grufoony Nov 21, 2024
e004129
Change default generator
Grufoony Nov 21, 2024
66640d2
Fix env variable
Grufoony Nov 21, 2024
29c330b
Update installation guidelines
Grufoony Nov 21, 2024
ad4917a
Add multiplication factor to Graph class
Grufoony Nov 25, 2024
f7287df
Small bugfix
Grufoony Nov 25, 2024
33e3efa
Merge branch 'main' into feature_addLogger
Grufoony Nov 25, 2024
857cc9a
Revert Graph changes
Grufoony Nov 25, 2024
c81977e
Removed test
Grufoony Nov 25, 2024
410bbe1
Update version
Grufoony Nov 25, 2024
afeaea8
Replace vcpkg with FetchContent
Grufoony Nov 25, 2024
a2c0095
Update Readme.md
Grufoony Nov 25, 2024
34087d7
Merge branch 'main' into feature_addLogger
Grufoony Nov 25, 2024
55e49f0
Formatting
Grufoony Nov 25, 2024
983efca
Zio bricco pylint
Grufoony Nov 25, 2024
240150e
Update cmakelists
Grufoony Nov 25, 2024
933f338
Fix pylint
Grufoony Nov 25, 2024
a73b473
Working benchmarks
Grufoony Nov 26, 2024
9334858
Add logger to Street class
Grufoony Nov 26, 2024
f3d81aa
Enhance console logger in street
Grufoony Nov 26, 2024
52adbc5
Slightly rework of addAgentsRandomly
Grufoony Nov 26, 2024
a475187
Bugfix and console logging agent class
Grufoony Nov 26, 2024
6d65371
Adding console loggers...
Grufoony Nov 26, 2024
2d3cc48
Adding console logger to Itinerary
Grufoony Nov 26, 2024
9fe83e8
Ops
Grufoony Nov 26, 2024
026f5dd
Addd console logger to node class
Grufoony Nov 26, 2024
6ac3c78
Bugfixing
Grufoony Nov 26, 2024
cf5d3c7
Try to fix workflow
Grufoony Nov 26, 2024
a48aed8
Merge branch 'main' into feature_addLogger
Grufoony Nov 26, 2024
b32fc38
Update checkout action
Grufoony Nov 26, 2024
9d59f40
Add wf for tests on macos
Grufoony Nov 26, 2024
4aaf9d9
Fix some clang warnings
Grufoony Nov 26, 2024
0ade4b0
Try -pthreads flag
Grufoony Nov 26, 2024
69de6a1
Nope
Grufoony Nov 26, 2024
a9a0a1e
Merge branch 'main' into feature_addLogger
Grufoony Nov 28, 2024
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 .pylintrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[MAIN]
generated-members=cv2
generated-members=cv2, osmnx
29 changes: 18 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,35 @@ cmake_minimum_required(VERSION 3.16.0)

project(dms VERSION 2.0.0 LANGUAGES CXX)

# set the C++ standard
# Set the C++ standard
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

include(FetchContent)
# Get spdlog
FetchContent_Declare(
spdlog
GIT_REPOSITORY https://github.com/gabime/spdlog.git
GIT_TAG v1.15.0
)
FetchContent_MakeAvailable(spdlog)

file(GLOB SOURCES "src/dsm/headers/*.cpp")

add_library(dsm STATIC ${SOURCES})

target_link_libraries(dsm PUBLIC spdlog::spdlog)

target_include_directories(dsm PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src/headers>
$<INSTALL_INTERFACE:include>
)

install(TARGETS dsm
EXPORT dsmConfig
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin)

install(DIRECTORY ${PROJECT_SOURCE_DIR}/src/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include)
EXPORT dsmConfig
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin)

install(EXPORT dsmConfig
FILE dsmConfig.cmake
NAMESPACE dsm::
DESTINATION lib/cmake/dsm)
install(DIRECTORY ${PROJECT_SOURCE_DIR}/src/ DESTINATION ${CMAKE_INSTALL_PREFIX}/include)
17 changes: 5 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,21 @@ This rework consists of a full code rewriting, in order to implement more featur

## Requirements

The project only requires `C++20` or greater and `cmake`.
This project requieres a compiler whith full support for `C++20` or greater and `cmake`.
It also depends on [spdlog](https://github.com/gabime/spdlog).

Utilities are written in python. To install their dependencies:
```shell
pip install -r ./requirements.txt
```

## Installation
The library can be installed using CMake. To build and install the project in the default folder run:
The library can be installed using CMake.
To build and install the project in the default folder run:
```shell
cmake -B build && cmake --build build
cmake -B build && make -C build
sudo cmake --install build
```
Otherwise, it is possible to customize the installation path:
```shell
cmake -B build -DCMAKE_INSTALL_PREFIX=/path/to/install
```
then building and installing it (eventually in sudo mode) with:
```shell
cmake --build build
cmake --install build
```

## Testing
This project uses [Doctest](https://github.com/doctest/doctest) for testing.
Expand Down
9 changes: 9 additions & 0 deletions benchmark/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ set(CMAKE_CXX_EXTENSIONS OFF)

include_directories(../extern/benchmark/)

include(FetchContent)
# Get spdlog
FetchContent_Declare(
spdlog
GIT_REPOSITORY https://github.com/gabime/spdlog.git
GIT_TAG v1.15.0
)
FetchContent_MakeAvailable(spdlog)

# add subdirectories
add_subdirectory(Graph)
add_subdirectory(Street)
Expand Down
11 changes: 10 additions & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ endif()
# Set the folder for the executable
set(EXECUTABLE_OUTPUT_PATH ../)

include(FetchContent)
# Get spdlog
FetchContent_Declare(
spdlog
GIT_REPOSITORY https://github.com/gabime/spdlog.git
GIT_TAG v1.15.0
)
FetchContent_MakeAvailable(spdlog)

# add as executable all cpp files into '.' folder
file(GLOB SOURCES "*.cpp")
file(GLOB SRC_SOURCES "../src/dsm/headers/*.cpp")
Expand All @@ -25,5 +34,5 @@ file(GLOB SRC_SOURCES "../src/dsm/headers/*.cpp")
foreach(SOURCE ${SOURCES})
get_filename_component(EXE_NAME ${SOURCE} NAME_WE)
add_executable(${EXE_NAME}.out ${SOURCE} ${SRC_SOURCES})
target_include_directories(${EXE_NAME}.out PRIVATE ../src/dsm/headers/ ../src/dsm/utility/TypeTraits/)
target_include_directories(${EXE_NAME}.out PRIVATE ../src/dsm/headers/ ../src/dsm/utility/TypeTraits/ ${spdlog_SOURCE_DIR}/include)
endforeach()
13 changes: 11 additions & 2 deletions profiling/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,22 @@ string(APPEND CMAKE_CXX_FLAGS "-Wall -Wextra -Os")
# Set the folder for the executable
set(EXECUTABLE_OUTPUT_PATH ../)

include(FetchContent)
# Get spdlog
FetchContent_Declare(
spdlog
GIT_REPOSITORY https://github.com/gabime/spdlog.git
GIT_TAG v1.15.0
)
FetchContent_MakeAvailable(spdlog)

file(GLOB SOURCES "../src/dsm/headers/*.cpp")

# Define the executable
add_executable(prof.out main.cpp ${SOURCES})
target_include_directories(prof.out PRIVATE ../src/)
target_include_directories(prof.out PRIVATE ../src/ ${spdlog_SOURCE_DIR}/include)
target_compile_options(prof.out PRIVATE -pg)
target_link_options(prof.out PRIVATE -pg)
add_executable(mem.out main.cpp ${SOURCES})
target_include_directories(mem.out PRIVATE ../src/)
target_include_directories(mem.out PRIVATE ../src/ ${spdlog_SOURCE_DIR}/include)
add_executable(parse_massif.out parse_massif.cpp)
13 changes: 5 additions & 8 deletions src/dsm/dsm.hpp
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
#ifndef dsm_hpp
#define dsm_hpp
#pragma once

#include <cstdint>
#include <format>

static constexpr uint8_t DSM_VERSION_MAJOR = 2;
static constexpr uint8_t DSM_VERSION_MINOR = 1;
static constexpr uint8_t DSM_VERSION_PATCH = 9;
static constexpr uint8_t DSM_VERSION_PATCH = 10;

#define DSM_VERSION \
std::format("{}.{}.{}", DSM_VERSION_MAJOR, DSM_VERSION_MINOR, DSM_VERSION_PATCH)
static auto const DSM_VERSION =
std::format("{}.{}.{}", DSM_VERSION_MAJOR, DSM_VERSION_MINOR, DSM_VERSION_PATCH);

namespace dsm {
/// @brief Returns the version of the DSM library
/// @return The version of the DSM library
constexpr auto version() { return DSM_VERSION; };
auto const& version() { return DSM_VERSION; };
} // namespace dsm

#include "headers/Agent.hpp"
Expand All @@ -27,5 +26,3 @@ namespace dsm {
#include "utility/TypeTraits/is_node.hpp"
#include "utility/TypeTraits/is_street.hpp"
#include "utility/TypeTraits/is_numeric.hpp"

#endif
Loading
Loading