Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
graph-tool
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
40
Issues
40
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tiago Peixoto
graph-tool
Commits
7e6968aa
Commit
7e6968aa
authored
Aug 02, 2009
by
Tiago Peixoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement show_config()
This prints useful library information.
parent
36b30534
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
8 deletions
+37
-8
configure.ac
configure.ac
+5
-4
src/graph/graph_bind.cc
src/graph/graph_bind.cc
+19
-2
src/graph_tool/__init__.py
src/graph_tool/__init__.py
+3
-2
src/graph_tool/core.py
src/graph_tool/core.py
+10
-0
No files found.
configure.ac
View file @
7e6968aa
...
...
@@ -173,9 +173,9 @@ AC_PYTHON_MODULE(numpy, fatal)
NUMPY_DIR="${PYTHON_SITE_PKG}/numpy"
AC_ARG_WITH([numpy], [AC_HELP_STRING([--with-numpy=DIR],
[directory where numpy is installed
[default=${PY
LIBDIR
}/numpy] ])],
[default=${PY
THON_SITE_PKG
}/numpy] ])],
NUMPY_DIR=$withval)
NUMPY_DIR="${NUMPY_DIR}/core/include/numpy"
[NUMPY_DIR="${NUMPY_DIR}/core/include/numpy"]
AC_CHECK_HEADER([${NUMPY_DIR}/arrayobject.h],
[CPPFLAGS="${CPPFLAGS} -I${NUMPY_DIR}"],
[AC_MSG_ERROR([Numpy extension header not found])],
...
...
@@ -186,7 +186,7 @@ AC_PYTHON_MODULE(scipy, fatal)
[SCIPY_DIR="${PYTHON_SITE_PKG}/scipy"]
AC_ARG_WITH([scipy], [AC_HELP_STRING([--with-scipy=DIR],
[scipy install directory
[default=${PY
LIBDIR
}/scipy] ])],
[default=${PY
THON_SITE_PKG
}/scipy] ])],
[SCIPY_DIR=$withval])
AC_CHECK_HEADER([${SCIPY_DIR}/weave/scxx/object.h],
[AC_DEFINE([HAVE_SCIPY], [1], [using scipy's weave])]
...
...
@@ -232,10 +232,11 @@ AC_SUBST(PACKAGE_DOC_DIR)
dnl Subst PYTHON_DIR.
AC_DEFINE_UNQUOTED([INSTALL_PREFIX],"${prefix}", [python prefix])
AC_DEFINE_UNQUOTED([PYTHON_DIR], "${PY
LIBDIR
}", [The directory name for the site-packages subdirectory of the standard Python install tree.])
AC_DEFINE_UNQUOTED([PYTHON_DIR], "${PY
THON_SITE_PKG
}", [The directory name for the site-packages subdirectory of the standard Python install tree.])
AC_DEFINE_UNQUOTED([CXXFLAGS],"${CXXFLAGS}", [c++ compilation options])
AC_DEFINE_UNQUOTED([CPPFLAGS],"${CPPFLAGS}", [c++ preprocessor compilation options])
AC_DEFINE_UNQUOTED([LDFLAGS],"${LDFLAGS}", [linker options])
AC_DEFINE_UNQUOTED([PACKAGE_DATA_DIR], "${packageprefix}/${packagedatadir}", [package data dir])
AC_DEFINE_UNQUOTED([PACKAGE_DOC_DIR], "${packageprefix}/${packagedocdir}", [package doc dir])
...
...
src/graph/graph_bind.cc
View file @
7e6968aa
...
...
@@ -45,9 +45,15 @@ struct LibInfo
string
GetVersion
()
const
{
return
VERSION
" (commit "
GIT_COMMIT
", "
GIT_COMMIT_DATE
")"
;}
string
GetLicense
()
const
{
return
"GPL version 3 or above"
;}
string
GetCXXFLAGS
()
const
{
return
C
XXFLAGS
" "
CPP
FLAGS
;}
string
GetCXXFLAGS
()
const
{
return
C
PPFLAGS
" "
CXXFLAGS
" "
LD
FLAGS
;}
string
GetInstallPrefix
()
const
{
return
INSTALL_PREFIX
;}
string
GetPythonDir
()
const
{
return
PYTHON_DIR
;}
string
GetGCCVersion
()
const
{
stringstream
s
;
s
<<
__GNUC__
<<
"."
<<
__GNUC_MINOR__
<<
"."
<<
__GNUC_PATCHLEVEL__
;
return
s
.
str
();
}
};
template
<
class
ValueType
>
...
...
@@ -288,6 +294,15 @@ string get_graph_type(GraphInterface& g)
return
name
;
}
bool
openmp_enabled
()
{
#ifdef USING_OPENMP
return
true
;
#else
return
false
;
#endif
}
BOOST_PYTHON_MODULE
(
libgraph_tool_core
)
{
// numpy
...
...
@@ -303,6 +318,7 @@ BOOST_PYTHON_MODULE(libgraph_tool_core)
class_
<
boost
::
any
>
(
"any"
);
def
(
"graph_filtering_enabled"
,
&
graph_filtering_enabled
);
def
(
"openmp_enabled"
,
&
openmp_enabled
);
mpl
::
for_each
<
mpl
::
push_back
<
scalar_types
,
string
>::
type
>
(
export_vector_types
());
...
...
@@ -379,7 +395,8 @@ BOOST_PYTHON_MODULE(libgraph_tool_core)
.
add_property
(
"license"
,
&
LibInfo
::
GetLicense
)
.
add_property
(
"cxxflags"
,
&
LibInfo
::
GetCXXFLAGS
)
.
add_property
(
"install_prefix"
,
&
LibInfo
::
GetInstallPrefix
)
.
add_property
(
"python_dir"
,
&
LibInfo
::
GetPythonDir
);
.
add_property
(
"python_dir"
,
&
LibInfo
::
GetPythonDir
)
.
add_property
(
"gcc_version"
,
&
LibInfo
::
GetGCCVersion
);
def
(
"get_graph_type"
,
&
get_graph_type
);
}
...
...
src/graph_tool/__init__.py
View file @
7e6968aa
...
...
@@ -94,9 +94,10 @@ import scipy.stats
from
.
core
import
__version__
,
Graph
,
GraphError
,
Vector_bool
,
\
Vector_int32_t
,
Vector_int64_t
,
Vector_double
,
Vector_long_double
,
\
Vector_string
,
value_types
,
load_graph
,
PropertyMap
,
Vertex
,
Edge
Vector_string
,
value_types
,
load_graph
,
PropertyMap
,
Vertex
,
Edge
,
\
show_config
__all__
=
[
"Graph"
,
"Vertex"
,
"Edge"
,
"GraphError"
,
"Vector_bool"
,
"Vector_int32_t"
,
"Vector_int64_t"
,
"Vector_double"
,
"Vector_long_double"
,
"Vector_string"
,
"value_types"
,
"load_graph"
,
"PropertyMap"
]
"PropertyMap"
,
"show_config"
]
src/graph_tool/core.py
View file @
7e6968aa
...
...
@@ -124,6 +124,16 @@ def _type_alias(type_name):
return
"vector<%s>"
%
alias
[
t
]
raise
ValueError
(
"invalid property value type: "
+
type_name
)
def
show_config
():
info
=
libcore
.
mod_info
()
print
"version:"
,
info
.
version
print
"gcc version:"
,
info
.
gcc_version
print
"compilation flags:"
,
info
.
cxxflags
print
"install prefix:"
,
info
.
install_prefix
print
"python dir:"
,
info
.
python_dir
print
"graph filtering:"
,
libcore
.
graph_filtering_enabled
()
print
"openmp:"
,
libcore
.
openmp_enabled
()
print
"uname:"
,
" "
.
join
(
os
.
uname
())
################################################################################
# Property Maps
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment