Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Clear n-th bit: bit_fld &= ~(1 << n)

Toggle (swap 0<->1) n-th bit: bit_fld ^= (1 << n)

Check if the element is in the vector or list

...

Code Block
ms_print massif.out.23864

 

 

 

 

 

...

Building C/C++ library using  distutils.core  setup, Extension

http://stackoverflow.com/questions/16854066/using-distutils-and-build-clib-to-build-c-library

Instead of passing a library name as a string, pass a tuple with the sources to compile:

Code Block
# setup.py
#__________

import sys
from distutils.core import setup
from distutils.command.build_clib import build_clib
from distutils.extension import Extension
from Cython.Distutils import build_ext

libhello = ('hello', {'sources': ['hello.c']})  # <<<<==============

ext_modules=[
    Extension("demo", ["demo.pyx"])
]

setup(
        name = 'demo',
        libraries = [libhello],
        cmdclass = {'build_clib': build_clib, 'build_ext': build_ext},
        ext_modules = ext_modules
)
#__________

Using C++ in Cython