Coder Social home page Coder Social logo

gul-cpp / gul14 Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 15.43 MB

General Utility Library for C++14

Home Page: https://gul14.info/

License: GNU Lesser General Public License v2.1

Makefile 0.25% C++ 97.78% HTML 0.05% Meson 0.76% CSS 0.06% C 0.23% Shell 0.65% Batchfile 0.23%
cpp14 library

gul14's Introduction

General Utility Library for C++14

The General Utility Library for C++14 (GUL14) contains often-used utility functions and types that form the foundation for other libraries and programs. The main fields covered by the library are:

  • String handling
  • Concurrency
  • Time
  • Statistics and numerics
  • Debugging
  • Containers
  • Type traits
  • Core guideline support library (GSL) excerpts
  • Backports from new standard library extensions

To get started, have a look at the documentation website

Here you find more detailed information on:

Installing with vcpkg

GUL14 is available from the vcpkg package manager. Once you have vcpkg installed, just run:

    vcpkg install gul14

Building

Clone this repository:

    git clone https://github.com/gul-cpp/gul14.git
    cd gul14

Use meson to configure the build you want to have. A list of the build options is given below. Build directory name can be what you want and can even be located outside of the projecte directory. E.g. on Linux you can place the build directory into a tmpfs mount (aka RAM disk). If your build directories are inside the project root directory and starting with 'build' they will be ignored by git. Examples:

    meson setup <build-dir>
    meson setup -D tests=false <build-without-tests-dir>
    meson setup --prefix=/usr --buildtype=release <build-rel-dir>
    meson setup --buildtype=release --unity=on <build-rel-unity-dir>
    meson setup --buildtype=release -D docs=false <build-nodocs-rel-dir>
    meson setup -Dcpp_args='-Wconversion -Wshadow' --buildtype=debug <build-with-extra-warnings-dir>
    CXX=clang++ meson setup <build-clang-dir>

Typical build configurations can be easily summoned as detailed in Default configurations below.

Afterwards, enter the build directory – in this case, for the release build – and start the build process:

    cd <build-dir>
    ninja
    ninja test
    ninja data/docs

If you need one, a Debian package is easily created with (Note 2):

    debuild

Packaging is closely coupled to how version information is extracted (see Versioning below). The debian/ files including the debian/changelog are autogenerated on configure time. You need to reconfigure your build directory if tags/versions/commits change afterwards.

Notes:

  1. The configuration to be changed can immediately follow the -D for example -Dwarning_level=1
  2. debuild is the normal Debian packager. For DESY environments, consider using makeDdeb instead.
  3. It is not necessary to call ninja before calling debuild/makeDdeb. But of course you usually want to run ninja test before you package.
  4. debuild/makeDdeb has to be called in the build directory of choice (that has been usually created with buildtype = release). Note that a proper Debian package needs the prefix to be set to /usr (see examples above)

Build configuration switches

You can list all possible build configuration switches with meson configure in an existing build directory [1]. This command can also be used to change build configurations after the directory has been created. For example to decrease the warning level after the build directory has already been created: meson configure -D warning_level=1 (Use mesonconf if your meson is too old.)

A lot of the switches change the versioning behaviour, more information on the versioning is given in a separate paragraph.

In addition to meson's standard switches there are:

Option         Default Value  Possible Values  Description
------         -------------  ---------------  -----------
docs           true           [true, false]    Generate documentation via doxygen
tests          true           [true, false]    Generate tests
deb-dev-name   @0@-dev        string           Debian package name for development package
deb-name       @0@            string           Debian package name
deb-vers-pack  false          [true, false]    Debian package name will contain version
deb-vers-tag   v              string           Debian package uses git version tags starting with this

The deb-*name switch can be used to configure the debian package building process with non-standard packet names. The substring '@0@' will be replaced by the canonical packet name (i.e. 'libgul14'). Although non-standard packages automatically conflict with standard packages care must be taken to keep the install target system consistent (i.e. install always only one variant of libgul14).

The deb-vers-ext switch forces the package names and versions to be based on the latest 'git external tag'. This is a tag in the git repository that does not start with 'v'. It is expected to give the version number to use in the form DESCRIPTION_major_minor_patch, where major, minor, and patch are positive integers.

The deb-vers-pack switch appends the version number to the library and package names. With this multiple different versions of GUL can be installed in parallel.

The deb-vers-tag option specifies how git tag start that are considered as version number tags. Tags selected here shall have a number after their start, in the form [0-9]+[._][0-9]+([._][0-9])?. The actual version is deduced from this and the changelog walks the git repository to find previous versions that fit this pattern. Note that only the startstring is used to identify these tags, that they conform to the given regex is to be ensured by the user.

Overview of maybe useful standard project options:

Option         Default Value         Description
------         -------------         -----------
prefix         /usr/local            Installation prefix
libdir         lib/...               Library directory
includedir     include               Header file directory
datadir        share                 Data file (Doxygen website) directory

Default configurations for Unix-like systems

Some typical build configurations can be set up in build directories under build/ with the following commands:

  • make release builds the release version of the library under build/x86\_64-linux-gnu/release
  • make debug builds the debug version of the library under build/x86\_64-linux-gnu/debug
  • make doocs-release builds a DOOCS release version that can be packaged with makeDdeb under build/x86\_64-linux-gnu/doocs-release
  • make test runs unit tests on the release version
  • make BUILDTYPE=debug test runs unit tests on the debug version
  • make test-junit runs unit tests and generates output in JUnit XML format under build/x86\_64-linux-gnu/release/test.xml
  • make JUNIT_XML_FILE=a.xml test-junit runs unit tests and generates output in JUnit XML format in the specified file
  • make clean cleans up the build files of the release version
  • make BUILDTYPE=debug clean cleans up the build files of the debug version
  • make mrproper removes all build directories completely
  • make doc builds documentation under build/x86\_64-linux-gnu/release/resources/doxygenerated (needs Doxygen and Graphviz)
  • make localinstall makes a local installation of the library under $HOME/Ubuntu-16.04-x86\_64/lib

Building on Windows with Visual C++

GUL can be built with Visual C++, although the integration with the Visual Studio IDE is somewhat patchy. In principle, meson and ninja can be used as outlined above. However, the devil is in the details:

  • For Meson, prefer the MSI installer from https://mesonbuild.com/. We found that Meson versions packaged with the Anaconda Python distribution do not work, to name an example.
  • For Ninja, the version from the Meson MSI installer works just as well as the one distributed with Visual Studio 2019 (in the cmake workload).

Setting up the PATH and calling the correct executable can be difficult. We distribute a Windows batch file tools\make_vs.bat as an example. It may require some editing to adapt it to your system, but afterwards you can call it from the command line or directly from Visual Studio to initiate a build, cleanup, or to run the unit test suite.

Usage:
make_vs mrproper                    - Remove the entire build directory
make_vs release <platform>          - Build the release version of the library for the specified platform
make_vs debug <platform>            - Build the debug version of the library for the specified platform
make_vs test <buildtype> <platform> - Run the unit tests for the specified build type and platform
where:
<buildtype> is one of "release" or "debug"
<platform> is one of "x86" or "x64"

The files .vs\tasks_vs.json and .vs\launch_vs.json as well as CppProperties.json in the root directory contain information for Visual Studio 2019 that should allow you to open the folder via "open folder" (i.e. without a project file) and still be able to build and debug GUL via the batch file.

It is not possible to build GUL with a version prior to Visual Studio 2017 version 15.7 (a.k.a. 19.14), because basic language features are missing (e.g. two phase name lookup is needed, N3652 and N3653 are used in GUL code).

Single header use

Under some circumstances it is nice to have all of GUL in only one header file that can be included - and no library to link to. For example when doing experiments with online compilers.

This is not the recommended way to use GUL, but you can use the script tools/single_gul to create such a complete header file (without Catch2).

Testing

After configuring the build directory one can run all tests by

    ninja test

To see which tests have failed and get other additional information you might want to do instead

    meson test --test-args '-r junit'

Or for older meson versions

    mesontest --test-args '-r junit'

Coverage report

To generate a coverage report you need to specify -D b_coverage=true on the meson call for the build configuration. Then after running the tests (see previous paragraph) the coverage report is generated by

    ninja coverage-html

Depending on the installed coverage tool the targets coverage-text and coverage-xml might also be there. To generate a coverage report the package gcov must be installed, and lcov/genhtml or (recommended) gcovr (>= 3.1) is used to generate the HTML pages.

Versioning

The versioning of libgul can be divided into two entities:

  • the API version
  • the packet version

The API has a semantic version number. It has a major and a minor number. Major is increased on non-backward compatible changes to the API, while the minor part is increased when features are added. This results in a API versions like 1.7. The API version is hard coded in the main meson.build file, and the git revision where it is introduced is tagged with an annotated tag like v1.7 - the lower case letter v followed by the API version. Note that the 'patch number' of usual semantic versioning schemes is not defined here.

The packet version is determined by the latest annotated git tag, that matches a given format: It has to start with the string given as deb-vers-tag. The default is to look for tags starting with v, which are the API version tags. To continue with the example of the previous paragraph the build system will look for the latest tag that starts with v and finds v1.7 extracts the version identifier (all that follows the deb-vers-tag: 1.7).

The packet version needs to take into account that we could have bugfix packets (packets with the same API version). For this purpose the 'patchlevel' or patch number is calculated: It is the number of git commits that the current HEAD is separated from the tagged API version commit. If GUL is packaged directly from a commit with a new deb-vers-tag version this will be zero. If there are for example 2 bug-fix commits on top, that number will be two.

Example:

bf184c8 (HEAD) bugfix: Do standalone test on string_util.h
9990745 Remove some static code analysis warnings
8ab1913 tests: Fix time critical tests on Windows
b4b6847 (tag: v1.7) Bump version number to 1.7
18499a3 to_number: Do less thoroughly random test on ARM
...

If we package the HEAD commit, the API version is 1.7, the packet version is 1.7.3.

While the API version is fixed to tags starting with 'v' (e.g. v3.5) the packet version can examine a different/custom set of tags (deb-vers-tag option). Normal Debian packets of course have the same (base) version as the API.

So here once again:

The first tag family donates the API version of the package that is in effect starting with the tagged commit. The version uses semantic versioning, and the format is defined as v1.2 where 1 is the major, 2 the minor version-part. It always starts with a lower case v. This tag is cross checked with the project version number given in the main meson.build file.

Package versioning can be based on that API version tags, or on any other tags set that start with the same text. Normal packets use the API tags. If another tag is desired the deb-vers-tag prefix must be specified.

The package version patchlevel is automatically determined from the number of commits since the package version tagged commit, and added where appropriate as third number.

That tags are used to tag specific points in time when a packet has been created from the project. Its form is name_1.2.3, and again 1, 2, and 3 donate version number parts, that might or might not be semantic (see recommended format in the description of the deb-vers-tags option). These tags can be used to create packet names in the form libgul14-1-2-3 (with -D deb-vers-pack=true set in meson). Note that the name_ part is ignored and can be arbitrary, as long as it does not start with lower case 'v'. The amount of numbers is arbitrary and just all _ or . get substituted by - to fit required format.

Here again a patchlevel is determined by the number of commits since the packet version tagged commit, and added where appropriate as either a semantic versioning patchlevel (i.e. third number) or explicit patchlevel (i.e. added p<number>)

The packaging rules prevent building dirty repositories. Commit your changes first.

Version number examples

The versioning related switches work in the following way. Assume that the API version tag is v0.1 and it is 3 commits behind; and the external tag version is D_18_11_7 and it is 5 commits behind.

deb-vers-tag   dev-vers-pack
    'v'            false            libgul14_0.1.3.deb                       ->   libgul14.so.0.1
    'v'            true             libgul14-0-1_0.1.3.deb                   ->   libgul14.so.0.1
    'D_'           false            libgul14_18.11.7.p5.deb                  ->   libgul14.so.18.11.7
    'D_'           true             libgul14-18-11-7_18.11.7.p5.deb          ->   libgul14.so.18.11.7

gul14's People

Contributors

finii avatar alt-graph avatar soerengrunewald avatar ohensler avatar

Stargazers

Raimund Kammering avatar  avatar

Watchers

 avatar  avatar

Forkers

finii

gul14's Issues

CI Update

  • The current CI does contain a lot of DESY internal stuff, which might no be suitable for the github environment (e.g. proxy settings).
  • We should include newer and different distros for compilation tests, as seen with #39.

Dynamically link unit tests

In #62, we had to start linking our unit tests statically. The reason (as far as we understand it) is the following:

  • We had to add threads as a dependency because the main library can now actually spawn std::threads.
  • That lead to linker failures in building the tests, apparently because the test build picked up an outdated GUL14 library from the system.

This is actually reproducible: When linking against libgul_dep instead of libgul_static_dep, we get this:

g++  -o tests/libgul-test tests/libgul-test.p/test_backports.cc.o tests/libgul-test.p/test_bit_manip.cc.o tests/libgul-test.p/test_case_ascii.cc.o tests/libgul-test.p/test_cat.cc.o tests/libgul-test.p/test_escape.cc.o tests/libgul-test.p/test_expected.cc.o tests/libgul-test.p/test_finalizer.cc.o tests/libgul-test.p/test_gcd_lcm.cc.o tests/libgul-test.p/test_hexdump.cc.o tests/libgul-test.p/test_join_split.cc.o tests/libgul-test.p/test_main.cc.o tests/libgul-test.p/test_num_util.cc.o tests/libgul-test.p/test_optional.cc.o tests/libgul-test.p/test_replace.cc.o tests/libgul-test.p/test_SlidingBuffer.cc.o tests/libgul-test.p/test_SmallVector.cc.o tests/libgul-test.p/test_statistics.cc.o tests/libgul-test.p/test_string_util.cc.o tests/libgul-test.p/test_substring_checks.cc.o tests/libgul-test.p/test_ThreadPool.cc.o tests/libgul-test.p/test_time_util.cc.o tests/libgul-test.p/test_to_number.cc.o tests/libgul-test.p/test_tokenize.cc.o tests/libgul-test.p/test_Trigger.cc.o tests/libgul-test.p/test_trim.cc.o tests/libgul-test.p/test_type_name.cc.o tests/libgul-test.p/test_variant.cc.o -fsanitize=address -Wl,--as-needed -Wl,--no-undefined '-Wl,-rpath,$ORIGIN/../src' -Wl,-rpath-link,/home/lfroehli/doocs/library/common/gul14/builddir/src -Wl,--start-group src/libgul14.so.2.10.0 -Wl,--end-group -pthread
/usr/bin/ld: tests/libgul-test.p/test_ThreadPool.cc.o: in function `gul14::ThreadPoolEngine::add_task<____C_A_T_C_H____T_E_S_T____17()::{lambda(gul14::ThreadPoolEngine&)#1}>(____C_A_T_C_H____T_E_S_T____17()::{lambda(gul14::ThreadPoolEngine&)#1}, std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)::{lambda()#1}::operator()() const':
/home/lfroehli/doocs/library/common/gul14/builddir/../include/gul14/ThreadPool.h:226:(.text+0x31013): undefined reference to `gul14::ThreadPoolEngine::is_full_i() const'
(etc)

It is not clear what is actually going on here. But somehow adding the threads dependency modifies the linker command line in a way that the linker picks up the wrong GUL14 .so.

std::invoke not declared when compiling under C++17

Probably a missing standard header...

++ -Isubprojects/libgul14/tests/504481b@@_ignore_me@sta -Isubprojects/libgul14/tests -I../subprojects/libgul14/tests -Isubprojects/libgul14/include -I../subprojects/libgul14/include -Isubprojects/libgul14/src -I../subprojects/libgul14/src -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -Wpedantic -std=c++17 -O3 -fPIC -DLIBGUL_API_VERSION=2.10 -DGUL_COMPILING_SHARED_LIB -Wshadow -Wconversion -MD -MQ 'subprojects/libgul14/tests/504481b@@_ignore_me@sta/meson-generated_.._incl_span.cc.o' -MF 'subprojects/libgul14/tests/504481b@@_ignore_me@sta/meson-generated_.._incl_span.cc.o.d' -o 'subprojects/libgul14/tests/504481b@@_ignore_me@sta/meson-generated_.._incl_span.cc.o' -c subprojects/libgul14/tests/incl_span.cc
In file included from ../subprojects/libgul14/include/gul14/span.h:30,
                 from subprojects/libgul14/tests/incl_span.cc:23:
../subprojects/libgul14/include/gul14/traits.h:99:12: error: 'std::invoke' has not been declared
   99 | using std::invoke;
      |            ^~~~~~

within_abs() does not work with custom physical unit types

As Olaf observed, code like this does not work:

    Meters org_gap{ original_gap_*1_mm };
    if (gul14::within_abs(gap_mm, org_gap, 0.1_mm)) ...

... despite the fact that the Meters class has all the behavior of a common double. Maybe we can allow custom types. I wish we had concepts. :)

SmallVector can not take const stuff?

auto dirs = gul14::SmallVector<std::string const, 2>{ dir1, dir2 };
../subprojects/libgul14/include/gul14/SmallVector.h:1254:23: error: invalid ‘static_cast’ from type ‘const std::__cxx11::basic_string<char>*’ to type ‘void*’
 1254 |                 ::new(static_cast<void*>(data_ptr)) ValueType{ *it };
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

Add functions for time formatting

In the DOOCS clientlib we have functions for formatting local time:

/**
 * Convert a timestamp into local time and format it into a std::string using strftime()
 * format specifiers.
 *
 * Due to the limitations of strftime(), this function does not support sub-second
 * output precision.
 *
 * \param ts   The timestamp to be formatted.
 * \param fmt  A format string following the specifications of strftime(), see
 *             https://en.cppreference.com/w/cpp/chrono/c/strftime . If fmt is a null
 *             pointer, an empty string is returned. The default format generates an
               ISO 8601 compliant date-time string.
 * \returns a string with the formatted output or an empty string if an error occurred.
 */
std::string format_localtime (Timestamp ts, const char *fmt = "%Y-%m-%dT%H:%M:%S");
std::string format_localtime (std::time_t t, const char *fmt = "%Y-%m-%dT%H:%M:%S");

Such functions are useful also for other projects (both for UTC and local times). I'd say we could use them in GUL14.

Feature request: Thread pool

We already have an implementation of a simple thread pool that is used in several DOOCS servers. We should evaluate if it might be a valuable additon to GUL14.

SmallVector compiler warning

$ c++ -Itests/libgul-test.p -Itests -I../tests -Iinclude -I../include -Isrc -I../src -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -Wpedantic -std=c++14 -O3 -pthread -MD -MQ tests/libgul-test.p/test_SmallVector.cc.o -MF tests/libgul-test.p/test_SmallVector.cc.o.d -o tests/libgul-test.p/test_SmallVector.cc.o -c ../tests/test_SmallVector.cc
In file included from /usr/include/c++/12/algorithm:60,
                 from ../tests/test_SmallVector.cc:23:
In static member function ‘static _Tp* std::__copy_move<_IsMove, true, std::random_access_iterator_tag>::__copy_m(const _Tp*, const _Tp*, _Tp*) [with _Tp = int; bool _IsMove = false]’,
    inlined from ‘_OI std::__copy_move_a2(_II, _II, _OI) [with bool _IsMove = false; _II = const int*; _OI = int*]’ at /usr/include/c++/12/bits/stl_algobase.h:495:30,
    inlined from ‘_OI std::__copy_move_a1(_II, _II, _OI) [with bool _IsMove = false; _II = const int*; _OI = int*]’ at /usr/include/c++/12/bits/stl_algobase.h:522:42,
    inlined from ‘_OI std::__copy_move_a(_II, _II, _OI) [with bool _IsMove = false; _II = const int*; _OI = int*]’ at /usr/include/c++/12/bits/stl_algobase.h:529:31,
    inlined from ‘_OI std::copy(_II, _II, _OI) [with _II = const int*; _OI = int*]’ at /usr/include/c++/12/bits/stl_algobase.h:620:7,
    inlined from ‘_OutputIterator std::__copy_n(_RandomAccessIterator, _Size, _OutputIterator, random_access_iterator_tag) [with _RandomAccessIterator = const int*; _Size = unsigned int; _OutputIterator = int*]’ at /usr/include/c++/12/bits/stl_algo.h:728:23,
    inlined from ‘_OIter std::copy_n(_IIter, _Size, _OIter) [with _IIter = const int*; _Size = unsigned int; _OIter = int*]’ at /usr/include/c++/12/bits/stl_algo.h:760:27,
    inlined from ‘gul14::SmallVector<ElementT, in_capacity>::ValueType* gul14::SmallVector<ElementT, in_capacity>::insert(ConstIterator, InputIterator, InputIterator) [with InputIterator = const int*; <template-parameter-2-2> = void; ElementT = int; long unsigned int in_capacity = 10]’ at ../include/gul14/SmallVector.h:851:20,
    inlined from ‘gul14::SmallVector<ElementT, in_capacity>::ValueType* gul14::SmallVector<ElementT, in_capacity>::insert(ConstIterator, std::initializer_list<_Tp>) [with ElementT = int; long unsigned int in_capacity = 10]’ at ../include/gul14/SmallVector.h:876:22,
    inlined from ‘void ____C_A_T_C_H____T_E_S_T____90()’ at ../tests/test_SmallVector.cc:1278:20:
/usr/include/c++/12/bits/stl_algobase.h:431:30: warning: argument 2 null where non-null expected [-Wnonnull]
  431 |             __builtin_memmove(__result, __first, sizeof(_Tp) * _Num);
      |             ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/12/bits/stl_algobase.h:431:30: note: in a call to built-in function ‘void* __builtin_memmove(void*, const void*, long unsigned int)’

memmove(to, from, len) is called with from == nullptr and len = 0. Anyhow, from is marked nonnull.

Reason seems to be the empty std::initializer_list that at some point, with -O3 gets optimized to nullptr.
(-O2 is silent.)

Time-dependent time_util test fails occasionally on MacOS

Another time-dependent test failing on the Github MacOS runner:

-------------------------------------------------------------------------------
Scenario: Negative or zero times make sleep() not wait
       When: sleep(0ms) is executed
       Then: the elapsed time is very very small
-------------------------------------------------------------------------------
../tests/test_time_util.cc:88
...............................................................................

../tests/test_time_util.cc:90: FAILED:
  REQUIRE( toc(t0) < 0.001 )
with expansion:
  0.00130301 < 0.001

to_number() test fails on Alpine Linux 3.19

By Soeren:

I tried to build the current release on Alpine 3.19 and got failures when testing:

1/1 all        FAIL            0.74s   exit status 4
>>> LD_LIBRARY_PATH=/tmp/build/libgul/src MALLOC_PERTURB_=64 ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1 UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 /tmp/build/libgul/tests/libgul-test
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― ✀  ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libgul-test is a Catch v2.13.7 host application.
Run with -? for options

-------------------------------------------------------------------------------
to_number(): min and subnormal floating point - long double
-------------------------------------------------------------------------------
../../../home/grunewal/git/desy.de/doocs/library/common/libgul/tests/test_to_number.cc:206
...............................................................................

../../../home/grunewal/git/desy.de/doocs/library/common/libgul/tests/test_to_number.cc:222: FAILED:
  REQUIRE( true == gul14::within_ulp(to_number<TestType>(ss.str()).value(), num, lenience) )
with expansion:
  true == false
with message:
  ss.str() := "3.36210314311209350626e-4932"

-------------------------------------------------------------------------------
to_number(): max and overflow floating point - long double
-------------------------------------------------------------------------------
../../../home/grunewal/git/desy.de/doocs/library/common/libgul/tests/test_to_number.cc:226
...............................................................................

../../../home/grunewal/git/desy.de/doocs/library/common/libgul/tests/test_to_number.cc:235: FAILED:
  REQUIRE( true == gul14::within_ulp(to_number<TestType>(numb).value(), max, lenience) )
with expansion:
  true == false

-------------------------------------------------------------------------------
to_number(): lowest and overflow floating point - long double
-------------------------------------------------------------------------------
../../../home/grunewal/git/desy.de/doocs/library/common/libgul/tests/test_to_number.cc:251
...............................................................................

../../../home/grunewal/git/desy.de/doocs/library/common/libgul/tests/test_to_number.cc:260: FAILED:
  REQUIRE( true == gul14::within_ulp(to_number<TestType>(numb).value(), lowest, lenience) )
with expansion:
  true == false

-------------------------------------------------------------------------------
to_number(): random round trip conversion - long double
-------------------------------------------------------------------------------
../../../home/grunewal/git/desy.de/doocs/library/common/libgul/tests/test_to_number.cc:311
...............................................................................

../../../home/grunewal/git/desy.de/doocs/library/common/libgul/tests/test_to_number.cc:348: FAILED:
  REQUIRE( true == gul14::within_ulp(*converted, num, 30) )
with expansion:
  true == false
with messages:
  i := 0
  numstr := "-2.08181233456417921937e-4933"
  conver := "-0"
  "subnormal " + std::to_string(++i_sub) := "subnormal 1"

===============================================================================
test cases:   351 |   347 passed | 4 failed
assertions: 25304 | 25300 passed | 4 failed

I was using GCC:

g++: (Alpine 13.2.1_git20231014) 13.2.1 20231014
meson: 1.3.0

Repo changes in gitlab

Recently an automated change happened on the mirrored Desy Gitlab repo...

That change has been auto-reverted by the next sync Github -> Gitlab.

image

Just to inform you @alt-graph

Compilation errors on Visual Studio

Compilation fails on Windows. We need a CI setup for that. :)

"cl" "-Itests\libgul-test.exe.p" "-Itests" "-I..\..\..\tests" "-Iinclude" "-I..\..\..\include" "-Isrc" "-I..\..\..\src" "/MDd" "/nologo" "/showIncludes" "/utf-8" "/W4" "/EHsc" "/std:c++14" "/permissive-" "/Od" "/Zi" "/Fdtests\libgul-test.exe.p\test_variant.cc.pdb" /Fotests/libgul-test.exe.p/test_variant.cc.obj "/c" ../../../tests/test_variant.cc
C:\Data\Develop\src\doocs\library\common\gul14\include\gul14/variant.h(716): error C2653: 'lib': is not a class or namespace name
C:\Data\Develop\src\doocs\library\common\gul14\include\gul14/variant.h(716): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Data\Develop\src\doocs\library\common\gul14\include\gul14/variant.h(716): error C2988: unrecognizable template declaration/definition
C:\Data\Develop\src\doocs\library\common\gul14\include\gul14/variant.h(716): error C2143: syntax error: missing ';' before '<'
C:\Data\Develop\src\doocs\library\common\gul14\include\gul14/variant.h(716): error C7525: inline variables require at least '/std:c++17'
C:\Data\Develop\src\doocs\library\common\gul14\include\gul14/variant.h(716): error C2238: unexpected token(s) preceding ';'
C:\Data\Develop\src\doocs\library\common\gul14\include\gul14/variant.h(716): error C2059: syntax error: '<'
C:\Data\Develop\src\doocs\library\common\gul14\include\gul14/variant.h(717): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
C:\Data\Develop\src\doocs\library\common\gul14\include\gul14/variant.h(785): error C2760: syntax error: unexpected token '{', expected 'expression'
C:\Data\Develop\src\doocs\library\common\gul14\include\gul14/variant.h(751): error C7510: 'push_back_t': use of dependent template name must be prefixed with 'template'
C:\Data\Develop\src\doocs\library\common\gul14\include\gul14/variant.h(748): note: This diagnostic occurred in the compiler generated function 'auto gul14::detail_variant::visitation::base::make_fmatrix_impl<F,Vs...>::impl(Is,std::integer_sequence<size_t,_Jx...>,Ls...)'
C:\Data\Develop\src\doocs\library\common\gul14\include\gul14/variant.h(759): error C2760: syntax error: unexpected token '{', expected 'expression'
C:\Data\Develop\src\doocs\library\common\gul14\include\gul14/variant.h(756): note: This diagnostic occurred in the compiler generated function 'auto gul14::detail_variant::visitation::base::make_fmatrix(void)'
C:\Data\Develop\src\doocs\library\common\gul14\include\gul14/variant.h(790): error C2760: syntax error: unexpected token '{', expected 'expression'
C:\Data\Develop\src\doocs\library\common\gul14\include\gul14/variant.h(783): note: This diagnostic occurred in the compiler generated function 'unknown-type gul14::detail_variant::visitation::base::make_fdiagonal(void)'
[37/66] Compiling C++ object tests/libgul-test.exe.p/test_to_number.cc.obj
C:\Data\Develop\src\doocs\library\common\gul14\include\gul14\optional.h(463) : warning C4702: unreachable code
C:\Data\Develop\src\doocs\library\common\gul14\include\gul14\optional.h(463) : warning C4702: unreachable code
C:\Data\Develop\src\doocs\library\common\gul14\include\gul14\optional.h(463) : warning C4702: unreachable code
[40/66] Compiling C++ object tests/lib_ignore_me.a.p/meson-generated_.._incl_date.cc.obj
ninja: build stopped: subcommand failed.
Finished. Build directory: build\x64-windows\debug

pow10() on arm

via email...

ich bin dabei DOOCS für eine neue Architektur zu bauen und habe ein Problem mit gul.
Der Test pow10() failed.

Der Development host ist doocsdevrb12.

Guck doch bitte mal.

Cheers,
Gerhard

LOG:
git clone https://github.com/gul-cpp/gul14.git
cd gul14
make mrproper
make doocs-release
cd build/aarch64-linux/doocs-release
makeDdeb -vIS

...

66/67] Compiling C++ object tests/lib_ignore_me.a.p/meson-generated_.._incl_variant.cc.o
[67/67] Linking static target tests/lib_ignore_me.a
make[1]: Leaving directory '/home/grygiel/[github.com/gul-cpp/gul14/build/aarch64-linux/doocs-release'](http://github.com/gul-cpp/gul14/build/aarch64-linux/doocs-release')
  dh_auto_test
dh_auto_test: warning: Compatibility levels before 10 are deprecated (level 9 in use)
	LC_ALL=C.UTF-8 MESON_TESTTHREADS=1 ninja test
[0/1] Running all tests.
1/1 all FAIL            0.89s   exit status 1
MALLOC_PERTURB_=38 LD_LIBRARY_PATH=/home/grygiel/[github.com/gul-cpp/gul14/build/aarch64-linux/doocs-release/src](http://github.com/gul-cpp/gul14/build/aarch64-linux/doocs-release/src) /home/grygiel/[github.com/gul-cpp/gul14/build/aarch64-linux/doocs-release/tests/libgul-test](http://github.com/gul-cpp/gul14/build/aarch64-linux/doocs-release/tests/libgul-test)
――――――――――――――――――――――――――――――――――――― ✀  ―――――――――――――――――――――――――――――――――――――

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libgul-test is a Catch v2.13.7 host application.
Run with -? for options

-------------------------------------------------------------------------------
test pow10()
-------------------------------------------------------------------------------
../../../tests/[test_to_number.cc:453](http://test_to_number.cc:453/)
...............................................................................

../../../tests/[test_to_number.cc:532](http://test_to_number.cc:532/): FAILED:
 REQUIRE( c.deviation() <= c.lenience_ )
with expansion:
 2 <= 1

===============================================================================
test cases:   356 |   355 passed | 1 failed
assertions: 25680 | 25679 passed | 1 failed

――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――


Summary of Failures:

1/1 all FAIL            0.89s   exit status 1

Ok:                 0   
Expected Fail:      0   
Fail:               1   
Unexpected Pass:    0   
Skipped:            0   
Timeout:            0   

Full log written to /home/grygiel/[github.com/gul-cpp/gul14/build/aarch64-linux/doocs-release/meson-logs/testlog.txt](http://github.com/gul-cpp/gul14/build/aarch64-linux/doocs-release/meson-logs/testlog.txt)

within_orders() with unexpected result

  REQUIRE( gul14::within_orders(0.0, 0.0, 5) == true )
with expansion:
  false == true
  REQUIRE( gul14::within_orders<double>(0.0, 0.0, 5) == true )
with expansion:
  false == true
    double a = 0.0;
    REQUIRE(gul14::within_orders<double>(a, a, 5) == true);
  REQUIRE( gul14::within_orders<double>(a, a, 5) == true )
with expansion:
  false == true

WAT?

MacOS CI builds fail in time tests

Apparently GitHub's CI runners are slower that what we saw before, so many of our time-related tests fail:

Log of Meson test suite run on 2022-08-19T10:15:25.885403

Inherited environment: GITHUB_JOB=build-and-run-tests-posix GITHUB_EVENT_PATH=/Users/runner/work/_temp/_github_workflow/event.json GITHUB_TRIGGERING_ACTOR=alt-graph RUNNER_OS=macOS XCODE_12_DEVELOPER_DIR=/Applications/Xcode_12.5.1.app/Contents/Developer GITHUB_BASE_REF='' NVM_CD_FLAGS='' ANDROID_HOME=/Users/runner/Library/Android/sdk SHELL=/bin/bash CHROMEWEBDRIVER=/usr/local/Caskroom/chromedriver/104.0.5112.79 GOROOT_1_17_X64=/Users/runner/hostedtoolcache/go/1.17.13/x64 GITHUB_REF_NAME=ci/add_github_ci PIPX_BIN_DIR=/usr/local/opt/pipx_bin GITHUB_REPOSITORY_OWNER=gul-cpp TMPDIR=/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/ RUNNER_ARCH=X64 GITHUB_RUN_ATTEMPT=1 GITHUB_RUN_NUMBER=27 GITHUB_ACTIONS=true ANDROID_SDK_ROOT=/Users/runner/Library/Android/sdk RUNNER_WORKSPACE=/Users/runner/work/gul14 GITHUB_REF_PROTECTED=false RCT_NO_LAUNCH_PACKAGER=1 JAVA_HOME_8_X64=/Users/runner/hostedtoolcache/Java_Temurin-Hotspot_jdk/8.0.345-1/x64/Contents/Home/ RUNNER_PERFLOG=/usr/local/opt/runner/perflog NUNIT_BASE_PATH=/Library/Developer/nunit GITHUB_WORKFLOW='CI for GUL14' GITHUB_REF=refs/heads/ci/add_github_ci LC_ALL=en_US.UTF-8 NUNIT3_PATH=/Library/Developer/nunit/3.6.0 JAVA_HOME_11_X64=/Users/runner/hostedtoolcache/Java_Temurin-Hotspot_jdk/11.0.16-8/x64/Contents/Home/ RUNNER_TOOL_CACHE=/Users/runner/hostedtoolcache GITHUB_ACTION_REPOSITORY='' NVM_DIR=/Users/runner/.nvm USER=runner GITHUB_REF_TYPE=branch GITHUB_API_URL=https://api.github.com GITHUB_EVENT_NAME=push GITHUB_SHA=f10aaf1f06f7dc08a89df47145fdbafef3cbb4e9 RUNNER_TEMP=/Users/runner/work/_temp RUNNER_NAME='Hosted Agent' ANDROID_NDK_ROOT=/Users/runner/Library/Android/sdk/ndk/25.0.8775105 ANDROID_NDK_LATEST_HOME=/Users/runner/Library/Android/sdk/ndk/25.0.8775105 ImageVersion=20220815.1 SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.P5BBfDhRCK/Listeners GITHUB_SERVER_URL=https://github.com __CF_USER_TEXT_ENCODING=0x1F5:0:0 HOMEBREW_NO_AUTO_UPDATE=1 GITHUB_HEAD_REF='' AGENT_TOOLSDIRECTORY=/Users/runner/hostedtoolcache GITHUB_GRAPHQL_URL=https://api.github.com/graphql JAVA_HOME_17_X64=/Users/runner/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.4-8/x64/Contents/Home/ GOROOT_1_19_X64=/Users/runner/hostedtoolcache/go/1.19.0/x64 PATH=/usr/local/lib/ruby/gems/2.7.0/bin:/usr/local/opt/[email protected]/bin:/usr/local/opt/pipx_bin:/Users/runner/.cargo/bin:/usr/local/opt/curl/bin:/usr/local/bin:/usr/local/sbin:/Users/runner/bin:/Users/runner/.yarn/bin:/Users/runner/Library/Android/sdk/tools:/Users/runner/Library/Android/sdk/platform-tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/usr/bin:/bin:/usr/sbin:/sbin:/Users/runner/.dotnet/tools:/Users/runner/.ghcup/bin:/Users/runner/hostedtoolcache/stack/2.7.5/x64 _=./meson.py GITHUB_RETENTION_DAYS=90 PERFLOG_LOCATION_SETTING=RUNNER_PERFLOG CONDA=/usr/local/miniconda VM_ASSETS=/usr/local/opt/runner/scripts PWD=/Users/runner/work/gul14/gul14 DOTNET_ROOT=/Users/runner/.dotnet EDGEWEBDRIVER=/usr/local/share/edge_driver JAVA_HOME=/Users/runner/hostedtoolcache/Java_Temurin-Hotspot_jdk/8.0.345-1/x64/Contents/Home/ VCPKG_INSTALLATION_ROOT=/usr/local/share/vcpkg LANG=en_US.UTF-8 XCODE_13_DEVELOPER_DIR=/Applications/Xcode_13.2.1.app/Contents/Developer ImageOS=macos11 XPC_FLAGS=0x0 PIPX_HOME=/usr/local/opt/pipx GITHUB_ACTOR=alt-graph GECKOWEBDRIVER=/usr/local/opt/geckodriver/bin XPC_SERVICE_NAME=0 HOME=/Users/runner SHLVL=2 RUNNER_TRACKING_ID=github_6de8b030-fc1c-48cb-a5b3-500884998b75 GITHUB_WORKSPACE=/Users/runner/work/gul14/gul14 GITHUB_ACTION_REF='' CI=true GRAALVM_11_ROOT=/Library/Java/JavaVirtualMachines/graalvm-ce-java11-22.2.0/Contents/Home/bin GITHUB_RUN_ID=2888690823 LOGNAME=runner GITHUB_ENV=/Users/runner/work/_temp/_runner_file_commands/set_env_a210191e-dd58-4132-b4c3-6881ef53585f LC_CTYPE=en_US.UTF-8 HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS=3650 HOMEBREW_CASK_OPTS=--no-quarantine POWERSHELL_DISTRIBUTION_CHANNEL=GitHub-Actions-macos11 GOROOT_1_18_X64=/Users/runner/hostedtoolcache/go/1.18.5/x64 ANDROID_NDK_HOME=/Users/runner/Library/Android/sdk/ndk/25.0.8775105 ANDROID_NDK=/Users/runner/Library/Android/sdk/ndk/25.0.8775105 BOOTSTRAP_HASKELL_NONINTERACTIVE=1 GITHUB_STEP_SUMMARY=/Users/runner/work/_temp/_runner_file_commands/step_summary_a210191e-dd58-4132-b4c3-6881ef53585f XCODE_11_DEVELOPER_DIR=/Applications/Xcode_11.7.app/Contents/Developer GITHUB_REPOSITORY=gul-cpp/gul14 GITHUB_PATH=/Users/runner/work/_temp/_runner_file_commands/add_path_a210191e-dd58-4132-b4c3-6881ef53585f STATS_PFS=true GITHUB_ACTION=__run_7 DOTNET_MULTILEVEL_LOOKUP=0 

==================================== 1/1 =====================================
test:         all
start time:   10:15:25
duration:     5.69s
result:       exit status 7
command:      MALLOC_PERTURB_=191 /Users/runner/work/gul14/gul14/build.asan/tests/libgul-test
----------------------------------- stdout -----------------------------------

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libgul-test is a Catch v2.13.7 host application.
Run with -? for options

-------------------------------------------------------------------------------
Scenario: After tic() and sleep(), toc() yields the correct time span
       When: two 50 ms delays are made via sleep()
       Then: toc() measures approximately 50 ms after the first one
-------------------------------------------------------------------------------
../tests/test_time_util.cc:55
...............................................................................

../tests/test_time_util.cc:61: FAILED:
  REQUIRE( toc_s < 0.050 + S_AFTER )
with expansion:
  0.132904987 < 0.0680000011

-------------------------------------------------------------------------------
Scenario: After tic() and sleep(), toc() yields the correct time span
       When: two 50 ms delays are made via sleep()
       Then: toc() measures approximately 100 ms after the second one
-------------------------------------------------------------------------------
../tests/test_time_util.cc:68
...............................................................................

../tests/test_time_util.cc:74: FAILED:
  REQUIRE( toc_s < 0.1 + 2 * S_AFTER )
with expansion:
  0.173287515 < 0.1360000022

-------------------------------------------------------------------------------
Scenario: After tic() and sleep(), toc() yields the correct time span
       When: a 50 ms delay is made via sleep()
       Then: toc() measures approximately 50 ms afterwards
-------------------------------------------------------------------------------
../tests/test_time_util.cc:84
...............................................................................

../tests/test_time_util.cc:90: FAILED:
  REQUIRE( toc_s < 0.05 + S_AFTER )
with expansion:
  0.164803243 < 0.0680000011

-------------------------------------------------------------------------------
Scenario: sleep(..., interrupt) can be interrupted from another thread
       When: interrupting sleep(2s, interrupt) after 15 ms
       Then: the elapsed time is approximately 15 ms
-------------------------------------------------------------------------------
../tests/test_time_util.cc:207
...............................................................................

../tests/test_time_util.cc:213: FAILED:
  REQUIRE( toc_s < 0.015 + S_AFTER )
with expansion:
  0.125236673 < 0.0330000011

-------------------------------------------------------------------------------
Scenario: Trigger::wait*() resumes if another thread calls trigger()
      Given: a trigger and a helper thread that sets it to true after 30 ms
       When: the main thread calls wait_for(1s)
       Then: it resumes after approximately 50 ms
-------------------------------------------------------------------------------
../tests/test_Trigger.cc:89
...............................................................................

../tests/test_Trigger.cc:92: FAILED:
  REQUIRE( time_ms <= 50 + MS_AFTER )
with expansion:
  148 <= 68

-------------------------------------------------------------------------------
Scenario: Trigger::wait*() resumes if another thread calls trigger()
      Given: a trigger and a helper thread that sets it to true after 30 ms
       When: the main thread calls wait_until(now + 1s)
       Then: it resumes after approximately 50 ms
-------------------------------------------------------------------------------
../tests/test_Trigger.cc:101
...............................................................................

../tests/test_Trigger.cc:104: FAILED:
  REQUIRE( time_ms <= 50 + MS_AFTER )
with expansion:
  119 <= 68

-------------------------------------------------------------------------------
Scenario: Trigger::wait_for() and wait_until() wait the requested amount of
          time
       When: calling wait_for(50ms)
       Then: execution resumes after approximately 50 ms
-------------------------------------------------------------------------------
../tests/test_Trigger.cc:121
...............................................................................

../tests/test_Trigger.cc:124: FAILED:
  REQUIRE( time_ms <= 50 + MS_AFTER )
with expansion:
  167 <= 68

===============================================================================
test cases:   333 |   329 passed | 4 failed
assertions: 25398 | 25391 passed | 7 failed

==============================================================================

Clang warnings generated on Darwin

In file included from ../src/trim.cc:24:
In file included from ../include/gul14/trim.h:28:
In file included from ../include/gul14/string_util.h:31:
../include/gul14/string_view.h:335:47: warning: operand of ? changes signedness: 'typename iterator_traits<const char *>::difference_type' (aka 'long') to 'unsigned long' [-Wsign-conversion]
        return iter == this->cend () ? npos : std::distance ( this->cbegin (), iter );
        ~~~~~~                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/trim.cc:36:27: note: in instantiation of member function 'gul14::basic_string_view<char>::find_first_not_of' requested here
    const auto lpos = str.find_first_not_of(ws_chars);
                          ^
In file included from ../src/trim.cc:24:
In file included from ../include/gul14/trim.h:28:
In file included from ../include/gul14/string_util.h:31:
../include/gul14/string_view.h:351:72: warning: implicit conversion changes signedness: 'gul14::basic_string_view::size_type' (aka 'unsigned long') to 'std::reverse_iterator<const char *>::difference_type' (aka 'long') [-Wsign-conversion]
        const_reverse_iterator iter = find_not_of ( this->crbegin () + pos, this->crend (), s );
                                                                     ~ ^~~
../src/trim.cc:41:27: note: in instantiation of member function 'gul14::basic_string_view<char>::find_last_not_of' requested here
    const auto rpos = str.find_last_not_of(ws_chars);
                          ^
In file included from ../src/trim.cc:24:
In file included from ../include/gul14/trim.h:28:
In file included from ../include/gul14/string_util.h:31:
../include/gul14/string_view.h:365:27: warning: implicit conversion changes signedness: 'typename iterator_traits<reverse_iterator<const char *>>::difference_type' (aka 'long') to 'unsigned long' [-Wsign-conversion]
        return len_ - 1 - std::distance ( first, last );
                        ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../include/gul14/string_view.h:352:48: note: in instantiation of function template specialization 'gul14::basic_string_view<char>::reverse_distance<std::reverse_iterator<const char *>>' requested here
        return iter == this->crend () ? npos : reverse_distance ( this->crbegin (), iter );
                                               ^
3 warnings generated.

Compiler warnings on MSVC 19.28.29912 x86

We get a few warnings from MSVC. They look like they are easy to fix:

[28/58] Compiling C++ object tests/libgul-test.exe.p/test_string_util.cc.obj
C:\Data\Develop\src\doocs\library\common\gul\include\gul14/string_util.h(113): warning C4244: 'initializing': conversion from 'unsigned __int64' to 'unsigned int', possible loss of data
../tests/test_string_util.cc(62): note: see reference to function template instantiation 'std::string gul14::hex_string<int64_t,true>(Integer)' being compiled
        with
        [
            Integer=int64_t
        ]
[32/58] Compiling C++ object tests/libgul-test.exe.p/test_statistics.cc.obj
C:\Data\Develop\src\doocs\library\common\gul\include\gul14/statistics.h(606): warning C4244: 'argument': conversion from 'const ResultT' to 'TestType', possible loss of data
        with
        [
            ResultT=gul14::statistics_result_type
        ]
        and
        [
            TestType=int
        ]
../tests/test_statistics.cc(462): note: see reference to function template instantiation 'ResultT gul14::accumulate<gul14::statistics_result_type,std::vector<int,std::allocator<int>>,int,const ElementT&(__cdecl *)(const ElementT &),int,____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____35::<lambda_b7871ad714b701fac01f0b30b0616f31>,void>(const ContainerT &,OpClosure,Accessor)' being compiled
        with
        [
            ResultT=gul14::statistics_result_type,
            ElementT=int,
            ContainerT=std::vector<int,std::allocator<int>>,
            OpClosure=____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____35::<lambda_b7871ad714b701fac01f0b30b0616f31>,
            Accessor=const int &(__cdecl *)(const int &)
        ]
../tests/test_statistics.cc(451): note: see reference to function template instantiation 'void ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____35<Type>(void)' being compiled
        with
        [
            Type=int
        ]
../tests/test_statistics.cc(451): note: see reference to function template instantiation 'void `anonymous-namespace'::ns_____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____34::reg_test<int>(`anonymous-namespace'::ns_____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____34::TypeList<int>,Catch::NameAndTags)' being compiled
../tests/test_statistics.cc(451): note: while compiling class template member function '`anonymous-namespace'::ns_____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____34::____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____34<`anonymous-namespace'::ns_____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____34::TypeList<int>,`anonymous-namespace'::ns_____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____34::TypeList<float>>::____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____34(void)'
../tests/test_statistics.cc(451): note: see reference to function template instantiation '`anonymous-namespace'::ns_____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____34::____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____34<`anonymous-namespace'::ns_____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____34::TypeList<int>,`anonymous-namespace'::ns_____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____34::TypeList<float>>::____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____34(void)' being compiled
../tests/test_statistics.cc(452): note: see reference to class template instantiation '`anonymous-namespace'::ns_____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____34::____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____34<`anonymous-namespace'::ns_____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____34::TypeList<int>,`anonymous-namespace'::ns_____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____34::TypeList<float>>' being compiled
C:\Data\Develop\src\doocs\library\common\gul\include\gul14/statistics.h(606): warning C4244: 'argument': conversion from 'const ResultT' to 'TestType', possible loss of data
        with
        [
            ResultT=gul14::statistics_result_type
        ]
        and
        [
            TestType=float
        ]
../tests/test_statistics.cc(462): note: see reference to function template instantiation 'ResultT gul14::accumulate<gul14::statistics_result_type,std::vector<float,std::allocator<float>>,float,const ElementT&(__cdecl *)(const ElementT &),float,____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____35::<lambda_9ece39205f1cd595ffb9de8f94cfb6bc>,void>(const ContainerT &,OpClosure,Accessor)' being compiled
        with
        [
            ResultT=gul14::statistics_result_type,
            ElementT=float,
            ContainerT=std::vector<float,std::allocator<float>>,
            OpClosure=____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____35::<lambda_9ece39205f1cd595ffb9de8f94cfb6bc>,
            Accessor=const float &(__cdecl *)(const float &)
        ]
../tests/test_statistics.cc(451): note: see reference to function template instantiation 'void ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____35<Type>(void)' being compiled
        with
        [
            Type=float
        ]
../tests/test_statistics.cc(451): note: see reference to function template instantiation 'void `anonymous-namespace'::ns_____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____34::reg_test<float>(`anonymous-namespace'::ns_____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____34::TypeList<float>,Catch::NameAndTags)' being compiled
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29910\include\xmemory(696): warning C4244: 
'argument': conversion from '_Ty' to 'TestType', possible loss of data
        with
        [
            _Ty=int
        ]
        and
        [
            TestType=float
        ]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29910\include\vector(689): note: see reference to function template instantiation 'void std::_Default_allocator_traits<_Alloc>::construct<_Ty,int,bool>(_Alloc &,_Objty *const ,int &&,bool &&)' being compiled
        with
        [
            _Alloc=std::allocator<____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____35::UserType>,
            _Ty=____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____35::UserType,
            _Objty=____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____35::UserType
        ]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29910\include\vector(694): note: see reference to function template instantiation 'void std::_Default_allocator_traits<_Alloc>::construct<_Ty,int,bool>(_Alloc &,_Objty *const ,int &&,bool &&)' being compiled
        with
        [
            _Alloc=std::allocator<____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____35::UserType>,
            _Ty=____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____35::UserType,
            _Objty=____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____35::UserType
        ]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.28.29910\include\vector(707): note: see reference to function template instantiation 'void std::vector<____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____35::UserType,std::allocator<____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____35::UserType>>::_Emplace_back_with_unused_capacity<_Ty,bool>(_Ty &&,bool &&)' being compiled
        with
        [
            _Ty=int
        ]
../tests/test_statistics.cc(488): note: see reference to function template instantiation 'void std::vector<____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____35::UserType,std::allocator<____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____35::UserType>>::emplace_back<int,bool>(int &&,bool &&)' being compiled

Documentation does not list header files

It would be helpful if the documentation of individual classes or functions could list the header in which they are declared. We recommend including gul14/gul.h, but for people who want to keep their compile time to a minimum this would be helpful.

RPM spec file broken?

I have no clue about RPM packaging.

Excerpt of the libgul14.spec:

#
# This file is used to build RPMS for libgul14

Name:           libgul14
Version:        2.7
Release:        1%{?dist}
Summary:        General Utility Library

License:        GPLv2
URL:            https://winweb.desy.de/mcs/docs/gul/
Source0:        gul14-%{version}.tar.xz
  • It appears that the version is wrong
  • The license is questionable (see more detailed debian/copyright)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.