Parcourir la source

Fix bug on Ubuntu

Eric Ramat il y a 9 ans
Parent
commit
5842e313bf

+ 1 - 1
CMakeLists.txt

@@ -25,7 +25,7 @@ INCLUDE(CMakeCPack.cmake)
 
 IF (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
   SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra")
-  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -std=c++11 -pthread")
+  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--no-as-needed -Wall -Wextra -std=c++11")
   IF (UNIX)
     SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic")
     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic")

+ 1 - 1
output/script.pl

@@ -2,7 +2,7 @@
 
 use List::Util qw(sum);
 
-for ($n = 1; $n < 9; $n++) {
+for ($n = 1; $n < 13; $n++) {
     @values = ();
     for ($i = 0; $i < 20; $i++)  {
 	push @values, `../build/src/tests/multithreading/pdevs-multithreading-main $n`;

+ 1 - 0
src/tests/multithreading/CMakeLists.txt

@@ -12,6 +12,7 @@ LINK_DIRECTORIES(
 ADD_EXECUTABLE(pdevs-multithreading-tests graph_manager.hpp tests.cpp)
 
 TARGET_LINK_LIBRARIES(pdevs-multithreading-tests
+  ${CMAKE_THREAD_LIBS_INIT}
   ${Boost_SYSTEM_LIBRARY}
   ${Boost_TIMER_LIBRARY})
 

+ 2 - 2
src/tests/multithreading/main.cpp

@@ -206,8 +206,8 @@ void tree(int n)
 int main(int argc, char** argv)
 {
     if (argc > 1) {
-        // grid(atoi(argv[1]));
-        tree(atoi(argv[1]));
+        grid(atoi(argv[1]));
+        // tree(atoi(argv[1]));
     }
     return 0;
 }