Skip to content
This repository was archived by the owner on Jul 8, 2022. It is now read-only.

Commit b2bfef4

Browse files
authored
Merge pull request #597 from tango-controls/add-debian-buster
Add debian buster (for 9.3-backports branch)
2 parents ad11782 + 3389e02 commit b2bfef4

File tree

17 files changed

+130
-96
lines changed

17 files changed

+130
-96
lines changed

.travis.yml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,11 @@ language: cpp
44

55
env:
66
matrix:
7-
- OS_TYPE=debian9 CMAKE_BUILD_TYPE=DEBUG SONAR_SCANNER=OFF COVERALLS=OFF
8-
- OS_TYPE=debian9 CMAKE_BUILD_TYPE=RELEASE SONAR_SCANNER=OFF COVERALLS=OFF
9-
- OS_TYPE=debian8 CMAKE_BUILD_TYPE=Debug SONAR_SCANNER=ON COVERALLS=ON
10-
- OS_TYPE=debian8 CMAKE_BUILD_TYPE=RELEASE SONAR_SCANNER=OFF COVERALLS=OFF
11-
- OS_TYPE=debian7 CMAKE_BUILD_TYPE=RELEASE SONAR_SCANNER=OFF COVERALLS=OFF
12-
# - OS_TYPE=debian7 CMAKE_BUILD_TYPE=DEBUG
13-
# - OS_TYPE=win32
14-
# etc
7+
- OS_TYPE=debian10 CMAKE_BUILD_TYPE=Release SONAR_SCANNER=OFF COVERALLS=OFF STOCK_CPPZMQ=ON
8+
- OS_TYPE=debian10 CMAKE_BUILD_TYPE=Debug SONAR_SCANNER=OFF COVERALLS=OFF STOCK_CPPZMQ=ON
9+
- OS_TYPE=debian9 CMAKE_BUILD_TYPE=Debug SONAR_SCANNER=OFF COVERALLS=OFF STOCK_CPPZMQ=ON
10+
- OS_TYPE=debian8 CMAKE_BUILD_TYPE=Debug SONAR_SCANNER=ON COVERALLS=ON STOCK_CPPZMQ=OFF
11+
- OS_TYPE=debian7 CMAKE_BUILD_TYPE=Debug SONAR_SCANNER=OFF COVERALLS=OFF STOCK_CPPZMQ=ON
1512

1613
notifications:
1714
email: false
@@ -35,7 +32,7 @@ before_install:
3532
- docker pull tangocs/mysql:9.2.2
3633
- docker pull tangocs/tango-cs:latest
3734
- git clone https://github.com/JoakimSoderberg/coveralls-cmake.git
38-
- git clone -b v4.2.2 https://${CI_USER_TOKEN}@github.com/zeromq/cppzmq.git cppzmq
35+
- (test ${STOCK_CPPZMQ} = "OFF" && git clone -b v4.2.2 https://${CI_USER_TOKEN}@github.com/zeromq/cppzmq.git cppzmq) || mkdir cppzmq
3936
- git clone -b tango-9-lts https://${CI_USER_TOKEN}@github.com/tango-controls/tango-idl.git idl
4037
- wget https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip && unzip build-wrapper-linux-x86.zip
4138

@@ -47,12 +44,12 @@ before_script:
4744
- docker build --build-arg APP_UID=$(id -u) --build-arg APP_GID=$(id -g) -t cpp_tango .travis/${OS_TYPE}
4845
- docker run --name cpp_tango -e TANGO_HOST=${TANGO_HOST} -e BINTRAY_USER_NAME=tango-ci -e BINTRAY_API_KEY=${CI_BINTRAY_API_KEY} -e COVERALLS_REPO_TOKEN=${COVERALLS_REPO_TOKEN} --link tango_cs:tango_cs -v `pwd`:/home/tango/src -v `pwd`/idl:/home/tango/idl -v `pwd`/cppzmq:/home/tango/cppzmq -v `pwd`/coveralls-cmake:/home/tango/coveralls-cmake -v `pwd`/build-wrapper-linux-x86:/home/tango/build-wrapper-linux-x86 -dit cpp_tango
4946
- .travis/install_tango_idl.sh
50-
- .travis/install_cppzmq.sh
47+
- (test ${STOCK_CPPZMQ} = "OFF" && .travis/install_cppzmq.sh) || true
5148
#work around gcov ignored by sonar
5249
- sudo mkdir /home/tango && sudo mkdir /home/tango/src && sudo mount --bind `pwd` /home/tango/src
5350

5451
script:
55-
- .travis/${OS_TYPE}/run.sh
52+
- .travis/run.sh
5653
- .travis/test.sh COVERALLS=OFF
5754

5855
after_success:

.travis/debian10/Dockerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
FROM debian:buster
2+
3+
ARG APP_UID=2000
4+
5+
ARG APP_GID=2000
6+
7+
MAINTAINER TANGO Controls team <tango@esrf.fr>
8+
9+
RUN apt-get update && apt-get install -y apt-utils
10+
11+
RUN apt-get install -y build-essential cmake
12+
13+
RUN apt-get install -y curl lsb-release
14+
15+
RUN apt-get install -y omniidl libomniorb4-dev libcos4-dev libomnithread4-dev libzmq3-dev
16+
17+
RUN apt-get install -y python2
18+
19+
RUN groupadd -g "$APP_GID" tango
20+
21+
RUN useradd -u "$APP_UID" -g "$APP_GID" -ms /bin/bash tango
22+
23+
ENV PKG_CONFIG_PATH=/home/tango/lib/pkgconfig
24+
25+
USER tango
26+
27+
WORKDIR /home/tango

.travis/debian7/run.sh

Lines changed: 0 additions & 12 deletions
This file was deleted.

.travis/debian8/run.sh

Lines changed: 0 additions & 16 deletions
This file was deleted.

.travis/debian9/run.sh

Lines changed: 0 additions & 11 deletions
This file was deleted.

.travis/run.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
echo "############################"
6+
echo "CMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE"
7+
echo "OS_TYPE=$OS_TYPE"
8+
echo "TANGO_HOST=$TANGO_HOST"
9+
echo "COVERALLS=$COVERALLS"
10+
echo "############################"
11+
12+
docker exec cpp_tango mkdir -p /home/tango/src/build
13+
14+
# set defaults
15+
MAKEFLAGS=${MAKEFLAGS:- -j 2}
16+
COVERALLS=${COVERALLS:-OFF}
17+
USE_PCH=${USE_PCH:-OFF}
18+
COVERALLS_MODULE_PATH=/home/tango/coveralls-cmake/cmake
19+
20+
docker exec cpp_tango cmake \
21+
-H/home/tango/src \
22+
-B/home/tango/src/build \
23+
-DCMAKE_VERBOSE_MAKEFILE=ON \
24+
-DCPPZMQ_BASE=/home/tango \
25+
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \
26+
-DCOVERALLS=${COVERALLS} \
27+
-DCOVERALLS_MODULE_PATH=${COVERALLS_MODULE_PATH}
28+
29+
if [[ "$COVERALLS" == "ON" ]]
30+
then
31+
docker exec cpp_tango \
32+
/home/tango/build-wrapper-linux-x86/build-wrapper-linux-x86-64 \
33+
--out-dir /home/tango/src/bw-output \
34+
make -C /home/tango/src/build
35+
else
36+
docker exec cpp_tango make -C /home/tango/src/build
37+
fi

INSTALL.md

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -44,30 +44,9 @@ Typical output:
4444
-- Installing: /storage/Projects/org.tango/git/cppTango/build/install/include/idl/tango.h
4545
```
4646

47-
## Ubuntu 16.04 compilation problem
47+
## Installing required cppzmq version on older systems
4848

49-
When compiling on Ubuntu 16.04 or on Debian stretch, the following error can occur:
50-
51-
```
52-
[ 17%] Building CXX object cppapi/client/CMakeFiles/client_objects.dir/zmqeventconsumer.cpp.o
53-
/home/ingvord/Projects/org.tango/git/cppTango/cppapi/client/zmqeventconsumer.cpp: In member function ‘virtual void* Tango::ZmqEventConsumer::run_undetached(void*)’:
54-
/home/ingvord/Projects/org.tango/git/cppTango/cppapi/client/zmqeventconsumer.cpp:186:18: error: cannot convert ‘zmq::socket_t’ to ‘void*’ in assignment
55-
items[0].socket = *control_sock;
56-
^
57-
/home/ingvord/Projects/org.tango/git/cppTango/cppapi/client/zmqeventconsumer.cpp:187:18: error: cannot convert ‘zmq::socket_t’ to ‘void*’ in assignment
58-
items[1].socket = *heartbeat_sub_sock;
59-
^
60-
/home/ingvord/Projects/org.tango/git/cppTango/cppapi/client/zmqeventconsumer.cpp:188:18: error: cannot convert ‘zmq::socket_t’ to ‘void*’ in assignment
61-
items[2].socket = *event_sub_sock;
62-
^
63-
/home/ingvord/Projects/org.tango/git/cppTango/cppapi/client/zmqeventconsumer.cpp: In member function ‘bool Tango::ZmqEventConsumer::process_ctrl(zmq::message_t&, zmq::pollitem_t*, int&)’:
64-
/home/ingvord/Projects/org.tango/git/cppTango/cppapi/client/zmqeventconsumer.cpp:1063:47: error: cannot convert ‘zmq::socket_t’ to ‘void*’ in assignment
65-
poll_list[old_poll_nb].socket = *tmp_sock;
66-
```
67-
68-
This is due to incompatibility of zmq.hpp file provided in libzmq3-dev:4.1.7
69-
(ubuntu 16.04), i.e. it is not possible to compile cppTango using zmq.hpp file
70-
provided by libzmq3-dev:4.1.7 (ubuntu 16.04).
49+
On some debian versions, 7 (wheezy) and older, there is no compatible cppzmq version available.
7150

7251
This requires installing [cppzmq](https://github.com/zeromq/cppzmq) via:
7352

@@ -80,6 +59,16 @@ cmake -DENABLE_DRAFTS=OFF -DCPPZMQ_BUILD_TESTS=OFF ..
8059
sudo make install
8160
```
8261

62+
And then pass `-DCPPZMQ_BASE=/usr/local` to cmake or use
63+
64+
```
65+
mkdir build
66+
cd build
67+
configure CXXFLAGS="-I /usr/local/include" ..
68+
```
69+
70+
when compiling via the tango source distribution.
71+
8372
# Using pkg-config
8473

8574
Once installed cppTango provides [pkg-config](https://en.wikipedia.org/wiki/Pkg-config) file `tango.pc`

configure/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,18 @@ Please install cppzmq (https://github.com/zeromq/cppzmq) on your system and/or u
151151
<OMNI_BASE>/include and system include directories).")
152152
endif()
153153

154+
if(NOT WIN32)
155+
try_compile(TANGO_ZMQ_HAS_DISCONNECT ${CMAKE_BINARY_DIR}/test_cppzmq_disconnect
156+
SOURCES ${CMAKE_SOURCE_DIR}/configure/test_cppzmq_disconnect.cpp
157+
COMPILE_DEFINITIONS "-I ${CPPZMQ_BASE}/include -I ${ZMQ_BASE}/include"
158+
LINK_LIBRARIES "${ZMQ_PKG_LIBRARIES}")
159+
160+
message(STATUS "Check if zmq::socket has a disconnect method: ${TANGO_ZMQ_HAS_DISCONNECT}")
161+
else()
162+
set(TANGO_ZMQ_HAS_DISCONNECT TRUE)
163+
message(STATUS "Check if zmq::socket has a disconnect method: ${TANGO_ZMQ_HAS_DISCONNECT} (hardcoded)")
164+
endif(NOT WIN32)
165+
154166
message("Verifying ${OMNIIDL_PATH}omniidl")
155167
if(WIN32)
156168
execute_process(COMMAND ${OMNIIDL_PATH}omniidl.exe -V RESULT_VARIABLE FAILED)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#include <zmq.hpp>
2+
3+
int main(int, char**)
4+
{
5+
zmq::context_t c;
6+
zmq::socket_t s(c, ZMQ_REQ);
7+
s.disconnect("some endpoint");
8+
}

cpp_test_suite/cxxtest/CMakeLists.txt

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
find_package (Threads REQUIRED)
22
find_program(PYTHON_INTERPRETER NAMES python2 python)
33

4+
if(NOT PYTHON_INTERPRETER)
5+
message(SEND_ERROR "Could not find python 2.")
6+
endif()
7+
48
macro(CXX_GENERATE_TEST name)
59
message("Generate ${name}.cpp")
10+
set(GENERATED_FILE "${CMAKE_CURRENT_SOURCE_DIR}/${name}.cpp")
611
execute_process(COMMAND "${PYTHON_INTERPRETER}" cxxtestgen.py
712
--template=${CMAKE_CURRENT_SOURCE_DIR}/template/tango_template.tpl
8-
-o ${CMAKE_CURRENT_SOURCE_DIR}/${name}.cpp
13+
-o ${GENERATED_FILE}
914
../../new_tests/${name}.cpp
10-
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)
15+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin
16+
RESULT_VARIABLE GENERATOR_OUTPUT)
1117

12-
if(${FAILED})
13-
message(SEND_ERROR " Failed to generate ${name}.cpp. rv=${FAILED}")
18+
if(NOT EXISTS ${GENERATED_FILE})
19+
message(SEND_ERROR " Failed to generate ${name}.cpp due to \"${GENERATOR_OUTPUT}\".")
1420
endif()
1521

1622
add_executable(${name} $<TARGET_OBJECTS:compare_test_object> ${name}.cpp)

0 commit comments

Comments
 (0)