Changeset 7e6968


Ignore:
Timestamp:
08/02/09 20:01:49 (4 years ago)
Author:
Tiago de Paula Peixoto <tiago@…>
Branches:
master, python3
Children:
014d05
Parents:
36b305
git-author:
Tiago de Paula Peixoto <tiago@…> (08/02/09 13:56:19)
git-committer:
Tiago de Paula Peixoto <tiago@…> (08/02/09 20:01:49)
Message:
Implement show_config()

This prints useful library information.
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • configure.ac

    rd836b5 r7e6968  
    174174AC_ARG_WITH([numpy], [AC_HELP_STRING([--with-numpy=DIR], 
    175175                     [directory where numpy is installed 
    176                       [default=${PYLIBDIR}/numpy] ])], 
     176                      [default=${PYTHON_SITE_PKG}/numpy] ])], 
    177177        NUMPY_DIR=$withval) 
    178 NUMPY_DIR="${NUMPY_DIR}/core/include/numpy" 
     178[NUMPY_DIR="${NUMPY_DIR}/core/include/numpy"] 
    179179AC_CHECK_HEADER([${NUMPY_DIR}/arrayobject.h], 
    180180                [CPPFLAGS="${CPPFLAGS} -I${NUMPY_DIR}"], 
     
    187187AC_ARG_WITH([scipy], [AC_HELP_STRING([--with-scipy=DIR], 
    188188                     [scipy install directory 
    189                       [default=${PYLIBDIR}/scipy] ])], 
     189                      [default=${PYTHON_SITE_PKG}/scipy] ])], 
    190190            [SCIPY_DIR=$withval]) 
    191191AC_CHECK_HEADER([${SCIPY_DIR}/weave/scxx/object.h], 
     
    233233dnl Subst PYTHON_DIR. 
    234234AC_DEFINE_UNQUOTED([INSTALL_PREFIX],"${prefix}", [python prefix]) 
    235 AC_DEFINE_UNQUOTED([PYTHON_DIR], "${PYLIBDIR}", [The directory name for the site-packages subdirectory of the standard Python install tree.]) 
     235AC_DEFINE_UNQUOTED([PYTHON_DIR], "${PYTHON_SITE_PKG}", [The directory name for the site-packages subdirectory of the standard Python install tree.]) 
    236236 
    237237AC_DEFINE_UNQUOTED([CXXFLAGS],"${CXXFLAGS}", [c++ compilation options]) 
    238238AC_DEFINE_UNQUOTED([CPPFLAGS],"${CPPFLAGS}", [c++ preprocessor compilation options]) 
     239AC_DEFINE_UNQUOTED([LDFLAGS],"${LDFLAGS}", [linker options]) 
    239240 
    240241AC_DEFINE_UNQUOTED([PACKAGE_DATA_DIR], "${packageprefix}/${packagedatadir}", [package data dir]) 
  • src/graph/graph_bind.cc

    r684efc r7e6968  
    4646                                        ", " GIT_COMMIT_DATE ")";} 
    4747    string GetLicense()   const {return "GPL version 3 or above";} 
    48     string GetCXXFLAGS()  const {return CXXFLAGS " " CPPFLAGS;} 
     48    string GetCXXFLAGS()  const {return CPPFLAGS " " CXXFLAGS " " LDFLAGS;} 
    4949    string GetInstallPrefix() const {return INSTALL_PREFIX;} 
    5050    string GetPythonDir() const {return PYTHON_DIR;} 
     51    string GetGCCVersion() const 
     52    { 
     53        stringstream s; 
     54        s << __GNUC__ << "." << __GNUC_MINOR__ << "." <<  __GNUC_PATCHLEVEL__; 
     55        return s.str(); 
     56    } 
    5157}; 
    5258 
     
    289295} 
    290296 
     297bool openmp_enabled() 
     298{ 
     299    #ifdef USING_OPENMP 
     300    return true; 
     301    #else 
     302    return false; 
     303    #endif 
     304} 
     305 
    291306BOOST_PYTHON_MODULE(libgraph_tool_core) 
    292307{ 
     
    304319 
    305320    def("graph_filtering_enabled", &graph_filtering_enabled); 
     321    def("openmp_enabled", &openmp_enabled); 
    306322 
    307323    mpl::for_each<mpl::push_back<scalar_types,string>::type>(export_vector_types()); 
     
    380396        .add_property("cxxflags", &LibInfo::GetCXXFLAGS) 
    381397        .add_property("install_prefix", &LibInfo::GetInstallPrefix) 
    382         .add_property("python_dir", &LibInfo::GetPythonDir); 
     398        .add_property("python_dir", &LibInfo::GetPythonDir) 
     399        .add_property("gcc_version", &LibInfo::GetGCCVersion); 
    383400 
    384401    def("get_graph_type", &get_graph_type); 
  • src/graph_tool/__init__.py

    r11e049 r7e6968  
    9595from . core import  __version__, Graph, GraphError, Vector_bool, \ 
    9696     Vector_int32_t, Vector_int64_t, Vector_double, Vector_long_double,\ 
    97      Vector_string, value_types, load_graph, PropertyMap, Vertex, Edge 
     97     Vector_string, value_types, load_graph, PropertyMap, Vertex, Edge,\ 
     98     show_config 
    9899 
    99100__all__ = ["Graph", "Vertex", "Edge", "GraphError", "Vector_bool", 
    100101           "Vector_int32_t", "Vector_int64_t", "Vector_double", 
    101102           "Vector_long_double", "Vector_string", "value_types", "load_graph", 
    102            "PropertyMap"] 
     103           "PropertyMap", "show_config"] 
  • src/graph_tool/core.py

    r7da1f0 r7e6968  
    125125    raise ValueError("invalid property value type: " + type_name) 
    126126 
     127def show_config(): 
     128    info = libcore.mod_info() 
     129    print "version:", info.version 
     130    print "gcc version:", info.gcc_version 
     131    print "compilation flags:", info.cxxflags 
     132    print "install prefix:", info.install_prefix 
     133    print "python dir:", info.python_dir 
     134    print "graph filtering:", libcore.graph_filtering_enabled() 
     135    print "openmp:", libcore.openmp_enabled() 
     136    print "uname:", " ".join(os.uname()) 
    127137 
    128138################################################################################ 
Note: See TracChangeset for help on using the changeset viewer.