-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ccf4c9e
commit f5e8be9
Showing
1,117 changed files
with
520,384 additions
and
2,533 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,8 @@ cmake_minimum_required ( VERSION 2.8.12 ) | |
|
||
project ( graphblas ) | ||
|
||
include ( GNUInstallDirs ) | ||
|
||
if ( CMAKE_VERSION VERSION_GREATER "3.0" ) | ||
cmake_policy ( SET CMP0042 NEW ) | ||
endif ( ) | ||
|
@@ -51,20 +53,20 @@ endif ( ) | |
set ( CMAKE_INCLUDE_CURRENT_DIR ON ) | ||
|
||
# include directories for both graphblas and graphblasdemo libraries | ||
include_directories ( Source/Template Include Demo/Include ) | ||
include_directories ( Source/Template Source Source/Generated Include Demo/Include ) | ||
|
||
# check which compiler is being used. If you need to make | ||
# compiler-specific modifications, here is the place to do it. | ||
if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") | ||
# cmake 2.8 workaround: gcc needs to be told to do ANSI C11. | ||
# cmake 3.0 doesn't have this problem. | ||
set (CMAKE_C_FLAGS "-std=c11 -lm") | ||
set (CMAKE_C_FLAGS "-std=c11 -lm -fopenmp") | ||
if (CMAKE_C_COMPILER_VERSION VERSION_LESS 4.9) | ||
message (FATAL_ERROR "gcc version must be at least 4.9") | ||
endif ( ) | ||
elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "Intel") | ||
# options for icc: also needs -std=c11 | ||
set (CMAKE_C_FLAGS "-std=c11") | ||
set (CMAKE_C_FLAGS "-std=c11 -fopenmp") | ||
if (CMAKE_C_COMPILER_VERSION VERSION_LESS 18.0) | ||
message (FATAL_ERROR "icc version must be at least 18.0") | ||
endif ( ) | ||
|
@@ -77,19 +79,51 @@ elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC") | |
# options for MicroSoft Visual Studio | ||
endif ( ) | ||
|
||
# create the graphblas library. Requires ANSI C11 | ||
file ( GLOB GRAPHBLAS_SOURCES "Source/*.c" ) | ||
# create the dynamic graphblas library. Requires ANSI C11 | ||
file ( GLOB GRAPHBLAS_SOURCES "Source/*.c" "Source/Generated/*.c" ) | ||
add_library ( graphblas SHARED ${GRAPHBLAS_SOURCES} ) | ||
SET_TARGET_PROPERTIES ( graphblas PROPERTIES VERSION 1.1.0 | ||
SET_TARGET_PROPERTIES ( graphblas PROPERTIES VERSION 1.1.2 | ||
SOVERSION 1 | ||
C_STANDARD_REQUIRED 11 | ||
PUBLIC_HEADER "Include/GraphBLAS.h" ) | ||
set_property ( TARGET graphblas PROPERTY C_STANDARD 11 ) | ||
|
||
# create the static graphblas library. Requires ANSI C11 | ||
add_library ( graphblas_static STATIC ${GRAPHBLAS_SOURCES} ) | ||
SET_TARGET_PROPERTIES ( graphblas_static PROPERTIES VERSION 1.1.2 | ||
OUTPUT_NAME graphblas | ||
POSITION_INDEPENDENT_CODE OFF | ||
SOVERSION 1 | ||
C_STANDARD_REQUIRED 11 | ||
PUBLIC_HEADER "Include/GraphBLAS.h" ) | ||
set_property ( TARGET graphblas_static PROPERTY C_STANDARD 11 ) | ||
|
||
# Notes from Sebastien Villemot ([email protected]): | ||
# SOVERSION policy: if a binary compiled against the old version of the shared | ||
# library needs recompiling in order to work with the new version, then a | ||
# SO_VERSION increase # is needed. Otherwise not. Examples of the changes that | ||
# require a SO_VERSION increase: | ||
# | ||
# - a public function or static variable is removed | ||
# - the prototype of a public function changes | ||
# - the integer value attached to a public #define or enum changes | ||
# - the fields of a public structure are modified | ||
# | ||
# Examples of changes that do not require a SO_VERSION increase: | ||
# | ||
# - a new public function or static variable is added | ||
# - a private function or static variable is removed or modified | ||
# - changes in the internals of a structure that is opaque to the calling | ||
# program (i.e. is only a pointer manipulated through public functions of | ||
# the library) | ||
# - a public enum is extended (by adding a new item at the end, but without | ||
# changing the already existing items) | ||
|
||
# graphblas installation location | ||
install ( TARGETS graphblas | ||
LIBRARY DESTINATION /usr/local/lib | ||
PUBLIC_HEADER DESTINATION /usr/local/include ) | ||
install ( TARGETS graphblas graphblas_static | ||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} | ||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) | ||
|
||
# Demo library | ||
file ( GLOB DEMO_SOURCES "Demo/Source/*.c" ) | ||
|
@@ -98,7 +132,13 @@ SET_TARGET_PROPERTIES ( graphblasdemo PROPERTIES | |
C_STANDARD_REQUIRED 11 ) | ||
set_property ( TARGET graphblasdemo PROPERTY C_STANDARD 11 ) | ||
|
||
target_link_libraries ( graphblasdemo graphblas ) | ||
add_library ( graphblasdemo_static STATIC ${DEMO_SOURCES} ) | ||
SET_TARGET_PROPERTIES ( graphblasdemo_static PROPERTIES | ||
C_STANDARD_REQUIRED 11 ) | ||
set_property ( TARGET graphblasdemo_static PROPERTY C_STANDARD 11 ) | ||
|
||
target_link_libraries ( graphblasdemo m graphblas ) | ||
target_link_libraries ( graphblasdemo_static graphblas_static ) | ||
|
||
# Demo programs | ||
add_executable ( bfs_demo "Demo/Program/bfs_demo.c" ) | ||
|
Oops, something went wrong.