Skip to content

Commit

Permalink
Release v1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
rcrowder committed Jul 7, 2017
1 parent c5892b8 commit f0b8483
Show file tree
Hide file tree
Showing 32 changed files with 2,710 additions and 51 deletions.
74 changes: 51 additions & 23 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,33 @@
# OgmaNeo
# Copyright(c) 2016 Ogma Intelligent Systems Corp. All rights reserved.
# Copyright(c) 2016-2017 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
sudo: required

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
matrix:
include:
- os: linux
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
# C++11 compiler for Linux builds
- g++-4.8

addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
# C++11 compiler for Linux builds
- gcc-4.8
- g++-4.8
# https://docs.travis-ci.com/user/osx-ci-environment/
- os: osx
osx_image: xcode8

cache:
directories:
- $HOME/.local
- $HOME/.cache/pip

before_install:
# Install dependencies into $HOME/.local
Expand All @@ -42,26 +40,56 @@ install:
# Install OpenCL (Linux - POCL driver, release_0_13)
- bash ./.travis/install_opencl.sh

# Install SWIG into $HOME/.local
- bash ./.travis/install_swig.sh

# Install dependancies for python
- pip install -r ./Python/requirements.txt

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

- echo Travis OS Name ... ${TRAVIS_OS_NAME}
- echo Travis build dir ... ${TRAVIS_BUILD_DIR}
- echo PATH var ... ${PATH}
- echo CMake Version .. $($HOME/.local/cmake/bin/cmake --version)
- echo Python Version ... $(python --version)
- which python
- which pip

# 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

# Build the Python bindings
- cd ../Python
- python setup.py bdist_wheel

- cd dist/
- ls -l
- pip install $(ls)
- cd ..

- pip show ogmaneo

# Build and test the Java JNI bindings
- cd ../Java
- mkdir build; cd build;
- $HOME/.local/cmake/bin/cmake ..
- make

- javac -cp JOgmaNeo.jar ../src/com/ogmacorp/Example.java -d .
- java -cp JOgmaNeo.jar:. -Djava.library.path=. Example 0

notifications:
email:
recipients:
Expand Down
4 changes: 1 addition & 3 deletions .travis/install_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ if [[ $TRAVIS_OS_NAME == 'osx' ]]; then
#brew unlink cmake
brew update

# OSX has:
# apple-gcc42
brew tap homebrew/versions
brew install gcc48
brew install [email protected]

else
sudo apt-get -qq update
Expand Down
3 changes: 1 addition & 2 deletions .travis/install_opencl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@ if [ $TRAVIS_OS_NAME == 'linux' ]; then

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

# 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

Expand Down
21 changes: 21 additions & 0 deletions .travis/install_swig.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/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 SWIG
cd $TRAVIS_BUILD_DIR

if [ $TRAVIS_OS_NAME == 'osx' ]; then
brew upgrade pcre
brew install swig
else
sudo apt install libpcre3 libpcre3-dev
sudo apt install swig3.0
fi
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
1.4 July, 2017
==============

- Merged Python and Java(JNI) bindings
- Add C# language bindings

1.3 March, 2017
===============

Expand Down
37 changes: 37 additions & 0 deletions CMake/FindOgmaNeo.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# --------------------------------------------------------------------------
# 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.
# --------------------------------------------------------------------------

# Locate OgmaNeo library
#
# This module defines
# OGMANEO_LIBRARY, the name of the library to link against
# OGMANEO_FOUND, if false, do not try to link to OgmaNeo
# OGMANEO_INCLUDE_DIR, where to find OgmaNeo headers
#
IF(OGMANEO_INCLUDE_DIR)
# Already in cache, be silent
SET(OGMANEO_FIND_QUIETLY TRUE)
ENDIF(OGMANEO_INCLUDE_DIR)

FIND_PATH(OGMANEO_INCLUDE_DIR ogmaneo/neo/Architect.h)
if (NOT "${OGMANEO_INCLUDE_DIR}" STREQUAL "OGMANEO_INCLUDE_DIR-NOTFOUND")
SET(OGMANEO_INCLUDE_DIR "${OGMANEO_INCLUDE_DIR}/ogmaneo")
ENDIF()

SET(OGMANEO_NAMES ogmaneo OgmaNeo OGMANEO)
FIND_LIBRARY(OGMANEO_LIBRARY NAMES ${OGMANEO_NAMES})

# Per-recommendation
SET(OGMANEO_INCLUDE_DIRS "${OGMANEO_INCLUDE_DIR}")
SET(OGMANEO_LIBRARIES "${OGMANEO_LIBRARY}")

# handle the QUIETLY and REQUIRED arguments and set OGMANEO_FOUND to TRUE if
# all listed variables are TRUE

INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OgmaNeo DEFAULT_MSG OGMANEO_LIBRARY OGMANEO_INCLUDE_DIR)
68 changes: 65 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ----------------------------------------------------------------------------
# OgmaNeo
# Copyright(c) 2016 Ogma Intelligent Systems Corp. All rights reserved.
# Copyright(c) 2016-2017 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.
Expand All @@ -12,6 +12,12 @@ cmake_minimum_required(VERSION 3.1)
project(OgmaNeo)
set(CMAKE_VERBOSE_MAKEFILE OFF)

set(OGMANEO_MAJOR_VERSION 1)
set(OGMANEO_MINOR_VERSION 4)
set(OGMANEO_PATCH_VERSION 0)
set(OGMANEO_VERSION
${OGMANEO_MAJOR_VERSION}.${OGMANEO_MINOR_VERSION}.${OGMANEO_PATCH_VERSION})

set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake")

if(NOT CMAKE_BUILD_TYPE)
Expand Down Expand Up @@ -136,7 +142,7 @@ if ("${CL2_HPP_NAME}" STREQUAL "CL2_HPP_NAME-NOTFOUND")
else()
# Extract the directory
get_filename_component(CL2_HPP_DIR "${CL2_HPP_NAME}" DIRECTORY)
message(STATUS "CL2.HPP found in ${CL2_HPP_DIR}")
message(STATUS "Found existing CL2.hpp in ${CL2_HPP_DIR}")

include_directories(SYSTEM "${CL2_HPP_DIR}/..")
endif()
Expand Down Expand Up @@ -222,7 +228,7 @@ foreach(ocl_filename ${KERNEL_SRC})

add_custom_command(
OUTPUT "${outfile}"
COMMAND OgmaOCLtoHpp "${infileCommon}" "${infile}" "${outfile}" ${filename}
COMMAND OgmaOCLtoHpp "${infileCommon}" "${infile}" "${outfile}" ${filename}
DEPENDS "${infileCommon}" "${infile}" OgmaOCLtoHpp
VERBATIM)

Expand Down Expand Up @@ -278,21 +284,76 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
endif()
endif()

# Offer the user the choice of overriding the installation directories
set(INSTALL_LIB_DIR lib CACHE PATH "Installation directory for libraries")
set(INSTALL_INCLUDE_DIR include/ogmaneo CACHE PATH
"Installation directory for header files")

message(STATUS "CMake install prefix = ${CMAKE_INSTALL_PREFIX}")

if(WIN32 AND NOT CYGWIN)
set(DEF_INSTALL_CMAKE_DIR CMake)
else()
set(DEF_INSTALL_CMAKE_DIR lib/CMake/OgmaNeo)
endif()
set(INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH
"Installation directory for CMake files")

# Make relative paths absolute (needed later on)
foreach(p LIB BIN INCLUDE CMAKE)
set(var INSTALL_${p}_DIR)
if(NOT IS_ABSOLUTE "${${var}}")
set(${var} "${CMAKE_INSTALL_PREFIX}/${${var}}")
endif()
endforeach()

# Add all targets to the build-tree export set
export(TARGETS OgmaNeo
FILE "${PROJECT_BINARY_DIR}/OgmaNeoTargets.cmake")

# Export the package for use from the build-tree
# (this registers the build-tree with a global CMake-registry)
export(PACKAGE OgmaNeo)

file(RELATIVE_PATH REL_INCLUDE_DIR "${INSTALL_CMAKE_DIR}"
"${INSTALL_INCLUDE_DIR}")

set(CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}" "${PROJECT_BINARY_DIR}")
configure_file(OgmaNeoConfig.cmake.in
"${PROJECT_BINARY_DIR}/OgmaNeoConfig.cmake" @ONLY)

set(CONF_INCLUDE_DIRS "\${OGMANEO_CMAKE_DIR}/${REL_INCLUDE_DIR}")
configure_file(OgmaNeoConfig.cmake.in
"${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/OgmaNeoConfig.cmake" @ONLY)

configure_file(OgmaNeoConfigVersion.cmake.in
"${PROJECT_BINARY_DIR}/OgmaNeoConfigVersion.cmake" @ONLY)

install(FILES
"${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/OgmaNeoConfig.cmake"
"${PROJECT_BINARY_DIR}/OgmaNeoConfigVersion.cmake"
DESTINATION "${INSTALL_CMAKE_DIR}")

# Library install target
install(TARGETS OgmaNeo
EXPORT OgmaNeoTargets
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)

# Headers, incl. schema headers, install targets
install(DIRECTORY "${PROJECT_SOURCE_DIR}/source/"
EXPORT OgmaNeoTargets
DESTINATION include/ogmaneo
FILES_MATCHING PATTERN "*.h*")

# 3rd party headers install targets
install(DIRECTORY "${3RDPARTY_PATH}/include/"
EXPORT OgmaNeoTargets
DESTINATION include/ogmaneo
FILES_MATCHING PATTERN "*.h*")

install(EXPORT OgmaNeoTargets DESTINATION "${INSTALL_CMAKE_DIR}")

# Uninstall target
configure_file(
Expand All @@ -302,3 +363,4 @@ configure_file(

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

Loading

0 comments on commit f0b8483

Please sign in to comment.