Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.measure
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.measure
Commits
3c4e640d
Commit
3c4e640d
authored
11 years ago
by
André Anjos
Browse files
Options
Downloads
Patches
Plain Diff
Include xbob.blitz C-API, Blitz++ and NumPy versions
parent
91247f34
Branches
Branches containing commit
Tags
v0.3.1
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
xbob/measure/version.cpp
+33
-19
33 additions, 19 deletions
xbob/measure/version.cpp
with
33 additions
and
19 deletions
xbob/measure/version.cpp
+
33
−
19
View file @
3c4e640d
...
...
@@ -22,6 +22,15 @@
#include
<xbob.blitz/capi.h>
#include
<xbob.blitz/cleanup.h>
static
int
dict_set
(
PyObject
*
d
,
const
char
*
key
,
const
char
*
value
)
{
PyObject
*
v
=
Py_BuildValue
(
"s"
,
value
);
if
(
!
v
)
return
0
;
int
retval
=
PyDict_SetItemString
(
d
,
key
,
v
);
Py_DECREF
(
v
);
if
(
retval
==
0
)
return
1
;
//all good
return
0
;
//a problem occurred
}
static
int
dict_steal
(
PyObject
*
d
,
const
char
*
key
,
PyObject
*
value
)
{
if
(
!
value
)
return
0
;
int
retval
=
PyDict_SetItemString
(
d
,
key
,
value
);
...
...
@@ -78,31 +87,36 @@ static PyObject* bob_version() {
return
Py_BuildValue
(
"sis"
,
BOB_VERSION
,
BOB_API_VERSION
,
BOB_PLATFORM
);
}
/**
* Numpy version
*/
static
PyObject
*
numpy_version
()
{
return
Py_BuildValue
(
"{ssss}"
,
"abi"
,
BOOST_PP_STRINGIZE
(
NPY_VERSION
),
"api"
,
BOOST_PP_STRINGIZE
(
NPY_API_VERSION
));
}
/**
* xbob.blitz c/c++ api version
*/
static
PyObject
*
xbob_blitz_version
()
{
return
Py_BuildValue
(
"{ss}"
,
"api"
,
BOOST_PP_STRINGIZE
(
XBOB_BLITZ_API_VERSION
));
}
static
PyObject
*
build_version_dictionary
()
{
PyObject
*
retval
=
PyDict_New
();
if
(
!
retval
)
return
0
;
auto
retval_
=
make_safe
(
retval
);
if
(
!
dict_steal
(
retval
,
"Boost"
,
boost_version
()))
{
Py_DECREF
(
retval
);
return
0
;
}
if
(
!
dict_steal
(
retval
,
"Compiler"
,
compiler_version
()))
{
Py_DECREF
(
retval
);
return
0
;
}
if
(
!
dict_steal
(
retval
,
"Python"
,
python_version
()))
{
Py_DECREF
(
retval
);
return
0
;
}
if
(
!
dict_steal
(
retval
,
"Bob"
,
bob_version
()))
{
Py_DECREF
(
retval
);
return
0
;
}
if
(
!
dict_set
(
retval
,
"Blitz++"
,
BZ_VERSION
))
return
0
;
if
(
!
dict_steal
(
retval
,
"Boost"
,
boost_version
()))
return
0
;
if
(
!
dict_steal
(
retval
,
"Compiler"
,
compiler_version
()))
return
0
;
if
(
!
dict_steal
(
retval
,
"Python"
,
python_version
()))
return
0
;
if
(
!
dict_steal
(
retval
,
"NumPy"
,
numpy_version
()))
return
0
;
if
(
!
dict_steal
(
retval
,
"xbob.blitz"
,
xbob_blitz_version
()))
return
0
;
if
(
!
dict_steal
(
retval
,
"Bob"
,
bob_version
()))
return
0
;
Py_INCREF
(
retval
);
return
retval
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment