5353 project (Graphitti LANGUAGES CXX C)
5454endif ()
5555
56- #Setting the base version to C++ 11
56+ #Setting the base version to C++ 17
5757set (CMAKE_CXX_STANDARD 17)
5858
5959#set(DEBUG_MODE YES) for debugging, no optimization
@@ -161,18 +161,24 @@ include_directories(
161161
162162if (ENABLE_CUDA)
163163
164- set (cuda_sources Simulator/Edges/Neuro/AllSynapsesDeviceFuncs_d.cpp
165- Simulator/Vertices/Neuro/AllVerticesDeviceFuncs_d.cpp
166- Simulator/Edges/Neuro/AllSpikingSynapses_d.cpp
167- Simulator/Edges/Neuro/AllSTDPSynapses_d.cpp
168- Simulator/Edges/Neuro/AllDSSynapses_d.cpp
169- Simulator/Edges/Neuro/AllDynamicSTDPSynapses_d.cpp
170- Simulator/Vertices/Neuro/AllLIFNeurons_d.cpp
171- Simulator/Vertices/Neuro/AllIZHNeurons_d.cpp
172- Simulator/Vertices/Neuro/AllIFNeurons_d.cpp
173- Simulator/Vertices/Neuro/AllSpikingNeurons_d.cpp
164+ set (cuda_ConnectionsSources
174165 Simulator/Connections/Neuro/ConnGrowth_d.cpp )
175- set_source_files_properties (${cuda_sources} PROPERTIES LANGUAGE CUDA)
166+ set_source_files_properties (${cuda_ConnectionsSources} PROPERTIES LANGUAGE CUDA)
167+
168+ set (cuda_EdgesSources Simulator/Edges/Neuro/AllSynapsesDeviceFuncs_d.cpp
169+ Simulator/Edges/Neuro/AllSpikingSynapses_d.cpp
170+ Simulator/Edges/Neuro/AllSTDPSynapses_d.cpp
171+ Simulator/Edges/Neuro/AllDSSynapses_d.cpp
172+ Simulator/Edges/Neuro/AllDynamicSTDPSynapses_d.cpp)
173+ set_source_files_properties (${cuda_EdgesSources} PROPERTIES LANGUAGE CUDA)
174+
175+ set (cuda_VerticesSources
176+ Simulator/Vertices/Neuro/AllVerticesDeviceFuncs_d.cpp
177+ Simulator/Vertices/Neuro/AllLIFNeurons_d.cpp
178+ Simulator/Vertices/Neuro/AllIZHNeurons_d.cpp
179+ Simulator/Vertices/Neuro/AllIFNeurons_d.cpp
180+ Simulator/Vertices/Neuro/AllSpikingNeurons_d.cpp)
181+ set_source_files_properties (${cuda_VerticesSources} PROPERTIES LANGUAGE CUDA)
176182endif ()
177183
178184 #Collect source files and create libraries
@@ -184,7 +190,7 @@ endif()
184190file (GLOB_RECURSE Connections_Source Simulator/Connections/*.cpp Simulator/Connections/*.h)
185191
186192if (ENABLE_CUDA)
187- add_library (Connections STATIC ${Connections_Source} ${cuda_sources } )
193+ add_library (Connections STATIC ${Connections_Source} ${cuda_ConnectionsSources } )
188194else ()
189195 list (REMOVE_ITEM Connections_Source "${CMAKE_CURRENT_SOURCE_DIR} /Simulator/Connections/Neuro/ConnGrowth_d.cpp" )
190196 add_library (Connections STATIC ${Connections_Source} )
@@ -195,7 +201,7 @@ endif()
195201file (GLOB_RECURSE Vertices_Source Simulator/Vertices/*.cpp Simulator/Vertices/*.h)
196202
197203if (ENABLE_CUDA)
198- add_library (Vertices SHARED ${Vertices_Source} ${cuda_sources } )
204+ add_library (Vertices STATIC ${Vertices_Source} ${cuda_VerticesSources } )
199205else ()
200206 list (REMOVE_ITEM Vertices_Source "${CMAKE_CURRENT_SOURCE_DIR} /Simulator/Vertices/Neuro/AllVerticesDeviceFuncs.h" )
201207 list (REMOVE_ITEM Vertices_Source "${CMAKE_CURRENT_SOURCE_DIR} /Simulator/Vertices/Neuro/AllVerticesDeviceFuncs_d.cpp" )
@@ -212,7 +218,7 @@ endif()
212218# Create Edges library
213219file (GLOB_RECURSE Edges_Source Simulator/Edges/*.cpp Simulator/Edges/*.h)
214220if (ENABLE_CUDA)
215- add_library (Edges SHARED ${Edges_Source} ${cuda_sources } )
221+ add_library (Edges STATIC ${Edges_Source} ${cuda_EdgesSources } )
216222else ()
217223 list (REMOVE_ITEM Edges_Source "${CMAKE_CURRENT_SOURCE_DIR} /Simulator/Edges/Neuro/AllSynapsesDeviceFuncs.h" )
218224 list (REMOVE_ITEM Edges_Source "${CMAKE_CURRENT_SOURCE_DIR} /Simulator/Edges/Neuro/AllSynapsesDeviceFuncs_d.cpp" )
@@ -373,45 +379,48 @@ target_link_libraries(tests gtest gtest_main)
373379# Link the combined library into the 'tests' executable.
374380target_link_libraries (tests combinedLib)
375381
376- # add_executable(serialTest
377- # Testing/RunTests.cpp
378- # Testing/UnitTesting/SerializationTests.cpp)
382+ #------- SERIALIZATION TESTS --------------------
383+ # Serialization tests must be executed separately, as each test requires the
384+ # simulation to run from start to finish. Running multiple simulations with
385+ # the same singleton instance results in a segmentation fault (SEG FAULT).
379386
380- # # Links the Googletest framework with the serialTest executable
381- # target_link_libraries(serialTest gtest gtest_main)
387+ add_executable (serialFullTest
388+ Testing/RunTests.cpp
389+ Testing/UnitTesting/SerializationFullTest.cpp)
382390
383- # # Link the combined library into the 'serialTest' executable.
384- # target_link_libraries(serialTest combinedLib)
391+ add_executable (serialFirstHalfTest
392+ Testing/RunTests.cpp
393+ Testing/UnitTesting/SerializationFirstHalfTest.cpp)
385394
386- # add_executable(deserialTest
387- # Testing/RunTests.cpp
388- # Testing/UnitTesting/DeserializationTests .cpp)
395+ add_executable (serialSecondHalfTest
396+ Testing/RunTests.cpp
397+ Testing/UnitTesting/SerializationSecondHalfTest .cpp)
389398
390- # # Links the Googletest framework with the deserialTest executable
391- # target_link_libraries(deserialTest gtest gtest_main)
399+ # Link the GoogleTest framework to each of the serial test executables.
400+ target_link_libraries (serialFullTest gtest gtest_main)
401+ target_link_libraries (serialFirstHalfTest gtest gtest_main)
402+ target_link_libraries (serialSecondHalfTest gtest gtest_main)
392403
393- # # Link the combined library into the 'deserialTest' executable.
394- # target_link_libraries(deserialTest combinedLib)
404+ # Link the combined library and filesystem support to the respective serial test executables.
405+ target_link_libraries (serialFullTest stdc++fs)
406+ target_link_libraries (serialFullTest combinedLib)
395407
396- # add_executable(serialFileAccessTest
397- # Testing/RunTests.cpp
398- # Testing/UnitTesting/SerializationFileAccessTest.cpp)
408+ target_link_libraries (serialFirstHalfTest stdc++fs)
409+ target_link_libraries (serialFirstHalfTest combinedLib)
399410
400- # # Links the Googletest framework with the serialFileAccessTest executable
401- # target_link_libraries(serialFileAccessTest gtest gtest_main )
411+ target_link_libraries (serialSecondHalfTest stdc++fs)
412+ target_link_libraries (serialSecondHalfTest combinedLib )
402413
403- # # Link the combined library into the 'serialFileAccessTest' executable.
404- # target_link_libraries(serialFileAccessTest combinedLib)
405-
406- add_executable (serialFileAccessTest
407- Testing/RunTests.cpp
408- Testing/UnitTesting/SerializationFileAccessTest.cpp)
414+ # commenting out serialFileAccessTest until issue-754 is resolved
415+ # add_executable(serialFileAccessTest
416+ # Testing/RunTests.cpp
417+ # Testing/UnitTesting/SerializationFileAccessTest.cpp)
409418
410419# Links the Googletest framework with the serialFileAccessTest executable
411- target_link_libraries (serialFileAccessTest gtest gtest_main)
420+ # target_link_libraries(serialFileAccessTest gtest gtest_main)
412421
413422# Link the combined library into the 'serialFileAccessTest' executable.
414- target_link_libraries (serialFileAccessTest combinedLib)
423+ # target_link_libraries(serialFileAccessTest combinedLib)
415424
416425# Clear ENABLE_CUDA, PERFORMANCE_METRICS and GPROF from the cache so it's reset for subsequent builds
417426unset (ENABLE_CUDA CACHE )
0 commit comments