Skip to content

Fixed some #Includes and LNK Errors#105

Closed
Cppuccino wants to merge 0 commit intoluminousmining:mainfrom
Cppuccino:main
Closed

Fixed some #Includes and LNK Errors#105
Cppuccino wants to merge 0 commit intoluminousmining:mainfrom
Cppuccino:main

Conversation

@Cppuccino
Copy link
Contributor

Fixed some errors i received while trying to build on Windows, Please double the CmakeList changes before merging, thank you.

)
endif()

if (BUILD_NVIDIA)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You totaly ingoring options:

### BUILD EXE
option(BUILD_EXE_MINER "Build miner executable" ON)
option(BUILD_EXE_UNIT_TEST "Build unit test executable" ON)
option(BUILD_EXE_BENCHMARK "Build benchmark executable" ON)

BENCH_EXE must be build only if BUILD_EXE_BENCHMARK is ON.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apply this logical with all your modifications ;)

### DEVICE TARGET
option(BUILD_AMD "Build with OpenCL for AMD GPU" ON)
option(BUILD_CPU "Build with OpenMP for CPU(Intel/AMD)" ON)
option(BUILD_NVIDIA "Build with CUDA for Nvidia GPU" ON)
### BUILD EXE
option(BUILD_EXE_MINER "Build miner executable" ON)
option(BUILD_EXE_UNIT_TEST "Build unit test executable" ON)
option(BUILD_EXE_BENCHMARK "Build benchmark executable" ON)

Example:
cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_EXE_MINER=OFF -DBUILD_EXE_UNIT_TEST=OFF -DBUILD_EXE_BENCHMARK=ON -DBUILD_NVIDIA=OFF -DBUILD_CPU=OFF -DBUILD_AMD=ON

*********************************************************************
-- BUILD_AMD        : ON
-- OPENCL           : 3.0
-- OPENCL Include   : /usr/local/include
-- OPENCL Libraries : /usr/local/lib/libOpenCL.so
*********************************************************************
-- BUILD_CPU        : OFF
*********************************************************************
-- BUILD_NVIDIA     : OFF
*********************************************************************
-- BUILD NVIDIA     : OFF
-- BUILD AMD        : ON
-- BUILD CPU        : OFF
*********************************************************************
-- BUILD MINER      : OFF
-- BUILD BENCHMARK  : ON
-- BUILD UNIT TEST  : OFF
*********************************************************************

The options is a filter to build only what you need !
Atm I need only benchmark with AMD, i'm ignoring other exe and Nvidia device.

if (BUILD_AMD)
target_link_libraries(${BENCH_EXE}
PUBLIC
${OpenCL_LIBRARIES}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why delete conditionnal link ? $<$<BOOL:BUILD_AMD>:${OpenCL_LIBRARIES}>
This macro add OpenCL_LIBRARIES only if BUILD_AMD is ON ;)
Let this macro in CMakeLists please.

Apply this everywhere you.

${LIB_CRYPTO_NVIDIA}
>
$<$<BOOL:BUILD_AMD>:${OpenCL_LIBRARIES}>
$<$<BOOL:BUILD_NVIDIA>:${CUDA_LIBRARY} ${CUDA_LIBRARIES} ${CUDA_NVRTC_LIBRARY} ${CUDA_NVPTX_LIBRARY} ${CUDA_NVRTC_BUILTINS_LIBRARY} ${LIB_BENCH_NVIDIA}>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please let multi lines link, better to read

        $<$<BOOL:BUILD_NVIDIA>:
            ${CUDA_LIBRARY}
            ${CUDA_LIBRARIES}
            ${CUDA_NVRTC_LIBRARY}
            ${CUDA_NVPTX_LIBRARY}
            ${CUDA_NVRTC_BUILTINS_LIBRARY}
            ${LIB_CRYPTO_NVIDIA}
        >

${CUDA_NVRTC_BUILTINS_LIBRARY}
${LIB_BENCH_NVIDIA}
>
$<$<BOOL:BUILD_NVIDIA>:${CUDA_LIBRARY} ${CUDA_LIBRARIES} ${CUDA_NVRTC_LIBRARY} ${CUDA_NVPTX_LIBRARY} ${CUDA_NVRTC_BUILTINS_LIBRARY} ${LIB_BENCH_NVIDIA}>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please let multi lines link, better to read

${LIB_CRYPTO_NVIDIA}
>
$<$<BOOL:BUILD_AMD>:${OpenCL_LIBRARIES}>
$<$<BOOL:BUILD_NVIDIA>:${CUDA_LIBRARY} ${CUDA_LIBRARIES} ${CUDA_NVRTC_LIBRARY} ${CUDA_NVPTX_LIBRARY} ${CUDA_NVRTC_BUILTINS_LIBRARY} ${LIB_BENCH_NVIDIA}>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please let multi lines link, better to read

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants