Mentions légales du service

Skip to content
Snippets Groups Projects
Commit d7b95243 authored by VIGNET Pierre's avatar VIGNET Pierre
Browse files

Integration of C API in the repository

parent 8093786b
No related branches found
No related tags found
No related merge requests found
# file GENERATED by distutils, do NOT edit
setup.py
src/cadbiom.c
all: clean compile sdist
clean:
@echo Clean Python build dir...
python2.7 setup.py clean --all
@echo Clean Python distribution dir...
@-rm -rf dist
compile:
@echo Building the library...
python2.7 setup.py build
sdist:
@echo Building the distribution package...
python2.7 setup.py sdist
install:
@echo Install the package...
python2.7 setup.py install --record files.txt
uninstall: files.txt
@echo Uninstalling the package...
cat files.txt | xargs rm -rf
rm files.txt
test_register:
python2.7 setup.py register -r https://testpypi.python.org/pypi
test_install:
python2.7 setup.py sdist upload -r https://testpypi.python.org/pypi
pip2.7 install -U -i https://testpypi.python.org/pypi pycryptosat
# -*- coding: utf-8 -*-
#
# CryptoMiniSat
#
# Copyright (c) 2009-2014, Mate Soos. All rights reserved.
#
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
#copies of the Software, and to permit persons to whom the Software is
#furnished to do so, subject to the following conditions:
#
#The above copyright notice and this permission notice shall be included in
#all copies or substantial portions of the Software.
#
#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
#THE SOFTWARE.
from distutils.core import setup, Extension
from distutils import sysconfig
__PACKAGE_VERSION__ = "0.1.0"
__LIBRARY_VERSION__ = "0.1.0"
# Delete unwanted flags for C compilation
# Distutils has the lovely feature of providing all the same flags that
# Python was compiled with. The result is that adding extra flags is easy,
# but removing them is a total pain. Doing so involves subclassing the
# compiler class, catching the arguments and manually removing the offending
# flag from the argument list used by the compile function.
# That's the theory anyway, the docs are too poor to actually guide you
# through what you have to do to make that happen.
d = sysconfig.get_config_vars()
for k, v in d.items():
for unwanted in ('-Wstrict-prototypes', '-DNDEBUG', ' -g ',
'-O2', '-D_FORTIFY_SOURCE=2', '-fstack-protector-strong'):
if str(v).find(unwanted) != -1:
v = d[k] = str(v).replace(unwanted, ' ')
modules = [
Extension(
"_cadbiom",
["src/cadbiom.c"],
language = "c",
include_dirs=['src', '.'],
define_macros=[
('CADBIOM_VERSION', '"' + __LIBRARY_VERSION__ + '"'),
],
extra_compile_args=[
"-flto",
"-march=native",
"-mtune=native",
"-Ofast",
#"-O3",
#"-Wall",
#"-g", # Not define NDEBUG macro => Debug build
"-DNDEBUG", # Force release build
#"-DBOOST_TEST_DYN_LINK",
#"-DUSE_ZLIB",
"-std=c11",
"-Wno-unused-variable",
"-Wno-unused-but-set-variable",
# assume that signed arithmetic overflow of addition, subtraction
# and multiplication wraps around using twos-complement
# representation
"-fwrapv",
#BOF protect (use both)
#"-D_FORTIFY_SOURCE=2",
#"-fstack-protector-strong",
"-pthread",
"-DUSE_PTHREADS",
"-fopenmp",
"-D_GLIBCXX_PARALLEL",
],
extra_link_args=[
"-Ofast",
"-march=native",
"-flto",
#"-lz",
"-std=c11",
"-fopenmp",
]
),
]
setup(
name = "_cadbiom",
version = __LIBRARY_VERSION__,
author = "Pierre Vignet",
author_email = "pierre.vignet@irisa.fr",
#url = "https://github.com/msoos/cryptominisat",
#license = "LGPLv2",
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: C++",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.5",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Topic :: Utilities",
],
ext_modules = modules,
py_modules = ['_cadbiom'],
description = "bindings to Cadbiom",
#long_description = open('python/README.rst').read(),
)
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment