Fpermissive Cmake

  1. See Building using CMake - Windows. Getting started with CMake (These instructions apply to Unix-like systems, including Cygwin and Mac. To build using Visual Studio or some other IDE supported by CMake, most of the information below still applies) Always compile in a separate directory to the code.
  2. CMake is an open-source, cross-platform family of tools designed to build, test and package software. CMake is used to control the software compilation process using simple platform and compiler independent configuration files, and generate native makefiles and workspaces that can be used in the compiler environment of your choice.

pybind11 — Seamless operability between C++11 and Python

Add -fpermissive to cmake CXXFLAGS #170 gcolvin merged 1 commit into ethereum: develop from Legogris: patch-1 May 9, 2016 Conversation 2 Commits 1 Checks 0 Files changed. When the consumer is built using GCC or Clang, -fpersmissive must be used. (The above macro/flag are just examples, the question holds for arbitrary macro/option usage requirements). I want to express these as usage requirements on Foo. My question is, what are the disadvantages of using variable-conditioned settings vs. Generator expressions?

Setuptools example• Scikit-build example• CMake example


Combining older versions of pybind11 (< 2.6.0) with Python 3.9.0 willtrigger undefined behavior that typically manifests as crashes duringinterpreter shutdown (but could also destroy your data. You have beenwarned.)

We recommend that you update to the latest patch release of Python (3.9.1),which includes a fixthat resolves this problem. If you do use Python 3.9.0, please update tothe latest version of pybind11 (2.6.0 or newer), which includes a temporaryworkaround specifically when Python 3.9.0 is detected at runtime.

pybind11 is a lightweight header-only library that exposes C++ typesin Python and vice versa, mainly to create Python bindings of existingC++ code. Its goals and syntax are similar to the excellentBoost.Pythonlibrary by David Abrahams: to minimize boilerplate code in traditionalextension modules by inferring type information using compile-timeintrospection.

The main issue with Boost.Python—and the reason for creating such asimilar project—is Boost. Boost is an enormously large and complex suiteof utility libraries that works with almost every C++ compiler inexistence. This compatibility has its cost: arcane template tricks andworkarounds are necessary to support the oldest and buggiest of compilerspecimens. Now that C++11-compatible compilers are widely available,this heavy machinery has become an excessively large and unnecessarydependency.

Think of this library as a tiny self-contained version of Boost.Pythonwith everything stripped away that isn’t relevant for bindinggeneration. Without comments, the core header files only require ~4Klines of code and depend on Python (2.7 or 3.5+, or PyPy) and the C++standard library. This compact implementation was possible thanks tosome of the new C++11 language features (specifically: tuples, lambdafunctions and variadic templates). Since its creation, this library hasgrown beyond Boost.Python in many ways, leading to dramatically simplerbinding code in many common situations.

Tutorial and reference documentation is provided atpybind11.readthedocs.io.A PDF version of the manual is availablehere.And the source code is always available atgithub.com/pybind/pybind11.

pybind11 can map the following core C++ features to Python:

  • Functions accepting and returning custom data structures per value,reference, or pointer

  • Instance methods and static methods

  • Overloaded functions

  • Instance attributes and static attributes

  • Arbitrary exception types

  • Enumerations

  • Callbacks

  • Iterators and ranges

  • Custom operators

  • Single and multiple inheritance

  • STL data structures

  • Smart pointers with reference counting like std::shared_ptr

  • Internal references with correct reference counting

  • C++ classes with virtual (and pure virtual) methods can be extendedin Python

In addition to the core functionality, pybind11 provides some extragoodies:

Fpermissive Cmake

  • Python 2.7, 3.5+, and PyPy/PyPy3 7.3 are supported with animplementation-agnostic interface.

  • It is possible to bind C++11 lambda functions with capturedvariables. The lambda capture data is stored inside the resultingPython function object.

  • pybind11 uses C++11 move constructors and move assignment operatorswhenever possible to efficiently transfer custom data types.

  • It’s easy to expose the internal storage of custom data types throughPythons’ buffer protocols. This is handy e.g. for fast conversionbetween C++ matrix classes like Eigen and NumPy without expensivecopy operations.

  • pybind11 can automatically vectorize functions so that they aretransparently applied to all entries of one or more NumPy arrayarguments.

  • Python’s slice-based access and assignment operations can besupported with just a few lines of code.

  • Everything is contained in just a few header files; there is no needto link against any additional libraries.

  • Binaries are generally smaller by a factor of at least 2 compared toequivalent bindings generated by Boost.Python. A recent pybind11conversion of PyRosetta, an enormous Boost.Python binding project,reporteda binary size reduction of 5.4x and compile time reduction by5.8x.

  • Function signatures are precomputed at compile time (usingconstexpr), leading to smaller binaries.

  • With little extra effort, C++ types can be pickled and unpickledsimilar to regular Python objects.

  1. Clang/LLVM 3.3 or newer (for Apple Xcode’s clang, this is 5.0.0 ornewer)

  2. GCC 4.8 or newer

  3. Microsoft Visual Studio 2015 Update 3 or newer

  4. Intel classic C++ compiler 18 or newer (ICC 20.2 tested in CI)

  5. Cygwin/GCC (previously tested on 2.5.1)

  6. NVCC (CUDA 11.0 tested in CI)

  7. NVIDIA PGI (20.9 tested in CI)

This project was created by WenzelJakob. Significant features and/orimprovements to the code were contributed by Jonas Adler, Lori A. Burns,Sylvain Corlay, Eric Cousineau, Ralf Grosse-Kunstleve, Trent Houliston, AxelHuebl, @hulucc, Yannick Jadoul, Sergey Lyskov Johan Mabille, Tomasz Miąsko,Dean Moldovan, Ben Pritchard, Jason Rhinelander, Boris Schäling, PimSchellart, Henry Schreiner, Ivan Smirnov, Boris Staletic, and Patrick Stewart.

We thank Google for a generous financial contribution to the continuousintegration infrastructure used by this project.

Fpermissive Cmake Link


See the contributingguidefor information on building and contributing to pybind11.


pybind11 is provided under a BSD-style license that can be found in theLICENSEfile. By using, distributing, or contributing to this project, you agreeto the terms and conditions of this license.


The Basics

  • Installing the library
  • First steps
  • Object-oriented code
  • Build systems

Advanced Topics

G++ Permissive

  • Functions
  • Classes
  • Exceptions
  • Smart pointers
  • Type conversions
  • Python C++ interface
  • Embedding the interpreter
  • Miscellaneous

Extra Information

Fpermissive Cmake Print

Sep 5th, 2014
Not a member of Pastebin yet?Sign Up, it unlocks many cool features!
  1. /home/Jacque/pybombs/mod_pybombs/sysutils.py:588: RuntimeWarning: tempnam is a potential security risk to your program
  2. tmpfile = os.tempnam(d);
  3. PyBombs.sysutils - INFO - 001b[1m001b[32mhave_deb: Satisfies requirement...installed version of make (3.81) is >= than 3.75001b[0m
  4. PyBombs.sysutils - INFO - 001b[1m001b[32mhave_deb: Satisfies requirement...installed version of python-cheetah (2.4.4) is >= than 2.0001b[0m
  5. PyBombs.sysutils - INFO - 001b[1m001b[32mhave_deb: Satisfies requirement...installed version of python-numpy (1.6.2) is >= than 1.5001b[0m
  6. PyBombs.sysutils - INFO - 001b[1m001b[32mhave_deb: Satisfies requirement...installed version of python-lxml (2.3.2) is >= than 2.3.2001b[0m
  7. PyBombs.sysutils - INFO - 001b[1m001b[32mhave_deb: Satisfies requirement...installed version of python-gtk2 (2.24.0) is >= than 2.17001b[0m
  8. PyBombs.sysutils - INFO - 001b[1m001b[32mhave_deb: Satisfies requirement...installed version of cmake (2.8.9) is >= than 2.8.3001b[0m
  9. PyBombs.sysutils - INFO - 001b[1m001b[32mhave_deb: Satisfies requirement...installed version of cmake-data (2.8.9) is >= than 2.8.3001b[0m
  10. PyBombs.sysutils - INFO - 001b[1m001b[32mhave_deb: Satisfies requirement...installed version of python-qt4 (4.9.3) is >= than 4.6.2001b[0m
  11. PyBombs.sysutils - INFO - 001b[1m001b[32mhave_deb: Satisfies requirement...installed version of python-qwt5-qt4 (5.2.1) is >= than 5.2001b[0m
  12. Settled on prefix: /home/Jacque/target
  13. Initializing environmental variables...
  14. /home/Jacque/target/python/:/home/Jacque/target/lib/python2.6/site-packages/:/home/Jacque/target/lib64/python2.6/site-packages/:/home/Jacque/target/lib/python2.6/dist-packages/:/home/Jacque/target/lib64/python2.6/dist-packages/:/home/Jacque/target/lib/python2.7/site-packages/:/home/Jacque/target/lib64/python2.7/site-packages/:/home/Jacque/target/lib/python2.7/dist-packages/:/home/Jacque/target/lib64/python2.7/dist-packages/:/home/Jacque/target/python/:/home/Jacque/target/lib/python2.6/site-packages/:/home/Jacque/target/lib64/python2.6/site-packages/:/home/Jacque/target/lib/python2.6/dist-packages/:/home/Jacque/target/lib64/python2.6/dist-packages/:/home/Jacque/target/lib/python2.7/site-packages/:/home/Jacque/target/lib64/python2.7/site-packages/:/home/Jacque/target/lib/python2.7/dist-packages/:/home/Jacque/target/lib64/python2.7/dist-packages/
  15. ---------- loading recipes -------------------
  16. Loading recipes ...
  17. Loading recipes ... done
  18. ---------- loading recipes finished ----------
  19. checking for gr-osmosdr
  20. False
  21. TMPFILE = /home/Jacque/target/filerZ997o
  22. WRITE PERMS OK /home/Jacque/target/filerZ997o
  23. installing gr-osmosdr
  24. gr-osmosdr dep [['uhd', 'rtl-sdr', 'osmo-sdr', 'hackrf', 'gnuradio', 'gr-iqbal', 'bladeRF', 'git', 'cmake']]
  25. uhd dep [['make', 'swig', 'python', 'libusb', 'git', 'cmake', 'cheetah', 'boost', 'gsl', 'numpy', 'cppunit', 'fftw', 'git', 'cmake']]
  26. rtl-sdr dep [['libusb', 'git', 'cmake']]
  27. osmo-sdr dep [['git', 'cmake', 'libusb', 'git', 'cmake']]
  28. hackrf dep [['git', 'cmake', 'libusb', 'git', 'cmake']]
  29. gnuradio dep [['make', 'boost', 'fftw', 'cppunit', 'swig', 'gsl', 'uhd', 'alsa', 'git', 'python', 'cheetah', 'wxpython', 'numpy', 'lxml', 'pygtk', 'pycairo', 'cmake', 'pyqt4', 'pyqwt5', 'gcc', 'ice', 'git', 'cmake']]
  30. make dep [[]]
  31. boost dep [['python', 'libbzip', 'wget']]
  32. fftw dep [['wget']]
  33. cppunit dep [['wget']]
  34. swig dep [['python', 'wget', 'gcc']]
  35. gsl dep [['wget']]
  36. uhd dep [['make', 'swig', 'python', 'libusb', 'git', 'cmake', 'cheetah', 'boost', 'gsl', 'numpy', 'cppunit', 'fftw', 'git', 'cmake']]
  37. alsa dep [['wget']]
  38. git dep [['wget', 'curl']]
  39. python dep [['wget']]
  40. cheetah dep [['python', 'wget', 'python']]
  41. wxpython dep [['gtk2', 'python', 'swig', 'wget']]
  42. numpy dep [['python', 'swig', 'wget', 'python']]
  43. lxml dep [['python', 'libxml', 'libxslt', 'setuptools', 'wget', 'python']]
  44. pygtk dep [['python', 'swig', 'gtk2', 'pygobject', 'pango', 'cairo', 'wget']]
  45. pycairo dep [['cairo', 'python', 'wget']]
  46. cmake dep [['wget']]
  47. pyqt4 dep [['python', 'sip', 'qt4', 'wget']]
  48. pyqwt5 dep [['qwt5', 'pyqt4', 'sip', 'wget']]
  49. gcc dep [[]]
  50. ice dep [['swig', 'mcpp', 'db48', 'libbzip', 'expat', 'python', 'wget', 'ssl']]
  51. git dep [['wget', 'curl']]
  52. cmake dep [['wget']]
  53. gr-iqbal dep [['gnuradio', 'libosmo-dsp', 'git', 'cmake']]
  54. gnuradio dep [['make', 'boost', 'fftw', 'cppunit', 'swig', 'gsl', 'uhd', 'alsa', 'git', 'python', 'cheetah', 'wxpython', 'numpy', 'lxml', 'pygtk', 'pycairo', 'cmake', 'pyqt4', 'pyqwt5', 'gcc', 'ice', 'git', 'cmake']]
  55. make dep [[]]
  56. boost dep [['python', 'libbzip', 'wget']]
  57. fftw dep [['wget']]
  58. cppunit dep [['wget']]
  59. swig dep [['python', 'wget', 'gcc']]
  60. gsl dep [['wget']]
  61. uhd dep [['make', 'swig', 'python', 'libusb', 'git', 'cmake', 'cheetah', 'boost', 'gsl', 'numpy', 'cppunit', 'fftw', 'git', 'cmake']]
  62. alsa dep [['wget']]
  63. git dep [['wget', 'curl']]
  64. python dep [['wget']]
  65. cheetah dep [['python', 'wget', 'python']]
  66. wxpython dep [['gtk2', 'python', 'swig', 'wget']]
  67. numpy dep [['python', 'swig', 'wget', 'python']]
  68. lxml dep [['python', 'libxml', 'libxslt', 'setuptools', 'wget', 'python']]
  69. pygtk dep [['python', 'swig', 'gtk2', 'pygobject', 'pango', 'cairo', 'wget']]
  70. pycairo dep [['cairo', 'python', 'wget']]
  71. cmake dep [['wget']]
  72. pyqt4 dep [['python', 'sip', 'qt4', 'wget']]
  73. pyqwt5 dep [['qwt5', 'pyqt4', 'sip', 'wget']]
  74. gcc dep [[]]
  75. ice dep [['swig', 'mcpp', 'db48', 'libbzip', 'expat', 'python', 'wget', 'ssl']]
  76. git dep [['wget', 'curl']]
  77. cmake dep [['wget']]
  78. libosmo-dsp dep [['fftw', 'autoconf', 'libtool', 'automake', 'git']]
  79. fftw dep [['wget']]
  80. autoco-- Build type set to RelWithDebInfo.
  81. -- Extracting version information from git describe...
  82. -- Compiler Version: gcc (Debian 4.7.2-5) 4.7.2
  83. Copyright (C) 2012 Free Software Foundation, Inc.
  84. This is free software; see the source for copying conditions. There is NO
  86. -- Compiler Flags: /usr/bin/gcc:::-O2 -g -fvisibility=hidden -Wsign-compare -Wall -Wno-uninitialized
  87. /usr/bin/g++:::-O2 -g -fpermissive -fvisibility=hidden -Wsign-compare -Wall -Wno-uninitialized
  89. -- Building Static Libraries: OFF
  90. -- Boost version: 1.53.0
  91. -- Found the following Boost libraries:
  92. -- date_time
  93. -- program_options
  94. -- filesystem
  95. -- system
  96. -- thread
  97. -- Minimum SWIG version required is 1.3.31
  98. --
  99. -- The build system will automatically enable all components.
  100. -- Use -DENABLE_DEFAULT=OFF to disable components by default.
  101. --
  102. -- Configuring python-support support...
  103. -- Dependency PYTHONLIBS_FOUND = TRUE
  104. -- Dependency SWIG_FOUND = TRUE
  105. -- Dependency SWIG_VERSION_CHECK = TRUE
  106. -- Enabling python-support support.
  107. -- Override with -DENABLE_PYTHON=ON/OFF
  108. --
  109. -- Configuring testing-support support...
  110. -- Dependency CPPUNIT_FOUND = TRUE
  111. -- Enabling testing-support support.
  112. -- Override with -DENABLE_TESTING=ON/OFF
  113. --
  114. -- Configuring volk support...
  115. -- Enabling volk support.
  116. -- Override with -DENABLE_VOLK=ON/OFF
  117. --
  118. -- Python checking for python >= 2.5
  119. -- Python checking for python >= 2.5 - found
  120. --
  121. -- Python checking for Cheetah >= 2.0.0
  122. -- Python checking for Cheetah >= 2.0.0 - found
  123. -- Boost version: 1.53.0
  124. -- Found the following Boost libraries:
  125. -- filesystem
  126. -- system
  127. -- unit_test_framework
  128. -- program_options
  129. -- checking for module 'orc-0.4 > 0.4.11'
  130. -- package 'orc-0.4 > 0.4.11' not found
  131. -- orc files (missing: ORC_LIBRARY ORC_INCLUDE_DIR ORCC_EXECUTABLE)
  132. -- Compiler name: GNU
  133. -- x86* CPU detected
  134. -- CPU missing xgetbv, Overruled arch avx
  135. -- CPU missing cvtpi32_ps, Overruled arch avx
  136. -- ORC support not found, Overruled arch orc
  137. -- CPU width is 64 bits, Overruled arch 32
  138. -- Available architectures: generic;64;3dnow;abm;popcount;mmx;sse;sse2;norc;sse3;ssse3;sse4_a;sse4_1;sse4_2
  139. -- Available machines: generic;sse2_64_mmx;sse3_64;ssse3_64;sse4_a_64;sse4_1_64;sse4_2_64
  141. -- Base cflags = -O2 -g -fvisibility=hidden -Wsign-compare -Wall -Wno-uninitialized
  142. -- BUILD INFO ::: generic ::: GNU ::: -O2 -g -fvisibility=hidden -Wsign-compare -Wall -Wno-uninitialized
  143. -- BUILD INFO ::: sse2_64_mmx ::: GNU ::: -O2 -g -fvisibility=hidden -Wsign-compare -Wall -Wno-uninitialized -m64 -mmmx -msse -msse2
  144. -- BUILD INFO ::: sse3_64 ::: GNU ::: -O2 -g -fvisibility=hidden -Wsign-compare -Wall -Wno-uninitialized -m64 -mmmx -msse -msse2 -msse3
  145. -- BUILD INFO ::: ssse3_64 ::: GNU ::: -O2 -g -fvisibility=hidden -Wsign-compare -Wall -Wno-uninitialized -m64 -mmmx -msse -msse2 -msse3 -mssse3
  146. -- BUILD INFO ::: sse4_a_64 ::: GNU ::: -O2 -g -fvisibility=hidden -Wsign-compare -Wall -Wno-uninitialized -m64 -mmmx -msse -msse2 -msse3 -msse4a -mpopcnt
  147. -- BUILD INFO ::: sse4_1_64 ::: GNU ::: -O2 -g -fvisibility=hidden -Wsign-compare -Wall -Wno-uninitialized -m64 -mmmx -msse -msse2 -msse3 -mssse3 -msse4.1
  148. -- BUILD INFO ::: sse4_2_64 ::: GNU ::: -O2 -g -fvisibility=hidden -Wsign-compare -Wall -Wno-uninitialized -m64 -mmmx -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -mpopcnt
  149. -- Compiler Version: gcc (Debian 4.7.2-5) 4.7.2
  150. Copyright (C) 2012 Free Software Foundation, Inc.
  151. This is free software; see the source for copying conditions. There is NO
  153. -- Not enabling ASM support. CMake >= 2.8.10 required.
  154. -- Did not find liborc and orcc, disabling orc support...
  155. -- Loading build date Fri, 05 Sep 2014 17:08:00 into constants...
  156. -- Loading version 0.1 into constants...
  157. -- Using install prefix: /home/Jacque/target
  158. -- ENABLE_GR_LOG set to ON.
  159. -- HAVE_LOG4CPP set to False.
  160. -- LOG4CPP_LIBRARIES set to .
  161. -- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
  162. -- Could NOT find Sphinx (missing: SPHINX_EXECUTABLE)
  163. --
  164. -- Configuring doxygen support...
  165. -- Dependency DOXYGEN_FOUND = NO
  166. CMake Error at cmake/Modules/GrComponent.cmake:75 (message):
  167. user force-enabled doxygen but configuration checked failed
  168. Call Stack (most recent call first):
  169. docs/CMakeLists.txt:30 (GR_REGISTER_COMPONENT)
  170. -- Configuring incomplete, errors occurred!
  171. ERROR:root:001b[31mPyBOMBS Configure step failed for package (gnuradio) please see bash output above for a reason (hint: look for the word Error)001b[0m
  172. nf dep [[]]
  173. libtool dep [[]]
  174. automake dep [[]]
  175. git dep [['wget', 'curl']]
  176. git dep [['wget', 'curl']]
  177. cmake dep [['wget']]
  178. bladeRF dep [['git', 'cmake', 'libusb', 'git', 'cmake']]
  179. git dep [['wget', 'curl']]
  180. cmake dep [['wget']]
  181. libusb dep [['wget']]
  182. git dep [['wget', 'curl']]
  183. cmake dep [['wget']]
  184. git dep [['wget', 'curl']]
  185. cmake dep [['wget']]
  186. packages to install: ['gnuradio', 'autoconf', 'libtool', 'automake', 'libosmo-dsp', 'gr-iqbal', 'bladeRF', 'gr-osmosdr']
  187. install called (gnuradio)
  188. install type priority: ['src']
  189. install src called (gnuradio)
  190. state = fetch
  191. Current step: (gnuradio :: configure)
  192. configure
  193. (' n CC=gcc CXX=g++ cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/home/Jacque/target -DENABLE_GR_FCD=ON -DENABLE_DOXYGEN=ON -DENABLE_GR_LOG=ON -DENABLE_PERFORMANCE_COUNTERS=ON -DCMAKE_CXX_FLAGS=-fpermissive n', ' n CC=$cc CXX=$cxx cmake .. -DCMAKE_BUILD_TYPE=$cmakebuildtype -DCMAKE_INSTALL_PREFIX=$prefix $config_optn')
  195. bash exec (/home/Jacque/pybombs/src/gnuradio/build)::
Fpermissive Cmake
RAW Paste Data