Skip to content

Commit

Permalink
Merge pull request #12 from dneg/llvm_8_support
Browse files Browse the repository at this point in the history
LLVM 5/6/7/8 CI
  • Loading branch information
Idclip authored Aug 19, 2019
2 parents c5f3304 + 284b850 commit 3a1659a
Show file tree
Hide file tree
Showing 5 changed files with 133 additions and 26 deletions.
135 changes: 121 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,18 @@
#
# Travis yaml script to configure continous integration
#
# Author: Matt Warner
# Author: Nick Avramoussis

dist: xenial
sudo: required
language: cpp

os:
- linux
- osx

compiler:
- gcc
- clang

cache: ccache
env: LLVM_VERSION=8

# Linux deps
addons:
apt:
packages:
packages: &native_deps
- cmake
- doxygen
- libboost-iostreams-dev
Expand All @@ -56,9 +49,9 @@ addons:
- libghc-zlib-dev
- libtbb-dev
- libblosc-dev
- llvm-5.0-dev
- libedit-dev

# OSX deps
before_install:
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then
brew update;
Expand All @@ -70,11 +63,125 @@ before_install:
brew install cppunit;
brew install c-blosc;
brew install tbb;
brew install llvm@5;
brew install llvm@$LLVM_VERSION;
brew install zlib;
fi

# Build matrix for linux which tests against llvm 5/6/7/8
# for both gcc and clang. Note that the test for osx is
# done outside of this matrix by the default settings above
matrix:
include:
###############################################################
# Linux LLVM 5/6/7/8 - GCC
###############################################################
- os: linux
compiler: gcc
env: LLVM_VERSION=8
addons:
apt:
sources:
- llvm-toolchain-xenial-8
packages:
- *native_deps
- llvm-8-dev
- os: linux
compiler: gcc
env: LLVM_VERSION=7
addons:
apt:
sources:
- llvm-toolchain-xenial-7
packages:
- *native_deps
- llvm-7-dev
- os: linux
compiler: gcc
env: LLVM_VERSION=6.0
addons:
apt:
packages:
- *native_deps
- llvm-6.0-dev
- os: linux
compiler: gcc
env: LLVM_VERSION=5.0
addons:
apt:
packages:
- *native_deps
- llvm-5.0-dev
###############################################################
# Linux LLVM 5/6/7/8 - clang
###############################################################
- os: linux
compiler: clang
env: LLVM_VERSION=8
addons:
apt:
sources:
- llvm-toolchain-xenial-8
packages:
- *native_deps
- llvm-8-dev
- os: linux
compiler: clang
env: LLVM_VERSION=7
addons:
apt:
sources:
- llvm-toolchain-xenial-7
packages:
- *native_deps
- llvm-7-dev
- os: linux
compiler: clang
env: LLVM_VERSION=6.0
addons:
apt:
packages:
- *native_deps
- llvm-6.0-dev
- os: linux
compiler: clang
env: LLVM_VERSION=5.0
addons:
apt:
packages:
- *native_deps
- llvm-5.0-dev
###############################################################
# MacOS LLVM 5/6/7/8 - GCC
###############################################################
- os: osx
compiler: gcc
env: LLVM_VERSION=8
- os: osx
compiler: gcc
env: LLVM_VERSION=7
- os: osx
compiler: gcc
env: LLVM_VERSION=6
- os: osx
compiler: gcc
env: LLVM_VERSION=5
###############################################################
# MacOS LLVM 5/6/7/8 - clang
###############################################################
- os: osx
compiler: clang
env: LLVM_VERSION=8
- os: osx
compiler: clang
env: LLVM_VERSION=7
- os: osx
compiler: clang
env: LLVM_VERSION=6
- os: osx
compiler: clang
env: LLVM_VERSION=5

install:
- travis/install-openvdb.sh
- travis/install-openvdb.sh

script: travis/install.sh
1 change: 1 addition & 0 deletions openvdb_ax/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ Version 0.1.0 - July 28, 2019
- Various fixes for clang and MacOS
- Overhaul of frontend tests to compare full AST generation
- Travis improvements including OSX builds
- Travis build matrices for LLVM 5/6/7/8, clang/gcc, osx/linux

Version 0.0.4 - December 12, 2018

Expand Down
15 changes: 7 additions & 8 deletions openvdb_ax/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ endif()
#########################################################################

# Configure LLVM
set(MINIMUM_LLVM_VERSION 5.0.0)

find_package(LLVM REQUIRED)
find_library(found_LLVM LLVM HINTS ${LLVM_LIBRARY_DIRS})
Expand All @@ -110,16 +111,14 @@ else()
set(LLVM_LIBS "${_llvm_libs}")
endif()

message(STATUS "Found LLVM: ${LLVM_DIR} (found version \"${LLVM_PACKAGE_VERSION}\")")

if(LLVM_VERSION_MAJOR GREATER 5)
message(WARNING "The version of LLVM located is greater than 5. "
"OpenVDB AX has been tested fully against LLVM 5.0.0 and 5.0.1, it is "
"recommended that you use this version where possible. Please report "
"any issues encountered with newer versions."
)
if(LLVM_PACKAGE_VERSION VERSION_LESS MINIMUM_LLVM_VERSION)
message(FATAL_ERROR "Could NOT find LLVM: Found unsuitable version \"${LLVM_PACKAGE_VERSION}\", "
"but required is at least \"${MINIMUM_LLVM_VERSION}\" (found ${LLVM_DIR})")
endif()

message(STATUS "Found LLVM: ${LLVM_DIR} (found suitable version \"${LLVM_PACKAGE_VERSION}\", "
"minimum required is \"${MINIMUM_LLVM_VERSION}\")")

#########################################################################

# Configure other dependencies
Expand Down
2 changes: 0 additions & 2 deletions travis/install-openvdb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ mkdir openvdb/build
cd openvdb/build

cmake \
-D CMAKE_CXX_COMPILER=g++ \
-D CMAKE_C_COMPILER=gcc \
-D DISABLE_DEPENDENCY_VERSION_CHECKS=ON \
-D OPENVDB_BUILD_CORE=ON \
-D OPENVDB_CORE_STATIC=OFF \
Expand Down
6 changes: 4 additions & 2 deletions travis/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ mkdir build
mkdir -p $HOME/install
cd build

echo "Testing aginst LLVM version $LLVM_VERSION"

OPENVDB_CXX_STRICT="ON"
LLVM_DIR="/usr/lib/llvm-5.0/share/llvm/cmake"
LLVM_DIR="/usr/lib/llvm-$LLVM_VERSION/share/llvm/cmake"

if [ "$TRAVIS_OS_NAME" = "osx" ]; then
LLVM_DIR="/usr/local/opt/llvm@5/lib/cmake/llvm"
LLVM_DIR="/usr/local/opt/llvm@$LLVM_VERSION/lib/cmake/llvm"
OPENVDB_CXX_STRICT="OFF"
fi

Expand Down

0 comments on commit 3a1659a

Please sign in to comment.