from distutils.core import setup, Extension import subprocess module=Extension('pywlc', ['wlc_python.c']) module.libraries = ['wlc'] module.extra_compile_args=[subprocess.check_output(["wlc-config", "--cflags"])] module.extra_link_args=[subprocess.check_output(["wlc-config", "--libs"])] setup(name='pywlc', version='0.0', ext_modules=[module])
ext_stub = Extension("_tosdb", sources=["_tosdb.cpp"], include_dirs=["../include"], optional=True) ext_win = Extension(**ext_stub.__dict__) # add/override for Win ext_win.library_dirs = ["../bin/Release/" + _SYS_ARCHD] ext_win.libraries = [ "_tos-databridge-shared-" + _SYS_ARCH, "_tos-databridge-static-" + _SYS_ARCH ] ext_win.define_macros = [("THIS_IMPORTS_IMPLEMENTATION", None), ("THIS_DOESNT_IMPORT_INTERFACE", None)] ext_win.extra_compile_args = ["/EHsc"] ext_win.extra_link_args = ["/LTCG"] try: # capture setup errors but allow setup to complete (optional=True) sio = StringIO() se = sys.stderr sys.stderr = sio setup(ext_modules=[ext_win if _SYS_IS_WIN else ext_stub], **setup_dict) sys.stderr = se if sio.getvalue(): print('\n', "+ Operation 'completed' with errors:\n") print(sio.getvalue()) print("+ Checking on the status of the build...") t = None try: import _tosdb as t
from distutils.core import setup, Extension mod = Extension('dbscan', sources=['CExtensionFiles/extension.c',\ 'CExtensionFiles/kd_tree.c', \ 'CExtensionFiles/dbscan.c', \ 'CExtensionFiles/dynamic_array.c']) mod.extra_compile_args = ['-std=c11'] setup(ext_modules=[mod])
# the cross platfrom stub ext_stub = Extension( "_tosdb", sources=[ "_tosdb.cpp" ], include_dirs=[ "../include" ], optional=True ) ext_win = Extension( **ext_stub.__dict__ ) # add/override for Win ext_win.library_dirs = [ "../bin/Release/"+ _SYS_ARCHD ] ext_win.libraries = [ "_tos-databridge-shared-"+ _SYS_ARCH, "_tos-databridge-static-"+ _SYS_ARCH ] ext_win.define_macros = [ ("THIS_IMPORTS_IMPLEMENTATION",None), ("THIS_DOESNT_IMPORT_INTERFACE",None) ] ext_win.extra_compile_args = ["/EHsc"] ext_win.extra_link_args = ["/LTCG"] try: # capture setup errors but allow setup to complete (optional=True) sio = StringIO() se = sys.stderr sys.stderr = sio setup( ext_modules=[ ext_win if _SYS_IS_WIN else ext_stub], **setup_dict ) sys.stderr = se if sio.getvalue(): print( '\n', "+ Operation 'completed' with errors:\n") print( sio.getvalue() ) print( "+ Checking on the status of the build...") t = None try: import _tosdb as t
np_library_dir = os.path.join(np_include_dir, '../lib') osd_include_dirs = ['../opensubdiv', '../regression'] osddir = '../build/lib' osd_shim = Extension( 'osd._shim', include_dirs = osd_include_dirs, library_dirs = [osddir, np_library_dir], libraries = ['osdCPU', 'npymath'], swig_opts = ['-c++'], sources = [ 'osd/osdshim.i', 'osd/subdivider.cpp', 'osd/topology.cpp']) osd_shim.extra_compile_args = \ ["-Wno-unused-function"] os.environ['ARCHFLAGS'] = '-arch ' + os.uname()[4] def setBuildFolder(folder): osddir = folder osd_shim.runtime_library_dirs = [folder] osd_shim.library_dirs = [folder, np_library_dir] def setCompilerFlags(flags): osd_shim.extra_compile_args = flags.split() + osd_shim.extra_compile_args def importBuildFolder(): import os.path builddir = os.path.join(osddir, "../python") if not os.path.exists(builddir):
import os os.environ["CC"] = "c++" from distutils.core import setup, Extension module = Extension('my_wrapper_c', ["MyWrapper.cpp","Generation.cpp","Tree.cpp","Leaf.cpp","Node.cpp", "Operation.cpp", "Operator.cpp"],include_dirs=["src"],libraries=[]) module.extra_compile_args = []#,'-pg'] setup(name='my_wrapper_c', version='1.0', author='Baptiste Sorin', author_email='*****@*****.**', ext_modules=[module])
dest.write(data) print "Done." arch = "-DINT32" config = {} sources_dir = "PyDCG/Cpp_sources/" if sys.maxsize > (2**31-1): arch = "-DINT64" config["MAX_INT"]=2**62 else: config["MAX_INT"]=2**30 geometricbasicsCpp = Extension('PyDCG.geometricbasicsCpp', sources = [sources_dir+"geometricbasicsCpp_wrapper.cpp", sources_dir+"geometricbasicsCpp.cpp"]) geometricbasicsCpp.extra_compile_args = ['--std=c++0x', arch] holesCpp = Extension('PyDCG.holesCpp', sources = [sources_dir+"holesCPP_wrapper.cpp", sources_dir+"holesCPP.cpp", sources_dir+"geometricbasicsCpp.cpp"]) holesCpp.extra_compile_args = ['--std=c++0x', arch]; crossingCpp = Extension('PyDCG.crossingCpp', sources = [sources_dir+"count_crossing_wrapper.cpp", sources_dir+"count_crossing.cpp", sources_dir+"geometricbasicsCpp.cpp"]) crossingCpp.extra_compile_args = ['--std=c++0x', arch]; modules = [] if options['PURE_PYTHON'] == 0: modules = [crossingCpp, holesCpp, geometricbasicsCpp] config['PURE_PYTHON'] = False else:
#!/usr/bin/python import os from distutils.core import setup, Extension scriptDir = os.path.dirname(os.path.realpath(__file__)) buildDir = os.path.join(scriptDir, '../../build') includeDirs = [buildDir, os.path.join(scriptDir, '../../src')] libraryDirs = [buildDir] module = Extension('bamboo32', include_dirs = includeDirs, sources = ['pythonBindings32.cpp'], libraries = ['bamboo32'], library_dirs = libraryDirs) module.extra_compile_args = ['--std=c++11'] setup(name='bamboo32', version='0.0', description='Bamboo32 is a library for defining object-oriented message protocols.', author='kestred', author_email='*****@*****.**', url = 'https://github.com/Astron/Bamboo', ext_modules=[module])
# You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import os import glob from distutils.core import setup, Extension module = Extension('graphgen', sources=['graphgen.cpp']) module.extra_compile_args = ['--std=c++11', '-Wall', '-pedantic', '-g'] headers_path = os.path.join("include", "graphgen") headers = [(headers_path, ["graphgen.hpp"])] headers += [(os.path.join(headers_path, "cpp-btree"), glob.glob("cpp-btree/*h"))] setup( name='graph-gen', version='0.1', description='graph-gen: graph generation library for Python', author='Giorgio Audrito, William Di Luigi, Gabriele Farina, Luca Versari', author_email= '[email protected], [email protected], [email protected], [email protected]',
def targetdir(): return os.getcwd() # cleaner and faster would be to link agains kyaml, but this leads to complexities due to kyaml being static # and the module being dynamic (-fPic flag). Dumb-but-works solution is to just recompile everything exactly # the way python wants it sources = globcc(os.path.join(sourcedir(), 'python', 'src')) + globcc( os.path.join(sourcedir(), 'src')) includes = [ os.path.join(sourcedir(), 'src', 'include'), os.path.join(sourcedir(), 'src') ] libraries = [] library_dirs = [] pykyaml = Extension('pykyaml', sources=sources, include_dirs=includes, libraries=libraries, library_dirs=library_dirs) # todo: a more portable way would be nice pykyaml.extra_compile_args = ['-std=c++11'] setup(name='pykyaml', version='0.1', description='Klaas\' implementation for yaml', ext_modules=[pykyaml])
# (there's also a gcc -x switch, but it needs to go before the filename; # I don't think setuptools allows that) if USE_CPP: sources = ['test_py3c.cpp'] else: sources = ['test_py3c.c'] extra_compile_args = [] extra_compile_args.extend(['-Werror', '-Wall']) if sys.version_info < (2, 7): # XXX: The PyCapsule (2.6) shim tests aren't yet warning-free in GCC extra_compile_args.extend(['-Wno-format']) test_py3c_module = Extension( 'test_py3c', sources=sources, include_dirs=['../include'], extra_compile_args=extra_compile_args, ) test_py3c_module.extra_compile_args=extra_compile_args setup_args = dict( name='test_py3c', version='0.0', description = '', ext_modules = [test_py3c_module] ) if __name__ == '__main__': setup(**setup_args)
from distutils.core import setup, Extension import subprocess import os os.environ["CC"] = "gcc" os.environ["CXX"] = "g++" detectionC_mod = Extension('detectionC', sources=['detectionC.cpp'], include_dirs=['/usr/local/include'], library_dirs=['/usr/local/lib']) detectionC_mod.extra_compile_args = [ '-ggdb', subprocess.check_output(['pkg-config', '--cflags', 'opencv']), subprocess.check_output(['pkg-config', '--libs', 'opencv']), ] setup( name="detectionC", version="1.0", description="OpenCV Video Face Detection Module", ext_modules=[detectionC_mod], )
# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import os import glob from distutils.core import setup, Extension module = Extension('graphgen', sources = ['graphgen.cpp']) module.extra_compile_args = ['--std=c++11', '-Wall', '-pedantic', '-g']; headers_path = os.path.join("include", "graphgen") headers = [(headers_path, ["graphgen.hpp"])] headers += [(os.path.join(headers_path, "cpp-btree"), glob.glob("cpp-btree/*h"))] setup( name = 'graph-gen', version = '0.1', description = 'graph-gen: graph generation library for Python', author = 'Giorgio Audrito, William Di Luigi, Gabriele Farina, Luca Versari', author_email = '[email protected], [email protected], [email protected], [email protected]', url = 'https://github.com/olimpiadi-informatica/graph-gen', ext_modules = [module],
OS_NAME = os.uname()[0] OS_VERS = os.uname()[2] # First our RCTL extension if OS_NAME == 'FreeBSD' and OS_VERS.find('9.') != -1: ext_rctl = Extension('pyrctl', define_macros=[('NEED_SOLARIS_BOOLEAN', 1)], include_dirs=['/usr/include', '/usr/local/include'], library_dirs=['/lib', '/usr/lib', '/usr/local/lib'], libraries=[ 'bsdxml', 'geom', 'c', 'm', 'nvpair', 'sbuf', 'umem', 'util', 'uutil', 'zfs' ], sources=['src/pyrctl.c']) ext_rctl.extra_compile_args = [ '-std=gnu89', '-fstack-protector', '-Wno-pointer-sign', '-Wno-unknown-pragmas' ] else: print 'Your platform is unsupported. This module is available for FreeBSD 9.X and higher only.' sys.exit(-1) if os.getenv('USER') != 'root': print 'You must be root to test and use this module.' sys.exit(-1) setup( name='pyrctl', version='0.8', description= 'Python binding to the RCTL/RACCT set of syscalls on FreeBSD 9.X and above.', author='Mike "Fuzzy" Partin',
from distutils.core import setup, Extension from Cython.Build import cythonize import numpy sources = ["multivec.pyx", "../multivec/monolingual.cpp", "../multivec/bilingual.cpp", "../multivec/distance.cpp"] module = Extension("multivec", sources, undef_macros=['NDEBUG'], language="c++") module.extra_compile_args = ['--std=c++11', '-w', '-I../multivec', '-O3'] module.libraries = ['m'] setup(name="multivec", version="1.0", ext_modules=cythonize([module]), include_dirs=[numpy.get_include()])
import os, os.path np_include_dir = numpy.get_include() np_library_dir = os.path.join(np_include_dir, '../lib') osd_include_dirs = ['../opensubdiv', '../regression'] osddir = '../build/lib' osd_shim = Extension( 'osd._shim', include_dirs=osd_include_dirs, library_dirs=[osddir, np_library_dir], libraries=['osdCPU', 'npymath'], swig_opts=['-c++'], sources=['osd/osdshim.i', 'osd/subdivider.cpp', 'osd/topology.cpp']) osd_shim.extra_compile_args = \ ["-Wno-unused-function"] os.environ['ARCHFLAGS'] = '-arch ' + os.uname()[4] def setBuildFolder(folder): osddir = folder osd_shim.runtime_library_dirs = [folder] osd_shim.library_dirs = [folder, np_library_dir] def setCompilerFlags(flags): osd_shim.extra_compile_args = flags.split() + osd_shim.extra_compile_args def importBuildFolder():
from distutils.core import setup, Extension motor_driver_module = Extension('_motor_driver', sources=[ '../../c-apps/spi-mover/spi_mover.cpp', '../../c-apps/motor-driver/dspin_driver.cpp', '../../c-apps/motor-driver/hoss_system.cpp', 'motor_driver_wrap.cxx']) motor_driver_module.extra_compile_args = \ ['-I../../c-apps/spi-mover'] setup(name='motor_driver', version='1.0', author='Shawn Hymel, Byron Jacquot', description="""Driver for SPI-based stepper motors""", ext_modules=[motor_driver_module], py_modules=['motor_driver'])
download_library() # check again (the user might have downloaded the library) if os.path.isdir(SQLPARSER_DIR): parsebridge = Extension('sqlparser', sources = ['Parser.c', 'Statement.c', 'Node.c', 'ENodeType.c', 'parsebridgemodule.c', SQLPARSER_DIR + 'ext/node_visitor/node_visitor.c', SQLPARSER_DIR + 'ext/expr_traverse/expr_traverse.c', SQLPARSER_DIR + 'ext/modifysql/modifysql.c' ], include_dirs = [ SQLPARSER_DIR + 'core/', SQLPARSER_DIR + 'ext/collection/includes/', SQLPARSER_DIR + 'ext/expr_traverse/', SQLPARSER_DIR + 'ext/modifysql/', SQLPARSER_DIR + 'ext/node_visitor/' ], library_dirs = [ SQLPARSER_DIR + '/lib/' ], libraries = [ 'gspcollection' + ARCH, 'gspcore' + ARCH ], define_macros = [ ('_CRT_SECURE_NO_WARNINGS', None), ('DONT_FIX_FRAGMENTS', None), ] ) if sys.platform == 'win32' or sys.platform == 'win64': parsebridge.extra_link_args = [ '/MANIFEST', '/DEBUG' ] parsebridge.extra_compile_args = [ '/Zi' ] setup (name = 'sqlparser', version = '1.0', description = 'A package for parsing SQL queries', author = 'Timo Djürken', url = 'https://github.com/TwoLaid/python-sqlparser', license = 'GPL', ext_modules = [ parsebridge ])
# define our OS OS_NAME = os.uname()[0] OS_VERS = os.uname()[2] # First our RCTL extension if OS_NAME == "FreeBSD" and OS_VERS.find("9.") != -1: ext_rctl = Extension( "pyrctl", define_macros=[("NEED_SOLARIS_BOOLEAN", 1)], include_dirs=["/usr/include", "/usr/local/include"], library_dirs=["/lib", "/usr/lib", "/usr/local/lib"], libraries=["bsdxml", "geom", "c", "m", "nvpair", "sbuf", "umem", "util", "uutil", "zfs"], sources=["src/pyrctl.c"], ) ext_rctl.extra_compile_args = ["-std=gnu89", "-fstack-protector", "-Wno-pointer-sign", "-Wno-unknown-pragmas"] else: print "Your platform is unsupported. This module is available for FreeBSD 9.X and higher only." sys.exit(-1) if os.getenv("USER") != "root": print "You must be root to test and use this module." sys.exit(-1) setup( name="pyrctl", version="0.8", description="Python binding to the RCTL/RACCT set of syscalls on FreeBSD 9.X and above.", author='Mike "Fuzzy" Partin', author_email="*****@*****.**", url="https://github.com/fuzzy/pyrctl",
#!/usr/bin/env python import os os.environ["CC"] = "c++" #os.environ["CC"] = "nvcc" from distutils.core import setup, Extension module = Extension('modevoevo_c', ["modevoevo_c.cpp", "CPrng.cpp", "CIndividual.cpp", "CPopulation.cpp", "CSimulation.cpp", "CFitnessEvaluator.cpp", "CFitnessModeTest1.cpp", "CFitnessCluster.cpp","CFitnessClusterKmeans.cpp","CFitnessRandom.cpp"],libraries=['gsl','blas']) module.extra_compile_args = [ '-std=gnu++0x'] setup(name='modevoevo_c', version='1.0', ext_modules=[module]) #c++ main.cpp CIndividual.cpp CPrng.cpp CFitnessEvaluator.cpp CFitnessCluster.cpp -lgsl -lgslcblas -lm -std=gnu++0x -lz
#!/usr/bin/python import os from distutils.core import setup, Extension scriptDir = os.path.dirname(os.path.realpath(__file__)) buildDir = os.path.join(scriptDir, '../../build') includeDirs = [buildDir, os.path.join(scriptDir, '../../src')] libraryDirs = [buildDir] module = Extension('bamboo32', include_dirs=includeDirs, sources=['pythonBindings32.cpp'], libraries=['bamboo32'], library_dirs=libraryDirs) module.extra_compile_args = ['--std=c++11'] setup(name='bamboo32', version='0.0', description= 'Bamboo32 is a library for defining object-oriented message protocols.', author='kestred', author_email='*****@*****.**', url='https://github.com/Astron/Bamboo', ext_modules=[module])
from distutils.core import setup, Extension module = Extension('_C_camodule', ['_C_camodule.c'], include_dirs = ["/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/"]) module.extra_compile_args = ['--std=c99'] setup(name='_C_camodule', version='1.0', ext_modules=[module]) #adres do arrayobject.h: /usr/lib/python2.7/dist-packages/numpy/core/include/numpy/arrayobject.h
SQLPARSER_DIR + 'ext/expr_traverse/expr_traverse.c', SQLPARSER_DIR + 'ext/modifysql/modifysql.c' ], include_dirs=[ SQLPARSER_DIR + 'core/', SQLPARSER_DIR + 'ext/collection/includes/', SQLPARSER_DIR + 'ext/expr_traverse/', SQLPARSER_DIR + 'ext/modifysql/', SQLPARSER_DIR + 'ext/node_visitor/' ], library_dirs=[SQLPARSER_DIR + '/lib/'], libraries=['gspcollection', 'gspcore'], define_macros=[ ('_CRT_SECURE_NO_WARNINGS', None), ('DONT_FIX_FRAGMENTS', None), ], extra_compile_args=['-Wno-strict-prototypes'], ) if sys.platform == 'win32' or sys.platform == 'win64': parsebridge.extra_link_args = ['/MANIFEST', '/DEBUG'] parsebridge.extra_compile_args = ['/Zi'] setup(name='sqlparser', version='1.0', description='A package for parsing SQL queries', author='Timo Djürken', url='https://github.com/TwoLaid/python-sqlparser', license='GPL', ext_modules=[parsebridge])
from distutils.core import setup, Extension import numpy module = Extension("multivec", ["wrapper.cpp", "../multivec/monolingual.cpp", "../multivec/bilingual.cpp", "../multivec/distance.cpp"], undef_macros=['NDEBUG']) module.extra_compile_args = ['--std=c++0x', '-w', '-I../multivec', '-O3'] module.libraries = ['m'] setup(name="multivec", version="1.0", ext_modules=[module], include_dirs=[numpy.get_include()])
from distutils.core import setup, Extension module = Extension( '_C_camodule', ['_C_camodule.c'], include_dirs=[ "/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/" ]) module.extra_compile_args = ['--std=c99'] setup(name='_C_camodule', version='1.0', ext_modules=[module]) #adres do arrayobject.h: /usr/lib/python2.7/dist-packages/numpy/core/include/numpy/arrayobject.h