Skip to content

Commit

Permalink
Merge pull request #55 from stlab/develop
Browse files Browse the repository at this point in the history
Release 1.0
  • Loading branch information
Sean Parent authored Jun 10, 2017
2 parents 39a70f9 + 1a44716 commit 1b106fe
Show file tree
Hide file tree
Showing 48 changed files with 9,905 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,15 @@
*.exe
*.out
*.app

*.js

# MacOS nonsense
.DS_Store

# cmake build directory
build/

.idea
cmake-build-debug
cmake-build-release
46 changes: 46 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
sudo: required
dist: trusty
language: cpp
cache:
directories:
- $HOME/.conan
matrix:
include:
- compiler: gcc
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-5
install: if [ "$CXX" = "g++" ]; then export CXX="g++-5" CC="gcc-5"; fi
# - compiler: clang
# addons:
# apt:
# sources:
# - ubuntu-toolchain-r-test
# - llvm-toolchain-precise-3.8
# packages:
# - clang-3.8
# install: if [ "$CXX" = "g++" ]; then export CXX="clang++-3.8" CC="clang-3.8"; fi
branches:
except: /pr\/.*/
before_install:
- pip install conan
script:
- mkdir build
- cd build
- conan install ./.. --build=missing
- cmake .. && make
- cd bin # It'd be great if we could just run all the binaries we find in here...
- ./future_test
- ./serial_queue_test
notifications:
recipients:
- [email protected]
email:
on_success: change
on_failure: always
slack:
rooms:
secure: D2Q2H8/89cCSDjJXc6AmIAOEKIkoUBQZBH5sYIkc/FgB7+cLqeSQFNpe7N96t22SmvyIUsqPzxiEccEMTiLeRdo0S4BXAAkd3abB8wd2KFXe/mlpUpNNSYTowYA6I6EfY83Hb5QxVkIi5SiD6fwUo9VFXGpBQM5wmgU9CXE4Xk64RWziSKowGSOzIPytSduksG2p+wKQE6tK0o4NNPvOI0uzbzJuWUwHjaLU/tH12L/O/DmeLj+WO1939v1Xmm48p86JKr7uJzNNiTTVCGuAMLY3CLdTRYHpgvnfAxy93x0v0arvYiRrtABlfUP1RjthUPlmY0oESIx1EbgSUMXx1Bh0tvfJoRUq2H2qu9V1mMhIrMj7JzWcLb+9X3+vWg7UPgz8Y2kX8PZbzxCclIqesWsgBbaqsErbS6o5Fh2hvTMzIjRXm8oXc38wbC3jM11H0CD7tCEvpUHyPHfVGYgf0/qFNSoFU3qhfuWRdhi3Pa+En9/VcFmDrbh2P9ba2kDqVnXzz2q+xRZ1rfmzBiKOe05TVTm4535JbcRPCa4bgE+gT6PvVIlb4WSJk6pZleAlo/lh8Ugqc4fCRiShhxd0lKK+3+B1ImipuVeaNaTGUgfhtj4hhMzXEp9Xi+M3UyScnXvQhLc7pA3eYO6paXuVjBUIzAWOXzsPVwCVPFoObhY=
49 changes: 49 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
cmake_minimum_required(VERSION 2.8)

project(stlab C CXX)


set(CMAKE_SKIP_RPATH OFF)

if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
#set(CMAKE_CXX_FLAGS "-g -Wall -O3 -std=c++14 -fsanitize=thread -fexceptions -D_GLIBCXX_USE_CXX11_ABI=0")
set(CMAKE_CXX_FLAGS "-O3 -g -Wall -std=c++14 -fexceptions -ftemplate-backtrace-limit=0 -D_GLIBCXX_USE_CXX11_ABI=0")
set(CMAKE_LINK_FLAGS "-pthreads")
SET (CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS_INIT} $ENV{LDFLAGS})
endif()

set (Boost_MULTITHREADED ON)

if(WIN32)
add_definitions(-D_WIN32_WINNT=0x0601)
set(Boost_USE_STATIC_LIBS ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
else()
set (Boost_USE_STATIC_LIBS ON)
endif(WIN32)

if(EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
set(CONAN_SYSTEM_INCLUDES ON)
conan_basic_setup()
else()
find_package(Boost 1.60.0 COMPONENTS unit_test_framework)

include_directories(SYSTEM ${Boost_INCLUDE_DIR})
link_directories(${Boost_LIBRARY_DIR})
endif()

set (Boost_MULTITHREADED ON)

set(CMAKE_THREAD_PREFER_PTHREAD TRUE)

find_package( Threads )

if(CMAKE_USE_PTHREADS_INIT)
set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} "-pthread")
endif()

include_directories(.)

add_subdirectory(test)
add_subdirectory(playground)
31 changes: 30 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,31 @@
# libraries
# stlab/libraries

This is the source code repository of the Software Technology Lab (stlab).

ASL libraries will be migrated here in the stlab namespace, new libraries will be created here.

# Content

## [Concurrency](http://www.stlab.cc/libraries/concurrency/)
This library provides futures and channels, high level constructs for implementing algorithms that eases the use of
multiple CPU cores while minimizing contention. This library solves several problems of the C++11 and C++17 TS futures.

# Documentation

The complete documentation is available on the [stlab home page](http://stlab.cc)

# Building

First, you will need the following tools:

- [`conan`](https://www.conan.io/) ([download](https://www.conan.io/downloads))
- [`CMake`](https://cmake.org/) ([download](https://cmake.org/download/))
- (Mac) Xcode 8.2.1 or later
- (MSVC) Visual Studio 2015 (14.0) Update 3 or later

`conan` and `cmake` are available on the Mac via [Homebrew](http://brew.sh). `cmake` is available on Windows via [`scoop`](http://scoop.sh/).

Once they're set up, run either `setup_xcode.sh` or `setup_msvc.bat` for the platform of your choice. It will setup all necessary library dependencies and create the platform-specific project file in the `./build/` directory.

# Build Status: [![Build Status](https://travis-ci.org/stlab/libraries.svg?branch=develop)](https://travis-ci.org/stlab/libraries)

15 changes: 15 additions & 0 deletions Setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Quick setup instruction
=======================

* checkout the code with git clone https://github.com/stlab/libraries
* Have a recent cmake in your path
* Have at least boost 1.60.0 with library test build
* Linux / MacOS
** mkdir stlab_build
* Windows
** md stlab_build
* cd stlab_build
* cmake -DBOOST_ROOT=<path to the boost folder> ../libraries
* make
* ./test/future_test

14 changes: 14 additions & 0 deletions conanfile.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[requires]
# TBB/4.4.4@memsharded/testing
Boost/1.60.0@lasote/stable

[generators]
cmake

[options]
# Boost:shared=True
Boost:shared=False

[imports]
bin, *.dll -> ./bin # copies package bin folder DLLs to "bin" folder
lib, *.dylib -> ./bin # copies package lib folder DLLs to "bin" folder
6 changes: 6 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include <iostream>

int main() {
std::cout << "Hello, World!" << std::endl;
return 0;
}
22 changes: 22 additions & 0 deletions playground/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
PROJECT(playground)

set(SOURCE
main.cpp
)

set(HEADERS
)

add_executable(playground ${SOURCE} ${HEADERS})

include_directories(${Boost_INCLUDE_DIRS})

target_link_libraries(
playground
${Boost_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${CONAN_LIBS})


set_property(TARGET playground PROPERTY CXX_STANDARD 14)
set_property(TARGET playground PROPERTY CXX_STANDARD_REQUIRED ON)
Loading

0 comments on commit 1b106fe

Please sign in to comment.