Skip to content
Snippets Groups Projects
Commit 9ea78a2c authored by psychocrypt's avatar psychocrypt Committed by GitHub
Browse files

Merge pull request #222 from fireice-uk/topic-compile-cleanup

Compile cleanup
parents 4aecd275 acdc560b
No related branches found
No related tags found
No related merge requests found
bin/ bin/
obj/ obj/
build/
xmr-stak-cpu.layout xmr-stak-cpu.layout
xmr-stak-cpu.depend xmr-stak-cpu.depend
config-debug.txt config-debug.txt
......
...@@ -50,6 +50,18 @@ set(LIBS ${LIBS} ${CMAKE_THREAD_LIBS_INIT}) ...@@ -50,6 +50,18 @@ set(LIBS ${LIBS} ${CMAKE_THREAD_LIBS_INIT})
option(MICROHTTPD_ENABLE "Enable or disable the requirement of microhttp (http deamon)" ON) option(MICROHTTPD_ENABLE "Enable or disable the requirement of microhttp (http deamon)" ON)
if(MICROHTTPD_ENABLE) 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 find_library(MHTD
NAMES NAMES
microhttpd microhttpd
...@@ -62,6 +74,7 @@ if(MICROHTTPD_ENABLE) ...@@ -62,6 +74,7 @@ if(MICROHTTPD_ENABLE)
message(FATAL_ERROR "microhttpd NOT found: use `-DMICROHTTPD_ENABLE=OFF` to build without http deamon support") message(FATAL_ERROR "microhttpd NOT found: use `-DMICROHTTPD_ENABLE=OFF` to build without http deamon support")
else() else()
set(LIBS ${LIBS} ${MHTD}) set(LIBS ${LIBS} ${MHTD})
include_directories(AFTER ${MTHD_INCLUDE_DIR})
endif() endif()
else() else()
add_definitions("-DCONF_NO_HTTPD") add_definitions("-DCONF_NO_HTTPD")
...@@ -134,8 +147,10 @@ endif() ...@@ -134,8 +147,10 @@ endif()
################################################################################ ################################################################################
# activate sse2 and aes-ni # activate sse2 and aes-ni
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2 -maes") if(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2 -maes") 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 # activate static libgcc and libstdc++ linking
if(CMAKE_LINK_STATIC) if(CMAKE_LINK_STATIC)
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
## Install Dependencies ## Install Dependencies
*Note: This guide is tested for FreeBSD 11.0-RELEASE using the 'dev' branch* *Note: This guide is tested for FreeBSD 11.0-RELEASE*
From the root shell, run the following commands: From the root shell, run the following commands:
...@@ -17,4 +17,4 @@ Type 'y' and hit enter to proceed with installing the packages. ...@@ -17,4 +17,4 @@ Type 'y' and hit enter to proceed with installing the packages.
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. 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. 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.
\ No newline at end of file
# Compile **xmr-stak** for Linux
### GNU Compiler
```
# Ubuntu / Debian
sudo apt-get 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
```
- 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'
...@@ -41,42 +41,12 @@ xXl2Nm/u3cPP/eQVrZz5H8eACwIv+LL1EV+9uLanWUa+IO5hHr3KElvKNKD6vN0= ...@@ -41,42 +41,12 @@ xXl2Nm/u3cPP/eQVrZz5H8eACwIv+LL1EV+9uLanWUa+IO5hHr3KElvKNKD6vN0=
=vGQV =vGQV
-----END PGP SIGNATURE----- -----END PGP SIGNATURE-----
``` ```
## Compile for Windows ## Compile guides
- see [WINCOMPILE.md](WINCOMPILE.md) - [Free BSD](FREEBSDCOMPILE.md)
- [Linux](LINUXCOMPILE.md)
- [Windows](WINCOMPILE.md)
## Compile on Linux
### GNU Compiler
```
# Ubuntu / Debian
sudo apt-get install libmicrohttpd-dev libssl-dev cmake build-essential libhwloc-dev
cmake .
# Fedora
sudo dnf install gcc gcc-c++ hwloc-devel libmicrohttpd-devel openssl-devel cmake
cmake .
# 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
```
- 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'
You can find a complete compile guide under [Advanced Compile Options](#advanced-compile-options).
#### CPU mining performance #### CPU mining performance
......
...@@ -36,11 +36,9 @@ ...@@ -36,11 +36,9 @@
#include "webdesign.h" #include "webdesign.h"
#include <microhttpd.h>
#ifdef _WIN32 #ifdef _WIN32
#include "libmicrohttpd/microhttpd.h"
#define strcasecmp _stricmp #define strcasecmp _stricmp
#else
#include <microhttpd.h>
#endif // _WIN32 #endif // _WIN32
httpd* httpd::oInst = nullptr; httpd* httpd::oInst = nullptr;
......
This diff is collapsed.
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