Giter Club home page Giter Club logo

stdplus's Introduction

stdplus

stdplus is a c++ project containing commonly used classes and functions for the Linux platform. Note the goals of this project are to implement only the minimum set of features needed by the OpenBMC project and other users. You may find the included set of functions currently quite sparse.

This project provides the following primitives:

  • A movable and copyable RAII helper wrapper which is used for wrapping c-native types that have custom destruction or copy reference logic.
  • Functions for trivially configuring signals without having to do the normal signal set operations from libc
  • C-Style Error Handler that wrap c-style functions which return errnos and negative error values into functions that throw c++ exceptions.
  • String Utilities that focus on providing helpful wrappers like efficient string append and concatenation.

Dependencies

Test cases require google{test,mock}, valgrind, and lcov. It also requires the Meson Build System which can be installed following the instructions at mesonbuild.com.

Building

For a standard release build, you want something like:

meson setup -Dexamples=false -Dtests=disabled builddir
ninja -C builddir
ninja -C builddir install

For a test / debug build, a typical configuration is

meson setup -Dtests=enabled builddir
meson test -C builddir

stdplus's People

Contributors

bradbishop avatar brandonkimbk avatar jzhu379 avatar manojkiraneda avatar wak-google avatar williamspatrick avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

stdplus's Issues

-fPIC error

How can i fix it?

**stdplus$ ninja -C builddir install
ninja: Entering directory builddir' [1/11] Linking target src/libstdplus.so.0.1 FAILED: src/libstdplus.so.0.1 c++ -o src/libstdplus.so.0.1 src/libstdplus.so.0.1.p/exception.cpp.o src/libstdplus.so.0.1.p/signal.cpp.o src/libstdplus.so.0.1.p/zstring.cpp.o src/libstdplus.so.0.1.p/zstring_view.cpp.o src/libstdplus.so.0.1.p/fd_atomic.cpp.o src/libstdplus.so.0.1.p/fd_create.cpp.o src/libstdplus.so.0.1.p/fd_dupable.cpp.o src/libstdplus.so.0.1.p/fd_fmt.cpp.o src/libstdplus.so.0.1.p/fd_impl.cpp.o src/libstdplus.so.0.1.p/fd_line.cpp.o src/libstdplus.so.0.1.p/fd_managed.cpp.o src/libstdplus.so.0.1.p/fd_mmap.cpp.o src/libstdplus.so.0.1.p/fd_ops.cpp.o -Wl,--as-needed -Wl,--no-undefined -shared -fPIC -Wl,--start-group -Wl,-soname,libstdplus.so.0 /usr/local/lib/libfmt.a -Wl,--end-group /usr/bin/ld: /usr/local/lib/libfmt.a(format.cc.o): warning: relocation against stdout@@GLIBC_2.2.5' in read-only section .text' /usr/bin/ld: /usr/local/lib/libfmt.a(format.cc.o): relocation R_X86_64_PC32 against symbol stderr@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
[2/11] Linking target subprojects/googletest/libgtest.so
ninja: build stopped: subcommand failed.
**

Difficulty Building stdplus: Missing std::dynamic_extent and nonstd::dynamic_extent

Having trouble building this library for eventual use of phosphor-ipmi-flash. Attached is output. Building on ubuntu 20.04.

The Meson build system
Version: 0.56.0
Source dir: /state/home/rchow/stdplus
Build dir: /state/home/rchow/stdplus/builddir
Build type: native build
Project name: stdplus
Project version: 0.1
C++ compiler for the host machine: c++ (gcc 10.2.0 "c++ (GCC) 10.2.0")
C++ linker for the host machine: c++ ld.bfd 2.31.1
Host machine cpu family: x86_64
Host machine cpu: x86_64
Did not find pkg-config by name 'pkg-config'
Found Pkg-config: NO
Found CMake: /usr/local/bin/cmake (3.18.0)
Run-time dependency fmt found: NO (tried pkgconfig and cmake)

|Executing subproject fmt method cmake
|
|
||Configuring the build directory with CMake version 3.18.0
||Running CMake with: -G Ninja -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DMASTER_PROJECT=OFF
||  - build directory:          /state/home/rchow/stdplus/builddir/subprojects/fmt/__CMake_build
||  - source directory:         /state/home/rchow/stdplus/subprojects/fmt
||  - toolchain file:           /state/home/rchow/stdplus/builddir/subprojects/fmt/CMakeMesonToolchainFile.cmake
||  - preload file:             /state/home/rchow/stdplus/builddir/meson-private/data/preload.cmake
||  - trace args:               --trace-expand --trace-format=json-v1 --no-warn-unused-cli --trace-redirect=cmake_trace.txt
||  - disabled policy warnings: [CMP0025, CMP0047, CMP0056, CMP0060, CMP0065, CMP0066, CMP0067, CMP0082, CMP0089, CMP0102]
||
||Running with expanded trace output on.
||Not searching for unused variables given on the command line.
||Trace will be written to cmake_trace.txt
||-- CMake version: 3.18.0
||-- The CXX compiler identification is GNU 10.2.0
||-- Detecting CXX compiler ABI info
||-- Detecting CXX compiler ABI info - done
||-- Check for working CXX compiler: /usr/bin/c++ - skipped
||-- Detecting CXX compile features
||-- Detecting CXX compile features - done
||-- Version: 7.1.2
||-- Build type: Release
||-- CXX_STANDARD: 11
||-- Performing Test has_std_11_flag
||-- Performing Test has_std_11_flag - Success
||-- Performing Test has_std_0x_flag
||-- Performing Test has_std_0x_flag - Success
||-- Performing Test SUPPORTS_USER_DEFINED_LITERALS
||-- Performing Test SUPPORTS_USER_DEFINED_LITERALS - Success
||-- Performing Test FMT_HAS_VARIANT
||-- Performing Test FMT_HAS_VARIANT - Success
||-- Required features: cxx_variadic_templates
||-- Looking for strtod_l
||-- Looking for strtod_l - found
||-- Target 'doc' disabled (requires doxygen)
||-- Looking for C++ include pthread.h
||-- Looking for C++ include pthread.h - found
||-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
||-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
||-- Looking for pthread_create in pthreads
||-- Looking for pthread_create in pthreads - not found
||-- Looking for pthread_create in pthread
||-- Looking for pthread_create in pthread - found
||-- Found Threads: TRUE
||-- Performing Test HAVE_FNO_DELETE_NULL_POINTER_CHECKS
||-- Performing Test HAVE_FNO_DELETE_NULL_POINTER_CHECKS - Success
||-- FMT_PEDANTIC: OFF
||-- Configuring done
||-- Generating done
||-- Build files have been written to: /state/home/rchow/stdplus/builddir/subprojects/fmt/__CMake_build
|
|CMake configuration: SUCCEEDED
|WARNING: CMake: path /state/home/rchow/stdplus/subprojects/fmt/gmock does not exist.
|WARNING:  --> Ignoring. This can lead to build errors.
|WARNING: CMake: path /state/home/rchow/stdplus/subprojects/fmt/gtest does not exist.
|WARNING:  --> Ignoring. This can lead to build errors.
|WARNING: CMake: path /state/home/rchow/stdplus/subprojects/fmt/gtest does not exist.
|WARNING:  --> Ignoring. This can lead to build errors.
|WARNING: CMake: path /state/home/rchow/stdplus/subprojects/fmt/gmock does not exist.
|WARNING:  --> Ignoring. This can lead to build errors.
|CMake project FMT has 20 build targets.
|
||Processing generated meson AST
||Build file: /state/home/rchow/stdplus/builddir/subprojects/fmt/meson.build
||
||Project name: FMT
||Project version: undefined
||C compiler for the host machine: cc (gcc 10.2.0 "cc (GCC) 10.2.0")
||C linker for the host machine: cc ld.bfd 2.31.1
||C++ compiler for the host machine: c++ (gcc 10.2.0 "c++ (GCC) 10.2.0")
||C++ linker for the host machine: c++ ld.bfd 2.31.1
||Build targets in project: 19
||Subproject fmt finished.
|

Header <span> has symbol "std::dynamic_extent" with dependency not-found: NO
Run-time dependency span-lite found: NO (tried pkgconfig and cmake)
Header <nonstd/span.hpp> has symbol "nonstd::dynamic_extent" with dependency not-found: NO
Cloning into 'span-lite'...
remote: Enumerating objects: 264, done.
remote: Counting objects: 100% (264/264), done.
remote: Compressing objects: 100% (129/129), done.
remote: Total 1459 (delta 133), reused 195 (delta 71), pack-reused 1195
Receiving objects: 100% (1459/1459), 294.58 KiB | 2.45 MiB/s, done.
Resolving deltas: 100% (819/819), done.

|Executing subproject span-lite method cmake
|
|
||Configuring the build directory with CMake version 3.18.0
||Running CMake with: -G Ninja -DCMAKE_INSTALL_PREFIX=/usr/local
||  - build directory:          /state/home/rchow/stdplus/builddir/subprojects/span-lite/__CMake_build
||  - source directory:         /state/home/rchow/stdplus/subprojects/span-lite
||  - toolchain file:           /state/home/rchow/stdplus/builddir/subprojects/span-lite/CMakeMesonToolchainFile.cmake
||  - preload file:             /state/home/rchow/stdplus/builddir/meson-private/data/preload.cmake
||  - trace args:               --trace-expand --trace-format=json-v1 --no-warn-unused-cli --trace-redirect=cmake_trace.txt
||  - disabled policy warnings: [CMP0025, CMP0047, CMP0056, CMP0060, CMP0065, CMP0066, CMP0067, CMP0082, CMP0089, CMP0102]
||
||Running with expanded trace output on.
||Not searching for unused variables given on the command line.
||Trace will be written to cmake_trace.txt
||-- The CXX compiler identification is GNU 10.2.0
||-- Detecting CXX compiler ABI info
||-- Detecting CXX compiler ABI info - done
||-- Check for working CXX compiler: /usr/bin/c++ - skipped
||-- Detecting CXX compile features
||-- Detecting CXX compile features - done
||-- Project 'span_lite', package 'span-lite' version: '0.8.1'
||-- Subproject 'test', programs 'span-lite-*'
||-- CompilerId: 'GNU'
||-- Matched: GNU
||-- Make target: '98'
||-- Make target: '11'
||-- Make target: '14'
||-- Make target: '17'
||-- Configuring done
||-- Generating done
||-- Build files have been written to: /state/home/rchow/stdplus/builddir/subprojects/span-lite/__CMake_build
|
|CMake configuration: SUCCEEDED
|CMake project span_lite has 5 build targets.
|
||Processing generated meson AST
||Build file: /state/home/rchow/stdplus/builddir/subprojects/span-lite/meson.build
||
||Project name: span_lite
||Project version: undefined
||C++ compiler for the host machine: c++ (gcc 10.2.0 "c++ (GCC) 10.2.0")
||C++ linker for the host machine: c++ ld.bfd 2.31.1
||Build targets in project: 23
||Subproject span-lite finished.
|

Build targets in project: 24

stdplus 0.1

  Subprojects
          fmt: YES
    span-lite: YES

Option tests is: disabled [default: auto]
Option examples is: false [default: true]
Found ninja-1.8.2 at /usr/bin/ninja```

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.