Skip to content
Snippets Groups Projects
Commit 637ca5d4 authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

Compilation is now working

parent d2e5ad40
No related branches found
No related tags found
No related merge requests found
[submodule "src/xbob.blitz"]
path = src/xbob.blitz
url = git@github.com:anjos/xbob.blitz
[submodule "src/xbob.io"]
path = src/xbob.io
url = git@github.com:anjos/xbob.io
......@@ -3,8 +3,8 @@
; Mon 16 Apr 08:29:18 2012 CEST
[buildout]
parts = xbob.blitz xbob.math xbob.io xbob.math scripts
eggs = xbob.math
parts = xbob.blitz xbob.io xbob.machine scripts
eggs = xbob.machine
ipdb
extensions = mr.developer
auto-checkout = *
......@@ -21,17 +21,12 @@ recipe = xbob.buildout:develop
setup = src/xbob.blitz
eggs = xbob.buildout xbob.extension
[xbob.math]
recipe = xbob.buildout:develop
setup = src/xbob.math
eggs = xbob.blitz xbob.buildout xbob.extension
[xbob.io]
recipe = xbob.buildout:develop
setup = src/xbob.io
eggs = xbob.blitz xbob.buildout xbob.extension
[xbob.math]
[xbob.machine]
recipe = xbob.buildout:develop
eggs = xbob.blitz
......
......@@ -7,6 +7,11 @@ from setuptools import setup, find_packages, dist
dist.Distribution(dict(setup_requires=['xbob.blitz']))
from xbob.blitz.extension import Extension
import os
package_dir = os.path.dirname(os.path.realpath(__file__))
package_dir = os.path.join(package_dir, 'xbob', 'machine', 'include')
include_dirs = [package_dir]
packages = ['bob-machine >= 1.3']
version = '2.0.0a0'
......@@ -38,7 +43,7 @@ setup(
ext_modules = [
Extension("xbob.machine._externals",
[
"xbob/io/externals.cpp",
"xbob/machine/externals.cpp",
],
packages = packages,
include_dirs = include_dirs,
......@@ -46,10 +51,11 @@ setup(
),
Extension("xbob.machine._library",
[
#"xbob/measure/activation.cpp",
"xbob/measure/main.cpp",
#"xbob/machine/activation.cpp",
"xbob/machine/main.cpp",
],
packages = packages,
include_dirs = include_dirs,
version = version,
),
],
......
Subproject commit 5898fa59c92e0949a94d6f0408322d0dde8f1ab7
Subproject commit 6e72599e697e874dc38b900ae2a6e590f368e863
/**
* @author Andre Anjos <andre.anjos@idiap.ch>
* @date Wed 11 Dec 08:42:53 2013
*
* @brief Some C++ tricks to make our life dealing with Python references a bit
* easier
*/
#include <Python.h>
#include <memory>
/**
* Calls Py_DECREF(x) on the input object x. Usage pattern:
*
* PyObject* x = ... // builds x with a new python reference
* auto protected_x = make_safe(x);
*
* After this point, no need to worry about DECREF'ing x anymore.
* You can still use `x' inside your code, or protected_x.get().
*/
template <typename T> std::shared_ptr<T> make_safe(T* o) {
return std::shared_ptr<T>(o, [&](T* p){Py_DECREF(p);});
}
/**
* Calls Py_XDECREF(x) on the input object x. Usage pattern:
*
* PyObject* x = ... // builds x with a new python reference, x may be NULL
* auto protected_x = make_xsafe(x);
*
* After this point, no need to worry about XDECREF'ing x anymore.
* You can still use `x' inside your code, or protected_x.get(). Note
* `x' may be NULL with this method.
*/
template <typename T> std::shared_ptr<T> make_xsafe(T* o) {
return std::shared_ptr<T>(o, [&](T* p){Py_XDECREF(p);});
}
......@@ -60,7 +60,7 @@ PyMODINIT_FUNC XBOB_EXT_ENTRY_NAME (void) {
PyObject* m = Py_InitModule3(XBOB_EXT_MODULE_NAME, module_methods, module_docstr);
/* register some constants */
PyModule_AddIntConstant(m, "__api_version__", XBOB_IO_API_VERSION);
PyModule_AddIntConstant(m, "__api_version__", XBOB_MACHINE_API_VERSION);
PyModule_AddStringConstant(m, "__version__", XBOB_EXT_MODULE_VERSION);
PyModule_AddObject(m, "versions", build_version_dictionary());
......
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