fireice-uk / xmr-stak

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

error: invalid conversion from ‘int (xmr-stak-1.0.5-rx) #2685

Open Ultracaine opened 4 years ago

Ultracaine commented 4 years ago

... are the placeholder for your answers. Please answer each question!

Describe the bug A clear and concise description of what the bug is.

Which operating system do you use?

System:    Host: Ryzen Kernel: 5.7.14-1-MANJARO x86_64 bits: 64 compiler: gcc v: 10.1.0 Desktop: KDE Plasma 5.19.4 
           Distro: Manjaro Linux 
Machine:   Type: Desktop Mobo: ASUSTeK model: PRIME X370-PRO v: Rev X.0x serial: <superuser/root required> 
           UEFI: American Megatrends v: 5603 date: 07/28/2020 
Battery:   ID-1: hidpp_battery_0 charge: N/A condition: N/A model: Logitech Gaming Mouse G900 status: Charging 
CPU:       Topology: 8-Core model: AMD Ryzen 7 2700X bits: 64 type: MT MCP arch: Zen+ rev: 2 L2 cache: 4096 KiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm bogomips: 118223 
           Speed: 2805 MHz min/max: 2200/3700 MHz Core speeds (MHz): 1: 2924 2: 1713 3: 1984 4: 1862 5: 1903 6: 2180 7: 2196 
           8: 2196 9: 1792 10: 1716 11: 1884 12: 2254 13: 2195 14: 2198 15: 2537 16: 1991 
Graphics:  Device-1: Advanced Micro Devices [AMD/ATI] Vega 10 XL/XT [Radeon RX Vega 56/64] vendor: ASUSTeK driver: amdgpu 
           v: kernel bus ID: 0c:00.0 
           Display: x11 server: X.Org 1.20.8 driver: amdgpu FAILED: ati unloaded: modesetting s-res: 3440x1440 
           OpenGL: renderer: Radeon RX Vega (VEGA10 DRM 3.37.0 5.7.14-1-MANJARO LLVM 10.0.1) v: 4.6 Mesa 20.1.5 
           direct render: Yes 
Audio:     Device-1: Advanced Micro Devices [AMD/ATI] Vega 10 HDMI Audio [Radeon Vega 56/64] driver: snd_hda_intel v: kernel 
           bus ID: 0c:00.1 
           Device-2: Advanced Micro Devices [AMD] Family 17h HD Audio vendor: ASUSTeK driver: snd_hda_intel v: kernel 
           bus ID: 0e:00.3 
           Sound Server: ALSA v: k5.7.14-1-MANJARO 
Network:   Device-1: Intel I211 Gigabit Network vendor: ASUSTeK driver: igb v: 5.6.0-k port: e000 bus ID: 08:00.0 
           IF: enp8s0 state: up speed: 100 Mbps duplex: full mac: 04:92:26:da:03:5f 
Drives:    Local Storage: total: 7.55 TiB used: 715.52 GiB (9.3%) 
           ID-1: /dev/nvme0n1 vendor: A-Data model: SX8200PNP size: 1.86 TiB 
           ID-2: /dev/sda vendor: Crucial model: CT1000MX500SSD1 size: 931.51 GiB 
           ID-3: /dev/sdb vendor: Toshiba model: TR150 size: 223.57 GiB 
           ID-4: /dev/sdc vendor: Seagate model: ST4000DM004-2CV104 size: 3.64 TiB 
           ID-5: /dev/sdd vendor: Seagate model: ST31000524AS size: 931.51 GiB 
           ID-6: /dev/sde type: USB model: SMI USB size: 7.62 GiB 
Partition: ID-1: / size: 180.00 GiB used: 10.17 GiB (5.6%) fs: f2fs dev: /dev/sdb3 
           ID-2: /boot size: 503.9 MiB used: 53.3 MiB (10.6%) fs: ext2 dev: /dev/sdb1 
Swap:      Alert: No Swap data was found. 
Sensors:   System Temperatures: cpu: 42.1 C mobo: N/A gpu: amdgpu temp: 54 C 
           Fan Speeds (RPM): N/A gpu: amdgpu fan: 1161 
Info:      Processes: 334 Uptime: 20m Memory: 31.36 GiB used: 2.18 GiB (6.9%) Init: systemd Compilers: gcc: 10.1.0 
           Packages: 1026 Shell: Bash v: 5.0.18 inxi: 3.1.05 

To Reproduce

[user@Ryzen xmr-stak-1.0.5-rx]$ cmake -S .
-- The C compiler identification is GNU 10.1.0
-- The CXX compiler identification is GNU 10.1.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found OpenSSL: /usr/lib/libcrypto.so (found version "1.1.1g")  
fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/Downloads/xmr-stak-1.0.5-rx
[user@Ryzen xmr-stak-1.0.5-rx]$ make
Scanning dependencies of target xmr-stak-randomx
[  2%] Building CXX object CMakeFiles/xmr-stak-randomx.dir/xmrstak/backend/cpu/crypto/randomx/aes_hash.cpp.o
[  4%] Building CXX object CMakeFiles/xmr-stak-randomx.dir/xmrstak/backend/cpu/crypto/randomx/allocator.cpp.o
[  6%] Building C object CMakeFiles/xmr-stak-randomx.dir/xmrstak/backend/cpu/crypto/randomx/argon2_core.c.o
[  8%] Building C object CMakeFiles/xmr-stak-randomx.dir/xmrstak/backend/cpu/crypto/randomx/argon2_ref.c.o
[ 10%] Building CXX object CMakeFiles/xmr-stak-randomx.dir/xmrstak/backend/cpu/crypto/randomx/blake2_generator.cpp.o
[ 12%] Building C object CMakeFiles/xmr-stak-randomx.dir/xmrstak/backend/cpu/crypto/randomx/blake2/blake2b.c.o
[ 14%] Building CXX object CMakeFiles/xmr-stak-randomx.dir/xmrstak/backend/cpu/crypto/randomx/bytecode_machine.cpp.o
[ 17%] Building CXX object CMakeFiles/xmr-stak-randomx.dir/xmrstak/backend/cpu/crypto/randomx/dataset.cpp.o
[ 19%] Building CXX object CMakeFiles/xmr-stak-randomx.dir/xmrstak/backend/cpu/crypto/randomx/instructions_portable.cpp.o
[ 21%] Building CXX object CMakeFiles/xmr-stak-randomx.dir/xmrstak/backend/cpu/crypto/randomx/randomx.cpp.o
[ 23%] Building C object CMakeFiles/xmr-stak-randomx.dir/xmrstak/backend/cpu/crypto/randomx/reciprocal.c.o
[ 25%] Building CXX object CMakeFiles/xmr-stak-randomx.dir/xmrstak/backend/cpu/crypto/randomx/soft_aes.cpp.o
[ 27%] Building CXX object CMakeFiles/xmr-stak-randomx.dir/xmrstak/backend/cpu/crypto/randomx/superscalar.cpp.o
[ 29%] Building CXX object CMakeFiles/xmr-stak-randomx.dir/xmrstak/backend/cpu/crypto/randomx/virtual_machine.cpp.o
[ 31%] Building CXX object CMakeFiles/xmr-stak-randomx.dir/xmrstak/backend/cpu/crypto/randomx/virtual_memory.cpp.o
[ 34%] Building CXX object CMakeFiles/xmr-stak-randomx.dir/xmrstak/backend/cpu/crypto/randomx/vm_compiled_light.cpp.o
[ 36%] Building CXX object CMakeFiles/xmr-stak-randomx.dir/xmrstak/backend/cpu/crypto/randomx/vm_compiled.cpp.o
[ 38%] Building CXX object CMakeFiles/xmr-stak-randomx.dir/xmrstak/backend/cpu/crypto/randomx/vm_interpreted_light.cpp.o
[ 40%] Building CXX object CMakeFiles/xmr-stak-randomx.dir/xmrstak/backend/cpu/crypto/randomx/vm_interpreted.cpp.o
[ 42%] Building C object CMakeFiles/xmr-stak-randomx.dir/xmrstak/backend/cpu/crypto/randomx/jit_compiler_x86_static.S.o
[ 44%] Building CXX object CMakeFiles/xmr-stak-randomx.dir/xmrstak/backend/cpu/crypto/randomx/jit_compiler_x86.cpp.o
[ 46%] Building CXX object CMakeFiles/xmr-stak-randomx.dir/xmrstak/backend/cpu/crypto/common/VirtualMemory_unix.cpp.o
[ 48%] Linking CXX static library bin/libxmr-stak-randomx.a
[ 48%] Built target xmr-stak-randomx
Scanning dependencies of target xmr-stak-rx-backend
[ 51%] Building CXX object CMakeFiles/xmr-stak-rx-backend.dir/xmrstak/backend/backendConnector.cpp.o
[ 53%] Building CXX object CMakeFiles/xmr-stak-rx-backend.dir/xmrstak/backend/cpu/cpuType.cpp.o
[ 55%] Building CXX object CMakeFiles/xmr-stak-rx-backend.dir/xmrstak/backend/cpu/crypto/cryptonight_1.cpp.o
[ 57%] Building CXX object CMakeFiles/xmr-stak-rx-backend.dir/xmrstak/backend/cpu/crypto/cryptonight_common.cpp.o
[ 59%] Building CXX object CMakeFiles/xmr-stak-rx-backend.dir/xmrstak/backend/cpu/hwlocHelper.cpp.o
[ 61%] Building CXX object CMakeFiles/xmr-stak-rx-backend.dir/xmrstak/backend/cpu/jconf.cpp.o
[ 63%] Building CXX object CMakeFiles/xmr-stak-rx-backend.dir/xmrstak/backend/cpu/minethd.cpp.o
[ 65%] Building CXX object CMakeFiles/xmr-stak-rx-backend.dir/xmrstak/backend/globalStates.cpp.o
[ 68%] Building CXX object CMakeFiles/xmr-stak-rx-backend.dir/xmrstak/http/httpd.cpp.o
/home/user/Downloads/xmr-stak-1.0.5-rx/xmrstak/http/httpd.cpp: In member function ‘bool httpd::start_daemon()’:
/home/user/Downloads/xmr-stak-1.0.5-rx/xmrstak/http/httpd.cpp:162:3: error: invalid conversion from ‘int (*)(void*, MHD_Connection*, const char*, const char*, const char*, const char*, size_t*, void**)’ {aka ‘int (*)(void*, MHD_Connection*, const char*, const char*, const char*, const char*, long unsigned int*, void**)’} to ‘MHD_AccessHandlerCallback’ {aka ‘MHD_Result (*)(void*, MHD_Connection*, const char*, const char*, const char*, const char*, long unsigned int*, void**)’} [-fpermissive]
  162 |   &httpd::req_handler,
      |   ^~~~~~~~~~~~~~~~~~~
      |   |
      |   int (*)(void*, MHD_Connection*, const char*, const char*, const char*, const char*, size_t*, void**) {aka int (*)(void*, MHD_Connection*, const char*, const char*, const char*, const char*, long unsigned int*, void**)}
In file included from /home/user/Downloads/xmr-stak-1.0.5-rx/xmrstak/http/httpd.cpp:38:
/usr/include/microhttpd.h:2428:45: note:   initializing argument 5 of ‘MHD_Daemon* MHD_start_daemon(unsigned int, uint16_t, MHD_AcceptPolicyCallback, void*, MHD_AccessHandlerCallback, void*, ...)’
 2428 |                   MHD_AccessHandlerCallback dh, void *dh_cls,
      |                   ~~~~~~~~~~~~~~~~~~~~~~~~~~^~
make[2]: *** [CMakeFiles/xmr-stak-rx-backend.dir/build.make:186: CMakeFiles/xmr-stak-rx-backend.dir/xmrstak/http/httpd.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:127: CMakeFiles/xmr-stak-rx-backend.dir/all] Error 2
make: *** [Makefile:149: all] Error 2

Additional information.

[user@Ryzen xmr-stak-1.0.5-rx]$ cmake -LA
CMake Warning:
  No source or binary directory provided.  Both will be assumed to be the
  same as the current working directory, but note that this warning will
  become a fatal error in future CMake releases.

fatal: not a git repository (or any of the parent directories): .git
fatal: not a git repository (or any of the parent directories): .git
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/Downloads/xmr-stak-1.0.5-rx
-- Cache values
CMAKE_ADDR2LINE:FILEPATH=/usr/bin/addr2line
CMAKE_AR:FILEPATH=/usr/bin/ar
CMAKE_BUILD_TYPE:STRING=Release
CMAKE_COLOR_MAKEFILE:BOOL=ON
CMAKE_CXX_COMPILER:FILEPATH=/usr/bin/c++
CMAKE_CXX_COMPILER_AR:FILEPATH=/usr/bin/gcc-ar
CMAKE_CXX_COMPILER_RANLIB:FILEPATH=/usr/bin/gcc-ranlib
CMAKE_CXX_FLAGS:STRING=
CMAKE_CXX_FLAGS_DEBUG:STRING=-g
CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG
CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG
CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG
CMAKE_C_COMPILER:FILEPATH=/usr/bin/cc
CMAKE_C_COMPILER_AR:FILEPATH=/usr/bin/gcc-ar
CMAKE_C_COMPILER_RANLIB:FILEPATH=/usr/bin/gcc-ranlib
CMAKE_C_FLAGS:STRING=
CMAKE_C_FLAGS_DEBUG:STRING=-g
CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG
CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG
CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG
CMAKE_DLLTOOL:FILEPATH=CMAKE_DLLTOOL-NOTFOUND
CMAKE_EXE_LINKER_FLAGS:STRING=
CMAKE_EXE_LINKER_FLAGS_DEBUG:STRING=
CMAKE_EXE_LINKER_FLAGS_MINSIZEREL:STRING=
CMAKE_EXE_LINKER_FLAGS_RELEASE:STRING=
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=
CMAKE_INSTALL_PREFIX:PATH=/home/user/Downloads/xmr-stak-1.0.5-rx
CMAKE_LINKER:FILEPATH=/usr/bin/ld
CMAKE_LINK_STATIC:BOOL=OFF
CMAKE_MAKE_PROGRAM:FILEPATH=/usr/bin/make
CMAKE_MODULE_LINKER_FLAGS:STRING=
CMAKE_MODULE_LINKER_FLAGS_DEBUG:STRING=
CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL:STRING=
CMAKE_MODULE_LINKER_FLAGS_RELEASE:STRING=
CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
CMAKE_NM:FILEPATH=/usr/bin/nm
CMAKE_OBJCOPY:FILEPATH=/usr/bin/objcopy
CMAKE_OBJDUMP:FILEPATH=/usr/bin/objdump
CMAKE_RANLIB:FILEPATH=/usr/bin/ranlib
CMAKE_READELF:FILEPATH=/usr/bin/readelf
CMAKE_SHARED_LINKER_FLAGS:STRING=
CMAKE_SHARED_LINKER_FLAGS_DEBUG:STRING=
CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL:STRING=
CMAKE_SHARED_LINKER_FLAGS_RELEASE:STRING=
CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=
CMAKE_SKIP_INSTALL_RPATH:BOOL=NO
CMAKE_SKIP_RPATH:BOOL=NO
CMAKE_STATIC_LINKER_FLAGS:STRING=
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_STRIP:FILEPATH=/usr/bin/strip
CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE
CPU_ENABLE:BOOL=ON
CUDA_ENABLE:BOOL=OFF
EXECUTABLE_OUTPUT_PATH:STRING=bin
HWLOC:FILEPATH=/usr/lib/libhwloc.so
HWLOC_ENABLE:BOOL=ON
HWLOC_INCLUDE_DIR:PATH=/usr/include
LIBRARY_OUTPUT_PATH:STRING=bin
MHTD:FILEPATH=/usr/lib/libmicrohttpd.so
MICROHTTPD_ENABLE:BOOL=ON
MTHD_INCLUDE_DIR:PATH=/usr/include
OPENSSL_CRYPTO_LIBRARY:FILEPATH=/usr/lib/libcrypto.so
OPENSSL_INCLUDE_DIR:PATH=/usr/include
OPENSSL_SSL_LIBRARY:FILEPATH=/usr/lib/libssl.so
OpenCL_ENABLE:BOOL=OFF
OpenSSL_ENABLE:BOOL=ON
PKG_CONFIG_EXECUTABLE:FILEPATH=/usr/bin/pkg-config
XMR-STAK_COMPILE:STRING=native
pkgcfg_lib__OPENSSL_crypto:FILEPATH=/usr/lib/libcrypto.so
pkgcfg_lib__OPENSSL_ssl:FILEPATH=/usr/lib/libssl.so

Feel free to add more information.

I hope you doing well
Might be issue related to GCC 10.1
Thank you
pscopic commented 4 years ago

I'm having this problem when compiling this package too, throwing the invalid conversion error. Any luck with this?

DGdev91 commented 4 years ago

Had the same issue, i'm on ArchLinux, wich currently has libmicrohttpd 0.9.71 in it's repos, wich is slightly newer form the version used for the release (0.9.60), maybe that's the issue.

Anyway, i tried to make it work. opened a pull request https://github.com/fireice-uk/xmr-stak/pull/2688

You can try to compile the code from my fork, let me know if my fix works for you

hobbes1069 commented 3 years ago

Same problem with Fedora 33.

hobbes1069 commented 3 years ago

I can confirm the commit a4a2b84 fixes it for me.

z5612365 commented 3 years ago

@hobbes1069 same here, thanks bro