Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-cpplib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-cpplib
Commits
6d44f8a7
Verified
Commit
6d44f8a7
authored
3 years ago
by
Timm Fitschen
Browse files
Options
Downloads
Patches
Plain Diff
WIP: conan
parent
65c53b94
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#9922
passed
3 years ago
Stage: info
Stage: setup
Stage: test
Stage: deploy
Pipeline: caosdb-cppinttest
#9930
Changes
4
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitlab-ci.yml
+2
-2
2 additions, 2 deletions
.gitlab-ci.yml
README_SETUP.md
+6
-66
6 additions, 66 deletions
README_SETUP.md
conan.profile
+0
-12
0 additions, 12 deletions
conan.profile
include/caosdb/utils.h
+2
-1
2 additions, 1 deletion
include/caosdb/utils.h
with
10 additions
and
81 deletions
.gitlab-ci.yml
+
2
−
2
View file @
6d44f8a7
...
@@ -84,7 +84,7 @@ test:
...
@@ -84,7 +84,7 @@ test:
script
:
script
:
-
mkdir build
-
mkdir build
-
cd build
-
cd build
-
conan install .. -
-profile ../conan.profile
-
conan install .. -
s "compiler.libcxx=libstdc++11"
-
cmake -DCMAKE_BUILD_TYPE=Debug ..
-
cmake -DCMAKE_BUILD_TYPE=Debug ..
-
cmake --build .
-
cmake --build .
-
cmake --build . --target unit_test_coverage
-
cmake --build . --target unit_test_coverage
...
@@ -129,7 +129,7 @@ trigger_inttest:
...
@@ -129,7 +129,7 @@ trigger_inttest:
script
:
script
:
-
mkdir -p build
-
mkdir -p build
-
cd build
-
cd build
-
conan install .. -
-profile ../conan.profile
-
conan install .. -
s "compiler.libcxx=libstdc++11"
-
cmake ..
-
cmake ..
-
cmake --build . --target doc-sphinx
-
cmake --build . --target doc-sphinx
-
cp -r doc/sphinx_out ../public
-
cp -r doc/sphinx_out ../public
...
...
This diff is collapsed.
Click to expand it.
README_SETUP.md
+
6
−
66
View file @
6d44f8a7
...
@@ -5,61 +5,9 @@
...
@@ -5,61 +5,9 @@
We use
[
cmake
](
https://cmake.org
)
as build tool.
We use
[
cmake
](
https://cmake.org
)
as build tool.
1.
`mkdir build && cd build/`
1.
`mkdir build && cd build/`
2.
`cmake -B . ..`
2.
`conan install .. -s "compiler.libcxx=libstdc++11"`
3.
`cmake --build .`
3.
`cmake -B . ..`
4.
`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`
.
## Unit Tests
## Unit Tests
...
@@ -68,22 +16,14 @@ installed correctly by `make install` of `grpc`.
...
@@ -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`
)
For the tests there is a slightly different setup required (with option
`-D CMAKE_BUILD_TYPE=Debug`
)
1.
`mkdir build && cd build/`
1.
`mkdir build && cd build/`
2.
`cmake -B . -D CMAKE_BUILD_TYPE=Debug ..`
2.
`conan install .. -s "compiler.libcxx=libstdc++11"`
3.
`cmake --build .`
3.
`cmake -B . -D CMAKE_BUILD_TYPE=Debug ..`
4.
`cmake --build .`
### Run
### Run
In the build directory, run
`ctest`
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
### Framework
We use
[
GoogleTest
](
https://google.github.io/googletest/
)
for unit testing.
We use
[
GoogleTest
](
https://google.github.io/googletest/
)
for unit testing.
...
...
This diff is collapsed.
Click to expand it.
conan.profile
deleted
100644 → 0
+
0
−
12
View file @
65c53b94
[
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
]
This diff is collapsed.
Click to expand it.
include/caosdb/utils.h
+
2
−
1
View file @
6d44f8a7
...
@@ -32,7 +32,8 @@ namespace caosdb::utils {
...
@@ -32,7 +32,8 @@ namespace caosdb::utils {
/**
/**
* @brief Read a text file into a string and return the file's content.
* @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
{
inline
auto
load_string_file
(
const
std
::
string
&
path
)
->
std
::
string
{
const
auto
path_view
=
std
::
string_view
{
path
};
const
auto
path_view
=
std
::
string_view
{
path
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment