-
Notifications
You must be signed in to change notification settings - Fork 64
x_dev Compiling
The supported way to compile creepMiner is to use conan in combination with CMake.
note: please do this only if you have experience in what you are doing.
Installing dependencies and conan
- Install python
- Install pip
curl https://bootstrap.pypa.io/get-pip.py | sudo python
- Install conan
sudo pip install conan
-
git clone https://github.com/Creepsky/creepMiner
(Stable brach) -
git clone -b development https://github.com/Creepsky/creepMiner
(Dev brach)
cd creepMiner
conan install . --build=missing -s compiler.libcxx=libstdc++11
cmake CMakeLists.txt -DCMAKE_BUILD_TYPE=RELEASE -DNO_GPU=ON
make -j$(nproc)
cmake CMakeLists.txt
-DCMAKE_BUILD_TYPE={DEBUG|RELEASE|MINSIZEREL|RELWITHDEBINFO}
[-b <your/binary/path>]
[-DCMAKE_INSTALL_PREFIX:PATH=<your/install/path>]
[-DNO_GPU={ON|OFF}]
[-DMINIMAL_BUILD={ON|OFF}]
[-DUSE_SSE4={ON|OFF}]
[-DUSE_AVX={ON|OFF}]
[-DUSE_AVX2={ON|OFF}]
[-DUSE_CUDA={ON|OFF}]
[-DUSE_OPENCL={ON|OFF}]
Have a look at what the different CMake flags mean.
Please see bellow for OS specific instructions, they might differ from the above
If you want to use your GPU, install the latest CUDA SDK
wget https://developer.nvidia.com/compute/cuda/9.1/Prod/local_installers/cuda-repo-ubuntu1604-9-1-local_9.1.85-1_amd64
sudo dpkg -i cuda-repo-ubuntu1604-9-1-local_9.1.85-1_amd64.deb
sudo apt-key add /var/cuda-repo-9-1-local/7fa2af80.pub
sudo apt-get update
sudo apt-get install cuda libssl-dev ocl-icd-opencl-dev
If you already ran conan before remember to delete the cache:
find . -iwholename '*cmake*' -not -name CMakeLists.txt -delete
If you are using 18.04 and want to compile creepMiner with CUDA support then you have to force using gcc version 6:
export CC=/usr/bin/gcc-6
export CXX=/usr/bin/g++-6
conan install . --build=missing -s compiler.libcxx=libstdc++11 -s compiler.version=6
Now you can call cmake with your desired options.
brew install cmake
conan install . --build=missing
cmake CMakeLists.txt -DCMAKE_BUILD_TYPE=RELEASE -DNO_GPU=ON
make -j$(nproc)
cp -r resources\public bin\ && cd bin && ./creepMiner
If you want to use CUDA download the CUDA Toolkit 9.1 local installer, and lunch the downloaded installer package.
Set up the development environment by modifying the PATH and DYLD_LIBRARY_PATH variables:
export PATH=/Developer/NVIDIA/CUDA-9.1/bin${PATH:+:${PATH}}
export DYLD_LIBRARY_PATH=/Developer/NVIDIA/CUDA-9.1/lib\
${DYLD_LIBRARY_PATH:+:${DYLD_LIBRARY_PATH}}
- git
- a C++ compiler that is aware of C++14 (like Visual Studio)
- CMake
- VCRedist2013
- VCRedist2015
- VCRedist2017
The compilation of OpenSSL on Windows is not an easy task.
But there is a workaround for this problem: you can simply use a precompiled version of it. There are plenty of sites that offers such precompiled versions, for example https://www.npcglib.org or http://p-nand-q.com. Only download it from sites that you trust!
- download the POCO source code (Complete Edition)
- edit the file
components
, empty it and enter:
Foundation
XML
JSON
Util
Net
Crypto
NetSSL_OpenSSL
- open your console and execute
buildwin 140 build static_md release x64 nosamples notests msbuild env minimal
- clone the git repository (
git clone https://github.com/Creepsky/creepMiner
) - go to the cloned directory (
cd creepMiner
) - create a project with CMake (
cmake -DCMAKE_BUILD_TYPE=RELEASE ... -G "Visual Studio 15 2017 Win64"
) - open the project
- compile it
Tested on a clean minimal installation: http://isoredirect.centos.org/centos/7/isos/x86_64/CentOS-7-x86_64-Minimal-1708.iso
update the system & reboot
sudo yum -y update && sudo reboot
install Extra Packages for Enterprise Linux
sudo yum -y install epel-release
install Software Collections (www.softwarecollections.org). It gives you the power to build, install, and use multiple versions of software on the same system, without affecting system-wide installed packages.
sudo yum -y install centos-release-scl
add the devtoolset-4 collection, which includes gcc 5.3.1
sudo yum -y install devtoolset-4
install cmake3, git and pip
sudo yum -y install cmake3 git python-pip
upgrade pip
sudo pip install --upgrade pip
install conan
sudo pip install conan
enable devtoolset-4 software collection you get a "virtual" environment which includes gcc 5.3.1:
$ gcc --version
scl enable devtoolset-4 bash
download creepminer
git clone https://github.com/Creepsky/creepMiner
cd creepMiner
configure cmake3 to be used during installation NOTE: this is not the correct way to use cmake3, see: https://stackoverflow.com/questions/48831131/cmake-on-linux-centos-7-how-to-force-the-system-to-use-cmake3/48842999#48842999
mkdir cmake && ln -s $(which cmake3) cmake/cmake
export PATH=$(pwd)/cmake:$PATH
check version (should be 3.x)
cmake --version
compile
NOTE: conan install . --build=missing
downloads prebuilt packeges linked to incompatible libs
conan install . --build
cmake CMakeLists.txt -DCMAKE_BUILD_TYPE=RELEASE -DNO_GPU=ON
make
exit from devtoolset-4 software collection environment
exit
Like for Poco, CUDA needs an environment variable too.
The name for the variable must be CUDA_ROOT and have to target the root directory of CUDA.
Note: CUDA only works with certain versions of clang or gcc If your system has a different version you can use that flag to set it.
For example if your version of cuda accepts gcc up to version 6 & your version is 7 use:
-DCUDA_HOST_COMPILER=/usr/bin/gcc-6
haha you should protect the wiki :D