build cpuminer for windows - connectivity problems no curl

This commit is contained in:
Dobromir Popov
2025-09-08 08:53:17 +03:00
parent 9a2d14de90
commit a545714b34
7 changed files with 603 additions and 25 deletions

87
rin/miner/.vscode/launch.json vendored Normal file
View File

@@ -0,0 +1,87 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Test Windows CPU Miner (Curl)",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/cpuminer-opt-rin/build/win/cpuminer-curl.exe",
"args": [
"--help"
],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/cpuminer-opt-rin/build/win",
"environment": [],
"externalConsole": true,
"preLaunchTask": "",
"presentation": {
"group": "windows-testing",
"order": 1
}
},
{
"name": "Test Windows CPU Miner (NO_CURL)",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/cpuminer-opt-rin/build/win/cpuminer-nocurl.exe",
"args": [
"--help"
],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/cpuminer-opt-rin/build/win",
"environment": [],
"externalConsole": true,
"preLaunchTask": "",
"presentation": {
"group": "windows-testing",
"order": 2
}
},
{
"name": "Debug Windows CPU Miner (Curl) - Localhost",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/cpuminer-opt-rin/build/win/cpuminer-curl.exe",
"args": [
"-a", "rinhash",
"-o", "stratum+tcp://127.0.0.1:3333",
"-u", "testuser",
"-p", "testpass",
"-t", "1",
"--debug"
],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/cpuminer-opt-rin/build/win",
"environment": [],
"externalConsole": true,
"preLaunchTask": "",
"presentation": {
"group": "windows-debugging",
"order": 1
}
},
{
"name": "Debug Windows CPU Miner (NO_CURL) - Localhost",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/cpuminer-opt-rin/build/win/cpuminer-nocurl.exe",
"args": [
"-a", "rinhash",
"-o", "stratum+tcp://127.0.0.1:3333",
"-u", "testuser",
"-p", "testpass",
"-t", "1",
"--debug"
],
"stopAtEntry": false,
"cwd": "${workspaceFolder}/cpuminer-opt-rin/build/win",
"environment": [],
"externalConsole": true,
"preLaunchTask": "",
"presentation": {
"group": "windows-debugging",
"order": 2
}
}
]
}

43
rin/miner/.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,43 @@
{
"files.associations": {
"*.c": "c",
"*.h": "c",
"*.sh": "shellscript",
"*.bat": "batch",
"*.md": "markdown",
"Makefile": "makefile",
"configure.ac": "autoconf",
"configure": "shellscript"
},
"terminal.integrated.shell.linux": "/bin/bash",
"terminal.integrated.shellArgs.linux": [],
"cmake.configureOnOpen": false,
"C_Cpp.default.compilerPath": "/usr/bin/gcc",
"C_Cpp.default.cStandard": "c11",
"C_Cpp.default.cppStandard": "c++11",
"C_Cpp.default.includePath": [
"${workspaceFolder}/cpuminer-opt-rin",
"${workspaceFolder}/cpuminer-opt-rin/algo",
"${workspaceFolder}/cpuminer-opt-rin/algo/rinhash"
],
"C_Cpp.default.defines": [
"HAVE_CONFIG_H"
],
"search.exclude": {
"**/build/**": true,
"**/complete-build-output/**": true,
"**/hip-output/**": true,
"**/rocm-direct-output/**": true,
"**/*.o": true,
"**/*.exe": true
},
"files.exclude": {
"**/build/**": false,
"**/complete-build-output/**": false,
"**/hip-output/**": false,
"**/rocm-direct-output/**": false
},
"task.quickOpen.detail": true,
"task.quickOpen.showAll": true,
"task.saveBeforeRun": "prompt"
}

164
rin/miner/.vscode/tasks.json vendored Normal file
View File

@@ -0,0 +1,164 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Build Windows CPU Miner (Smart)",
"type": "shell",
"command": "sudo",
"args": [
"./build-windows-smart.sh"
],
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared",
"showReuseMessage": true,
"clear": true
},
"options": {
"cwd": "${workspaceFolder}",
"shell": {
"executable": "/bin/bash"
}
},
"problemMatcher": [],
"detail": "Build Windows executable with automatic curl detection (recommended)"
},
{
"label": "Build Windows CPU Miner (Original Curl)",
"type": "shell",
"command": "sudo",
"args": [
"docker",
"run",
"--rm",
"-v",
"${workspaceFolder}/cpuminer-opt-rin:/work",
"-v",
"${workspaceFolder}/cpuminer-opt-rin/build/win:/output",
"cpuminer-windows-builder",
"bash",
"-c",
"cd /work && make clean && rm -rf Makefile Makefile.in configure config.* && ./autogen.sh && ./configure --host=x86_64-w64-mingw32 --with-curl=/usr/x86_64-w64-mingw32 CFLAGS='-O3 -march=x86-64 -DCURL_STATICLIB' LDFLAGS='-L/usr/x86_64-w64-mingw32/lib' LIBS='-lcurl -lbcrypt -ladvapi32 -lcrypt32 -lz -lws2_32 -pthread' && make -j4 && cp cpuminer.exe /output/cpuminer-curl.exe"
],
"group": "build",
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared",
"showReuseMessage": true,
"clear": true
},
"options": {
"cwd": "${workspaceFolder}",
"shell": {
"executable": "/bin/bash"
}
},
"problemMatcher": [],
"detail": "Build Windows executable with original curl implementation"
},
{
"label": "Build Windows CPU Miner (NO_CURL Fallback)",
"type": "shell",
"command": "sudo",
"args": [
"docker",
"run",
"--rm",
"-v",
"${workspaceFolder}/cpuminer-opt-rin:/work",
"-v",
"${workspaceFolder}/cpuminer-opt-rin/build/win:/output",
"cpuminer-windows-builder",
"bash",
"-c",
"cd /work && make clean && rm -rf Makefile Makefile.in configure config.* && ./autogen.sh && ./configure --host=x86_64-w64-mingw32 CFLAGS='-O3 -march=x86-64 -DNO_CURL' LDFLAGS='-static' && make -j4 && cp cpuminer.exe /output/cpuminer-nocurl.exe"
],
"group": "build",
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared",
"showReuseMessage": true,
"clear": true
},
"options": {
"cwd": "${workspaceFolder}",
"shell": {
"executable": "/bin/bash"
}
},
"problemMatcher": [],
"detail": "Build Windows executable with NO_CURL direct socket fallback"
},
{
"label": "Clean Windows Build",
"type": "shell",
"command": "sudo",
"args": [
"docker",
"run",
"--rm",
"-v",
"${workspaceFolder}/cpuminer-opt-rin:/work",
"-v",
"${workspaceFolder}/cpuminer-opt-rin/build/win:/output",
"cpuminer-windows-builder",
"bash",
"-c",
"cd /work && make clean && rm -rf Makefile Makefile.in configure config.* *.exe"
],
"group": "build",
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared",
"showReuseMessage": true,
"clear": false
},
"options": {
"cwd": "${workspaceFolder}",
"shell": {
"executable": "/bin/bash"
}
},
"problemMatcher": [],
"detail": "Clean Windows build artifacts and temporary files"
},
{
"label": "Test Windows Executable",
"type": "shell",
"command": "bash",
"args": [
"-c",
"echo 'Testing Windows executable...' && if [ -f '${workspaceFolder}/cpuminer-opt-rin/build/win/cpuminer-curl.exe' ]; then echo 'Found cpuminer-curl.exe:' && ls -la '${workspaceFolder}/cpuminer-opt-rin/build/win/cpuminer-curl.exe'; else echo 'cpuminer-curl.exe not found'; fi && if [ -f '${workspaceFolder}/cpuminer-opt-rin/build/win/cpuminer-nocurl.exe' ]; then echo 'Found cpuminer-nocurl.exe:' && ls -la '${workspaceFolder}/cpuminer-opt-rin/build/win/cpuminer-nocurl.exe'; else echo 'cpuminer-nocurl.exe not found'; fi"
],
"group": "test",
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared",
"showReuseMessage": true,
"clear": false
},
"options": {
"cwd": "${workspaceFolder}",
"shell": {
"executable": "/bin/bash"
}
},
"problemMatcher": [],
"detail": "Check if Windows executables were built successfully"
}
]
}