Skip to content
Snippets Groups Projects
Commit 01f8ce04 authored by Petr Ruzicka's avatar Petr Ruzicka
Browse files

Build documenation improved and added "docker script" for building xmr-stak for other distributions

parent 429e019e
No related branches found
No related tags found
No related merge requests found
......@@ -13,13 +13,13 @@
make install
# Fedora
sudo dnf install gcc gcc-c++ hwloc-devel libmicrohttpd-devel openssl-devel cmake
sudo dnf install gcc gcc-c++ hwloc-devel libmicrohttpd-devel libstdc++-static make openssl-devel cmake
cmake .
make install
# CentOS
sudo yum install centos-release-scl cmake3 hwloc-devel libmicrohttpd-devel openssl-devel
sudo yum install devtoolset-4-gcc*
sudo yum install centos-release-scl epel-release
sudo yum install cmake3 devtoolset-4-gcc* hwloc-devel libmicrohttpd-devel openssl-devel make
sudo scl enable devtoolset-4 bash
cmake3 .
make install
......@@ -39,6 +39,8 @@
- g++ version 5.1 or higher is required for full C++11 support. CMake release compile scripts, as well as CodeBlocks build environment for debug builds is included.
If you want to compile the binary without installing libraries / compiler or just compile binary for some other distribution, please check the [build_xmr-stak_docker.sh script](scripts/build_xmr-stak_docker/build_xmr-stak_docker.sh).
### To do a static build for a system without gcc 5.1+
```
cmake -DCMAKE_LINK_STATIC=ON .
......
#!/bin/bash -uex
if [ -d xmr-stak-cpu ]; then
sudo git -C xmr-stak-cpu clean -f
else
sudo git clone https://github.com/fireice-uk/xmr-stak-cpu.git
fi
########################
# Fedora (latest)
########################
sudo docker run --rm -it -v $PWD/xmr-stak-cpu:/xmr-stak-cpu fedora:latest /bin/bash -c "
set -ex ;
dnf install -y -q gcc gcc-c++ hwloc-devel libmicrohttpd-devel libstdc++-static make openssl-devel cmake ;
cd /xmr-stak-cpu ;
cmake -DCMAKE_LINK_STATIC=ON . ;
make install ;
"
sudo mv xmr-stak-cpu/bin/xmr-stak-cpu xmr-stak-cpu_fedora_latest
sudo git -C xmr-stak-cpu clean -f
exit
########################
# Ubuntu (latest)
########################
sudo docker run --rm -it -v $PWD/xmr-stak-cpu:/xmr-stak-cpu ubuntu:latest /bin/bash -c "
set -ex ;
apt update -qq ;
apt install -y -qq libmicrohttpd-dev libssl-dev cmake build-essential libhwloc-dev ;
cd /xmr-stak-cpu ;
cmake -DCMAKE_LINK_STATIC=ON . ;
make install ;
"
sudo mv xmr-stak-cpu/bin/xmr-stak-cpu xmr-stak-cpu_ubuntu_latest
sudo git -C xmr-stak-cpu clean -f
########################
# Ubuntu 16.04
########################
sudo docker run --rm -it -v $PWD/xmr-stak-cpu:/xmr-stak-cpu ubuntu:16.04 /bin/bash -c "
set -ex ;
apt update -qq ;
apt install -y -qq libmicrohttpd-dev libssl-dev cmake build-essential libhwloc-dev ;
cd /xmr-stak-cpu ;
cmake -DCMAKE_LINK_STATIC=ON . ;
make install ;
"
sudo mv xmr-stak-cpu/bin/xmr-stak-cpu xmr-stak-cpu_ubuntu_1604
sudo git -C xmr-stak-cpu clean -f
########################
# Ubuntu 14.04
########################
sudo docker run --rm -it -v $PWD/xmr-stak-cpu:/xmr-stak-cpu ubuntu:14.04 /bin/bash -c "
set -ex ;
apt update -qq ;
apt install -y -qq curl libmicrohttpd-dev libssl-dev libhwloc-dev software-properties-common ;
add-apt-repository -y ppa:ubuntu-toolchain-r/test ;
apt update -qq ;
apt install -y -qq gcc-7 g++-7 make ;
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 1 --slave /usr/bin/g++ g++ /usr/bin/g++-7 ;
curl -L https://cmake.org/files/v3.9/cmake-3.9.0.tar.gz | tar -xzf - -C /tmp/ ;
cd /tmp/cmake-3.9.0/ && ./configure && make && sudo make install && cd - ;
update-alternatives --install /usr/bin/cmake cmake /usr/local/bin/cmake 1 --force ;
cd /xmr-stak-cpu ;
cmake -DCMAKE_LINK_STATIC=ON . ;
make install ;
"
sudo mv xmr-stak-cpu/bin/xmr-stak-cpu xmr-stak-cpu_ubuntu_1404
sudo git -C xmr-stak-cpu clean -f
########################
# CentOS (latest)
########################
sudo docker run --rm -it -v $PWD/xmr-stak-cpu:/xmr-stak-cpu centos:latest /bin/bash -c "
set -ex ;
yum install -y -q centos-release-scl epel-release ;
yum install -y -q cmake3 devtoolset-4-gcc* hwloc-devel libmicrohttpd-devel openssl-devel make ;
scl enable devtoolset-4 - << EOF
cd /xmr-stak-cpu ;
cmake3 -DCMAKE_LINK_STATIC=ON . ;
make install ;
EOF
"
sudo mv xmr-stak-cpu/bin/xmr-stak-cpu xmr-stak-cpu_centos_latest
sudo git -C xmr-stak-cpu clean -f
########################
# CentOS 6.x
########################
sudo docker run --rm -it -v $PWD/xmr-stak-cpu:/xmr-stak-cpu centos:6 /bin/bash -c "
set -ex ;
yum install -y -q centos-release-scl epel-release ;
yum install -y -q cmake3 devtoolset-4-gcc* hwloc-devel libmicrohttpd-devel openssl-devel make ;
scl enable devtoolset-4 - << EOF
cd /xmr-stak-cpu ;
cmake3 -DCMAKE_LINK_STATIC=ON . ;
make install ;
EOF
"
sudo mv xmr-stak-cpu/bin/xmr-stak-cpu xmr-stak-cpu_centos_6
sudo git -C xmr-stak-cpu clean -f
sudo rm -rf xmr-stak-cpu
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment