Basic Development Environment - a set of foundational C++ libraries used at Bloomberg.

BDE Libraries

This repository contains the BDE libraries, currently BSL (Basic Standard Library), BDL (Basic Development Library), BAL (Basic Application Library), and BBL (Basic Business Library).

Documentation and Build Links

For more information about BDE libraries follow the links below.

Open Source

Bloomberg LP (internal)

Build Instructions

BDE uses a build system based on cmake. The build system is located in the BDE tools repository (see Documentation Links).

Prerequisites

The BDE CMake build system requires the following software to be preinstalled and configured on the system:

Note that python is used by the build helpers bde_build_env.py and cmake_build.py, but is not strictly needed to build BDE. See the more complete build instructions linked below for more detail.

Build Instructions (Open Source)

Please see the more complete build instructions for open source users.

The following commands can be used to configure and build the BDE repository:

  1. Clone the bde-tools and bde repositories and add bde-tools to your PATH:

    $ git clone https://github.com/bloomberg/bde-tools.git
    $ export PATH=$PWD/bde-tools/bin:$PATH      # add bde-tools to the 'PATH'
    $ git clone https://github.com/bloomberg/bde.git
    $ cd bde
  2. From the root of this source repository, run:

    $ export BDE_CMAKE_BUILD_DIR=$PWD/_build   # configure the build directory
    $ cmake_build.py configure -u dbg_exc_mt_64_cpp14
  3. To build the libraries, but not the test drivers, run:

    $ cmake_build.py build

    To also build the test drivers, run:

    $ cmake_build.py build --test build

    To build and run the test drivers, run:

    $ cmake_build.py build --test run

Build Instructions (Bloomberg LP)

Please see the more complete build instructions for Bloomberg LP users.

The following commands can be used to configure and build the BDE repository:

  1. Clone the bde-tools and bde repositories and add bde-tools to your PATH:

    $ git clone bbgithub:bde/bde-tools
    $ export PATH=$PWD/bde-tools/bin:$PATH      # add bde-tools to the 'PATH'
    $ git clone bbgithub:bde/bde
    $ cd bde
  2. From the root of this source repository, run:

    $ export BDE_CMAKE_BUILD_DIR=$PWD/_build   # configure the build directory
    $ cmake_build.py configure -u dbg_exc_mt_64_cpp14
  3. To build the libraries, but not the test drivers, run:

    $ cmake_build.py build

    To also build the test drivers, run:

    $ cmake_build.py build --test build

    To build and run the test drivers, run:

    $ cmake_build.py build --test run

License

The BDE libraries are distributed under the Apache License (version 2.0); see the LICENSE file at the top of the source tree for more information.

Comments
  • Linux on PowerPC port

    Linux on PowerPC port

    Linux on PowerPC initial platform, atomics support for gcc compiler

    Also provides (same) atomics implementation for gcc on AIX on PowerPC, replacing the stub implementation bsls_atomicoperations_powerpc_aix_gcc

  • bslim_printer: Support printing StringRef values.

    bslim_printer: Support printing StringRef values.

    Printing bslstl::StringRef values was not previously supported because the type does not contain a print() method and also does not declare the bslalg::HasStlIterators type trait due to not fulfilling the requirements. Since StringRef values should print enclosed in quotes similar to bsl::string values, support printing them directly and defer to StringRef's operator<< implementation.

  • Fixes for XCode 5

    Fixes for XCode 5

    There are 2 commits on this branch:

    • in any bsl+stdhdrs header, only forward names in the std namespace to the bsl namespace in as per the C++ standard, and no others; maintaining the current behaviour under BSL_OVERRIDES_STD to not break internal Bloomberg code (if this is deemed unsafe, we could come up with another #define that would be more appropriate)
    • obtain system time primitives on OS X from <sys/time.h> instead of <time.h>

    I was able to get all the test programs in bsl+stdhdrs/test compiling, all regular tests compiling and all tests passing on Linux and OS X. This fixes #92.

  • Testing label 1

    Testing label 1

    For these files, we have performed 4-way or 6-way matches to ensure the Testing Labels in Test Case Test Plans match the Test Plan Checklist items.

    We have performed 4-way matches between component '.h' files; Test Plan checklists; Test Case Test Plans and Test Case Test Code.

    In larger Test Drivers we have performed 6-way matches between component '.h' files; Test Plan checklists; Test Case Test Plans; Test Case Test Code; Function Test Case Test Plans and Function Test Case Test Code.

  • replace the `createNull` method with a public `static const s_null` data member

    replace the `createNull` method with a public `static const s_null` data member

    This change has been discussed with the bde team, and I had intended to make it before handing Datum off to them, but never got around to it. It would simplify use of Datum, provide a potential performance benefit (as null objects are created frequently), and as a side-benefit, allow the logic in the body of createNull to move into bdld_datum.cpp.

    Note that createNull could be left intact (perhaps returning a const Datum&) for compatibility.

    I'll be happy to write the patch myself if this change is approved.

  • Question regarding running failed  tests individually

    Question regarding running failed tests individually

    I recently built and ran the bde + bsl suite on my Solaris system.

    While my build was successful, I had a few runtime failures. I am a novice user and had a couple of questions.

    My command line is python waf build -j 1 --test=build --abi-bits=64

    For example my log file shows: TEST ../groups/bsl/bslstl/bslstl_vector.t.cpp CASE 2 li: 1 Error ../groups/bsl/bslstl/bslstl_vector.t.cpp(8422): B + 0 + TYPE_ALLOC == A (failed) li: 2 Error ../groups/bsl/bslstl/bslstl_vector.t.cpp(8422): B + 0 + TYPE_ALLOC == A (failed) li: 4

    1. While this runs all the tests, is there a way for me to just rerun the failed tests? I know I can run the binary as say $ groups/bsl/bslstl/bslstl_vector.t 2 Can I do something like python waf ...

    2. Also, would it be possible to see the flags that were passed to the C++ compiler preferably while the test is running? I did try the verbose option but it didn't seem to help.

    Thanks.

  • bsls_atomic.t test case 7 times out (marked failure) on OS X

    bsls_atomic.t test case 7 times out (marked failure) on OS X

    Machine: Fully patched OS X Yosemite

    Darwin x.local 14.0.0 Darwin Kernel Version 14.0.0: Fri Sep 19 00:26:44 PDT 2014; root:xnu-2782.1.97~2/RELEASE_X86_64 x86_64
    

    Compiler: Xcode 6

    $ g++ -v
    Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
    Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn)
    Target: x86_64-apple-darwin14.0.0
    Thread model: posix
    

    When building in default x64 mode on OS X, all test drivers run successfully except for bsls_atomic.t case 7 -- it is cancelled by the test runner for timing out. Running the test manually in lldb shows that it is continuously looping performing atomic operations.

    I have also tried both with the current code (it selects bsls_atomicoperations_x64_all_gcc.h due to the code thinking Clang is GCC 4.4.0) as well as the newer GCC >= 4.7 intrinsics selected when my patch #142 is applied (bsls_atomicoperations_all_all_gccintrinsics.h).

    Printing out a stack walkback shows that the 2nd and 3rd thread are continuously changing calls, indicating they are not deadlocked, while the 1st thread is stopped in __semwait_signal:

    Process 41142 stopped
    * thread #1: tid = 0x235312, 0x00007fff858ef486 libsystem_kernel.dylib`__semwait_signal + 10, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
      thread #2: tid = 0x235343, 0x000000010000cea3 bsls_atomic.t`(anonymous namespace)::PetersonsLockSeqCst<BloombergLP::bsls::AtomicInt>::lock(this=0x00007fff5fbfcc00) + 19 at bsls_atomic.t.cpp:258
      thread #3: tid = 0x235344, 0x000000010000d79c bsls_atomic.t`BloombergLP::bsls::AtomicInt::operator=(this=0x00007fff5fbfcc14, value=1) + 12 at bsls_atomic.h:1070
    
    Process 54802 stopped
    * thread #1: tid = 0x25d8c3, 0x00007fff858ef486 libsystem_kernel.dylib`__semwait_signal + 10, queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
      thread #2: tid = 0x25d8e3, 0x000000010000cf5e bsls_atomic.t`(anonymous namespace)::PetersonsLockSeqCst<BloombergLP::bsls::AtomicInt>::lock() + 206
      thread #3: tid = 0x25d8e4, 0x000000010000cf64 bsls_atomic.t`(anonymous namespace)::PetersonsLockSeqCst<BloombergLP::bsls::AtomicInt>::lock() + 212
    
  • update configure instructions for waf build

    update configure instructions for waf build

    Since waf is now provided through the bde-tools repository, running python waf configure fails. This change updates the documentation for the configuration step since waf will now be found in PATH.

  • bde on ARM architecture

    bde on ARM architecture

    waf configuration line:

    CCX=/usr/bin/arm-linux-gnueabi-g++-4.7 CC=/usr/bin/arm-linux-gnueabi-gcc-4.7 waf configure --prefix=/home/federico-garciacruz/devel/allocatorBloomberg/bde/build-arm --out=/home/federico-garciacruz/devel/allocatorBloomberg/bde/build-arm -a 32 -t opt_cpp11

    output: Setting top to : /home/federico-garciacruz/devel/allocatorBloomberg/bde Setting out to : /home/federico-garciacruz/devel/allocatorBloomberg/bde/build-arm Checking for 'gcc' (c compiler) : /usr/bin/arm-linux-gnueabi-gcc-4.7 Checking for 'g++' (c++ compiler) : /usr/bin/arm-linux-gnueabi-g++-4.7 os_type : unix os_name : linux cpu_type : x86_64 os_ver : 3.13.0 comp_type : gcc comp_ver : 4.7.3 uplid : unix-linux-x86_64-3.13.0-gcc-4.7.3 ufid : opt_cpp11 prefix : /home/federico-garciacruz/devel/allocatorBloomberg/bde/build-arm Loading BDE metadata : ok Evaluating options for 'bsl' : ok Evaluating options for 'bdl' : ok Saving configuration : ok 'configure' finished successfully (0.168s)

    when I execute waf build I get these errors:

    arm-linux-gnueabi-g++-4.7: error: unrecognized command line option ‘-m32’ arm-linux-gnueabi-g++-4.7: error: unrecognized argument in option ‘-march=pentium2’ arm-linux-gnueabi-g++-4.7: note: valid arguments to ‘-march=’ are: armv2 armv2a armv3 armv3m armv4 armv4t armv5 armv5e armv5t armv5te armv6 armv6-m armv6j armv6k armv6s-m armv6t2 armv6z armv6zk armv7 armv7-a armv7-m armv7-r armv7e-m ep9312 iwmmxt iwmmxt2 native arm-linux-gnueabi-g++-4.7: error: unrecognized argument in option ‘-mtune=opteron’ arm-linux-gnueabi-g++-4.7: note: valid arguments to ‘-mtune=’ are: arm1020e arm1020t arm1022e arm1026ej-s arm10e arm10tdmi arm1136j-s arm1136jf-s arm1156t2-s arm1156t2f-s arm1176jz-s arm1176jzf-s arm2 arm250 arm3 arm6 arm60 arm600 arm610 arm620 arm7 arm70 arm700 arm700i arm710 arm7100 arm710c arm710t arm720 arm720t arm740t arm7500 arm7500fe arm7d arm7di arm7dm arm7dmi arm7m arm7tdmi arm7tdmi-s arm8 arm810 arm9 arm920 arm920t arm922t arm926ej-s arm940t arm946e-s arm966e-s arm968e-s arm9e arm9tdmi cortex-a15 cortex-a5 cortex-a7 cortex-a8 cortex-a9 cortex-m0 cortex-m1 cortex-m3 cortex-m4 cortex-r4 cortex-r4f cortex-r5 ep9312 fa526 fa606te fa626 fa626te fa726te fmp626 generic-armv7-a iwmmxt iwmmxt2 mpcore mpcorenovfp native strongarm strongarm110 strongarm1100 strongarm1110 xscale

    Am I missing some configuration setting here?

  • bsls_timeutil: Fix OS_DARWIN compilation.

    bsls_timeutil: Fix OS_DARWIN compilation.

    Fixes sys/time.h ifdef logic to include all OS_UNIX other than OS_LINUX and OS_AIX. Adds cast to ::times() clock_t return value due to value being unsigned on OS_DARWIN.

    Addresses issue reported in #5.

  • std::unordered_map compilation problem

    std::unordered_map compilation problem

    Hello,

    I am working with bde library and I was getting some compilation errors when I included std::unordered_map:

    ..../bdeExample1.cpp:24:9: error: ‘unordered_map’ in namespace ‘std’ does not name a type

    I have found this code in BDE_BUILD_PATH/include/bsl/unordered_map:

    if 0 // Native STL header disabled until we routinely test for C++11 libs

    if defined(BSLS_COMPILERFEATURES_SUPPORT_INCLUDE_NEXT)

    include_next <unordered_map>

    else

    include BSL_NATIVE_CPP_LIB_HEADER(unordered_map)

    endif

    endif

    I commented the #if 0/#endif statement and it seems to work fine. Is there any bde library version with this issue fixed? or how could I perform the tests needed to make sure things are working properly?

  • Add vcpkg installation instructions

    Add vcpkg installation instructions

    bde is available as a port in vcpkg, a C++ library manager that simplifies installation for bde and other project dependencies. Documenting the install process here will help users get started by providing a single set of commands to build bde, ready to be included in their projects.

    We also test whether our library ports build in various configurations (dynamic, static) on various platforms (OSX, Linux, Windows: x86, x64) to keep a wide coverage for users.

    I'm a maintainer for vcpkg, and here is what the port script looks like. We try to keep the library maintained as close as possible to the original library.😊

  • Cleanup for C++20 testing on a Mac M1

    Cleanup for C++20 testing on a Mac M1

    This patch supplies additional cleanups that were independently developed testing C++20 on an M1 mac. After rebasing onto the changes already landed in master, the main effect is to adopt an additional library feature macro, in the style of existing feature macros, rather than rely on inline tests for the C++ language version. Also added platform support for the Arm 9 CPU, and fixed up a typo or two.

  • Compilation error on latest master

    Compilation error on latest master

    /home/tcanabrava/Projects/bde/groups/bal/balb/balb_controlmanager.cpp: In member function ‘void BloombergLP::balb::ControlManager::printUsage(std::ostream&, const std::string_view&) const’:
    /home/tcanabrava/Projects/bde/groups/bal/balb/balb_controlmanager.cpp:142:32: error: ‘endl’ is not a member of ‘bsl’; did you mean ‘end’?
      142 |     stream << preamble << bsl::endl;
          |                                ^~~~
          |                                end
    
  • error_code hash bug in tests

    error_code hash bug in tests

    https://github.com/bloomberg/bde/blob/master/groups/bsl/bslstl/bslstl_error.t.cpp#L1359

    There's no guarantee that the std::hash of an std::error_code differ if the error code categories are different. Indeed, on libc++, this is the case:

    template <>
    struct _LIBCPP_TEMPLATE_VIS hash<error_code>
        : public unary_function<error_code, size_t>
    {
        _LIBCPP_INLINE_VISIBILITY
        size_t operator()(const error_code& __ec) const _NOEXCEPT
        {
            return static_cast<size_t>(__ec.value());
        }
    };
    

    It only hashes the value, not the category.

  • BDE test bug

    BDE test bug

    https://github.com/bloomberg/bde/blob/master/groups/bsl/bslstl/bslstl_stringview.t.cpp#L5327 (and line 5343)

    I'm compiling with Circle targeting libc++. string_view.max_size() returns 18446744073709551615 on that platform, so the MAX_MAX_SIZE is (18446744073709551614) is smaller, violating the assert.

C++14 evented IO libraries for high performance networking and media based applications

LibSourcey C++ Networking Evolved LibSourcey is a collection of cross platform C++14 modules and classes that provide developers with an arsenal for r

Sep 28, 2022
stb single-file public domain libraries for C/C++

stb single-file public domain (or MIT licensed) libraries for C/C++ Noteworthy: image loader: stb_image.h image writer: stb_image_write.h image resize

Oct 1, 2022
A collection of single-file C libraries. (generic containers, random number generation, argument parsing and other functionalities)

cauldron A collection of single-file C libraries and tools with the goal to be portable and modifiable. Libraries library description arena-allocator.

Sep 17, 2022
Framework for Enterprise Application Development in c++, HTTP1/HTTP2/HTTP3 compliant, Supports multiple server backends

The ffead-cpp Framework ffead-cpp is a web-framework, application framework, utilities all bundled into one. It also provides an embedded HTTP/Web-Soc

Sep 23, 2022
An open-source C++ library developed and used at Facebook.

Folly: Facebook Open-source Library What is folly? Folly (acronymed loosely after Facebook Open Source Library) is a library of C++14 components desig

Sep 28, 2022
U++ is a C++ cross-platform rapid application development framework focused on programmer's productivity. It includes a set of libraries (GUI, SQL, Network etc.), and integrated development environment (TheIDE).
U++ is a C++ cross-platform rapid application development framework focused on programmer's productivity. It includes a set of libraries (GUI, SQL, Network etc.), and integrated development environment (TheIDE).

Ultimate++ Ultimate++ is a C++ cross-platform rapid application development framework focused on programmers productivity. It includes a set of librar

Sep 28, 2022
A basic system that waters a plant according to the heat index of the environment.

Basic-Plant-Watering-System ?? This is a basic plant watering system created on Arduino Uno using DHT11 Temperature and Humidity sensor. DHT Sensor Li

Apr 11, 2021
Mystikos is a set of tools for running applications in a hardware trusted execution environment (TEE)
Mystikos is a set of tools for running applications in a hardware trusted execution environment (TEE)

Mystikos is a set of tools for running applications in a hardware trusted execution environment (TEE). The current release supports Intel ® SGX while other TEEs may be supported in future releases. Linux is also a supported target, though only suitable for testing purposes as it provides no additional protection.

Sep 23, 2022
foxBMS is a free, open and flexible development environment to design battery management systems.

foxBMS is a free, open and flexible development environment to design battery management systems. It is the first modular open source BMS development platform.

Oct 1, 2022
A FREE Windows C development course where we will learn the Win32API and reverse engineer each step utilizing IDA Free in both an x86 and x64 environment.
A FREE Windows C development course where we will learn the Win32API and reverse engineer each step utilizing IDA Free in both an x86 and x64 environment.

FREE Reverse Engineering Self-Study Course HERE Hacking Windows The book and code repo for the FREE Hacking Windows book by Kevin Thomas. FREE Book Do

Sep 25, 2022
POCO C++ Libraries are powerful cross-platform C++ libraries for building network
POCO C++ Libraries are powerful cross-platform C++ libraries for building network

The POCO C++ Libraries are powerful cross-platform C++ libraries for building network- and internet-based applications that run on desktop, server, mobile, IoT, and embedded systems.

Sep 26, 2022
Basic jam templates using Handmade libraries to get up and running quickly.
Basic jam templates using Handmade libraries to get up and running quickly.

This is a selection of template projects to get up and running with for the Wheel Reinvention Jam. They are built on top of Handmade-inspired librarie

Sep 7, 2022
A set of libraries and tools to make MSX games using the C programming language.

ubox MSX lib This is a set of libraries and tools to make MSX games using the C programming language. There are three main components: ubox: thin wrap

May 30, 2022
Libraries and tools to perform fully homomorphic encryption operations on an encrypted data set.

Fully Homomorphic Encryption (FHE) This repository contains open-source libraries and tools to perform fully homomorphic encryption (FHE) operations o

Sep 27, 2022
A basic C++ cryptocurrency/block-chain. Includes a basic wallet system. See README.md for all the inclusions and future additions.

Cryptocurrency Project C++ cryptocurrency/block-chain. Mostly basic blockchain for now. New Additions are in the works(see below). This file details w

Dec 23, 2021
Implementation of Univaraint Linear Regresion (Supervised Machine Learning) in c++. With a data set (training set) you can predict outcomes.

Linear-Regression Implementation of Univaraint Linear Regresion (Supervised Machine Learning) in c++. With a data set (training set) you can predict o

Nov 3, 2021
oZKS (Ordered Zero-Knowledge Set) is a library that provides an implementation of an Ordered (and Append Only) Zero-Knowledge Set.

Ordered Zero-Knowledge Set - oZKS Introduction oZKS is a library that provides an implementation of an Ordered (and Append Only) Zero Knowledge Set. A

Aug 31, 2022
6D - Pose Annotation Tool (6D-PAT) - is a tool that allows the user to load a set of images and also a set of 3D models and annotate where in the 2D image the 3D object ist placed.
6D - Pose Annotation Tool (6D-PAT) - is a tool that allows the user to load a set of images and also a set of 3D models and annotate where in the 2D image the 3D object ist placed.

6D - Pose Annotation Tool (6D-PAT) For detiled explanations checkout the WikiPage. What is it? With 6D-PAT you can create 6D annotations on images for

Sep 22, 2022