fireice-uk / xmr-stak

Free Monero RandomX Miner and unified CryptoNight miner
GNU General Public License v3.0
4.05k stars 1.79k forks source link

CMake Error at CMakeLists.txt:525 (add_executable): add_executable called with incorrect number of arguments #802

Closed mohamed786 closed 6 years ago

mohamed786 commented 6 years ago

Please provide as much as possible information to reproduce the issue.

Basic information

Compile issues

CMake Error at CMakeLists.txt:532 (target_link_libraries): Cannot specify link libraries for target "xmr-stak" which is not built by this project.

-- Configuring incomplete, errors occurred! See also "C:/Users/Mohamed786/Desktop/Build [XMR-STAK Miner]/xmr-stak-2.2.0/xmr-stak-2.2.0/build/CMakeFiles/CMakeOutput.log".

run cmake -LA . in the build folder and add the output here

C:\Users\mohamed786\Desktop\Build [XMR-STAK Miner]\xmr-stak-2.2.0\xmr-stak-2.2.0\build>cmake -LA
CMake Error: The source directory "C:/Users/mohamed786/Desktop/Build [XMR-STAK Miner]/xmr-stak-2.2.0/xmr-stak-2.2.0/build" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
-- Cache values
CMAKE_BUILD_TYPE:STRING=Release
CMAKE_CONFIGURATION_TYPES:STRING=Debug;Release;MinSizeRel;RelWithDebInfo
CMAKE_CXX_FLAGS:STRING=/DWIN32 /D_WINDOWS /W3 /GR /EHsc
CMAKE_CXX_FLAGS_DEBUG:STRING=/MDd /Zi /Ob0 /Od /RTC1
CMAKE_CXX_FLAGS_MINSIZEREL:STRING=/MD /O1 /Ob1 /DNDEBUG
CMAKE_CXX_FLAGS_RELEASE:STRING=/MD /O2 /Ob2 /DNDEBUG
CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=/MD /Zi /O2 /Ob1 /DNDEBUG
CMAKE_CXX_STANDARD_LIBRARIES:STRING=kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib
CMAKE_C_FLAGS:STRING=/DWIN32 /D_WINDOWS /W3
CMAKE_C_FLAGS_DEBUG:STRING=/MDd /Zi /Ob0 /Od /RTC1
CMAKE_C_FLAGS_MINSIZEREL:STRING=/MD /O1 /Ob1 /DNDEBUG
CMAKE_C_FLAGS_RELEASE:STRING=/MD /O2 /Ob2 /DNDEBUG
CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=/MD /Zi /O2 /Ob1 /DNDEBUG
CMAKE_C_STANDARD_LIBRARIES:STRING=kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib
CMAKE_EXE_LINKER_FLAGS:STRING=/machine:x64
CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL
CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO
CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL
CMAKE_INSTALL_PREFIX:PATH=C:/Users/mohamed786/Desktop/Build [XMR-STAK Miner]/xmr-stak-2.2.0/xmr-stak-2.2.0/build
CMAKE_LINKER:FILEPATH=D:/Microsoft-VisualStudio-2017/VC/Tools/MSVC/14.12.25827/bin/Hostx64/x64/link.exe
CMAKE_LINK_STATIC:BOOL=ON
CMAKE_MODULE_LINKER_FLAGS:STRING=/machine:x64
CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL
CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO
CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO
CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL
CMAKE_RC_COMPILER:FILEPATH=rc
CMAKE_RC_FLAGS:STRING=/DWIN32
CMAKE_RC_FLAGS_DEBUG:STRING=/D_DEBUG
CMAKE_RC_FLAGS_MINSIZEREL:STRING=
CMAKE_RC_FLAGS_RELEASE:STRING=
CMAKE_RC_FLAGS_RELWITHDEBINFO:STRING=
CMAKE_SHARED_LINKER_FLAGS:STRING=/machine:x64
CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=/debug /INCREMENTAL
CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=/INCREMENTAL:NO
CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=/INCREMENTAL:NO
CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=/debug /INCREMENTAL
CMAKE_SKIP_INSTALL_RPATH:BOOL=NO
CMAKE_SKIP_RPATH:BOOL=NO
CMAKE_STATIC_LINKER_FLAGS:STRING=/machine:x64
CMAKE_STATIC_LINKER_FLAGS_DEBUG:STRING=
CMAKE_STATIC_LINKER_FLAGS_MINSIZEREL:STRING=
CMAKE_STATIC_LINKER_FLAGS_RELEASE:STRING=
CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING=
CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE
CPU_ENABLE:BOOL=ON
CUDA_ENABLE:BOOL=OFF
HWLOC:FILEPATH=C:/xmr-stak-dep/hwloc/lib/libhwloc.lib
HWLOC_ENABLE:BOOL=ON
HWLOC_INCLUDE_DIR:PATH=C:/xmr-stak-dep/hwloc/include
LIB_EAY_DEBUG:FILEPATH=LIB_EAY_DEBUG-NOTFOUND
LIB_EAY_LIBRARY_DEBUG:FILEPATH=LIB_EAY_LIBRARY_DEBUG-NOTFOUND
LIB_EAY_RELEASE:FILEPATH=C:/xmr-stak-dep/openssl/lib/libeay32.lib
MHTD:FILEPATH=C:/xmr-stak-dep/libmicrohttpd/lib/libmicrohttpd.lib
MICROHTTPD_ENABLE:BOOL=ON
MTHD_INCLUDE_DIR:PATH=C:/xmr-stak-dep/libmicrohttpd/include
OPENSSL_INCLUDE_DIR:PATH=C:/xmr-stak-dep/openssl/include
OpenCL_ENABLE:BOOL=ON
OpenCL_INCLUDE_DIR:PATH=C:/Program Files (x86)/AMD APP SDK/3.0/include
OpenCL_LIBRARY:FILEPATH=C:/Program Files (x86)/AMD APP SDK/3.0/lib/x86_64/OpenCL.lib
OpenSSL_ENABLE:BOOL=ON
SSL_EAY_DEBUG:FILEPATH=SSL_EAY_DEBUG-NOTFOUND
SSL_EAY_LIBRARY_DEBUG:FILEPATH=SSL_EAY_LIBRARY_DEBUG-NOTFOUND
SSL_EAY_RELEASE:FILEPATH=C:/xmr-stak-dep/openssl/lib/ssleay32.lib
XMR-STAK_COMPILE:STRING=native
XMR-STAK_CURRENCY:STRING=all
# Issue with the execution
  - Do you compiled the miner by our own?
  ``` Yes 
  run `./xmr-stak --version-long` and add the output here

AMD OpenCl issue

  run `clinfo` and add the output here

Stability issue

JerichoJones commented 6 years ago

I use the below batch file to compile without issue with CUDA 8 or 9 (Separate compile machine per CUDA version). Change:

cmake -G "Visual Studio 15 2017 Win64" -T v141,host=x64 ..

to suit your CUDA version per the compile guide.

@echo off PUSHD %~DP0 echo ########## Running VsMSBuildCmd.bat CALL "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsMSBuildCmd.bat" PUSHD %~DP0 echo ########## Setting CMAKE_PREFIX_PATH set CMAKE_PREFIX_PATH=C:\xmr-stak-dep\hwloc;C:\xmr-stak-dep\libmicrohttpd;C:\xmr-stak-dep\openssl echo ########## Making build directory mkdir build echo ########## Changing to build directory cd build echo ########## Running cmake -G "Visual Studio 15 2017 Win64" -T v140,host=x64 .. cmake -G "Visual Studio 15 2017 Win64" -T v140,host=x64 .. echo ########## Running cmake --build . --config Release --target install cmake --build . --config Release --target install echo ########## Changing to bin\Release directory cd bin\Release echo ########## Copy OpenSSL DLLs xcopy C:\xmr-stak-dep\openssl\bin*.dll . /v echo ########## Running Explorer explorer.exe . echo ########## Done... Exiting POPD pause

mohamed786 commented 6 years ago

Thanks For the .bat file i will try it now ! basically am building for AMD !

mohamed786 commented 6 years ago

########## Running VsMSBuildCmd.bat

Visual Studio 2017 MSBuild Command Prompt Copyright (c) 2017 Microsoft Corporation

########## Setting CMAKE_PREFIX_PATH ########## Making build directory ########## Changing to build directory ########## Running cmake -G "Visual Studio 15 2017 Win64" -T v141,host=x64 .. -- The C compiler identification is MSVC 19.12.25831.0 -- The CXX compiler identification is MSVC 19.12.25831.0 -- Check for working C compiler: D:/Microsoft-VisualStudio-2017/VC/Tools/MSVC/14.12.25827/bin/Hostx64/x64/cl.exe -- Check for working C compiler: D:/Microsoft-VisualStudio-2017/VC/Tools/MSVC/14.12.25827/bin/Hostx64/x64/cl.exe -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler: D:/Microsoft-VisualStudio-2017/VC/Tools/MSVC/14.12.25827/bin/Hostx64/x64/cl.exe -- Check for working CXX compiler: D:/Microsoft-VisualStudio-2017/VC/Tools/MSVC/14.12.25827/bin/Hostx64/x64/cl.exe -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Set miner currency to 'monero' and 'aeon' -- Looking for CL_VERSION_2_0 -- Looking for CL_VERSION_2_0 - found -- Found OpenCL: C:/Program Files (x86)/AMD APP SDK/3.0/lib/x86_64/OpenCL.lib (found version "2.0") -- Found OpenSSL: C:/xmr-stak-dep/openssl/lib/libeay32.lib (found version "1.0.2m") You have called ADD_LIBRARY for library xmr-stak-c without any source files. This typically indicates a problem with your CMakeLists.txt file You have called ADD_LIBRARY for library xmr-stak-backend without any source files. This typically indicates a problem with your CMakeLists.txt file You have called ADD_LIBRARY for library xmrstak_opencl_backend without any source files. This typically indicates a problem with your CMakeLists.txt file CMake Error at CMakeLists.txt:525 (add_executable): add_executable called with incorrect number of arguments

CMake Error at CMakeLists.txt:532 (target_link_libraries): Cannot specify link libraries for target "xmr-stak" which is not built by this project.

-- Configuring incomplete, errors occurred! See also "C:/Users/mohamed786/Desktop/Build [XMR-STAK Miner]/xmr-stak-2.2.0/build/CMakeFiles/CMakeOutput.log". ########## Running cmake --build . --config Release --target install Microsoft (R) Build Engine version 15.5.180.51428 for .NET Framework Copyright (C) Microsoft Corporation. All rights reserved.

MSBUILD : error MSB1009: Project file does not exist. Switch: install.vcxproj ########## Changing to bin\Release directory The system cannot find the path specified. ########## Copy OpenSSL DLLs File not found - bin*.dll 0 File(s) copied ########## Running Explorer ########## Done... Exiting Press any key to continue . . .

Still the Same Error

JerichoJones commented 6 years ago

Do the files exist in the path indicated in ADD_LIBRARY as indicated by the error?


You have called ADD_LIBRARY for library xmr-stak-c without any source files. This typically indicates a problem with your CMakeLists.txt file
You have called ADD_LIBRARY for library xmr-stak-backend without any source files. This typically indicates a problem with your CMakeLists.txt file
You have called ADD_LIBRARY for library xmrstak_opencl_backend without any source files. This typically indicates a problem with your CMakeLists.txt file
``
mohamed786 commented 6 years ago

Do No where to add the PATH whether as i have to add path in CMakelist or in Windows Environment variable!

JerichoJones commented 6 years ago

Do No where to add the PATH whether as i have to add path in CMakelist or in Windows Environment variable!

Sorry but environment variables in Windows are a very basic knowledge item. If you do not understand them then compiling is going to be about impossible.

mohamed786 commented 6 years ago

instead of negative replay ! will you pls help me to resolve the issue ! nothing is impossible for me !

Note: Practice makes a man perfect !

mohamed786 commented 6 years ago

By the Way ! the compiling started now ! i will post the sucessful build image !

mohamed786 commented 6 years ago

How To FIX:

ERROR:

You have called ADD_LIBRARY for library xmr-stak-c without any source files. This typically indicates a problem with your CMakeLists.txt file You have called ADD_LIBRARY for library xmr-stak-backend without any source files. This typically indicates a problem with your CMakeLists.txt file You have called ADD_LIBRARY for library xmrstak_opencl_backend without any source files. This typically indicates a problem with your CMakeLists.txt file ``

FIX: Just Build in New Directory or in New Folder

for example : if you have build it on directory [C;\Users\Desktop\XMR-Stak\Build] Then Build it on [C;\Users\Desktop\XMR-Stak-1\Build]

BTC: 1Gwp6BkYndtkRXUSerbHR1NTq6iB8kzwBz BCH[BitcoinCash]: 1DEoTTmiosyasswGbvKYY559r22CDWBoNp

mohamed786 commented 6 years ago

@JerichoJones ## DONT UnderEstimate the POWER of a Comman man ! screenshot_4

JerichoJones commented 6 years ago

Well done!