From 5e6b43f88bfae5794b21950a870713d2283016cc Mon Sep 17 00:00:00 2001 From: 5chdn Date: Sun, 9 Oct 2016 22:30:51 +0200 Subject: [PATCH 1/2] Add posix threads to cxx flags, ref #3316 --- cmake/EthCompilerSettings.cmake | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/cmake/EthCompilerSettings.cmake b/cmake/EthCompilerSettings.cmake index d91c35787a4..28f0de4430d 100644 --- a/cmake/EthCompilerSettings.cmake +++ b/cmake/EthCompilerSettings.cmake @@ -25,7 +25,7 @@ endif(CCACHE_FOUND) if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")) # Use ISO C++11 standard language. - set(CMAKE_CXX_FLAGS -std=c++11) + set(CMAKE_CXX_FLAGS "-pthread -std=c++11") # Enables all the warnings about constructions that some users consider questionable, # and that are easy to avoid. Also enable some extra warning flags that are not @@ -65,12 +65,12 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA # Build everything as shared libraries (.so files) add_definitions(-DSHAREDLIB) - + # If supported for the target machine, emit position-independent code, suitable for dynamic # linking and avoiding any limit on the size of the global offset table. add_compile_options(-fPIC) - # Configuration-specific compiler settings. + # Configuration-specific compiler settings. set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -DETH_DEBUG") set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG -DETH_RELEASE") set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG -DETH_RELEASE") @@ -103,7 +103,7 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA # or newer (AppleClang 7.0+). We should be able to re-enable this setting # on non-Apple Clang as well, if we can work out what expression to use for # the version detection. - + # The fact that the version-reporting for AppleClang loses the original # Clang versioning is rather annoying. Ideally we could just have # a single cross-platform "if version >= 3.4.1" check. @@ -132,20 +132,20 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA # testing on at least OS X and Ubuntu. add_compile_options(-Wno-unused-function) add_compile_options(-Wno-dangling-else) - + # Some Linux-specific Clang settings. We don't want these for OS X. if ("${CMAKE_SYSTEM_NAME}" MATCHES "Linux") - + # TODO - Is this even necessary? Why? # See http://stackoverflow.com/questions/19774778/when-is-it-necessary-to-use-use-the-flag-stdlib-libstdc. add_compile_options(-stdlib=libstdc++) - + # Tell Boost that we're using Clang's libc++. Not sure exactly why we need to do. add_definitions(-DBOOST_ASIO_HAS_CLANG_LIBCXX) - + # Use fancy colors in the compiler diagnostics add_compile_options(-fcolor-diagnostics) - + # See "How to silence unused command line argument error with clang without disabling it?" # When using -Werror with clang, it transforms "warning: argument unused during compilation" messages # into errors, which makes sense. @@ -200,7 +200,7 @@ elseif (MSVC) message("Forcing static linkage for MSVC.") set(ETH_STATIC 1) endif () - + # If you don't have GCC, Clang or VC++ then you are on your own. Good luck! else () message(WARNING "Your compiler is not tested, if you run into any issues, we'd welcome any patches.") From 9c51541e754a1f67d22803b886d21a600a996736 Mon Sep 17 00:00:00 2001 From: 5chdn Date: Sun, 9 Oct 2016 22:32:38 +0200 Subject: [PATCH 2/2] Link libethash against math library, ref #3316 --- libethash/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libethash/CMakeLists.txt b/libethash/CMakeLists.txt index afefa8b0e68..442dad9b2a2 100644 --- a/libethash/CMakeLists.txt +++ b/libethash/CMakeLists.txt @@ -37,4 +37,6 @@ if (CRYPTOPP_FOUND) TARGET_LINK_LIBRARIES(ethash ${CRYPTOPP_LIBRARIES}) endif() +TARGET_LINK_LIBRARIES(ethash m) + install(TARGETS ethash RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib)