diff --git a/cmake/flags.cmake b/cmake/flags.cmake index 7b6d0163..5edad339 100644 --- a/cmake/flags.cmake +++ b/cmake/flags.cmake @@ -96,6 +96,10 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES Clang) endif() endif() + if (BUILD_STATIC) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static") + endif() + endif() if (NOT WIN32) diff --git a/scripts/build.hwloc.sh b/scripts/build.hwloc.sh index 216f3af2..1ca34731 100755 --- a/scripts/build.hwloc.sh +++ b/scripts/build.hwloc.sh @@ -13,7 +13,7 @@ tar -xzf hwloc-${HWLOC_VERSION}.tar.gz cd hwloc-${HWLOC_VERSION} ./configure --disable-shared --enable-static --disable-io --disable-libudev --disable-libxml2 -make -j$(nproc) -cp -fr include/ ../../deps +make -j$(nproc || sysctl -n hw.ncpu || sysctl -n hw.logicalcpu) +cp -fr include ../../deps cp hwloc/.libs/libhwloc.a ../../deps/lib cd .. \ No newline at end of file diff --git a/scripts/build.hwloc1.sh b/scripts/build.hwloc1.sh new file mode 100755 index 00000000..f1afc285 --- /dev/null +++ b/scripts/build.hwloc1.sh @@ -0,0 +1,19 @@ +#!/bin/bash -e + +HWLOC_VERSION="1.11.13" + +mkdir -p deps +mkdir -p deps/include +mkdir -p deps/lib + +mkdir -p build && cd build + +wget https://download.open-mpi.org/release/hwloc/v1.11/hwloc-${HWLOC_VERSION}.tar.gz -O hwloc-${HWLOC_VERSION}.tar.gz +tar -xzf hwloc-${HWLOC_VERSION}.tar.gz + +cd hwloc-${HWLOC_VERSION} +./configure --disable-shared --enable-static --disable-io --disable-libudev --disable-libxml2 +make -j$(nproc || sysctl -n hw.ncpu || sysctl -n hw.logicalcpu) +cp -fr include ../../deps +cp src/.libs/libhwloc.a ../../deps/lib +cd .. \ No newline at end of file diff --git a/scripts/build.libressl.sh b/scripts/build.libressl.sh index af7fe822..e7495233 100755 --- a/scripts/build.libressl.sh +++ b/scripts/build.libressl.sh @@ -13,8 +13,8 @@ tar -xzf libressl-${LIBRESSL_VERSION}.tar.gz cd libressl-${LIBRESSL_VERSION} ./configure --disable-shared -make -j$(nproc) -cp -fr include/ ../../deps +make -j$(nproc || sysctl -n hw.ncpu || sysctl -n hw.logicalcpu) +cp -fr include ../../deps cp crypto/.libs/libcrypto.a ../../deps/lib cp ssl/.libs/libssl.a ../../deps/lib cd .. \ No newline at end of file diff --git a/scripts/build.openssl.sh b/scripts/build.openssl.sh index 5939eb57..5f9e5a71 100755 --- a/scripts/build.openssl.sh +++ b/scripts/build.openssl.sh @@ -13,8 +13,8 @@ tar -xzf openssl-${OPENSSL_VERSION}.tar.gz cd openssl-${OPENSSL_VERSION} ./config -no-shared -no-asm -no-zlib -no-comp -no-dgram -no-filenames -no-cms -make -j$(nproc) -cp -fr include/ ../../deps +make -j$(nproc || sysctl -n hw.ncpu || sysctl -n hw.logicalcpu) +cp -fr include ../../deps cp libcrypto.a ../../deps/lib cp libssl.a ../../deps/lib cd .. \ No newline at end of file diff --git a/scripts/build.uv.sh b/scripts/build.uv.sh index 6f4c9796..8279da37 100755 --- a/scripts/build.uv.sh +++ b/scripts/build.uv.sh @@ -14,7 +14,7 @@ tar -xzf v${UV_VERSION}.tar.gz cd libuv-${UV_VERSION} sh autogen.sh ./configure --disable-shared -make -j$(nproc) -cp -fr include/ ../../deps +make -j$(nproc || sysctl -n hw.ncpu || sysctl -n hw.logicalcpu) +cp -fr include ../../deps cp .libs/libuv.a ../../deps/lib cd .. \ No newline at end of file diff --git a/src/backend/cuda/cuda.cmake b/src/backend/cuda/cuda.cmake index d75fc395..6661ec83 100644 --- a/src/backend/cuda/cuda.cmake +++ b/src/backend/cuda/cuda.cmake @@ -1,4 +1,4 @@ -if (BUILD_STATIC AND XMRIG_OS_LINUX AND WITH_CUDA) +if (BUILD_STATIC AND XMRIG_OS_UNIX AND WITH_CUDA) message(WARNING "CUDA backend is not compatible with static build, use -DWITH_CUDA=OFF to suppress this warning") set(WITH_CUDA OFF) diff --git a/src/backend/opencl/opencl.cmake b/src/backend/opencl/opencl.cmake index 8d9235f3..acaed339 100644 --- a/src/backend/opencl/opencl.cmake +++ b/src/backend/opencl/opencl.cmake @@ -1,4 +1,4 @@ -if (BUILD_STATIC AND XMRIG_OS_LINUX AND WITH_OPENCL) +if (BUILD_STATIC AND XMRIG_OS_UNIX AND WITH_OPENCL) message(WARNING "OpenCL backend is not compatible with static build, use -DWITH_OPENCL=OFF to suppress this warning") set(WITH_OPENCL OFF)