Skip to content

Commit a69553e

Browse files
author
Kent Knox
committed
Version bump to v0.6.2
* Added Travis CI build automation * OPENCL_ROOT can be passed through env var to help find OpenCL * ExternalBoost can select compiler through ENV{CC} * Linux/OSX builds will find boost either in static or dynamic forms * Cmake config package now installs to ${LIB_INSTALL_DIR}/cmake/clSPARSE - #116 * Library links to ${CMAKE_DL_LIBS} - #117 Merge branch 'develop' Conflicts: CMakeLists.txt src/CMakeLists.txt
2 parents 4e34f70 + 7971327 commit a69553e

File tree

13 files changed

+317
-99
lines changed

13 files changed

+317
-99
lines changed

.travis.yml

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# Ubuntu name decoder ring; https://en.wikipedia.org/wiki/List_of_Ubuntu_releases
2+
# Ubuntu 12.04 LTS (Precise Pangolin) <== Travis CI VM image
3+
# Ubuntu 12.10 (Quantal Quetzal)
4+
# Ubuntu 13.04 (Raring Ringtail)
5+
# Ubuntu 13.10 (Saucy Salamander)
6+
# Ubuntu 14.04 LTS (Trusty Tahr)
7+
# Ubuntu 14.10 (Utopic Unicorn)
8+
# Ubuntu 15.04 (Vivid Vervet)
9+
# Ubuntu 15.10 (Wily Werewolf)
10+
# Ubuntu 16.04 LTS (Xenial Xantus)
11+
12+
# language: instructs travis what compilers && environment to set up in build matrix
13+
language: cpp
14+
15+
# sudo: false instructs travis to build our project in a docker VM (faster)
16+
# Can not yet install fglrx packages with 'false'
17+
sudo: required # false
18+
19+
# os: expands the build matrix to include multiple os's
20+
# disable linux, as we get sporadic failures on building boost, needs investigation
21+
os:
22+
# - linux
23+
- osx
24+
25+
# compiler: expands the build matrix to include multiple compilers (per os)
26+
compiler:
27+
- gcc
28+
- clang
29+
30+
addons:
31+
# apt: is disabled on osx builds
32+
# apt: needed by docker framework to install project dependencies without
33+
# sudo. Apt uses published Ubunto PPA's from https://launchpad.net/
34+
# https://github.com/travis-ci/apt-source-whitelist/blob/master/ubuntu.json
35+
apt:
36+
sources:
37+
# ubuntu-toolchain-r-test contains newer versions of gcc to install
38+
- ubuntu-toolchain-r-test
39+
# llvm-toolchain-precise-3.6 contains newer versions of clang to install
40+
# - llvm-toolchain-precise-3.6
41+
# kubuntu-backports contains newer versions of cmake to install
42+
- kubuntu-backports
43+
# boost-latest contains boost v1.55
44+
# - boost-latest
45+
packages:
46+
# g++-4.8 is minimum version considered to be the first good c++11 gnu compiler
47+
- g++-4.8
48+
# - clang-3.6
49+
# We require v2.8.12 minimum
50+
- cmake
51+
# I'm finding problems between pre-compiled versions of boost ublas, with gtest
52+
# stl_algobase.h: error: no matching function for call to swap()
53+
# - libboost-program-options1.55-dev
54+
# - libboost-serialization1.55-dev
55+
# - libboost-filesystem1.55-dev
56+
# - libboost-system1.55-dev
57+
# - libboost-regex1.55-dev
58+
# The package opencl-headers on 'precise' only installs v1.1 cl headers; uncomment for 'trusty' or greater
59+
# - opencl-headers
60+
# Uncomment one of the following when fglrx modules are added to the apt whitelist
61+
# - fglrx
62+
# - fglrx=2:8.960-0ubuntu1
63+
# - fglrx=2:13.350.1-0ubuntu0.0.1
64+
65+
# env: specifies additional global variables to define per row in build matrix
66+
env:
67+
global:
68+
- CLSPARSE_ROOT=${TRAVIS_BUILD_DIR}/bin/make/release
69+
70+
# The following filters our build matrix; we are interested in linux-gcc & osx-clang
71+
matrix:
72+
exclude:
73+
- os: linux
74+
compiler: clang
75+
- os: osx
76+
compiler: gcc
77+
78+
before_install:
79+
# Remove the following linux clause when fglrx can be installed with sudo: false
80+
- if [ ${TRAVIS_OS_NAME} == "linux" ]; then
81+
sudo apt-get update -qq &&
82+
sudo apt-get install -qq fglrx=2:13.350.1-0ubuntu0.0.1;
83+
fi
84+
- if [ ${TRAVIS_OS_NAME} == "linux" ]; then
85+
export OPENCL_ROOT="${TRAVIS_BUILD_DIR}/opencl-headers";
86+
export BUILD_BOOST="ON";
87+
fi
88+
- if [ ${TRAVIS_OS_NAME} == "osx" ]; then
89+
brew update;
90+
brew outdated boost || brew upgrade boost;
91+
brew outdated cmake || brew upgrade cmake;
92+
export BUILD_BOOST="OFF";
93+
fi
94+
- if [ ${CXX} = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi
95+
- cmake --version;
96+
- ${CC} --version;
97+
- ${CXX} --version;
98+
99+
install:
100+
# 'Precise' only distributes v1.1 opencl headers; download 1.2 headers from khronos website
101+
# Remove when the travis VM upgrades to 'trusty' or beyond
102+
- if [ ${TRAVIS_OS_NAME} == "linux" ]; then
103+
mkdir -p ${OPENCL_ROOT}/include/CL;
104+
pushd ${OPENCL_ROOT}/include/CL;
105+
wget -w 1 -r -np -nd -nv -A h,hpp https://www.khronos.org/registry/cl/api/1.2/;
106+
popd;
107+
fi
108+
# osx image does not contain cl.hpp file; download from Khronos
109+
- if [ ${TRAVIS_OS_NAME} == "osx" ]; then
110+
pushd /System/Library/Frameworks/OpenCL.framework/Versions/A/Headers/;
111+
sudo wget -w 1 -np -nd -nv -A h,hpp https://www.khronos.org/registry/cl/api/1.2/cl.hpp;
112+
popd;
113+
fi
114+
115+
# Use before_script: to run configure steps
116+
before_script:
117+
- mkdir -p ${CLSPARSE_ROOT}
118+
- pushd ${CLSPARSE_ROOT}
119+
- cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_Boost=${BUILD_BOOST} -DBUILD_gMock=ON -DBUILD_clSPARSE=ON -DBUILD_SAMPLES=ON ${TRAVIS_BUILD_DIR}
120+
121+
# use script: to execute build steps
122+
script:
123+
- make
124+
- cd clSPARSE-build
125+
- make package

CMakeLists.txt

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ cmake_minimum_required( VERSION 2.8.10 )
2828
if( POLICY CMP0048 )
2929
cmake_policy( SET CMP0048 NEW )
3030

31-
project( SuperBuild.clSPARSE VERSION 0.6.1.0 )
31+
project( SuperBuild.clSPARSE VERSION 0.6.2.0 )
3232
else( )
3333
project( SuperBuild.clSPARSE )
3434

@@ -42,7 +42,7 @@ else( )
4242
endif( )
4343

4444
if( NOT DEFINED SuperBuild.clSPARSE_VERSION_PATCH )
45-
set( SuperBuild.clSPARSE_VERSION_PATCH 1 )
45+
set( SuperBuild.clSPARSE_VERSION_PATCH 2 )
4646
endif( )
4747

4848
if( NOT DEFINED SuperBuild.clSPARSE_VERSION_TWEAK )
@@ -91,6 +91,7 @@ set_property( CACHE BUILD_CLVERSION PROPERTY STRINGS 2.0 1.2 1.1 )
9191
# Comment this out because this does not work yet
9292
set( clSPARSE.Dependencies )
9393
set( clSPARSE.Cmake.Args )
94+
set( clSPARSE.Samples.Cmake.Args )
9495

9596
# If the user selects, download, uncompress, and setup Boost
9697
if( BUILD_Boost )
@@ -100,13 +101,12 @@ if( BUILD_Boost )
100101
list( APPEND clSPARSE.Dependencies Boost )
101102
list( APPEND clSPARSE.Cmake.Args -DBOOST_ROOT=${BOOST_ROOT} )
102103
else( )
103-
if( NOT DEFINED BOOST_ROOT AND NOT DEFINED ENV{BOOST_ROOT} )
104-
message( SEND_ERROR "BOOST_ROOT must be provided if BUILD_Boost is disabled" )
104+
if( WIN32 AND (NOT DEFINED BOOST_ROOT AND NOT DEFINED ENV{BOOST_ROOT}) )
105+
message( WARNING "BOOST_ROOT should be provided if Boost is not in a default location" )
105106
else( )
106-
if( NOT DEFINED BOOST_ROOT )
107-
set( BOOST_ROOT "$ENV{BOOST_ROOT}" )
107+
if( DEFINED BOOST_ROOT )
108+
list( APPEND clSPARSE.Cmake.Args -DBOOST_ROOT=${BOOST_ROOT} )
108109
endif( )
109-
list( APPEND clSPARSE.Cmake.Args -DBOOST_ROOT=${BOOST_ROOT} )
110110
endif( )
111111
endif( )
112112

@@ -129,6 +129,12 @@ else( )
129129
endif( )
130130
endif( )
131131

132+
# Pass OPENCL_ROOT along to subproject if users provides path
133+
if( DEFINED OPENCL_ROOT )
134+
list( APPEND clSPARSE.Cmake.Args -DOPENCL_ROOT=${OPENCL_ROOT} )
135+
list( APPEND clSPARSE.Samples.Cmake.Args -DOPENCL_ROOT=${OPENCL_ROOT} )
136+
endif( )
137+
132138
# If the user selects, download, uncompress, and setup clBLAS
133139
#if( BUILD_clBLAS )
134140
# message( STATUS "Setting up clBLAS external..." )
@@ -198,7 +204,7 @@ if( BUILD_clSPARSE OR BUILD_SAMPLES )
198204
DEPENDS clSPARSE
199205
SOURCE_DIR ${PROJECT_SOURCE_DIR}/samples
200206
BINARY_DIR clSPARSE-samples-build
201-
CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DBUILD_CLVERSION=${BUILD_CLVERSION} -DBUILD64=${BUILD64} -DCMAKE_PREFIX_PATH=${install_dir}
207+
CMAKE_ARGS ${clSPARSE.Samples.Cmake.Args} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DBUILD_CLVERSION=${BUILD_CLVERSION} -DBUILD64=${BUILD64} -DCMAKE_PREFIX_PATH=${install_dir}
202208
EXCLUDE_FROM_ALL 1
203209
INSTALL_COMMAND ""
204210
)

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1+
## Build Status
12
Pre-built binaries are available on our [releases page](https://github.com/clMathLibraries/clSPARSE/releases)
23

4+
| Build branch | master | develop |
5+
|-----|-----|-----|
6+
| Linux/OSX x64 | [![Build Status](https://travis-ci.org/clMathLibraries/clSPARSE.svg?branch=master)](https://travis-ci.org/clMathLibraries/clSPARSE) |[![Build Status](https://travis-ci.org/clMathLibraries/clSPARSE.svg?branch=develop)](https://travis-ci.org/clMathLibraries/clSPARSE) |
7+
38
# clSPARSE
49
an OpenCL&copy; library implementing Sparse linear algebra. This project is a result of
510
a collaboration between [AMD Inc.](http://www.amd.com/) and

cmake/ExternalBoost.cmake

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# ########################################################################
22
# Copyright 2015 Advanced Micro Devices, Inc.
3-
#
3+
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
66
# You may obtain a copy of the License at
7-
#
7+
#
88
# http://www.apache.org/licenses/LICENSE-2.0
9-
#
9+
#
1010
# Unless required by applicable law or agreed to in writing, software
1111
# distributed under the License is distributed on an "AS IS" BASIS,
1212
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -44,8 +44,8 @@ endif( )
4444
set( Boost.Command ./b2 --prefix=<INSTALL_DIR>/package )
4545

4646
if( CMAKE_COMPILER_IS_GNUCXX )
47-
list( APPEND Boost.Command cxxflags=-fPIC )
48-
elseif( XCODE_VERSION )
47+
list( APPEND Boost.Command cxxflags=-fPIC -std=c++11 )
48+
elseif( XCODE_VERSION OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang") )
4949
list( APPEND Boost.Command cxxflags=-std=c++11 -stdlib=libc++ linkflags=-stdlib=libc++ )
5050
endif( )
5151

@@ -77,6 +77,18 @@ elseif( MSVC14 )
7777
list( APPEND Boost.Command toolset=msvc-14.0 )
7878
elseif( XCODE_VERSION )
7979
list( APPEND Boost.Command toolset=clang )
80+
elseif( DEFINED ENV{CC} )
81+
# CMake apprarently puts the full path of the compiler into CC
82+
# The user might specify a non-default gcc compiler through ENV
83+
message( STATUS "ENV{CC}=$ENV{CC}" )
84+
get_filename_component( gccToolset $ENV{CC} NAME )
85+
86+
# see: https://svn.boost.org/trac/boost/ticket/5917
87+
string( TOLOWER ${gccToolset} gccToolset )
88+
if( gccToolset STREQUAL "cc")
89+
set( gccToolset "gcc" )
90+
endif( )
91+
list( APPEND Boost.Command toolset=${gccToolset} )
8092
endif( )
8193

8294
if( WIN32 )
@@ -148,9 +160,11 @@ ExternalProject_Add(
148160
URL ${ext.Boost_URL}
149161
URL_MD5 ${ext.MD5_HASH}
150162
UPDATE_COMMAND ${Boost.Bootstrap}
163+
LOG_UPDATE 1
151164
CONFIGURE_COMMAND ""
152165
BUILD_COMMAND ${Boost.Command}
153166
BUILD_IN_SOURCE 1
167+
LOG_BUILD 1
154168
INSTALL_COMMAND ""
155169
)
156170

samples/CMakeLists.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ########################################################################
22
# Copyright 2015 Vratis, Ltd.
3-
#
3+
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
66
# You may obtain a copy of the License at
@@ -32,6 +32,11 @@ list( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
3232
find_package( clSPARSE REQUIRED CONFIG )
3333
message( STATUS "clSPARSE INCLUDES = ${clSPARSE_INCLUDE_DIR}")
3434

35+
# Query the user for which version of OpenCL they wish to build the library for
36+
set( BUILD_CLVERSION "1.2" CACHE STRING "The version of OpenCL we wish to compile the samples against" )
37+
set_property( CACHE BUILD_CLVERSION PROPERTY STRINGS 2.0 1.2 1.1 )
38+
message( STATUS "clSPARSE samples are building using CL interface ='${BUILD_CLVERSION}'" )
39+
3540
# Find OpenCL
3641
find_package( OpenCL ${BUILD_CLVERSION} REQUIRED )
3742
message( STATUS "OPENCL_INCLUDE_DIRS = ${OPENCL_INCLUDE_DIRS}")

samples/cmake/FindOpenCL.cmake

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
# ########################################################################
22
# Copyright 2015 Advanced Micro Devices, Inc.
3-
#
3+
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
66
# You may obtain a copy of the License at
7-
#
7+
#
88
# http://www.apache.org/licenses/LICENSE-2.0
9-
#
9+
#
1010
# Unless required by applicable law or agreed to in writing, software
1111
# distributed under the License is distributed on an "AS IS" BASIS,
1212
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
# ########################################################################
1616

17-
1817
# Locate an OpenCL implementation.
1918
# Currently supports AMD APP SDK (http://developer.amd.com/sdks/AMDAPPSDK/Pages/default.aspx/)
2019
#
@@ -49,10 +48,15 @@
4948
include( CheckSymbolExists )
5049
include( CMakePushCheckState )
5150

51+
if( DEFINED OPENCL_ROOT OR DEFINED ENV{OPENCL_ROOT})
52+
message( STATUS "Defined OPENCL_ROOT: ${OPENCL_ROOT}, ENV{OPENCL_ROOT}: $ENV{OPENCL_ROOT}" )
53+
endif( )
54+
5255
find_path(OPENCL_INCLUDE_DIRS
5356
NAMES OpenCL/cl.h CL/cl.h
5457
HINTS
5558
${OPENCL_ROOT}/include
59+
$ENV{OPENCL_ROOT}/include
5660
$ENV{AMDAPPSDKROOT}/include
5761
$ENV{CUDA_PATH}/include
5862
PATHS
@@ -107,6 +111,7 @@ if( LIB64 )
107111
NAMES OpenCL
108112
HINTS
109113
${OPENCL_ROOT}/lib
114+
$ENV{OPENCL_ROOT}/lib
110115
$ENV{AMDAPPSDKROOT}/lib
111116
$ENV{CUDA_PATH}/lib
112117
DOC "OpenCL dynamic library path"
@@ -119,6 +124,7 @@ else( )
119124
NAMES OpenCL
120125
HINTS
121126
${OPENCL_ROOT}/lib
127+
$ENV{OPENCL_ROOT}/lib
122128
$ENV{AMDAPPSDKROOT}/lib
123129
$ENV{CUDA_PATH}/lib
124130
DOC "OpenCL dynamic library path"

src/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ endif( )
3131
# clSPARSE becomes the name of the project with a particular version
3232
if( POLICY CMP0048 )
3333
cmake_policy( SET CMP0048 NEW )
34-
project( clSPARSE VERSION 0.6.1.0 LANGUAGES C CXX )
34+
project( clSPARSE VERSION 0.6.2.0 LANGUAGES C CXX )
3535
else( )
3636
project( clSPARSE C CXX )
3737
# Define a version for the code
@@ -44,7 +44,7 @@ else( )
4444
endif( )
4545

4646
if( NOT DEFINED clSPARSE_VERSION_PATCH )
47-
set( clSPARSE_VERSION_PATCH 1 )
47+
set( clSPARSE_VERSION_PATCH 2 )
4848
endif( )
4949

5050
if( NOT DEFINED clSPARSE_VERSION_TWEAK )

0 commit comments

Comments
 (0)