11cmake_minimum_required (VERSION 3.12)
22
33############################################################################################
4- # CONDITIONAL FLAG (to run simulation on CPU or GPU)
5- #
6- # For GPU: For CPU:
7- # set(ENABLE_CUDA YES) set(ENABLE_CUDA NO)
4+ #CONDITIONAL FLAG(to run simulation on CPU or GPU)
85#
9- # You can also pass this flag when running cmake from the command line like this:
6+ #For GPU : For CPU:
7+ #set(ENABLE_CUDA YES) set(ENABLE_CUDA NO)
108#
11- # cmake .. -D ENABLE_CUDA=YES
9+ #You can also pass this flag when running cmake from the command line like this:
1210#
13- # "YES"/GPU choice only available if CUDA library is installed and the GPU is CUDA capable.
11+ #cmake..- D ENABLE_CUDA = YES
12+ #
13+ #"YES" / GPU choice only available if CUDA library is installed and the GPU is CUDA capable.
1414############################################################################################
1515if (NOT ENABLE_CUDA)
1616 set (ENABLE_CUDA NO )
1717endif ()
1818
19- # CONDITIONAL FLAG to turn on the performance metrics
19+ #CONDITIONAL FLAG to turn on the performance metrics
2020if (NOT PERFORMANCE_METRICS)
2121 set (PERFORMANCE_METRICS NO )
2222endif ()
2323
24- # CONDITIONAL FLAG to turn on the Gprof profiler (Gprof is a performance analysis tool for Unix applications)
25- # Steps to run Gprof
26- # Step 01 : set(GPROF YES) below
27- # Step 02 : Compile and run the simulation on CPU or GPU as usual
28- # Step 03 : Run the generated gmon.out file from the build directory and save the output in an txt file to improve readability-
29- # If using CPU - "~/Graphitti/build$ gprof cgraphitti gmon.out > analysis_test.txt"
30- # If using GPU - "~/Graphitti/build$ gprof ggraphitti gmon.out > analysis_test.txt"
24+ #CONDITIONAL FLAG to turn on the Gprof profiler( \
25+ # Gprof is a performance analysis tool for Unix applications)
26+ #Steps to run Gprof
27+ #Step 01 : set(GPROF YES) below
28+ #Step 02 : Compile and run the simulation on CPU or GPU as usual
29+ #Step 03 : Run the generated gmon.out file from the build directory and save the output in an txt \
30+ # file to improve readability \
31+ #If using CPU - "~/Graphitti/build$ gprof cgraphitti gmon.out > analysis_test.txt"
32+ #If using GPU - "~/Graphitti/build$ gprof ggraphitti gmon.out > analysis_test.txt"
3133if (NOT GPROF)
3234 set (GPROF NO )
3335endif ()
3436
35- # Creates the Graphitti project with the correct languages, depending on if using GPU or not
36- # If using CUDA, also verify the CUDA package and set the required CUDA variables
37+ #Creates the Graphitti project with the correct languages, depending on if using GPU or not
38+ #If using CUDA, also verify the CUDA package and set the required CUDA variables
3739if (ENABLE_CUDA)
3840 message ("\n ----Generating Makefile for Graphitti GPU version----" )
3941 project (Graphitti LANGUAGES CXX CUDA C)
40- # Verify CUDA package is present
42+ # Verify CUDA package is present
4143 find_Package (CUDA REQUIRED)
42- # Set the USE_GPU preprocessor macro so that GPU code will be compiled.
44+ # Set the USE_GPU preprocessor macro so that GPU code will be compiled.
4345 add_compile_definitions (USE_GPU)
44- # Specify the CUDA architecture/ gencode that will be targeted
46+ # Specify the CUDA architecture / gencode that will be targeted
4547 ### Set gencode and architecture variables to the correct values for your specific NVIDIA hardware
4648 set (CMAKE_CUDA_ARCHITECTURES 37)
4749 set (CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} ;-gencode=arch=compute_37,code=sm_37)
@@ -51,11 +53,11 @@ else()
5153 project (Graphitti LANGUAGES CXX C)
5254endif ()
5355
54- # Setting the base version to C++ 11
56+ #Setting the base version to C++ 11
5557set (CMAKE_CXX_STANDARD 17)
5658
57- # set(DEBUG_MODE YES) for debugging, no optimization
58- # set(DEBUG_MODE NO) for production code, -O3 optimization enabled
59+ #set(DEBUG_MODE YES) for debugging, no optimization
60+ #set(DEBUG_MODE NO) for production code, -O3 optimization enabled
5961set (DEBUG_MODE NO )
6062
6163if (PERFORMANCE_METRICS)
@@ -70,7 +72,8 @@ if(GPROF)
7072 set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pg" )
7173endif ()
7274
73- # HDF5 Support, finds HDF5 package for C and C++ and links the hdf5 libraries to the executable later in the file.
75+ #HDF5 Support, finds HDF5 package for C and C++ and links the hdf5 libraries to the executable \
76+ # later in the file.
7477find_package (HDF5 COMPONENTS C CXX)
7578if (HDF5_FOUND)
7679 message ("-- HDF5 version ${HDF5_VERSION} located. HDF5 recorders are available." )
@@ -81,20 +84,20 @@ else()
8184 message ("-- HDF5 library was not located. Please only use XML recorders." )
8285endif ()
8386
84- # Find boost graph library
87+ #Find boost graph library
8588find_package (Boost REQUIRED COMPONENTS graph)
8689
87- # Get git commit ID
88- # Change to "git rev-parse --short HEAD" for short commit ID
90+ #Get git commit ID
91+ #Change to "git rev-parse --short HEAD" for short commit ID
8992execute_process (
9093 COMMAND
9194 git rev-parse HEAD
9295 OUTPUT_VARIABLE GIT_COMMIT_ID )
9396
94- # GIT_COMMIT_ID has trailing whitespaces
97+ #GIT_COMMIT_ID has trailing whitespaces
9598string (REGEX REPLACE "\n $" "" GIT_COMMIT_ID "${GIT_COMMIT_ID} " )
9699
97- # Save GIT_COMMIT_ID to config.h, which is included in Core.cpp
100+ #Save GIT_COMMIT_ID to config.h, which is included in Core.cpp
98101configure_file ( ${CMAKE_CURRENT_SOURCE_DIR} /config.h.in
99102 ${CMAKE_BINARY_DIR} /config.h
100103 @ONLY )
@@ -103,13 +106,14 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
103106
104107#set(CMAKE_VERBOSE_MAKEFILE TRUE)
105108
106- # Setting the location of the executable to be in the top-level directory. This helps when using file paths during
107- # runtime.
109+ #Setting the location of the executable to be in the top \
110+ # - level directory.This helps when using file paths during
111+ #runtime.
108112set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} /lib)
109113set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} /lib)
110114set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} )
111115
112- # Set extra warning flags
116+ #Set extra warning flags
113117#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
114118
115119if (NOT DEBUG_MODE)
@@ -121,11 +125,11 @@ endif()
121125add_compile_definitions (TIXML_USE_STL)
122126message ("-- Setting Compile Definition: TIMXL_USE_STL" )
123127
124- # Used to define file paths for #include definitions. For example, you can write:
128+ #Used to define file paths for #include definitions.For example, you can write:
125129# #include "Simulator.h"
126- # rather than:
130+ #rather than:
127131# #include "Simulator/Core/Simulator.h"
128- # if the file path "Simulator/Core" is in the following statement.
132+ #if the file path "Simulator/Core" is in the following statement.
129133include_directories (
130134 ../Graphitti
131135 Simulator
@@ -171,11 +175,12 @@ if(ENABLE_CUDA)
171175 set_source_files_properties (${cuda_sources} PROPERTIES LANGUAGE CUDA)
172176endif ()
173177
174- # Collect source files and create libraries
175- # Libraries containing .cpp files compiled as CUDA .cu files should be created as STATIC to ensure proper linking
178+ #Collect source files and create libraries
179+ #Libraries containing.cpp files compiled as CUDA.cu files should be created as STATIC to ensure \
180+ #proper linking
176181
177182
178- # Create Connections library
183+ # Create Connections library
179184file (GLOB_RECURSE Connections_Source Simulator/Connections/*.cpp Simulator/Connections/*.h)
180185
181186if (ENABLE_CUDA)
@@ -285,8 +290,8 @@ include_directories(Testing/lib/GoogleTest/googletest-master/googletest/include)
285290
286291# Set CUDA_SEPERABLE_COMPILATION to ON for all libraries that contain .cpp files with device functions compiled as CUDA files
287292if (ENABLE_CUDA)
288- set_property (TARGET Edges PROPERTY CUDA_STANDARD 11 )
289- set_property (TARGET Vertices PROPERTY CUDA_STANDARD 11 )
293+ set_property (TARGET Edges PROPERTY CUDA_STANDARD 17 )
294+ set_property (TARGET Vertices PROPERTY CUDA_STANDARD 17 )
290295 # Enables CUDA code in these libraries to be compiled into separate object files and then linked together
291296 set_property (TARGET Edges PROPERTY CUDA_SEPARABLE_COMPILATION ON )
292297 set_property (TARGET Vertices PROPERTY CUDA_SEPARABLE_COMPILATION ON )
@@ -355,36 +360,47 @@ add_executable(tests
355360 Testing/UnitTesting/RecorderFactoryTests.cpp
356361 Testing/UnitTesting/InputManagerTests.cpp
357362 Testing/UnitTesting/RNGFactoryTests.cpp
363+ Testing/UnitTesting/GraphManagerTests.cpp
358364 Testing/Utils/ParameterManagerTests.cpp
359365 Testing/Utils/CircularBufferTests.cpp
360- # Testing/UnitTesting/XmlRecorderTests.cpp)
361- )
366+ Testing/UnitTesting/XmlRecorderTests.cpp
367+ Testing/UnitTesting/Hdf5RecorderTests.cpp )
362368
363369# Links the Googletest framework with the testing executable
364370target_link_libraries (tests gtest gtest_main)
365371
366372# Link the combined library into the 'tests' executable.
367373target_link_libraries (tests combinedLib)
368374
369- add_executable (serialTest
370- Testing/RunTests.cpp
371- Testing/UnitTesting/SerializationTests.cpp)
375+ # add_executable(serialTest
376+ # Testing/RunTests.cpp
377+ # Testing/UnitTesting/SerializationTests.cpp)
372378
373- # Links the Googletest framework with the serialTest executable
374- target_link_libraries (serialTest gtest gtest_main)
379+ # # Links the Googletest framework with the serialTest executable
380+ # target_link_libraries(serialTest gtest gtest_main)
375381
376- # Link the combined library into the 'serialTest' executable.
377- target_link_libraries (serialTest combinedLib)
382+ # # Link the combined library into the 'serialTest' executable.
383+ # target_link_libraries(serialTest combinedLib)
378384
379- add_executable (deserialTest
380- Testing/RunTests.cpp
381- Testing/UnitTesting/DeserializationTests.cpp)
385+ # add_executable(deserialTest
386+ # Testing/RunTests.cpp
387+ # Testing/UnitTesting/DeserializationTests.cpp)
388+
389+ # # Links the Googletest framework with the deserialTest executable
390+ # target_link_libraries(deserialTest gtest gtest_main)
391+
392+ # # Link the combined library into the 'deserialTest' executable.
393+ # target_link_libraries(deserialTest combinedLib)
394+
395+ # add_executable(serialFileAccessTest
396+ # Testing/RunTests.cpp
397+ # Testing/UnitTesting/SerializationFileAccessTest.cpp)
382398
383- # Links the Googletest framework with the deserialTest executable
384- target_link_libraries (deserialTest gtest gtest_main)
399+ # # Links the Googletest framework with the serialFileAccessTest executable
400+ # target_link_libraries(serialFileAccessTest gtest gtest_main)
385401
386- # Link the combined library into the 'deserialTest ' executable.
387- target_link_libraries (deserialTest combinedLib)
402+ # # Link the combined library into the 'serialFileAccessTest ' executable.
403+ # target_link_libraries(serialFileAccessTest combinedLib)
388404
389405add_executable (serialFileAccessTest
390406 Testing/RunTests.cpp
0 commit comments