aboutsummaryrefslogtreecommitdiffstats
path: root/Godeps/_workspace/src/github.com/ethereum/ethash/benchmark/CMakeLists.txt
blob: e6ba85790429ea64c75f4d62b7e1aee1f0c19115 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
include_directories(..)

set(CMAKE_BUILD_TYPE Release)

if (MSVC)
    add_definitions("/openmp")
endif()

if (NOT MPI_FOUND)
    find_package(MPI)
endif()

if (NOT CRYPTOPP_FOUND)
    find_package(CryptoPP 5.6.2)
endif()

if (CRYPTOPP_FOUND)
    add_definitions(-DWITH_CRYPTOPP)
endif()

if (NOT OpenCL_FOUND)
    find_package(OpenCL)
endif()
if (OpenCL_FOUND)
    add_definitions(-DWITH_OPENCL)
    include_directories(${OpenCL_INCLUDE_DIRS})
    list(APPEND FILES ethash_cl_miner.cpp ethash_cl_miner.h)
endif()

if (MPI_FOUND)
    include_directories(${MPI_INCLUDE_PATH})
    add_executable (Benchmark_MPI_FULL benchmark.cpp)
    target_link_libraries (Benchmark_MPI_FULL ${ETHHASH_LIBS} ${MPI_LIBRARIES})
    SET_TARGET_PROPERTIES(Benchmark_MPI_FULL PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} ${MPI_COMPILE_FLAGS} -DFULL -DMPI")

    add_executable (Benchmark_MPI_LIGHT benchmark.cpp)
    target_link_libraries (Benchmark_MPI_LIGHT ${ETHHASH_LIBS} ${MPI_LIBRARIES})
    SET_TARGET_PROPERTIES(Benchmark_MPI_LIGHT PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} ${MPI_COMPILE_FLAGS} -DMPI")
endif()

add_executable (Benchmark_FULL benchmark.cpp)
target_link_libraries (Benchmark_FULL ${ETHHASH_LIBS})
SET_TARGET_PROPERTIES(Benchmark_FULL PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} -DFULL")

add_executable (Benchmark_LIGHT benchmark.cpp)
target_link_libraries (Benchmark_LIGHT ${ETHHASH_LIBS})

if (OpenCL_FOUND)
    add_executable (Benchmark_CL benchmark.cpp)
    target_link_libraries (Benchmark_CL ${ETHHASH_LIBS} ethash-cl)
    SET_TARGET_PROPERTIES(Benchmark_CL PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} -DOPENCL")
endif()