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

Use external nlohmann-json library instead of copying the files in th… #279

Merged
merged 2 commits into from
Nov 28, 2023
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
3 changes: 2 additions & 1 deletion .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install libboost-all-dev libexpat1-dev libjsoncpp-dev libspdlog-dev libcapnp-dev capnproto
sudo apt-get install libboost-all-dev libexpat1-dev libjsoncpp-dev libspdlog-dev libcapnp-dev capnproto nlohmann-json3-dev
- name: Install deps
if: matrix.os == 'macOS-latest'
run: |
Expand All @@ -32,6 +32,7 @@ jobs:
brew install boost
brew install capnp
brew install spdlog
brew install nlohmann-json
- name: Gen configure
run: autoreconf -i
- name: configure
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
- name: Install deps
run: |
sudo apt-get update
sudo apt-get install libboost-all-dev libexpat1-dev libjsoncpp-dev libspdlog-dev libcapnp-dev capnproto
sudo apt-get install libboost-all-dev libexpat1-dev libjsoncpp-dev libspdlog-dev libcapnp-dev capnproto nlohmann-json3-dev
- name: Gen configure
run: autoreconf -i
- name: configure
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM debian:bullseye-slim
FROM debian:bookworm-slim
WORKDIR /source
# Install dependencies in an intermediate image
RUN apt-get update && \
apt-get -y --no-install-recommends install build-essential autoconf automake autoconf-archive pkg-config capnproto libcapnp-dev \
libboost-all-dev libtool libspdlog-dev
libboost-all-dev libtool libspdlog-dev nlohmann-json3-dev

# Copy and build source
COPY . /source
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,14 @@ https://chairemobilite.github.io/trRouting/
brew install boost
brew install capnp
brew install spdlog
brew install nlohmann-json
```

## Ubuntu 16.04 Install

[Install Cap'nProto](https://capnproto.org/install.html)
```
sudo apt-get install clang libboost-all-dev libexpat1-dev libjsoncpp-dev libspdlog-dev
sudo apt-get install clang libboost-all-dev libexpat1-dev libjsoncpp-dev libspdlog-dev nlohmann-json3-dev
```

## Compilation
Expand Down
4 changes: 3 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ AS_IF([test x"$CAPNP_BIN" = x"no"], [AC_MSG_ERROR([Please install capnp binary.]

PKG_CHECK_MODULES(SPDLOG, spdlog)

PKG_CHECK_MODULES(JSON, nlohmann_json)

# TODO: Add link to doc of this override flag
CPPFLAGS+=" -DBOOST_BIND_GLOBAL_PLACEHOLDERS"

CPPFLAGS+=" $CAPNP_CFLAGS $PTHREAD_CFLAGS $SPDLOG_CFLAGS"
CPPFLAGS+=" $CAPNP_CFLAGS $PTHREAD_CFLAGS $SPDLOG_CFLAGS $JSON_CLAGS"

# Add BOOST flags
LDFLAGS+=" $BOOST_LDFLAGS $BOOST_REGEX_LIB $BOOST_SYSTEM_LIB $BOOST_PROGRAM_OPTIONS_LIB $BOOST_DATE_TIME_LIB"
Expand Down
2 changes: 1 addition & 1 deletion connection_scan_algorithm/include/result_to_v2.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef TR_RESULT_TO_V2_RESPONSE
#define TR_RESULT_TO_V2_RESPONSE

#include "json.hpp"
#include <nlohmann/json.hpp>
#include "routing_result.hpp"

namespace TrRouting
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef TR_RESULT_TO_V2_ACCESSIBILITY_RESPONSE
#define TR_RESULT_TO_V2_ACCESSIBILITY_RESPONSE

#include "json.hpp"
#include <nlohmann/json.hpp>
#include "routing_result.hpp"

namespace TrRouting
Expand Down
2 changes: 1 addition & 1 deletion connection_scan_algorithm/include/result_to_v2_summary.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef TR_RESULT_TO_V2_SUMMARY_RESPONSE
#define TR_RESULT_TO_V2_SUMMARY_RESPONSE

#include "json.hpp"
#include <nlohmann/json.hpp>
#include "routing_result.hpp"

namespace TrRouting
Expand Down
1 change: 1 addition & 0 deletions connection_scan_algorithm/src/od_trips_routing.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <random>
#include "spdlog/spdlog.h"
#include <nlohmann/json.hpp>

#include "calculator.hpp"
#include "toolbox.hpp"
Expand Down
2 changes: 1 addition & 1 deletion connection_scan_algorithm/src/result_to_v2.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "json.hpp"
#include <nlohmann/json.hpp>
#include "constants.hpp"
#include "result_constants.hpp"
#include "result_to_v2.hpp"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "json.hpp"
#include <nlohmann/json.hpp>
#include "constants.hpp"
#include "result_constants.hpp"
#include "result_to_v2_accessibility.hpp"
Expand Down
2 changes: 1 addition & 1 deletion connection_scan_algorithm/src/result_to_v2_summary.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "json.hpp"
#include <nlohmann/json.hpp>
#include "constants.hpp"
#include "result_to_v2_summary.hpp"
#include "toolbox.hpp"
Expand Down
Loading