Skip to content

Commit

Permalink
Merge pull request #228 from fireice-uk/rc-1.5.0
Browse files Browse the repository at this point in the history
release 1.5.0
  • Loading branch information
fireice-uk authored Jul 19, 2017
2 parents d0f991c + b47d514 commit d973983
Show file tree
Hide file tree
Showing 33 changed files with 1,126 additions and 3,045 deletions.
31 changes: 31 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# image
image: Visual Studio 2017

# build platform
platform: x64

# clone directory
clone_folder: c:\xmr-stak-cpu

install:
- mkdir c:\xmr-stak-dep
- curl -fsS http://slproweb.com/download/Win64OpenSSL-1_0_2L.exe -o Win64OpenSSL.exe
- Win64OpenSSL.exe /silent /verysilent /sp- /suppressmsgboxes
- curl -fsS https://www.open-mpi.org/software/hwloc/v1.11/downloads/hwloc-win64-build-1.11.7.zip -o hwloc-win64-build.zip
- 7z x hwloc-win64-build.zip -o"c:\xmr-stak-dep" -y > nul
- curl -fsS http://mirror.reismil.ch/gnu/libmicrohttpd/libmicrohttpd-latest-w32-bin.zip -o libmicrohttpd-w32-bin.zip
- 7z x libmicrohttpd-w32-bin.zip -o"c:\xmr-stak-dep" -y > nul

build_script:
- call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsMSBuildCmd.bat"
- cd c:\xmr-stak-cpu
- set CMAKE_PREFIX_PATH=C:\xmr-stak-dep\hwloc-win64-build-1.11.7;C:\xmr-stak-dep\libmicrohttpd-0.9.55-w32-bin\x86_64\VS2017\Release-static;
- cmake -G "Visual Studio 15 2017 Win64" -T v141,host=x64 .
- msbuild xmr-stak-cpu.sln /p:Configuration=Release

test_script:
- cd c:\xmr-stak-cpu\bin\Release
- copy c:\xmr-stak-dep\hwloc-win64-build-1.11.7\bin\libhwloc-5.dll .
- copy c:\xmr-stak-dep\libmicrohttpd-0.9.55-w32-bin\x86_64\VS2017\Release-dll\libmicrohttpd-dll.dll .
- dir
# - xmr-stak-cpu.exe -c ..\..\..\config.txt
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
bin/
obj/
build/
xmr-stak-cpu.layout
xmr-stak-cpu.depend
config-debug.txt
Expand Down
75 changes: 75 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
dist: trusty

osx_image: xcode8.3

sudo: false

language: cpp

addons:
apt:
packages: &default_packages
- cmake
- libmicrohttpd-dev
- libssl-dev
- libhwloc-dev

matrix:
include:
- os: linux
compiler: gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- *default_packages
- gcc-5
- g++-5
env:
- CMAKE_CXX_COMPILER=g++-5
- CMAKE_C_COMPILER=gcc-5

- os: linux
compiler: gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- *default_packages
- gcc-6
- g++-6
env:
- CMAKE_CXX_COMPILER=g++-6
- CMAKE_C_COMPILER=gcc-6

- os: linux
compiler: gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- *default_packages
- gcc-7
- g++-7
env:
- CMAKE_CXX_COMPILER=g++-7
- CMAKE_C_COMPILER=gcc-7

- os: osx
compiler: gcc

before_install:
- if [ $TRAVIS_OS_NAME = osx ]; then brew tap homebrew/science; fi

script:
- if [ $TRAVIS_OS_NAME = osx ]; then
brew install hwloc;
cmake -DMICROHTTPD_ENABLE=OFF -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl .;
else
cmake -D CMAKE_C_COMPILER=${CMAKE_C_COMPILER} -D CMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} .;
fi;
- make VERBOSE=1
- ./bin/xmr-stak-cpu -c ./config.txt
109 changes: 87 additions & 22 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ list(APPEND CMAKE_PREFIX_PATH "$ENV{CMAKE_PREFIX_PATH}")
# https://github.com/fireice-uk/xmr-stak-nvidia/pull/10#issuecomment-290821792
# If you remove this guard to compile with older gcc versions the miner will produce
# a high rate of wrong shares.
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.1)
message(FATAL_ERROR "GCC version must be at least 5.1!")
message(FATAL_ERROR "g++ version must be at least 5.1!")
endif()
endif()

Expand All @@ -48,45 +48,109 @@ set(LIBS ${LIBS} ${CMAKE_THREAD_LIBS_INIT})
# Find microhttpd
################################################################################

option(MICROHTTPD_REQUIRED "Enable or disable the requirement of microhttp (http deamon)" ON)
find_library(MHTD NAMES microhttpd)
if("${MHTD}" STREQUAL "MHTD-NOTFOUND")
if(MICROHTTPD_REQUIRED)
message(FATAL_ERROR "microhttpd NOT found: use `-DMICROHTTPD_REQUIRED=OFF` to build without http deamon support")
option(MICROHTTPD_ENABLE "Enable or disable the requirement of microhttp (http deamon)" ON)
if(MICROHTTPD_ENABLE)
find_path(MTHD_INCLUDE_DIR
NAMES
microhttpd.h
PATHS
/opt/local
/usr/local
/usr
ENV "PROGRAMFILES(X86)"
ENV "HWLOC_ROOT"
PATH_SUFFIXES
include)

find_library(MHTD
NAMES
microhttpd
libmicrohttpd.lib
PATHS
ENV "MICROHTTPD_ROOT"
PATH_SUFFIXES
lib)
if("${MHTD}" STREQUAL "MHTD-NOTFOUND")
message(FATAL_ERROR "microhttpd NOT found: use `-DMICROHTTPD_ENABLE=OFF` to build without http deamon support")
else()
message(STATUS "microhttpd NOT found: disable http server")
add_definitions("-DCONF_NO_HTTPD")
set(LIBS ${LIBS} ${MHTD})
include_directories(AFTER ${MTHD_INCLUDE_DIR})
endif()
else()
set(LIBS ${LIBS} ${MHTD})
add_definitions("-DCONF_NO_HTTPD")
endif()

###############################################################################
# Find OpenSSL
###############################################################################

option(OpenSSL_REQUIRED "Enable or disable the requirement of OpenSSL" ON)
find_package(OpenSSL)
if(OPENSSL_FOUND)
include_directories(${OPENSSL_INCLUDE_DIR})
set(LIBS ${LIBS} ${OPENSSL_LIBRARIES})
option(OpenSSL_ENABLE "Enable or disable the requirement of OpenSSL" ON)
if(OpenSSL_ENABLE)
find_package(OpenSSL)
if(OPENSSL_FOUND)
include_directories(${OPENSSL_INCLUDE_DIR})
set(LIBS ${LIBS} ${OPENSSL_LIBRARIES})
else()
message(FATAL_ERROR "OpenSSL NOT found: use `-DOpenSSL_ENABLE=OFF` to build without SSL support")
endif()
else()
if(OpenSSL_REQUIRED)
message(FATAL_ERROR "OpenSSL NOT found: use `-DOpenSSL_REQUIRED=OFF` to build without SSL support")
add_definitions("-DCONF_NO_TLS")
endif()

################################################################################
# Find hwloc
################################################################################

option(HWLOC_ENABLE "Enable or disable the requirement of hwloc" ON)
if(HWLOC_ENABLE)
find_path(HWLOC_INCLUDE_DIR
NAMES
hwloc.h
PATHS
/opt/local
/usr/local
/usr
ENV "PROGRAMFILES(X86)"
ENV "HWLOC_ROOT"
PATH_SUFFIXES
include)

find_library(HWLOC
NAMES
libhwloc.lib
hwloc
PATHS
ENV "HWLOC_ROOT"
PATH_SUFFIXES
lib)

if("${HWLOC}" STREQUAL "MHTD-NOTFOUND" OR ${HWLOC_INCLUDE_DIR} STREQUAL "HWLOC_INCLUDE_DIR-NOTFOUND")
message(FATAL_ERROR "hwloc NOT found: use `-DHWLOC_ENABLE=OFF` to build without hwloc support")
else()
if(NOT OPENSSL_FOUND)
add_definitions("-DCONF_NO_TLS")
endif()
set(LIBS ${LIBS} ${HWLOC})
include_directories(AFTER ${HWLOC_INCLUDE_DIR})
endif()
else()
add_definitions("-DCONF_NO_HWLOC")
endif()

################################################################################
# Windows Sockets
################################################################################

if(WIN32)
set(LIBS ${LIBS} wsock32 ws2_32)
endif()

################################################################################
# Compile & Link
################################################################################

# activate sse2 and aes-ni
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2 -maes")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2 -maes")
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2 -maes")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2 -maes")
endif()

# activate static libgcc and libstdc++ linking
if(CMAKE_LINK_STATIC)
Expand All @@ -104,6 +168,7 @@ add_library(xmr-stak-c
${SRCFILES_C}
)
set_property(TARGET xmr-stak-c PROPERTY C_STANDARD 99)
target_link_libraries(xmr-stak-c ${LIBS})

add_executable(xmr-stak-cpu
${SRCFILES_CPP}
Expand Down
20 changes: 20 additions & 0 deletions FREEBSDCOMPILE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Compile **xmr-stak** for FreeBSD

## Install Dependencies

*Note: This guide is tested for FreeBSD 11.0-RELEASE*

From the root shell, run the following commands:

pkg install git libmicrohttpd hwloc cmake

Type 'y' and hit enter to proceed with installing the packages.

git clone https://github.com/fireice-uk/xmr-stak-cpu.git
cd xmr-stak-cpu
cmake .
make

Now you have the binary located at "bin/xmr-stak-cpu". Either move this file to your desired location or run "make install" to install it to your path.

You can edit the prebuilt [config.txt](config.txt) file found in the root of the repository or you can make your own. This file is required to run xmr-stak-cpu.
50 changes: 50 additions & 0 deletions LINUXCOMPILE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Compile **xmr-stak** for Linux

### GNU Compiler
```
# Ubuntu / Debian
sudo apt install libmicrohttpd-dev libssl-dev cmake build-essential libhwloc-dev
cmake .
make install
# Arch
sudo pacman -S base-devel hwloc openssl cmake libmicrohttpd
cmake .
make install
# Fedora
sudo dnf install gcc gcc-c++ hwloc-devel libmicrohttpd-devel 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 scl enable devtoolset-4 bash
cmake3 .
make install
# Ubuntu 14.04
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install gcc-5 g++-5 make
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 1 --slave /usr/bin/g++ g++ /usr/bin/g++-5
curl -L http://www.cmake.org/files/v3.4/cmake-3.4.1.tar.gz | tar -xvzf - -C /tmp/
cd /tmp/cmake-3.4.1/ && ./configure && make && sudo make install && cd -
sudo update-alternatives --install /usr/bin/cmake cmake /usr/local/bin/cmake 1 --force
sudo apt install libmicrohttpd-dev libssl-dev libhwloc-dev
cmake .
make install
```

- 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.

### To do a static build for a system without gcc 5.1+
```
cmake -DCMAKE_LINK_STATIC=ON .
make install
```
Note - cmake caches variables, so if you want to do a dynamic build later you need to specify '-DCMAKE_LINK_STATIC=OFF'



Loading

0 comments on commit d973983

Please sign in to comment.