Skip to content

Commit

Permalink
gcc 8.2 & clang 4 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
loic-barnault committed Mar 15, 2019
1 parent 0aff7eb commit 24c6c30
Show file tree
Hide file tree
Showing 85 changed files with 2,770 additions and 4,655 deletions.
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,10 @@ doc/latex/
.clang/
.codelite/
**/CodeLite/Debug/*
**/Makefile
**/*.mk
**/tutos.txt
**/Tests.txt
**/Debug/
e2e_localhost.txt
/.vscode
.vscode/*

**/.vscode/*
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,36 @@ Sub-sections: Added, Removed, Depreceted </br>
### Refactored
--->


## [2.6.9] - 2019-03-15

- upgraded to gcc 8.2 & clang 4.0 compatibility
- removed Actor::Event::SerialBuffer from actor.h
- renamed SerialBufferChain to SerialBuffer
- rewrote SerialBuffer using ::mmap()
- no longer templetized
- no longer has constructor arguments


### Deprecated

- removed TREDZONE_SDK_IS_COMPILER_COMPATIBLE macro
- removed TREDZONE_SDK_IS_DEBUG_RELEASE_COMPATIBLE macro
- removed SDK_ARCHITECTURE constant
- removed checkRuntimeCompatibility() static function
- removed RuntimeCompatibilityExceptions:
E_COMPILER_VERSION
E_DEBUG_RELEASE
- removed TRZ_DEBUG() macro


### Enterprise
- ServerTCPListenSocket & EngineToEngineSocketConnectorActor constructors take host (string) and port (int)
- for server, use "0.0.0.0" to listen on any interface
- added e2e unit tests
- changed e2e protocol headers to use 32-bit event type IDs


## [2.6.8] - 2019-01-31

### bug fixes
Expand Down
82 changes: 0 additions & 82 deletions CMakeLists.txt

This file was deleted.

60 changes: 44 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Tredzone was founded in 2013 and operates in France, the UK and US.
This code has been built and unit-tested on Linux with:

- Linux kernel 2.6+
- g++ versions 4.9.4, 5.5, 6.4 and 7.3
- clang++ 3.9.1 with the libstdc++ runtime
- g++ versions 4.9.4, 5.5, 6.4, 7.3 and 8.2
- clang++ 3.9.1 and 4.0 with the libstdc++ runtime

It requires either C++ 11, 14 or 17 and the pthreads library. Support for Windows/VisualC++ will be announced soon.

Expand All @@ -25,24 +25,15 @@ It requires either C++ 11, 14 or 17 and the pthreads library. Support for Window
Simplx is open-sourced under the Apache 2.0 license, please see the [accompanying License](./LICENSE).


## Enterprise License

If you have a commercial enterprise license with us, including appropriate github access credentials, you may fetch those components with:

```
git submodule update --init enterprise
```


## Getting Started

About a dozen tutorials are included here, please see the [Tutorials README](./tutorials/README.md).

To build all tutorials, open a terminal at the root of the repository and type:
To build the first tutorial, open a terminal at the root of the repository and type:

```
mkdir build
cd build
cd tutorials/01_hello_actor
mkdir build && cd build
cmake ..
make -j8
```
Expand All @@ -54,8 +45,9 @@ To build and run the unit tests, which depend on the Google Test submodule, open

```
git submodule update --init thirdparty/googletest
cd test
mkdir tbuild && cd tbuild
cmake -DBUILD_TEST=1 ..
cmake ..
make -j8
```

Expand All @@ -65,7 +57,6 @@ to then run the unit tests type:
make test
```


## Docker

There's a Bash that'll compile the tutorials and run the unit tests under all above-mentionned versions of gcc and clang under Docker:
Expand All @@ -87,3 +78,40 @@ To generate the documentation, open a terminal at the repository root and type
doxygen doc/Doxyfile
```


## Enterprise License

If you have a commercial enterprise license with us, including appropriate github access credentials, you may fetch those components with:

```
git submodule update --init enterprise
```

for compilation you should also #define the following:

```
TREDZONE_ENTREPRISE
```

## Enterprise Unit Tests

At the root of the repository and type:

```
git submodule update --init thirdparty/googletest
mkdir tbuild && cd tbuild
cmake -DENTERPRISE=1 -DBUILD_TEST=1 ..
make -j8
make test
```


## Docker

To run the unit tests under Docker:

```
./test/docker_test.sh -DENTERPRISE=1
```


134 changes: 134 additions & 0 deletions common_simplx.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
# common cmake util functions for simplx
cmake_minimum_required(VERSION 3.7.2)
project(root)

# root SIMPLX dir
set(SIMPLX_DIR ${CMAKE_CURRENT_LIST_DIR})

option(TREDZONE_E2E "TREDZONE_E2E" OFF)

INCLUDE(Dart)

# topmost include
include_directories(${SIMPLX_DIR}/include)

#---- Set CXX Flags ------------------------------------------------------------

function(trz_set_cxx_flags)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11")

# search for user-defined c++ version
string(FIND ${CMAKE_CXX_FLAGS} "--std=c++" USER_CXX_VERSION_POS)
if (USER_CXX_VERSION_POS GREATER -1)
# user-defined C++ version
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
else()
# default is c++11
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11")
endif()

# add pthread
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")

# set C++ compiler options
if (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
# gcc
if(${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 4.9)
# gcc > 4.9
if(${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 7)
# gcc 7+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Werror -Wno-deprecated -Woverloaded-virtual -Wsign-promo -Wno-noexcept-type -fdiagnostics-color=auto ")
else()
# gcc ] 4.9 ; 7 ]
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Werror -Wno-deprecated -Woverloaded-virtual -Wsign-promo -fdiagnostics-color=auto")
endif()
else()
# gcc <= 4.9
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Werror -Wno-deprecated -Woverloaded-virtual -Wsign-promo -Wno-noexcept-type")
endif()
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0") # -g already defined
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
else()
message (FATAL_ERROR "unsupported C++ compiler ${CMAKE_CXX_COMPILER_ID}")
endif()

# will overwrite previous flags?? [PL]
#if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -g")
#elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
#endif()

# re-export to parent -- should be CACHE variable?
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} PARENT_SCOPE)

endfunction()

#---- Add (relative-from-top) directory MACRO ----------------------------------

# must be MACRO because function would add its own scope and then be lost

macro(trz_add_topdir)

# message("@ trz_add_topdir: TREDZONE_E2E = ${TREDZONE_E2E}")

if (${TREDZONE_E2E})
add_definitions(-DTREDZONE_E2E=1) # only valid in current directory
else()
add_definitions(-DTREDZONE_E2E=0) # only valid in current directory
endif()

set(reldir "${ARGV0}")

set(dir1 "${SIMPLX_DIR}/${reldir}")
set(dir2 "${CMAKE_BINARY_DIR}/${reldir}")

add_subdirectory(${dir1} ${dir2})

# barfs cause # of arguments?
# list(REMOVE_DUPLICATES ${SOURCE_FILES})

endmacro()

#---- Add Unit Test ------------------------------------------------------------

function(trz_add_test test_name source_file dependency)

add_executable(${test_name} ${source_file})
trz_target_link_libraries(${test_name} "${dependency}")
add_test(${test_name} ${test_name}) # add_test(TEST_NAME CMAKE_REF)

endfunction()

#---- Set Link Dependencies ----------------------------------------------------

function(trz_target_link_libraries test_name dependency)

target_link_libraries(${test_name} ${dependency} gtest_main ${CMAKE_THREAD_LIBS_INIT} )

endfunction()

#---- Remove e2e stub ----------------------------------------------------------

function(trz_remove_e2e_stub)

MESSAGE("@ ${TARGET_NAME} bf remove")
MESSAGE(" SOURCE_FILES = ${SOURCE_FILES}")

list(FILTER SOURCE_FILES EXCLUDE REGEX "^/.+/e2e_stub\\.cpp$")

MESSAGE("@ ${TARGET_NAME} af remove")
MESSAGE(" SOURCE_FILES = ${SOURCE_FILES}")

# re-export to parent
set(SOURCE_FILES ${SOURCE_FILES} PARENT_SCOPE)

endfunction()

# can NOT re-export to parent, cause has no parent?
# set(SIMPLX_DIR ${SIMPLX_DIR} CACHE)


1 change: 0 additions & 1 deletion enterprise
Submodule enterprise deleted from 2a50b8
7 changes: 5 additions & 2 deletions include/simplx.h
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/**
* @file simplx.h
* @brief Simplx top-level bulk header
* @copyright 2013-2018 Tredzone (www.tredzone.com). All rights reserved.
* @copyright 2013-2019 Tredzone (www.tredzone.com). All rights reserved.
* Please see accompanying LICENSE file for licensing terms.
*/


#include "trz/engine/actor.h"
#include "trz/engine/engine.h"
#include "trz/engine/engineversion.h"
#include "trz/engine/initializer.h"
#include "trz/engine/platform.h"

// internal
#include "trz/engine/internal/e2econnector.h"
#include "trz/engine/internal/cacheline.h"
#include "trz/engine/internal/mdoublechain.h"
#include "trz/engine/internal/mforwardchain.h"
Expand All @@ -28,3 +28,6 @@
#include "trz/engine/internal/dlldecorationrestore.h"
#include "trz/engine/internal/dlldecorationsave.h"

#if TREDZONE_E2E
#include "trz/e2e/e2e.h"
#endif
Loading

0 comments on commit 24c6c30

Please sign in to comment.