From 6d44f8a74ed8ffc4293bf64230b5cfc09562807f Mon Sep 17 00:00:00 2001 From: Timm Fitschen <t.fitschen@indiscale.com> Date: Tue, 6 Jul 2021 10:15:06 +0200 Subject: [PATCH] WIP: conan --- .gitlab-ci.yml | 4 +-- README_SETUP.md | 72 ++++-------------------------------------- conan.profile | 12 ------- include/caosdb/utils.h | 3 +- 4 files changed, 10 insertions(+), 81 deletions(-) delete mode 100644 conan.profile diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8c14961..52de1bf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -84,7 +84,7 @@ test: script: - mkdir build - cd build - - conan install .. --profile ../conan.profile + - conan install .. -s "compiler.libcxx=libstdc++11" - cmake -DCMAKE_BUILD_TYPE=Debug .. - cmake --build . - cmake --build . --target unit_test_coverage @@ -129,7 +129,7 @@ trigger_inttest: script: - mkdir -p build - cd build - - conan install .. --profile ../conan.profile + - conan install .. -s "compiler.libcxx=libstdc++11" - cmake .. - cmake --build . --target doc-sphinx - cp -r doc/sphinx_out ../public diff --git a/README_SETUP.md b/README_SETUP.md index 14139ea..bf48fa3 100644 --- a/README_SETUP.md +++ b/README_SETUP.md @@ -5,61 +5,9 @@ We use [cmake](https://cmake.org) as build tool. 1. `mkdir build && cd build/` -2. `cmake -B . ..` -3. `cmake --build .` - -### Troubleshooting - -#### protobufConfig.cmake not found - -If you encounter something like `protobufConfig.cmake not found` when doing -`cmake -B . ..` your system doesn't have the gRPC library installed at all -or your installation doesn't have the required `protobufConfig.cmake` -file. In this case you can install grpcc manually by cloning the -repository and its submodules nad building it from the sources: - -```sh -RUN git clone --recurse-submodules -b v1.38.1 https://github.com/grpc/grpc -cd grpc -mkdir -p cmake/build -cp cmake/build -cmake -DgRPC_INSTALL=ON \ - -DgRPC_BUILD_CSHARP_EXT=OFF \ - -DgRPC_BUILD_GRPC_CSHARP_PLUGIN=OFF \ - -DgRPC_BUILD_GRPC_PYTHON_PLUGIN=OFF \ - -DgRPC_BUILD_GRPC_RUBY_PLUGIN=OFF \ - -DgRPC_BUILD_GRPC_PHP_PLUGIN=OFF \ - -DgRPC_BUILD_GRPC_OBJECTIVE_C_PLUGIN=OFF \ - -DgRPC_BUILD_GRPC_NODE_PLUGIN=OFF \ - -DgRPC_BUILD_TESTS=OFF \ - ../.. -make -j3 # Or whatever number of jobs suits your system -make install -``` - -It may make sense to specify a custom directory for your grpc -installation such as `$HOME/.local` by adding -`-DCMAKE_INSTALL_PREFIX=/path/to/install/dir` to the above `cmake` -command. This prevents interference with a possible system-wide -installation of grpc that's lacking the relevant cmake files. - -Depending on your system, it may be necessary to manually install the -`abseil` submodule: - -```sh -cd grpc -mkdir -p third_party/abseil-cpp/cmake/build -cd third_party/abseil-cpp/cmake/build -cmake -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE ../.. -make -j3 -make install -``` - -As above, it may make sense to specify a `CMAKE_INSTALL_PREFIX` in -order to not interfere with system-wide installations. - -You may have to repeat this for other submodules that haven't been -installed correctly by `make install` of `grpc`. +2. `conan install .. -s "compiler.libcxx=libstdc++11"` +3. `cmake -B . ..` +4. `cmake --build .` ## Unit Tests @@ -68,22 +16,14 @@ installed correctly by `make install` of `grpc`. For the tests there is a slightly different setup required (with option `-D CMAKE_BUILD_TYPE=Debug`) 1. `mkdir build && cd build/` -2. `cmake -B . -D CMAKE_BUILD_TYPE=Debug ..` -3. `cmake --build .` +2. `conan install .. -s "compiler.libcxx=libstdc++11"` +3. `cmake -B . -D CMAKE_BUILD_TYPE=Debug ..` +4. `cmake --build .` ### Run In the build directory, run `ctest` -### Troubleshooting - -Depending on your gtest installation, there may be warnings treated as -errors during the above build command, e.g., a -`-Werror=maybe-uninitialized` in -`caosdb-cpplib-new/build/_deps/googletest-src/googletest/src/gtest-death-test.cc`. In -that case, suppress the corresponding warning by adding -`-DCMAKE_CXX_FLAGS="-Wno-maybe-uninitialized"` to the cmake command in 2. - ### Framework We use [GoogleTest](https://google.github.io/googletest/) for unit testing. diff --git a/conan.profile b/conan.profile deleted file mode 100644 index 4d20c96..0000000 --- a/conan.profile +++ /dev/null @@ -1,12 +0,0 @@ -[settings] -os=Linux -os_build=Linux -arch=x86_64 -arch_build=x86_64 -compiler=gcc -compiler.version=8 -compiler.libcxx=libstdc++11 -build_type=Release -[options] -[build_requires] -[env] diff --git a/include/caosdb/utils.h b/include/caosdb/utils.h index bb54e79..20aebbf 100644 --- a/include/caosdb/utils.h +++ b/include/caosdb/utils.h @@ -32,7 +32,8 @@ namespace caosdb::utils { /** * @brief Read a text file into a string and return the file's content. - * @todo use boost-filesystem's "load_string_file"! + * + * TODO use boost-filesystem's "load_string_file"! */ inline auto load_string_file(const std::string &path) -> std::string { const auto path_view = std::string_view{path}; -- GitLab