Skip to content

Commit

Permalink
*Merge code with bytecoin v3.1.0
Browse files Browse the repository at this point in the history
*Minor changes on Bitsum lib
+Explorer
  • Loading branch information
4egod committed May 31, 2018
1 parent 0d8604c commit 2bce229
Show file tree
Hide file tree
Showing 43 changed files with 2,061 additions and 780 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ BreakBeforeBraces: Attach
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: true
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
BreakStringLiterals: false
ColumnLimit: 120
CommentPragmas: '^ IWYU pragma:'
ConstructorInitializerAllOnOneLineOrOnePerLine: true
Expand Down
19 changes: 16 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ if(WIN32)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
add_definitions(-D_SCL_SECURE_NO_WARNINGS=1 -D_CRT_SECURE_NO_WARNINGS=1 -D_WIN32_WINNT=0x0501)
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -maes -g -O2 -Wall -Wextra -Werror=return-type -Wno-unused-parameter")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -maes -g -O2 -Wall -Wextra -Werror=return-type -Wno-unused-parameter")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -maes -g -O2 -Wall -Wextra -Werror=return-type -Wno-unused-parameter -Wno-unknown-pragmas")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -maes -g -O2 -Wall -Wextra -Werror=return-type -Wno-unused-parameter -Wno-unknown-pragmas")
message(STATUS "Instrumentation usage: " ${USE_INSTRUMENTATION})
message(STATUS "Thread sanitizer usage: " ${WITH_THREAD_SANITIZER})
if(USE_INSTRUMENTATION)
Expand Down Expand Up @@ -170,12 +170,25 @@ else()
find_package(Boost 1.65 REQUIRED COMPONENTS system)
include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
set(Boost_LIBRARIES "${Boost_LIBRARIES}")
if(APPLE)
set(BOOST_ROOT ../boost)
find_package(Boost 1.62 REQUIRED COMPONENTS system)
message(STATUS "Boost_INCLUDE_DIRS: " ${Boost_INCLUDE_DIRS})
include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
#set(Boost_LIBRARIES "${Boost_LIBRARIES}")
else()
message(STATUS "Boost_INCLUDE_DIRS: ../boost")
include_directories(SYSTEM ../boost)
set(Boost_LIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/../boost/stage/lib/libboost_system.a")
endif()
message(STATUS "Boost_LIBRARIES: " ${Boost_LIBRARIES})
if(APPLE)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.11")
target_link_libraries(wallet-rpc "-framework Foundation" "-framework IOKit")
target_link_libraries(bitsumd "-framework Foundation" "-framework IOKit")
endif()
target_link_libraries(wallet-rpc ${Boost_LIBRARIES} ${LINK_OPENSSL} dl pthread)
target_link_libraries(bitsum ${Boost_LIBRARIES} ${LINK_OPENSSL} dl pthread)
target_link_libraries(wallet-rpc ${Boost_LIBRARIES} ${LINK_OPENSSL} dl pthread)
target_link_libraries(bitsumd ${Boost_LIBRARIES} ${LINK_OPENSSL} dl pthread)
#target_link_libraries(tests ${Boost_LIBRARIES} ${LINK_OPENSSL} dl pthread)
endif()
39 changes: 15 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ $> mkdir bitsum
$> cd bitsum
```

To go futher you have to have a number of packages and utilities.
To go futher you have to have a number of packages and utilities. You need at least gcc 5.4.

* `build-essential` package:
```
Expand All @@ -37,16 +37,15 @@ To go futher you have to have a number of packages and utilities.
If version is too old, follow instructions on [the official site](https://cmake.org/download/).
* Boost (1.62 or newer):
You need boost in `bcndev` folder. We do not configure to use boost installed by `apt-get`, because it is sometimes updated without your control by installing some unrelated packages. Also some users reported crashes after `find_package` finds headers from one version of boost and libraries from different version, or if installed boost uses dynamic linking.
```
$> sudo apt-get install libboost-all-dev
$> cat /usr/include/boost/version.hpp | grep "BOOST_LIB_VERSION"
```
If version is too old, download boost from [boost.org](https://boost.org), unpack it into a folder inside `bitsum` and rename it from `boost_1_66_0` or similar to just `boost`
Build boost
```
$> cd boost
$bitsum/boost> ./bootstrap.sh
$bitsum/boost> ./b2 link=static -j 8 --build-dir=build64 --stagedir=stage
$bcndev> wget -c 'http://sourceforge.net/projects/boost/files/boost/1.67.0/boost_1_67_0.tar.bz2/download'
$bcndev> tar xf download
$bcndev> rm download
$bcndev> mv boost_1_67_0 boost
$bcndev> cd boost
$bcndev/boost> ./bootstrap.sh
$bcndev/boost> ./b2 link=static cxxflags="-fPIC" linkflags="-pie" -j 8 --build-dir=build64 --stagedir=stage
cd ..
```
Expand All @@ -64,14 +63,11 @@ Create build directory inside bytecoin, go there and run CMake and Make:
```
$bitsum> mkdir bitsum_core/build
$bitsum> cd bitsum_core/build
$bitsum/bitsum_core/build> cmake -DUSE_SSL=0 ..
$bitsum/bitsum_core/build> cmake ..
$bitsum/bitsum_core/build> time make -j4
```
Check built binaries by running them from `../bin` folder
```
$bitsum/bitsum_core/build> ../bin/bytecoind -v
```
### Building with specific options
Expand Down Expand Up @@ -130,11 +126,6 @@ $bitsum/bitsum_core/build> cmake -DUSE_SSL=0 ..
$bitsum/bitsum_core/build> time make -j4
```
Check built binaries by running them from `../bin` folder:
```
$bitsum/bitsum_core/build> ../bin/bitsumd -v
```
### Building with specific options
Binaries linked with Boost installed by Homebrew will work only on your computer's OS X version or newer, but not on older versions like El Capitan.
Expand All @@ -147,9 +138,9 @@ Download and unpack [Boost](https://boost.org) to `Downloads` folder.
Then build and install Boost:
```
$~> cd ~/Downloads/boost_1_58_0/
$~/Downloads/boost_1_58_0> ./bootstrap.sh
$~/Downloads/boost_1_58_0> ./b2 -a -j 4 cxxflags="-stdlib=libc++ -std=c++14 -mmacosx-version-min=10.11 -isysroot/Users/user/Downloads/MacOSX10.11.sdk" install`
$~> cd ~/Downloads/boost_1_67_0/
$~/Downloads/boost_1_67_0> ./bootstrap.sh
$~/Downloads/boost_1_67_0> ./b2 -a -j 4 cxxflags="-stdlib=libc++ -std=c++14 -mmacosx-version-min=10.11 -isysroot/Users/user/Downloads/MacOSX10.11.sdk" install`
```
Install OpenSSL to `bitsum/openssl` folder:
Expand Down Expand Up @@ -185,7 +176,7 @@ $bitsum/bitsum_core/build> time make -j4
## Building on Windows
You need Microsoft Visual Studio Community 2017. [Download](https://microsoft.com) and install it selecting `C++`, `git`, `cmake integration` packages.
You need Microsoft Visual Studio Community 2017. [Download](https://www.visualstudio.com/vs/) and install it selecting `C++`, `git`, `cmake integration` packages.
Run `Visual Studio x64 command prompt` from start menu.
Create directory `bitsum` somewhere:
Expand Down
3 changes: 3 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## Release Notes

### v1.18.5.25
- Merge code with bytecoin v3.1.0

### v1.18.5.10
- Merge code with bytecoin v3.0.4

Expand Down
Loading

0 comments on commit 2bce229

Please sign in to comment.