WyvernTKC / cpuminer-gr-avx2

Optimised Version of GR miner for RTM
GNU General Public License v2.0
371 stars 193 forks source link

Compiling for Windows #143

Closed ShazAu closed 2 years ago

ShazAu commented 2 years ago

Hi, I'm trying to compile the miner for Windows and have run into trouble. I've been following the instructions found in the INSTALL_WINDOWS. I'm a windows guy so I found this hard to follow. I'll give a brief summary of the current issue and then a full set of steps that I followed to get this far. Apologies for the wall of text!

Under step 4 copying files to the releases folder I have 3 files that fail to copy This copy fails _cp $GCC_MINGWLIB/libstdc++-6.dll release/ cp: cannot stat '/usr/lib/gcc/x86_64-w64-mingw32/10-win32/libstdc++-6.dll': No such file or directory

This copy also fails _cp $GCC_MINGW_LIB/libgcc_sseh-1.dll release/ cp: cannot stat '/usr/lib/gcc/x86_64-w64-mingw32/10-win32/libgcc_s_seh-1.dll': No such file or directory

This copy also failed _cp $LOCAL_LIB/openssl/libcrypto-11-x64.dll release/ The above file doesn't exist even though the make of openssl did not report errors, copied the following file instead, thought it might be a versioning thing: _cp $LOCALLIB/openssl/libcrypto-3-x64.dll release/

Trying to compile the application as is causes fatal errors, no such file or directory for: curl/curl.h openssl/sha.h

Complete build steps so far:

I'm running the latest version of Linux Mint xfce (20.2 Uma) 64bit Installed the pre reqs: sudo apt-get install build-essential automake libssl-dev libcurl4-openssl-dev libjansson-dev libgmp-dev zlib1g-dev libnuma-dev git Cloned the source from Git: git clone https://github.com/WyvernTKC/cpuminer-gr-avx2 Installed mingw-w64: sudo apt-get install mingw-w64 libz-mingw-w64-dev Created the $HOME/usr/lib folder, ($HOME/shaz/lib in my case: mkdir lib Changed directory to the lib folder cd lib Cloned openssl from Git: git clone https://github.com/openssl/openssl/ Cloned curl from Git: git clone https://github.com/curl/curl Downloaded gmp and extracted to $HOME/shaz/lib/gmp/gmp-6.2.1

Configured mingw64 options _./Configure mingw64 shared --cross-compile-prefix=x8664-w64-mingw32- Compiled mingw64 (using 3 cores) make -j 3

Curl, changed directory to curl folder cd cd lib/curl/ Install additional pre-requisites _sudo apt-get install autoconf automake libtool perl Configure Curl autoreconf -fi ./configure --with-winssl --with-winidn --with-schannel --host=x8664-w64-mingw32 Compile curl (using 3 cores) make -j 3

gmp, changed directory to gmp folder cd cd lib/gmp/gmp-6.2.1 ./configure --host=x86_64-w64-mingw32 make -j 3

export LOCAL_LIB="$HOME/usr/lib" export CONFIGURE_ARGS="--with-curl=$LOCAL_LIB/curl --with-crypto=$LOCAL_LIB/openssl --host=x86_64-w64-mingw32" export MINGW_LIB="/usr/x86_64-w64-mingw32/lib" export GCC_MINGW_LIB="/usr/lib/gcc/x86_64-w64-mingw32/10-win32"

Make the release folder cd mkdir release

Copy files _cp $MINGW_LIB/zlib1.dll release/ cp $MINGWLIB/libwinpthread-1.dll release/

This copy fails _cp $GCC_MINGWLIB/libstdc++-6.dll release/ cp: cannot stat '/usr/lib/gcc/x86_64-w64-mingw32/10-win32/libstdc++-6.dll': No such file or directory This copy also fails _cp $GCC_MINGW_LIB/libgcc_sseh-1.dll release/ cp: cannot stat '/usr/lib/gcc/x86_64-w64-mingw32/10-win32/libgcc_s_seh-1.dll': No such file or directory

This copy also failed _cp $LOCAL_LIB/openssl/libcrypto-11-x64.dll release/ file doesn't exist even thought make of openssl did not report errors, copied the following file instead, thought it might be a versioning thing _cp $LOCALLIB/openssl/libcrypto-3-x64.dll release/

$LOCAL_LIB/curl/lib/.libs/libcurl-4.dll release/

Step 6. after here I don't have exact steps I followed... Changed folder to cpuminer-gr-avx2 cd cd cpuminer-gr-avx2 export LDFLAGS="-L$LOCAL_LIB/curl/lib/.libs -L$LOCAL_LIB/gmp/.libs -L$LOCAL_LIB/openssl" rm ./gmp.h 2>/dev/null ln -s $LOCAL_LIB/gmp/gmp.h ./gmp.h

This command fails: make distclean **make: * No rule to make target 'distclean'. Stop. (I think this is just because I haven't run make before?)

rm -f config.status ./autogen.sh

export DCFLAGS="-fno-common -D_WIN32_WINNT=0x0601" CFLAGS="-O3 -march=native -mtune=native ${DCFLAGS}" \ CXXFLAGS="$CFLAGS -std=c++20 -Wno-ignored-attributes" \ ./configure ${CONFIGURE_ARGS}

Compile, using 3 threads make -j 3

compilation error: In file included from sysinfos.c:17, from util.c:15: miner.h:42:10: fatal error: curl/curl.h: No such file or directory 42 | #include <curl/curl.h> | ^~~~~ compilation terminated. make[2]: [Makefile:1255: cpuminer-util.o] Error 1 make[2]: Waiting for unfinished jobs.... api.c:22:10: fatal error: openssl/sha.h: No such file or directory 22 | #include <openssl/sha.h> | ^~~~~~~ compilation terminated. In file included from ./algo-gate-api.h:4, from algo/sha/sha256d.h:1, from cpu-miner.c:27: ./miner.h:42:10: fatal error: curl/curl.h: No such file or directory 42 | #include <curl/curl.h> | ^~~~~ compilation terminated.

adekkpl commented 2 years ago

I never tried to compile it but think that something is wrong with curl and openssl missing libraries, have You tried thease solutions? https://stackoverflow.com/questions/11471690/curl-h-no-such-file-or-directory/11471743 for curl https://unix.stackexchange.com/questions/87458/make-fatal-error-openssl-sha-h-no-such-file-or-directory for opssl

or similar when type "fatal error: curl/curl.h: No such file or directory" in google

PS If compile will succeed let me know than I think I try to compile it with i686-w64-mingw32-gcc for Win32 bit systems.

qwewer0 commented 2 years ago

@ShazAu Hope this helps: INSTALL_WINDOWS.md

ShazAu commented 2 years ago

Thanks for the replies guys. I'm currently playing with the xmrig miner at the moment so I'm going to close this issue for now.