Skip to content

Commit 5c35067

Browse files
committed
Merge pull request #142 from robmccoll/dev
Release 15.10
2 parents e21fa13 + 5eb95a5 commit 5c35067

1,416 files changed

Lines changed: 89802 additions & 328652 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,15 @@
1717
# Editor temporaries
1818
*~
1919

20-
# Google Protobufs
20+
# Google Protobufs
2121
/src/lib/protobuf/configure
2222
/src/lib/protobuf/autom4te.cache/
2323

24-
/src/py/stinger/*.pyc
24+
*.pyc
2525

2626
.project
2727
.cproject
28+
.pydevproject
29+
30+
*.pickle
31+
/flask/stinger_paths.py

.travis.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1+
sudo: false
12
language: cpp
23
compiler:
34
- gcc
45
- clang
56
before_install:
67
- wget http://www.cmake.org/files/v3.3/cmake-3.3.0-rc3-Linux-x86_64.sh
7-
- sudo sh cmake-3.3.0-rc3-Linux-x86_64.sh --skip-license --prefix=/usr
8+
- mkdir -p $HOME/cmake
9+
- sh cmake-3.3.0-rc3-Linux-x86_64.sh --skip-license --prefix=$HOME/cmake
810
before_script:
911
- mkdir build
1012
- cd build
11-
- cmake ..
12-
script: make
13+
- $HOME/cmake/bin/cmake ..
14+
script:
15+
- make
16+
- make check

CMakeLists.txt

Lines changed: 126 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,148 @@
1-
CMAKE_MINIMUM_REQUIRED (VERSION 2.8.11)
1+
cmake_minimum_required (VERSION 2.8.11)
2+
project (STINGER)
23

3-
PROJECT (STINGER)
4-
SET(STINGER_VERSION_MAJOR 2013)
5-
SET(STINGER_VERSION_MINOR 06)
4+
include (ExternalProject)
5+
include (CTest)
66

7-
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
8-
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
9-
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
7+
set(STINGER_VERSION_MAJOR 2015)
8+
set(STINGER_VERSION_MINOR 10)
109

11-
SET(STINGER_NAME_USE_SQLITE FALSE CACHE BOOL "Use sqlite for virtual to physmap")
12-
IF(STINGER_NAME_USE_SQLITE)
10+
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
11+
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
12+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
13+
#set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} "--no-as-needed -ldl")
14+
set(STINGER_NAME_USE_SQLITE FALSE CACHE BOOL "Use sqlite for virtual to physmap")
15+
if(STINGER_NAME_USE_SQLITE)
1316
add_definitions(-DNAME_USE_SQLITE)
14-
ENDIF()
17+
endif()
1518

16-
SET(STINGER_USE_TCP FALSE CACHE BOOL "Use TCP instead of Unix Sockets")
17-
IF(STINGER_USE_TCP)
19+
set(STINGER_USE_TCP FALSE CACHE BOOL "Use TCP instead of Unix Sockets")
20+
if(STINGER_USE_TCP)
1821
add_definitions(-DSTINGER_USE_TCP)
19-
ENDIF()
22+
endif()
2023

21-
FIND_PACKAGE( OpenMP )
24+
find_package( OpenMP )
2225
if(OPENMP_FOUND)
2326
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
2427
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
2528
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
2629
endif()
2730

28-
LINK_LIBRARIES(m)
31+
link_libraries(m)
32+
33+
option(BUILD_SHARED_LIBS "Build libraries as SHARED" ON)
2934

3035
IF(APPLE)
3136
# Apple doesn't support librt, using CoreServices instead
32-
LINK_LIBRARIES(/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices)
37+
link_libraries(/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices)
38+
set(CMAKE_MACOSX_RPATH ON)
3339
ELSEIF(WIN32)
3440
# Not sure what to do here as far as librt...?
35-
LINK_LIBRARIES(rt)
41+
link_libraries(rt)
3642
ELSE()
37-
LINK_LIBRARIES(rt)
43+
link_libraries(rt)
44+
link_libraries(dl)
3845
ENDIF()
3946

47+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu9x")
48+
4049
# Doxygen
41-
find_package(Doxygen)
42-
if (DOXYGEN_FOUND)
43-
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doxygen/Doxyfile.in
44-
${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
45-
add_custom_target(doc
46-
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
47-
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
48-
COMMENT "Generating API documentation with Doxygen" VERBATIM
49-
)
50-
endif(DOXYGEN_FOUND)
51-
52-
# Custom protobuf to use STINGER distributed version
53-
function(CUST_PROTOBUF_GENERATE_CPP SUBDIR SRCS HDRS)
54-
if(NOT ARGN)
55-
message(SEND_ERROR "Error: PROTOBUF_GENERATE_CPP() called without any proto files")
56-
return()
57-
endif(NOT ARGN)
58-
59-
set(${SRCS})
60-
set(${HDRS})
61-
foreach(FIL ${ARGN})
62-
get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
63-
get_filename_component(FIL_WE ${FIL} NAME_WE)
64-
65-
list(APPEND ${SRCS} "${CMAKE_CURRENT_BINARY_DIR}/${SUBDIR}/proto/${FIL_WE}.pb.cc")
66-
list(APPEND ${HDRS} "${CMAKE_CURRENT_BINARY_DIR}/${SUBDIR}/proto/${FIL_WE}.pb.h")
67-
68-
add_custom_command(
69-
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${SUBDIR}/proto/${FIL_WE}.pb.cc"
70-
"${CMAKE_CURRENT_BINARY_DIR}/${SUBDIR}/proto/${FIL_WE}.pb.h"
71-
COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/protoc
72-
ARGS --cpp_out ${CMAKE_CURRENT_BINARY_DIR} --proto_path ${CMAKE_CURRENT_SOURCE_DIR} ${ABS_FIL}
73-
DEPENDS ${ABS_FIL}
74-
COMMENT "Running C++ protocol buffer compiler on ${FIL}"
75-
VERBATIM )
76-
endforeach()
77-
78-
set_source_files_properties(${${SRCS}} ${${HDRS}} PROPERTIES GENERATED TRUE)
79-
set(${SRCS} ${${SRCS}} PARENT_SCOPE)
80-
set(${HDRS} ${${HDRS}} PARENT_SCOPE)
81-
endfunction()
82-
83-
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu9x")
84-
85-
INCLUDE_DIRECTORIES("${CMAKE_BINARY_DIR}/include")
86-
87-
ADD_SUBDIRECTORY(src)
50+
if(BUILD_DOCUMENTATION)
51+
find_package(Doxygen)
52+
if (DOXYGEN_FOUND)
53+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doxygen/Doxyfile.in
54+
${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
55+
add_custom_target(doc
56+
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
57+
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
58+
COMMENT "Generating API documentation with Doxygen" VERBATIM
59+
)
60+
endif()
61+
endif()
62+
63+
#protobuf
64+
ExternalProject_Add(protobuf
65+
PREFIX ${CMAKE_BINARY_DIR}/external
66+
URL file://${CMAKE_SOURCE_DIR}/external/protobuf-2.5.0.tar.gz
67+
URL_MD5 b751f772bdeb2812a2a8e7202bf1dae8
68+
UPDATE_COMMAND ""
69+
PATCH_COMMAND ""
70+
CONFIGURE_COMMAND CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} ${CMAKE_BINARY_DIR}/external/src/protobuf/configure
71+
--prefix=${CMAKE_BINARY_DIR}
72+
--enable-shared
73+
BUILD_COMMAND make
74+
INSTALL_COMMAND make install
75+
)
76+
77+
#libconfig
78+
ExternalProject_Add(libconfig
79+
PREFIX ${CMAKE_BINARY_DIR}/external
80+
URL file://${CMAKE_SOURCE_DIR}/external/libconfig-1.5.tar.gz
81+
URL_MD5 a939c4990d74e6fc1ee62be05716f633
82+
UPDATE_COMMAND ""
83+
PATCH_COMMAND ""
84+
CONFIGURE_COMMAND CC=${CMAKE_C_COMPILER} CXX=${CMAKE_CXX_COMPILER} ${CMAKE_BINARY_DIR}/external/src/libconfig/configure
85+
--prefix=${CMAKE_BINARY_DIR}
86+
--enable-shared
87+
--disable-examples
88+
BUILD_COMMAND cp ${CMAKE_BINARY_DIR}/external/src/libconfig/lib/libconfig.h ${CMAKE_BINARY_DIR}/external/src/libconfig-build/lib/ && make
89+
INSTALL_COMMAND make install
90+
)
91+
92+
if(APPLE)
93+
set(SHARED_LIB_EXT .dylib)
94+
else()
95+
set(SHARED_LIB_EXT .so)
96+
endif()
97+
98+
add_library(_libconfig_library STATIC IMPORTED)
99+
add_dependencies(_libconfig_library libconfig)
100+
set_target_properties(_libconfig_library PROPERTIES IMPORTED_LOCATION ${CMAKE_BINARY_DIR}/lib/libconfig${SHARED_LIB_EXT})
101+
102+
add_library(_libconfig++_library STATIC IMPORTED)
103+
add_dependencies(_libconfig++_library libconfig)
104+
set_target_properties(_libconfig++_library PROPERTIES IMPORTED_LOCATION ${CMAKE_BINARY_DIR}/lib/libconfig++${SHARED_LIB_EXT})
105+
106+
add_library(_protobuf_library STATIC IMPORTED)
107+
add_dependencies(_protobuf_library protobuf)
108+
set_target_properties(_protobuf_library PROPERTIES IMPORTED_LOCATION ${CMAKE_BINARY_DIR}/lib/libprotobuf${SHARED_LIB_EXT})
109+
110+
add_library(_protobuf_lite_library STATIC IMPORTED)
111+
add_dependencies(_protobuf_lite_library protobuf)
112+
set_target_properties(_protobuf_lite_library PROPERTIES IMPORTED_LOCATION ${CMAKE_BINARY_DIR}/lib/libprotobuf-lite${SHARED_LIB_EXT})
113+
114+
add_library(_protoc_library STATIC IMPORTED)
115+
add_dependencies(_protoc_library protobuf)
116+
set_target_properties(_protoc_library PROPERTIES IMPORTED_LOCATION ${CMAKE_BINARY_DIR}/lib/libprotoc${SHARED_LIB_EXT})
117+
118+
# Memory size configuration bits for stinger_core
119+
set(STINGER_DEFAULT_VERTICES "(1L<<24)" CACHE STRING "Default number of vertices")
120+
set(STINGER_DEFAULT_NUMETYPES "5" CACHE STRING "Default number of edge types")
121+
set(STINGER_DEFAULT_NUMVTYPES "128" CACHE STRING "Default number of vertex types")
122+
set(STINGER_DEFAULT_NEB_FACTOR "4" CACHE STRING "Default number of edge blocks per vertex")
123+
set(STINGER_EDGEBLOCKSIZE "14" CACHE STRING "Number of edges per edge block")
124+
set(STINGER_NAME_STR_MAX "255" CACHE STRING "Max string length in physmap")
125+
126+
configure_file(${CMAKE_SOURCE_DIR}/lib/stinger_core/inc/stinger_defs.h.in ${CMAKE_BINARY_DIR}/include/stinger_core/stinger_defs.h @ONLY)
127+
configure_file(${CMAKE_SOURCE_DIR}/lib/stinger_core/inc/stinger_names.h.in ${CMAKE_BINARY_DIR}/include/stinger_core/stinger_names.h @ONLY)
128+
#file(COPY ${CMAKE_SOURCE_DIR}/lib/stinger_core/inc/stinger_defs.h DESTINATION ${CMAKE_BINARY_DIR}/include/stinger_core/)
129+
#file(COPY ${CMAKE_SOURCE_DIR}/lib/stinger_core/inc/stinger_names.h DESTINATION ${CMAKE_BINARY_DIR}/include/stinger_core/)
130+
131+
include_directories("${CMAKE_BINARY_DIR}/include")
132+
include_directories("${CMAKE_SOURCE_DIR}/external/googletest/include/")
133+
134+
add_subdirectory(external/googletest)
135+
add_subdirectory(lib)
136+
add_subdirectory(src)
137+
138+
enable_testing()
139+
add_test(NamesTest ${CMAKE_BINARY_DIR}/bin/stinger_names_test)
140+
add_test(StingerCoreTest ${CMAKE_BINARY_DIR}/bin/stinger_core_test)
141+
add_test(StingerPhysmapTest ${CMAKE_BINARY_DIR}/bin/stinger_physmap_test)
142+
add_test(StingerTraversalTest ${CMAKE_BINARY_DIR}/bin/stinger_traversal_test)
143+
add_test(StingerPagerankTest ${CMAKE_BINARY_DIR}/bin/stinger_pagerank_test)
144+
add_test(StingerAdamicAdarTest ${CMAKE_BINARY_DIR}/bin/stinger_adamic_adar_test)
145+
add_test(StingerBetweennessTest ${CMAKE_BINARY_DIR}/bin/stinger_betweenness_test)
146+
147+
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} -E env CTEST_OUTPUT_ON_FAILURE=1 --verbose DEPENDS stinger_names_test stinger_core_test stinger_physmap_test stinger_traversal_test stinger_pagerank_test stinger_adamic_adar_test stinger_betweenness_test)
148+

LICENSE

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
Libraries in /external are the right of their respective owners.
2+
3+
STINGER
4+
Copyright (c) 2009-2015 Georgia Institute of Technology
5+
All rights reserved.
6+
7+
Redistribution and use in source and binary forms, with or without
8+
modification, are permitted provided that the following conditions are met:
9+
10+
- Redistributions of source code must retain the above copyright notice,
11+
this list of conditions and the following disclaimer.
12+
- Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
- Neither the name of the Georgia Institute of Technology nor the names of
16+
its contributors may be used to endorse or promote products derived from
17+
this software without specific prior written permission.
18+
19+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22+
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
29+
THE POSSIBILITY OF SUCH DAMAGE.

0 commit comments

Comments
 (0)