RavenCommunity / kawpowminer

KawPow 0.9.4 implementation for Ravencoin
https://github.com/RavenProject/Ravencoin
GNU General Public License v3.0
232 stars 96 forks source link

Failed OSX build... documentation link doesn't work... #29

Open stevenmcastano opened 4 years ago

stevenmcastano commented 4 years ago

I got the following error while trying to build on a MacPro running MacOS 10.15.3:

darwin.compile.c++ bin.v2/libs/system/build/darwin-11.0.3/debug/link-static/threading-multi/visibility-hidden/error_code.o
clang: error: unknown argument: '-fcoalesce-templates'

    "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++" "-isysroot" "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk" "-std=c++11" "-isysroot" "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk"   -fvisibility-inlines-hidden -fcoalesce-templates -O0 -fno-inline -Wall -g -fvisibility=hidden -gdwarf-2 -fexceptions -Wno-long-double  -DBOOST_ALL_NO_LIB=1 -DBOOST_SYSTEM_STATIC_LINK=1  -I"." -c -o "bin.v2/libs/system/build/darwin-11.0.3/debug/link-static/threading-multi/visibility-hidden/error_code.o" "libs/system/src/error_code.cpp"

...failed darwin.compile.c++ bin.v2/libs/system/build/darwin-11.0.3/debug/link-static/threading-multi/visibility-hidden/error_code.o...
darwin.compile.c++ bin.v2/libs/system/build/darwin-11.0.3/release/link-static/threading-multi/visibility-hidden/error_code.o
clang: error: unknown argument: '-fcoalesce-templates'

    "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++" "-isysroot" "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk" "-std=c++11" "-isysroot" "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk"   -fvisibility-inlines-hidden -fcoalesce-templates -O3 -Wall -fvisibility=hidden -gdwarf-2 -fexceptions -Wno-long-double -Wno-inline  -DBOOST_ALL_NO_LIB=1 -DBOOST_SYSTEM_STATIC_LINK=1 -DNDEBUG  -I"." -c -o "bin.v2/libs/system/build/darwin-11.0.3/release/link-static/threading-multi/visibility-hidden/error_code.o" "libs/system/src/error_code.cpp"

...failed darwin.compile.c++ bin.v2/libs/system/build/darwin-11.0.3/release/link-static/threading-multi/visibility-hidden/error_code.o...
...skipped <pbin.v2/libs/system/build/darwin-11.0.3/release/link-static/threading-multi/visibility-hidden>libboost_system-mt.a(clean) for lack of <pbin.v2/libs/system/build/darwin-11.0.3/release/link-static/threading-multi/visibility-hidden>error_code.o...
...skipped <pbin.v2/libs/system/build/darwin-11.0.3/release/link-static/threading-multi/visibility-hidden>libboost_system-mt.a for lack of <pbin.v2/libs/system/build/darwin-11.0.3/release/link-static/threading-multi/visibility-hidden>error_code.o...
...skipped <p/Users/Steve/.hunter/_Base/e14bc15/5e2d6c9/196746b/Build/Boost/__system/Source/stage/lib>libboost_system-mt.a for lack of <pbin.v2/libs/system/build/darwin-11.0.3/release/link-static/threading-multi/visibility-hidden>libboost_system-mt.a...
...skipped <pbin.v2/libs/system/build/darwin-11.0.3/debug/link-static/threading-multi/visibility-hidden>libboost_system-mt-d.a(clean) for lack of <pbin.v2/libs/system/build/darwin-11.0.3/debug/link-static/threading-multi/visibility-hidden>error_code.o...
...skipped <pbin.v2/libs/system/build/darwin-11.0.3/debug/link-static/threading-multi/visibility-hidden>libboost_system-mt-d.a for lack of <pbin.v2/libs/system/build/darwin-11.0.3/debug/link-static/threading-multi/visibility-hidden>error_code.o...
...skipped <p/Users/Steve/.hunter/_Base/e14bc15/5e2d6c9/196746b/Build/Boost/__system/Source/stage/lib>libboost_system-mt-d.a for lack of <pbin.v2/libs/system/build/darwin-11.0.3/debug/link-static/threading-multi/visibility-hidden>libboost_system-mt-d.a...
...failed updating 2 targets...
...skipped 6 targets...
...updated 15 targets...
make[2]: *** [Boost-system-prefix/src/Boost-system-stamp/Boost-system-build] Error 1
make[1]: *** [CMakeFiles/Boost-system.dir/all] Error 2
make: *** [all] Error 2

[hunter ** FATAL ERROR **] Build step failed (dir: /Users/Steve/.hunter/_Base/e14bc15/5e2d6c9/196746b/Build/Boost/__system
[hunter ** FATAL ERROR **] [Directory:/Users/Steve/.hunter/_Base/Download/Hunter/0.23.214/e14bc15/Unpacked/cmake/projects/Boost/system]

------------------------------ ERROR -----------------------------
    https://docs.hunter.sh/en/latest/reference/errors/error.external.build.failed.html
------------------------------------------------------------------

CMake Error at /Users/Steve/.hunter/_Base/Download/Hunter/0.23.214/e14bc15/Unpacked/cmake/modules/hunter_error_page.cmake:12 (message):
Call Stack (most recent call first):
  /Users/Steve/.hunter/_Base/Download/Hunter/0.23.214/e14bc15/Unpacked/cmake/modules/hunter_fatal_error.cmake:20 (hunter_error_page)
  /Users/Steve/.hunter/_Base/Download/Hunter/0.23.214/e14bc15/Unpacked/cmake/modules/hunter_download.cmake:617 (hunter_fatal_error)
  /Users/Steve/.hunter/_Base/Download/Hunter/0.23.214/e14bc15/Unpacked/cmake/projects/Boost/system/hunter.cmake:16 (hunter_download)
  /Users/Steve/.hunter/_Base/Download/Hunter/0.23.214/e14bc15/Unpacked/cmake/modules/hunter_add_package.cmake:62 (include)
  CMakeLists.txt:56 (hunter_add_package)

-- Configuring incomplete, errors occurred!
uhrohraggy commented 4 years ago

FWIW, I was able to get past this part as of writing. Am on Catalina 10.15.5 (19F101) and receiving issues not being able to find CUDA paths.

-- Found the following Boost libraries:
--   system
--   filesystem
--   thread
-- [hunter] JSONCPP_ROOT: /Users/foo/.hunter/_Base/e14bc15/0926a03/196746b/Install (ver.: 1.8.0)
-- [hunter] ETHASH_ROOT: /Users/foo/.hunter/_Base/e14bc15/0926a03/196746b/Install (ver.: 1.0.0)
----------------------------------------------------------------------------
-- CMake 3.18.0-rc2
-- Build Release / Darwin
----------------------------------------------------------------- components
-- ETHASHCL         Build OpenCL components                      ON
-- ETHASHCUDA       Build CUDA components                        ON
-- ETHASHCPU        Build CPU components (only for development)  OFF
-- ETHDBUS          Build D-Bus components                       OFF
-- APICORE          Build API Server components                  ON
-- DEVBUILD         Build with dev logging                       OFF
----------------------------------------------------------------------------

CMake Error at /Applications/CMake.app/Contents/share/cmake-3.18/Modules/FindCUDA.cmake:715 (message):
  Specify CUDA_TOOLKIT_ROOT_DIR
Call Stack (most recent call first):
  libhwmon/CMakeLists.txt:19 (find_package)
uhrohraggy commented 4 years ago

Got it working by running it as cmake .. -DETHASHCUDA=OFF but as you can tell I don't really know whether that's good or just silencing a functionality issue down the road

After running the make command it built but running kawpow with a configured account and worker gives me

kawpowminer 1.2.3+commit.d46045ef
Build: darwin/release/appleclang

Unrecognized platform Apple
Error: No usable mining devices found

Likely related to https://github.com/RavenCommunity/kawpowminer/pull/27

andrei-kondakov commented 4 years ago

@stevenmcastano it's important to pay attention to following error: clang: error: unknown argument: '-fcoalesce-templates' This is a known bug when building boost and which was fixed in the new version. I can't name the exact version, but I tried 1.73 and everything builds fine. The Hunter that is used in the building installs the boost 1.70.

Therefore, I can suggest you install a newer version of boost and comment this line: https://github.com/RavenCommunity/kawpowminer/blob/master/CMakeLists.txt#L56. And then try to build again: https://github.com/RavenCommunity/kawpowminer#ubuntu--osx

johanneshahn commented 4 years ago

Change ./cmake/Hunter/config.cmake to

hunter_config(Boost VERSION 1.72.0-p1)

solved this for me (Catalina 10.15.7)

Evgengrmit commented 4 years ago

Good day everyone! Sorry, but I don't understand how to fix it on macOS Catalina 10.15.6 My CMakeLists.txt

cmake_minimum_required(VERSION 3.2)
include("cmake/HunterGate.cmake")
HunterGate(
        URL "https://github.com/cpp-pm/hunter/archive/v0.10.9.tar.gz"
        SHA1 "53b198e364dc7bc8360fc545f798563229bd7e20"
)
project(Foo)
hunter_add_package(Boost COMPONENTS  regex system filesystem)
find_package(Boost CONFIG REQUIRED  regex system filesystem)
add_executable(foo main.cpp)
target_link_libraries(foo PUBLIC  Boost::regex Boost::system Boost::filesystem)

My Error

[ 66%] Performing build step for 'Boost-regex'
CMake Error at /Users/evgengrmit/.hunter/_Base/53b198e/1c72480/3ff7083/Build/Boost/__regex/Build/Boost-regex-prefix/src/Boost-regex-stamp/Boost-regex-build-.cmake:49 (message):
  Command failed: 1

   './b2' '-a' 'link=static' 'threading=multi' 'variant=debug,release' '--layout=tagged' 'toolset=darwin' '--user-config=/Users/evgengrmit/.hunter/_Base/53b198e/1c72480/3ff7083/Build/Boost/__regex/Build/boost.user.jam' '--with-regex' 'cxxflags= -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk' '-j' '12'

  See also

    /Users/evgengrmit/.hunter/_Base/53b198e/1c72480/3ff7083/Build/Boost/__regex/Build/Boost-regex-prefix/src/Boost-regex-stamp/Boost-regex-build-*.log

make[3]: *** [Boost-regex-prefix/src/Boost-regex-stamp/Boost-regex-build] Error 1
make[2]: *** [CMakeFiles/Boost-regex.dir/all] Error 2
make[1]: *** [all] Error 2

[hunter ** FATAL ERROR **] Build step failed (dir: /Users/evgengrmit/.hunter/_Base/53b198e/1c72480/3ff7083/Build/Boost/__regex
[hunter ** FATAL ERROR **] [Directory:/Users/evgengrmit/.hunter/_Base/Download/Hunter/0.10.9/53b198e/Unpacked/cmake/projects/Boost/regex]

------------------------------ WIKI -------------------------------
    https://github.com/ruslo/hunter/wiki/error.external.build.failed
-------------------------------------------------------------------

CMake Error at /Users/evgengrmit/.hunter/_Base/Download/Hunter/0.10.9/53b198e/Unpacked/cmake/modules/hunter_wiki.cmake:12 (message):
Call Stack (most recent call first):
  /Users/evgengrmit/.hunter/_Base/Download/Hunter/0.10.9/53b198e/Unpacked/cmake/modules/hunter_fatal_error.cmake:20 (hunter_wiki)
  /Users/evgengrmit/.hunter/_Base/Download/Hunter/0.10.9/53b198e/Unpacked/cmake/modules/hunter_download.cmake:384 (hunter_fatal_error)
  /Users/evgengrmit/.hunter/_Base/Download/Hunter/0.10.9/53b198e/Unpacked/cmake/projects/Boost/regex/hunter.cmake:20 (hunter_download)
  /Users/evgengrmit/.hunter/_Base/Download/Hunter/0.10.9/53b198e/Unpacked/cmake/modules/hunter_add_package.cmake:72 (include)
  CMakeLists.txt:8 (hunter_add_package)

-- Configuring incomplete, errors occurred!
spyder46n2 commented 4 years ago

Good day everyone! Sorry, but I don't understand how to fix it on macOS Catalina 10.15.6 My CMakeLists.txt

cmake_minimum_required(VERSION 3.2)
include("cmake/HunterGate.cmake")
HunterGate(
        URL "https://github.com/cpp-pm/hunter/archive/v0.10.9.tar.gz"
        SHA1 "53b198e364dc7bc8360fc545f798563229bd7e20"
)
project(Foo)
hunter_add_package(Boost COMPONENTS  regex system filesystem)
find_package(Boost CONFIG REQUIRED  regex system filesystem)
add_executable(foo main.cpp)
target_link_libraries(foo PUBLIC  Boost::regex Boost::system Boost::filesystem)

My Error

[ 66%] Performing build step for 'Boost-regex'
CMake Error at /Users/evgengrmit/.hunter/_Base/53b198e/1c72480/3ff7083/Build/Boost/__regex/Build/Boost-regex-prefix/src/Boost-regex-stamp/Boost-regex-build-.cmake:49 (message):
  Command failed: 1

   './b2' '-a' 'link=static' 'threading=multi' 'variant=debug,release' '--layout=tagged' 'toolset=darwin' '--user-config=/Users/evgengrmit/.hunter/_Base/53b198e/1c72480/3ff7083/Build/Boost/__regex/Build/boost.user.jam' '--with-regex' 'cxxflags= -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk' '-j' '12'

  See also

    /Users/evgengrmit/.hunter/_Base/53b198e/1c72480/3ff7083/Build/Boost/__regex/Build/Boost-regex-prefix/src/Boost-regex-stamp/Boost-regex-build-*.log

make[3]: *** [Boost-regex-prefix/src/Boost-regex-stamp/Boost-regex-build] Error 1
make[2]: *** [CMakeFiles/Boost-regex.dir/all] Error 2
make[1]: *** [all] Error 2

[hunter ** FATAL ERROR **] Build step failed (dir: /Users/evgengrmit/.hunter/_Base/53b198e/1c72480/3ff7083/Build/Boost/__regex
[hunter ** FATAL ERROR **] [Directory:/Users/evgengrmit/.hunter/_Base/Download/Hunter/0.10.9/53b198e/Unpacked/cmake/projects/Boost/regex]

------------------------------ WIKI -------------------------------
    https://github.com/ruslo/hunter/wiki/error.external.build.failed
-------------------------------------------------------------------

CMake Error at /Users/evgengrmit/.hunter/_Base/Download/Hunter/0.10.9/53b198e/Unpacked/cmake/modules/hunter_wiki.cmake:12 (message):
Call Stack (most recent call first):
  /Users/evgengrmit/.hunter/_Base/Download/Hunter/0.10.9/53b198e/Unpacked/cmake/modules/hunter_fatal_error.cmake:20 (hunter_wiki)
  /Users/evgengrmit/.hunter/_Base/Download/Hunter/0.10.9/53b198e/Unpacked/cmake/modules/hunter_download.cmake:384 (hunter_fatal_error)
  /Users/evgengrmit/.hunter/_Base/Download/Hunter/0.10.9/53b198e/Unpacked/cmake/projects/Boost/regex/hunter.cmake:20 (hunter_download)
  /Users/evgengrmit/.hunter/_Base/Download/Hunter/0.10.9/53b198e/Unpacked/cmake/modules/hunter_add_package.cmake:72 (include)
  CMakeLists.txt:8 (hunter_add_package)

-- Configuring incomplete, errors occurred!

There is an active PR to fix this, but until then you can use this version of the source as it has the fixes needed to build on OSX: https://github.com/hwh57/kawpowminer.git

Evgengrmit commented 4 years ago

Thank you! It's really helping!

eyeballologist commented 3 years ago

@spyder46n2 I tried the link you mentioned and it seemed to build a lot better than previous attempts. However, when I actually try to mine, here's what I get: My command:

kawpowminer/build/kawpowminer/kawpowminer -P stratum+tcp://eyeballologist8.workername@us-east.kawpow-hub.miningpoolhub.com:20611

Output:

kawpowminer 1.2.3+commit.6defed0d Build: darwin/release/appleclang

i 22:56:52 Configured pool us-east.kawpow-hub.miningpoolhub.com:20611 i 22:56:52 Selected pool us-east.kawpow-hub.miningpoolhub.com:20611 i 22:56:52 Stratum mode : Stratum i 22:56:52 Established connection to us-east.kawpow-hub.miningpoolhub.com [45.79.192.137:20611] i 22:56:52 Spinning up miners... i 22:56:52 Extranonce set to 2872 cl 22:56:52 cl-0 Creating buffers cl 22:56:52 cl-0 Using PciId : AMD Radeon Pro 5300M Compute Engine OpenCL 1.2 Memory : 3.98 GB i 22:56:52 cl-0 Adjusting CL work multiplier for 20 CUs. Adjusted work multiplier: 18,205 i 22:56:52 New target set to: 00000009f5ffffffffff80000000000000000000000000000000000000000000 i 22:56:52 Epoch : 221 Difficulty : 431.17 Mh i 22:56:52 Job: b7d540c8… block 1663094 us-east.kawpow-hub.miningpoolhub.com [45.79.192.137:20611] i 22:56:54 Authorized worker eyeballologist8.workername i 22:56:54 New target set to: 00000009f6000000000000000000000000000000000000000000000000000000 cl 22:56:54 cl-0 Unable to lower compiler priority. X 22:56:54 cl-0 OpenCL kernel build log:

:220:6: warning: no previous prototype for function 'keccak_f800_round' void keccak_f800_round(uint32_t st[25], const int r) ^ :265:10: warning: no previous prototype for function 'keccak_f800' uint64_t keccak_f800(uint32_t* st) ^ :272:1: warning: control reaches end of non-void function } ^ :284:10: warning: no previous prototype for function 'kiss99' uint32_t kiss99(kiss99_t* st) ^ :296:6: warning: no previous prototype for function 'fill_mix' void fill_mix(local uint32_t* seed, uint32_t lane_id, uint32_t* mix) ^ :409:18: error: passing 'uint32_t *' (aka 'unsigned int *') to parameter of type '__local uint32_t *' (aka '__local unsigned int *') changes address space of pointer fill_mix(share[group_id].uint32s, lane_id, mix); ^~~~~~~~~~~~~~~~~~~~~~~ :296:31: note: passing argument to parameter 'seed' here void fill_mix(local uint32_t* seed, uint32_t lane_id, uint32_t* mix) ^ :491:9: warning: 'FNV_PRIME' macro redefined #define FNV_PRIME 0x01000193 ^ :185:9: note: previous definition is here #define FNV_PRIME 0x1000193 ^ :537:26: warning: unknown OpenCL extension 'cl_amd_media_ops' - ignoring #pragma OPENCL EXTENSION cl_amd_media_ops : enable ^ :542:16: warning: implicit declaration of function 'amd_bitalign' is invalid in C99 return amd_bitalign((vv).xy, (vv).yx, 32 - r); ^ X 22:56:54 cl-0 OpenCL kernel build error (-11): clBuildProgram cl 22:56:54 cl-0 Loaded period 554,364 progpow kernel cl 22:56:54 cl-0 Unable to lower compiler priority. X 22:56:54 cl-0 OpenCL kernel build log: :220:6: warning: no previous prototype for function 'keccak_f800_round' void keccak_f800_round(uint32_t st[25], const int r) ^ :265:10: warning: no previous prototype for function 'keccak_f800' uint64_t keccak_f800(uint32_t* st) ^ :272:1: warning: control reaches end of non-void function } ^ :284:10: warning: no previous prototype for function 'kiss99' uint32_t kiss99(kiss99_t* st) ^ :296:6: warning: no previous prototype for function 'fill_mix' void fill_mix(local uint32_t* seed, uint32_t lane_id, uint32_t* mix) ^ :409:18: error: passing 'uint32_t *' (aka 'unsigned int *') to parameter of type '__local uint32_t *' (aka '__local unsigned int *') changes address space of pointer fill_mix(share[group_id].uint32s, lane_id, mix); ^~~~~~~~~~~~~~~~~~~~~~~ :296:31: note: passing argument to parameter 'seed' here void fill_mix(local uint32_t* seed, uint32_t lane_id, uint32_t* mix) ^ :491:9: warning: 'FNV_PRIME' macro redefined #define FNV_PRIME 0x01000193 ^ :185:9: note: previous definition is here #define FNV_PRIME 0x1000193 ^ :537:26: warning: unknown OpenCL extension 'cl_amd_media_ops' - ignoring #pragma OPENCL EXTENSION cl_amd_media_ops : enable ^ :542:16: warning: implicit declaration of function 'amd_bitalign' is invalid in C99 return amd_bitalign((vv).xy, (vv).yx, 32 - r); ^ X 22:56:54 cl-0 OpenCL kernel build error (-11): clBuildProgram m 22:56:57 0:00 A0 0.00 h - cl0 0.00 m 22:57:02 0:00 A0 0.00 h - cl0 0.00 m 22:57:07 0:00 A0 0.00 h - cl0 0.00

Any thoughts on this? It's choosing the correct card (5300M) but has a OpenCL kernel build error (-11). Is this due to Macs only going to OpenCL 1.2? Thanks!

tachyon-ops commented 3 years ago

There is an active PR to fix this, but until then you can use this version of the source as it has the fixes needed to build on OSX: https://github.com/hwh57/kawpowminer.git

Thanks! Still compiling but at least I am way past that initial error.

saltzmanjoelh commented 2 years ago

I used that repo from hwh57 and it compiles but I get the same results as @eyeballologist. It runs, with a warning and the hash rate shows 0.00 h