Skip to content

Commit

Permalink
Release 1.0.1 (#6)
Browse files Browse the repository at this point in the history
* Release 1.0.1

* Date fix in Changes.md
  • Loading branch information
rcrowder authored Oct 13, 2016
1 parent c4d2fd2 commit 409d56e
Show file tree
Hide file tree
Showing 11 changed files with 315 additions and 21 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -211,3 +211,6 @@ FakesAssemblies/
CMakeFiles/
CMakeCache.txt
cmake_install.cmake

# MacOS cache
.DS_Store
70 changes: 70 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# OgmaNeo
# Copyright(c) 2016 Ogma Intelligent Systems Corp. All rights reserved.
#
# This copy of OgmaNeo is licensed to you under the terms described
# in the OGMANEO_LICENSE.md file included in this distribution.

language: cpp

sudo: required
dist: trusty

os:
# https://docs.travis-ci.com/user/trusty-ci-environment/
# Ubuntu 14.04 Trusty Tahr
- linux

# https://docs.travis-ci.com/user/osx-ci-environment/
# OS X 10.11.6 (and Xcode 7.3.1)
- osx

addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
# C++11 compiler for Linux builds
- gcc-4.8
- g++-4.8

cache:
directories:
- $HOME/.local

before_install:
# Install dependencies into $HOME/.local
- bash ./.travis/install_deps.sh

install:
# Install CMake v3.6 into $HOME/.local
- bash ./.travis/install_cmake.sh

# Install OpenCL (Linux - POCL driver, release_0_13)
- bash ./.travis/install_opencl.sh

script:
- echo Travis OS Name ... ${TRAVIS_OS_NAME}
- echo Travis build dir ... ${TRAVIS_BUILD_DIR}
- echo CMake Version .. $($HOME/.local/cmake/bin/cmake --version)

# Build the OgmaNeo library
- cd $TRAVIS_BUILD_DIR
- mkdir build
- cd build

- if [ $TRAVIS_OS_NAME == 'linux' ]; then
export CC=gcc-4.8;
export CXX=g++-4.8;
fi

- $HOME/.local/cmake/bin/cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=../install .. || travis_terminate 1;

- make
- make install

notifications:
email:
recipients:
- [email protected]
on_success: change
on_failure: always
31 changes: 31 additions & 0 deletions .travis/install_cmake.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/sh

# OgmaNeo
# Copyright(c) 2016 Ogma Intelligent Systems Corp. All rights reserved.
#
# This copy of OgmaNeo is licensed to you under the terms described
# in the OGMANEO_LICENSE.md file included in this distribution.

set -ex

#----------------------------------------
# Install the latest CMake
cd $TRAVIS_BUILD_DIR

# Check to see if CMake cache folder is empty
if [ ! -d "$HOME/.local/cmake" ]; then
wget https://cmake.org/files/v3.6/cmake-3.6.2.tar.gz
tar -xzf cmake-3.6.2.tar.gz
cd cmake-3.6.2

if [ $TRAVIS_OS_NAME == 'osx' ]; then
CC=clang CXX=clang++ ./configure --prefix=$HOME/.local/cmake
else
CC=gcc-4.8 CXX=g++-4.8 ./configure --prefix=$HOME/.local/cmake
fi

make
make install
else
echo "Using cached CMake directory."
fi
29 changes: 29 additions & 0 deletions .travis/install_deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/sh

# OgmaNeo
# Copyright(c) 2016 Ogma Intelligent Systems Corp. All rights reserved.
#
# This copy of OgmaNeo is licensed to you under the terms described
# in the OGMANEO_LICENSE.md file included in this distribution.

set -ex

#----------------------------------------
# Package updates

if [[ $TRAVIS_OS_NAME == 'osx' ]]; then
#brew unlink cmake
brew update

# OSX has:
# apple-gcc42
brew tap homebrew/versions
brew install gcc48

else
sudo apt-get -qq update

# Trusty has:
# gcc 4.8.4
# llvm clang 3.5.0
fi
65 changes: 65 additions & 0 deletions .travis/install_opencl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/bin/sh

# OgmaNeo
# Copyright(c) 2016 Ogma Intelligent Systems Corp. All rights reserved.
#
# This copy of OgmaNeo is licensed to you under the terms described
# in the OGMANEO_LICENSE.md file included in this distribution.

set -ex

#----------------------------------------
# Install POCL (Linux only)

if [ $TRAVIS_OS_NAME == 'linux' ]; then
cd $TRAVIS_BUILD_DIR

sudo apt install libhwloc-dev ocl-icd-opencl-dev libglew-dev
sudo apt install zlib1g-dev libedit-dev libltdl-dev opencl-headers

# Check to see if POCL cache folder is empty
if [ ! -d "$HOME/.local/pocl" ]; then
sudo apt install clang-3.8 libclang-3.8-dev

git clone https://github.com/pocl/pocl.git
cd pocl

git checkout release_0_13
mkdir build-pocl; cd build-pocl

CC=gcc-4.8 CXX=g++-4.8 $HOME/.local/cmake/bin/cmake -DCMAKE_INSTALL_PREFIX=$HOME/.local/pocl -DWITH_LLVM_CONFIG=/usr/bin/llvm-config-3.8 -DSTATIC_LLVM=1 -DENABLE_ICD=1 ..

make
sudo make install
sudo cp /etc/OpenCL/vendors/pocl.icd $HOME/.local/pocl/
else
echo "Using cached POCL directory."

sudo mkdir -p /etc/OpenCL/vendors/
sudo cp $HOME/.local/pocl/pocl.icd /etc/OpenCL/vendors/
fi
fi


#----------------------------------------
# Install Khronos cl2.hpp
cd $TRAVIS_BUILD_DIR

wget https://github.com/KhronosGroup/OpenCL-CLHPP/releases/download/v2.0.10/cl2.hpp

if [ $TRAVIS_OS_NAME == 'linux' ]; then
sudo cp cl2.hpp /usr/include/CL/
else
mkdir $TRAVIS_BUILD_DIR/source/OpenCL
cp cl2.hpp $TRAVIS_BUILD_DIR/source/OpenCL/
fi


#----------------------------------------
# Test OpenCL using Oblomov's clinfo
cd $TRAVIS_BUILD_DIR

git clone https://github.com/Oblomov/clinfo.git
cd clinfo
make
./clinfo
8 changes: 8 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
1.0.1 October 12, 2016
========================

- Travis CI integration
- Kernel code changes for Intel OpenCL SDK and POCL driver
- Apple Mac OSX support
- Raspberry Pi3 support

1.0 September, 2016
====================

Expand Down
98 changes: 89 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,21 @@ set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake")
#endif()
#message("Build type: ${CMAKE_BUILD_TYPE}")

if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(BITNESS 64)
else()
set(BITNESS 32)
endif()
#message("Bitness: ${BITNESS}")

option(BUILD_SHARED_LIBS OFF)
message(STATUS "Shared libs: ${BUILD_SHARED_LIBS}")


include(ExternalProject)

set(3RDPARTY_PATH "${CMAKE_CURRENT_BINARY_DIR}/3rdparty")
include_directories("${3RDPARTY_PATH}/include")
include_directories(BEFORE "${3RDPARTY_PATH}/include")
link_directories("${3RDPARTY_PATH}/lib")


Expand All @@ -37,24 +45,97 @@ link_directories("${3RDPARTY_PATH}/lib")

find_path(OPENCL_INCLUDE_DIRS
NAMES OpenCL/cl.h CL/cl.h
HINTS /usr/local/include/ $ENV{AMDAPPSDKROOT}/include/
HINTS
$ENV{AMDAPPSDKROOT}/include/
$ENV{INTELOCLSDKROOT}/include/
$ENV{CUDA_PATH}/include/
$ENV{OPENCL_ROOT}/include/
PATHS
/usr/include /usr/local/include/
)

find_library(OPENCL_LIBRARIES
NAMES OpenCL
HINTS /usr/local/lib/ $ENV{AMDAPPSDKROOT}/lib/x86_64/
PATH_SUFFIXES ${PLATFORM}${BITNESS} ${BITNESS_SUFFIX}
)
if(BITNESS EQUAL 64)
find_library(OPENCL_LIBRARIES
NAMES OpenCL
HINTS
$ENV{AMDAPPSDKROOT}/lib
$ENV{INTELOCLSDKROOT}/lib
$ENV{CUDA_PATH}/lib
$ENV{OPENCL_ROOT}/lib
PATH_SUFFIXES x86_64 x64
PATHS /usr/lib64 /usr/lib /usr/local/lib
)
elseif(BITNESS EQUAL 32)
find_library(OPENCL_LIBRARIES
NAMES OpenCL
HINTS
$ENV{AMDAPPSDKROOT}/lib
$ENV{INTELOCLSDKROOT}/lib
$ENV{CUDA_PATH}/lib
$ENV{OPENCL_ROOT}/lib
PATH_SUFFIXES x86 Win32
PATHS /usr/lib32 /usr/lib /usr/local/lib
)
endif()

# Fall-back to find a POCL install
if(OPENCL_LIBRARIES STREQUAL "")
find_library(OPENCL_LIBRARIES
NAMES pocl
HINTS $HOME/.local/pocl/lib /usr/lib64 /usr/lib /usr/local/lib
)
endif()

if(OPENCL_INCLUDE_DIRS STREQUAL "" OR OPENCL_LIBRARIES STREQUAL "")
message(FATAL_ERROR "Could not locate OpenCL include & libs")
else()
message(STATUS "Found existing OpenCL in ${OPENCL_INCLUDE_DIRS}")
message(STATUS "Found existing OpenCL lib ${OPENCL_LIBRARIES}")
endif()

include_directories(${OPENCL_INCLUDE_DIRS})


############################################################################
# Find Khronos cl2.hpp include file

find_file(CL2_HPP_DIR
NAMES OpenCL/cl2.hpp CL/cl2.hpp
HINTS
$ENV{AMDAPPSDKROOT}/include/
$ENV{INTELOCLSDKROOT}/include/
$ENV{CUDA_PATH}/include/
$ENV{OPENCL_ROOT}/include/
PATHS
/usr/include /usr/local/include/
)

if ("${CL2_HPP_DIR}" STREQUAL "CL2_HPP_DIR-NOTFOUND")
message(STATUS "CL2 HPP not found!")

# The file DOWNLOAD using a https URL require that CMake contains SSL support
# By default CMake doesn't have SSL enabled. Only Mac OSX has this enabled,
# so restict the following cl2.hpp download to only Apple devices.

if(APPLE)
message(STATUS "Downloading cl2.hpp v2.0.10 into ${3RDPARTY_PATH}/include")
file(DOWNLOAD
https://github.com/KhronosGroup/OpenCL-CLHPP/releases/download/v2.0.10/cl2.hpp
${3RDPARTY_PATH}/include/OpenCL/cl2.hpp
SHOW_PROGRESS
STATUS cl2_download_status
LOG cl2_download_log)

list(GET cl2_download_status 0 status_code)
list(GET cl2_download_status 1 status_string)

if(NOT status_code EQUAL 0)
message(FATAL_ERROR "Error: downloading cl2.hpp (code: ${status_code} - ${status_string} log: ${cl2_download_log}")
endif()
endif()
endif()


############################################################################
# Find flatbuffers and build schemas

Expand All @@ -68,7 +149,7 @@ else()
ExternalProject_Add(
FlatBuffers
PREFIX FlatBuffers
URL "https://github.com/google/flatbuffers/archive/v1.4.0.zip"
GIT_REPOSITORY "https://github.com/google/flatbuffers.git"
CMAKE_ARGS
"-DFLATBUFFERS_BUILD_TESTS=OFF"
"-DCMAKE_INSTALL_PREFIX=${3RDPARTY_PATH}"
Expand Down Expand Up @@ -200,4 +281,3 @@ configure_file(

add_custom_target(UNINSTALL
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)

Loading

0 comments on commit 409d56e

Please sign in to comment.