Commit Graph

314 Commits

Author SHA1 Message Date
Jacques Germishuys
b26542bbfc Problem: strnlen may not be available
Solution: Provide an implementation
2019-03-18 11:37:53 +00:00
Claudio Biagi
d41ed6180b Proxy performance fix, ticket #3439
Improve performance of the proxy forwarding batch of message.
Add throughput benchmark for proxy.
Fix valgrind error reported on unitialized vars
RELICENSE: Add emtr grant
2019-03-08 15:02:58 +01:00
Simon Giesecke
120edd9809 Problem: selection of condition_variable_t implementation is confusing and not configurable
Solution: move configuration to build definition
2019-02-12 03:47:26 -05:00
Simon Giesecke
bfb092c3ec Problem: value for _WIN32_WINNT not always known in CMakeLists.txt
Solution: calculate from CMAKE_SYSTEM_VERSION

Problem: CMAKE_SYSTEM_VERSION might be newer than Windows SDK Version

Solution: limit _WIN32_WINNT value to Visual Studio default Windows SDK version
2019-02-12 03:47:22 -05:00
Simon Giesecke
01371398e9 Problem: monitor events are unversioned
Solution: add monitor event socket option
2019-02-02 15:33:27 +01:00
Simon Giesecke
5c81bbe82e Problem: norm_engine.cpp missing in CMakeLists.txt
Solution: added it
2019-02-02 15:23:56 +01:00
Simon Giesecke
93c1843f3e Problem: duplication across ipc_listener_t, tcp_listener_t, tipc_listener_t
Solution: extract common base class stream_listener_base_t
2019-02-01 04:58:57 -05:00
Simon Giesecke
d6f8d246e2 Problem: data members are duplicated across tcp_connecter_t, ipc_connecter_t, tipc_connecter_t
Solution: extract common base class stream_connecter_base_t
2019-02-01 04:58:47 -05:00
Luca Boccassi
4a0c83fb12 Problem: yqueue false sharing issues on PPC64
Solution: detect cacheline size for aligment purposes at build time
instead of hard-coding it, so that PPC and S390 can align to a value
greater than the 64 bytes default.
Uses libc getconf program, and falls back to the previous value of 64
if not found.
2019-01-19 20:08:14 +00:00
Luca Boccassi
73d41cec57 Problem: versions are out of date
Solution: bump ABI and revisions and changelog now that v4.3.1 is out
2019-01-12 16:10:36 +00:00
Luca Boccassi
28d5ce3dfa Problem: pkg-config file cannot be used for static linking
Solution: use requires.private, which pkg-config expands recursively
so that dependencies of dependencies can be linked against when
using pkg-config --static
2018-12-15 00:44:00 +00:00
Luca Boccassi
9d06e29cb2 Problem: duplicated pkg-config template
Solution: use the same for both autotools and cmake
2018-12-14 23:27:42 +00:00
Luca Boccassi
fbf37bb668 Problem: 4.3.0 is released, need to update ABI/version
Solution: bump to 5.2.1 and 4.3.1 respectively
2018-11-28 20:06:23 +00:00
Luca Boccassi
eff190d503 Problem: ABI is not correct for 4.3.0
Solution: bump it to 5.2.0 as new stable APIs have been added
2018-11-28 20:02:27 +00:00
Bill Torpey
25e069d131 Add specific option to select radix tree implementation for subscriptions (#3304)
* Add specific option to select radix tree implementation for subscriptions (defaults to ON if draft API enabled).
2018-11-12 21:57:11 +00:00
Shubham Lagwankar
3659c1204a Problem: radix tree needs benchmarks and improvements (#3290)
* Problem: radix tree needs benchmarks and improvements

Solution: add a benchmark and make suggested improvements
2018-11-09 10:49:40 +00:00
Bill Torpey
29c369ff0b Some changes for CMakeLists.txt:
- MacOS version requires CMake version 3.0.2 (because of policy CMP0042)
- Add option to build instrumented binaries with Address Sanitizer
- Add option to select compiler intrinsics for atomic ops
- Only build docs on request (saves build time)
2018-11-02 11:10:14 -04:00
Shubham Lagwankar
c68afb412e Problem: potentially large memory footprint of trie as number of
subscriptions increases

Solution: use a radix tree instead of a trie to store subscriptions
2018-10-31 07:49:55 -04:00
Luca Boccassi
7c0017c55d
Merge pull request #3272 from hpsaturn/av/fix_for_android
fix for android building
2018-10-27 19:35:17 +01:00
Juraj Oršulić
3942195817
Update CMakeLists.txt 2018-10-22 14:08:02 +02:00
Antonio Vanegas
69ac7a934c fix for android building 2018-10-09 16:49:19 -05:00
Christoph Schulz
a21228b664 Conform to cmakelint --filter=-linelength
- Lowercase all commands
- Unify indent to 2 spaces
- Remove spaces around brackets
- Remove repitition of condition in else(...) and endif(...)

Note: (re-)running CMake did not change the content of the generated files
2018-09-10 00:12:07 +02:00
Christoph Schulz
ca7c03f825 Add instead of replace linker flags (fix for LLVM toolchain) 2018-09-09 23:24:33 +02:00
Simon Giesecke
a9973ac43f Problem: /Z7 debug info is used only for Debug build, but not for RelWitDebInfo build
Solution: apply the same commadn for RelWithDebInfo build
2018-08-16 11:40:55 +02:00
chymanfx
da8024d3c9 Problem: No CI for mingw64 (#3195)
* Problem: No CI for mingw64

Adding CI support for mingw64 to appveyor.yml

Reason: To help address the issue:
  Several checks fail under 64-bit MinGW on Windows when running make check #3185

* Problem: Docs do not build with mingw64, dll already in right place

Turning off WITH_DOC for mingw64
Removing copy command for mingw64 and cygwin64 (it now seems to be directly built in "bin" directoy)
2018-07-29 22:40:35 +01:00
Justus Ranvier
458f41e349
Problem: build system does not play nicely as a cmake subproject #3196
Solution: avoid exporting targets and installing files if neither
BUILD_SHARED nor BUILD_STATIC is set
2018-07-26 17:18:26 -05:00
Elliott Sales de Andrade
1e51d6e043 Problem: cmake: pkgconfig always installed in lib.
Solution: Use cmake's libdir variable to ensure that the pkgconfig file
ends up in the correct lib/lib64 directory. This matches the autotools
behaviour.
2018-07-26 00:36:46 -04:00
Andras Lasso
f1aeb7956c
cmake: Fix .dll file location in the build tree
This commit ensures that the variable CMAKE_*_OUTPUT_DIRECTORY
are considered when creating the library.
2018-07-24 18:22:47 -04:00
Jean-Christophe Fillion-Robin
b1d4955065
cmake: Streamline integration allowing config of CMAKE_*_OUTPUT_DIRECTORY
Setting EXECUTABLE_OUTPUT_PATH and LIBRARY_OUTPUT_PATH variables is deprecated
2018-07-24 18:22:45 -04:00
Simon Giesecke
eccf2e53bc Problem: cygwin build defines ZMQ_HAVE_WINDOWS
Solution: do not check for windows.h on cygwin
2018-06-04 15:19:13 +02:00
Simon Giesecke
a8d62d14c1 Problem: polling utilities not at a reusable location
Solution: move to separate header
2018-06-01 18:22:48 +02:00
Simon Giesecke
0dce223341 Problem: no check if noexcept is supported by compiler
Solution: add compile check
2018-05-30 22:50:30 +02:00
Simon Giesecke
7f880c256f Problem: magic numbers and data duplication in plain_*.cpp
Solution: extract constants / move to plain_common.hpp
2018-05-28 17:53:46 +02:00
Luca Boccassi
58d13395ec Problem: clang 6 warns about comparisons on 64 bit
Solution: ignore tautological-constant-compare warnings, as they
might be useless on 64 bit but they are not on 32 bit where sizeof
size_t != sizeof uint64_t
2018-05-28 14:06:41 +01:00
Simon Giesecke
2b31e50b01 Problem: No static analysis under Windows
Solution: Enable VS static analyzer and core guideline checks
2018-05-24 13:44:45 +02:00
Simon Giesecke
06e0c0776d Problem: cmake run is very slow with MSVC
Solution: skip tests than can never succeed with MSVC
2018-05-23 18:13:22 +02:00
Simon Giesecke
082b6aa641 Problem: epoll not supported under Windows
Solution: Use wepoll on Windows
2018-05-23 16:25:07 +02:00
Simon Giesecke
d326434b37 Problem: API poller cannot be set independently from I/O thread poller, poll I/O thread poller broken on Windows
Solution: change platform definitions to separate API poller from I/O thread poller, disallow configuring poll I/O thread poller on Windows
2018-05-22 18:36:04 +02:00
Simon Giesecke
d7e99085ef Problem: Warnings in Windows builds
Solution: enable warnings-as-errors
2018-05-14 17:17:10 +02:00
Lionel Flandrin
4cd2c2ebf8 Problem: address parsing code is tied to the TCP code
Solution: Factor the code into a different file with a well defined API and add
unit tests.
2018-05-02 18:06:01 +02:00
Luca Boccassi
e5eab4b91f Problem: CMake parallel build not enabled for C files
Solution: set the equivalent flag
2018-04-29 22:14:05 +01:00
Dennis Klein
0dda63660e
Install relocatable dylibs (MacOS)
Problem: When building libzmq with CMake, the installed libzmq.dylib
  has a relative install name (otool -D libzmq.dylib) on MacOS. This
  is a regression against building via autotools which sets an
  absolute install name. Effectively, the CMake built libzmq.dylib
  is rendered useless if installed in non-system directories and
  used in environments without explicit DYLD_LIBRARY_PATH mgmt. For
  example running any of the installed executables currently fails:
  $ /some_install_prefix/bin/inproc_lat
  dyld: Library not loaded: libzmq.5.dylib
    Referenced from: /some_install_prefix/bin/inproc_lat
    Reason: image not found
  Trace/BPT trap: 5

Solution: Best practice is to install relocatable dylibs.
  On MacOS this means setting an install name with a special prefix,
  e.g. @rpath/libzmq.dylib, and adding the relevant search paths
  to the embedded rpath list. In this patch the necessary CMake options
  are added to generate the desired relocatable dylibs. Find more
  information on: https://cmake.org/Wiki/CMake_RPATH_handling.
2018-04-25 20:18:42 +02:00
Steffen Wittmeier
bb4fb32925 CMake: Linker PDB install rule does not work when Visual Studio generators are used (#3040)
* Fixes issues with the PDB install rule for VS solutions

* Fix for compile PDB and linker PDB under Windows
2018-04-04 10:48:36 +01:00
Luca Boccassi
6f26a33359 Problem: 4.2.5 is out, we need to restore API changes and 4.3.x
Solution: revert the revert!

Revert "Problem: regression in 4.2.3 went unnoticed, want to release 4.2.5"

This reverts commit 5f17e26fa4.
2018-03-23 19:31:42 +00:00
Arda Aytekin
6fa9362351
Fix gcc build problem
Fixed gcc-related build problem resulting from `-errwarn=%all` switch.

Fixes #3012.
2018-03-21 18:21:39 +01:00
Luca Boccassi
f0378bfbf7 Problem: 4.2.4 is out, version is out of date
Solution: bump to 4.2.5
2018-03-21 16:03:49 +00:00
Luca Boccassi
c9437ab755
Merge pull request #2986 from wittmeie/ws/fix-for-windows-imported-target
Missing IMPORTED_LOCATION_<CONFIG>property for shared-library import-targets (see zeromq/libzmq#2985)
2018-03-12 15:41:10 +00:00
Steffen Wittmeier
79d9f2ba1e Fixes missing IMPORTED_LOCATION in import-target 2018-03-12 13:38:46 +01:00
Tony Theodore
c7876c097f Problem: mingw static/shared builds have different preprocessor defines
Solution: remove objects optimisation in library build (similar to #2860)
and set PUBLIC compile definitions on all static builds instead of MSVC
only.
2018-03-12 21:56:37 +11:00
Tony Theodore
794d7a3143 Problem: certain windows header files are actually lowercase
Solution: change case of `WinSock2.h Iphlpapi.h Rpc.h` to match the
files on disk. This is only noticeable when cross-compiling from a
case-sensitive system so wouldn't get picked up in MSVC or mingw
builds running on a windows machine.

MSDN uses capitalised versions in prose and lowercase in code examples:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms737629(v=vs.85).aspx

Fixes #2978, the missing library message is a little misleading.
2018-03-12 20:19:27 +11:00
Simon Giesecke
a9712c0bf2 Problem: no unittests for mtrie
Solution: made mtrie generic (to remove complex dependency on pipe_t),
and added some unit tests
2018-03-02 13:32:51 +01:00
Francis Hart
ef7cb96782 Fix cmake install error when BUILD_SHARED is off
This fixes an error with the cmake install configuration, which
attempted an invalid copy of a .pdb file on windows, when the
BUILD_SHARED option is disabled.
2018-02-14 15:22:54 +02:00
Francis Hart
d470475272 Add cmake build option for disabling tests
This adds a new cmake build option called BUILD_TESTS, that can be used
to enable/disable building of the tests. This is enabled by default.
2018-02-14 15:22:54 +02:00
Francis Hart
dee0213108 Ensure correct cmake target suffix for all builds
This updates the cmake set_target_properperties usage, so that the suffix
is specified for the MinSizeRel build type.
2018-02-14 15:22:54 +02:00
Simon Giesecke
fafea72b92 Problem: header files not included in VS project files
Solution: add to list of sources
2018-02-13 18:38:24 +01:00
Simon Giesecke
56c726d425 Problem: no unit tests
Solution: set up initial unit tests
2018-02-11 17:25:36 +00:00
sigiesec
43c11d0a61 Problem: cmake broken under Windows
Solution: fix CMAKE_MODULES_PATH
2018-02-02 15:47:43 +01:00
sigiesec
4161793d19 Problem: clang-format not run on CI
Solution: add clang-format to cmake, and add another travis-ci build type
2018-02-02 15:47:43 +01:00
Salvo Virga
9d6a5f3c2f linkage is now homogeneous for both targets libzmq and libzmq-static
all calls to target_link_libraries are now at the same location
2018-01-15 00:36:02 +01:00
Min RK
5f8488de6d move FindSodium to builds/cmake/Modules
with the rest of the CMake modules
2018-01-13 13:15:51 -08:00
Min RK
f8da0ac721 move cmake ZeroMQConfig.cmake.in to builds/cmake 2018-01-13 13:14:53 -08:00
Sylvain Corlay
8d35cf82f1 [cmake] fix SOVERSION 2018-01-13 09:31:04 +01:00
Johan Mabille
b2a8bbd89b removing hard-coded path of librt 2018-01-10 21:07:25 +01:00
Giuseppe Corbelli
020b0bede8 Fix CMake tests on Windows (#2872)
* Changed CMake tests to use check_symbol_exists in network-related libraries on win32 instead of check_library_exists
2018-01-09 17:15:24 +00:00
Luca Boccassi
65a1e458ab Problem: 4.2.3 is out, version(s) are out of date
Solution: bump changelog, ABI revision, library and packaging version
2017-12-13 14:12:15 +00:00
Gunther Laure
5189898479 export ZMQ_STATIC compile flag to depending projects (MSVC)
Signed-off-by: Gunther Laure <glaure@dewetron.com>
2017-12-12 10:25:19 +01:00
Luca Boccassi
53e536a983 Problem: static build broken on Win + CMake
Solution: revert the objects optimisation, and go back to building
everything twice on Windows, as the static builds needs different
preprocessor definitions from the shared one, so the objects have to be
rebuilt.
Keep the optimisation for all the other platforms.
Fixes #2858
2017-12-10 17:42:42 +00:00
Steven Peters
de5e7a3983 Problem: WIN32 CMAKECONFIG_INSTALL_DIR is broken
Solution: set it to CMake instead of a subfolder of share.
See cmake find_package documentation for further info.
2017-12-06 12:45:48 -08:00
Luca Boccassi
0298d037d0 Problem: CMake rebuilds everything twice
Solution: build all the objects separately before the link step, to
avoid rebuilding when doing both static and shared builds
2017-11-20 15:55:35 +00:00
Luca Boccassi
ac552ba448 Problem: accept4 not available on all platforms
Solution: check for availability in CMake and autoconf before using it
2017-11-18 11:33:53 +00:00
f18m
bfbb4ff2e9 Background threads enhancements (#2778)
* Background thread scheduling 

- add ZMQ_THREAD_AFFINITY ctx option; set all thread scheduling options
from the context of the secondary thread instead of using the main
process thread context!
- change ZMQ_THREAD_PRIORITY to support setting NICE of the background
thread when using SCHED_OTHER
2017-10-16 12:29:03 +01:00
Luca Boccassi
7453a02144 Problem: CMake on Linux does not link libzmq with optional libs
Solution: add missing target_link_libraries
Fixes #2701
2017-08-19 12:26:36 +01:00
sigiesec
301f3c70c2 Problem: code duplication between curve_client_t and curve_server_t decode and encode
Solution: extracted common base class curve_mechanism_base_t
2017-08-18 11:34:22 +02:00
sigiesec
6e8a0b31be Problem: ZAP client code is duplicated in all mechanisms
Solution: created a zap_client_t class, extracted first function send_zap_request from curve_server_t
2017-08-16 18:04:30 +02:00
Brian Russell
b963542e8f Add socket option BINDTODEVICE
Linux now supports Virtual Routing and Forwarding (VRF) as per:

https://www.kernel.org/doc/Documentation/networking/vrf.txt

In order for an application to bind or connect to a socket with an
address in a VRF, they need to first bind the socket to the VRF device:

    setsockopt(sd, SOL_SOCKET, SO_BINDTODEVICE, dev, strlen(dev)+1);

Note "dev" is the VRF device, eg. VRF "blue", rather than an interface
enslaved to the VRF.

Add a new socket option, ZMQ_BINDTODEVICE, to bind a socket to a device.
In general, if a socket is bound to a device, eg. an interface, only
packets received from that particular device are processed by the socket.

If device is a VRF device, then subsequent binds/connects to that socket
use addresses in the VRF routing table.
2017-07-31 15:31:47 +01:00
Luca Boccassi
fbb6bbdcb8 Problem: reading from /dev/urandom is clunky
Solution: if available use the getrandom function as it doesn't
require any synchronization, state or cleanup
2017-07-28 11:28:19 +01:00
Luca Boccassi
2626fdfa23 Problem: tweetnacl leaks file descriptor on fork+exec
Solution: open with O_CLOEXEC if available or set FD_CLOEXEC if not
2017-07-28 11:27:55 +01:00
Iban Cereijo
d040dc18b5 Problem: CMake evaluation fails with Mingw-w64
Solution: we can use 'CMAKE_SYSTEM_VERSION' instead of
'${CMAKE_SYSTEM_VERSION}' for the 'if' clauses.

CMake fails to evaluate condition when CMAKE_SYSTEM_VERSION is
empty, which can happen with a default installation of Mingw-w64
in Linux.
2017-06-14 15:55:29 +02:00
Tim Ebringer
293a18257a Suppress linker warning 4221 for MSVC
Some #define switches cause the body of entire files to be omitted. This
causes a linker warning on Visual Studio 2017, for example

    warning LNK4221: This object file does not define any previously
    undefined public symbols, so it will not be used by any link
    operation that consumes this library

Since this is warning us about something that shouldn't be
earth-shattering news, we add a linker flag to suppress this warning on
MSVC builds.
2017-05-20 14:29:58 -04:00
Yann Diorcet
f66c49a62b Fix precompiled 2017-05-18 12:02:07 +02:00
Yann Diorcet
ec7b9480f5 Fix WITH_DOC 2017-04-28 13:43:17 +02:00
Yann Diorcet
17460b3b2b Targets broken by some parts of f7d1c159d4 2017-04-24 15:57:14 +02:00
RPGillespie6
69b2affe05 Add CMake Build Output Options
Add two new options to CMakeLists.txt:

`BUILD_SHARED` - Whether or not to build the shared object (Default: ON)
`BUILD_STATIC` - Whether or not to build the static archive (Default: ON)
2017-04-17 18:26:04 -04:00
Yann Diorcet
f7d1c159d4 Fix windows compilation 2017-04-12 10:59:04 +02:00
Yann Diorcet
c7fea39005 Fix asciidoc 2017-04-05 14:16:29 +02:00
Stefan Herbrechtsmeier
2f367bddf7 cmake: Remove build/msvc include path to remove file name clash
Remove the `build/msvc` include path from the test project to fix a
problem with the order of the include paths. Additionally remove the
unnecessary `include_directories` from the master project.

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
2017-04-05 10:03:07 +02:00
Stefan Herbrechtsmeier
f186421273 cmake: Export targets to package config
Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
2017-04-04 15:48:39 +02:00
Stefan Herbrechtsmeier
4e3e3f659d cmake: Disable runtime checks while cross compiling
Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
2017-04-04 15:48:39 +02:00
Stefan Herbrechtsmeier
556de55e4c cmake: Use project specific source directory instead of top level source tree
Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
2017-04-04 15:48:39 +02:00
bbdb68
1d58a00992 Problem: no windows UWP support
* add define for windows/UWP

* prevent issue with COM references

* gettickcount not available on uwp

* add compiler definitions

* add convenitnece cmake file

* brute force uwp compilation

* fix compiler version

* cosmetics
2017-04-04 09:50:33 +01:00
Luca Boccassi
3ab4796c5a Problem: ZMQ background threads are unnamed
Solution: use pthread API to set the name. For now call every thread
"ZMQ b/g thread". Would be nice to number the I/O threads and name
explicitly the reaper thread, but in reality a bit of internal API
churn would be necessary, so perhaps it's not worth it.
This is useful when debugging a process with many threads.
2017-03-12 00:46:15 +00:00
Luca Boccassi
ac5c75cea1 Problem: 4.2.2 is out, version(s) are out of date
Solution: bump changelog, ABI revision, library and packaging version
2017-02-18 17:56:55 +00:00
Sylvain Corlay
4e472b18e3 Make OS Xframwork build optional 2017-01-27 19:30:18 +01:00
Pawel Kurdybacha
877419e94f CMake static library output does not match ZeroMQ Config.
Configuration used in ZeroMQConfig.cmake.in does not match to
explicic "libzmq" output of static build.
2017-01-22 18:17:55 +00:00
Sylvain Corlay
e38453866d Problem: cmake artefacts different from make generated artefacts 2017-01-21 15:14:30 +01:00
Sylvain Corlay
c65a27213a Problem: name of static library generated by cmake differs from the behavior of kernel.
Solution: Change the target output name from libzmq-static to libzmq.
2017-01-19 13:31:39 +01:00
Johan Mabille
36d0c70647 cmake install on linux fixed 2017-01-13 00:10:32 +01:00
Johan Mabille
7c709e5466 cmake install config file 2017-01-07 00:21:06 +01:00
Johan Mabille
e95d23198f CPack option and .txt files installation dir 2017-01-06 14:29:56 +01:00
Johan Mabille
2d749a066c Windows cmake build fixed 2017-01-06 10:52:20 +01:00