OpenShadingLanguage/0001-Some-SPI-build-fixes-for-finding-the-right-llvm.patch
Dave Plater 1c4af470c7 Accepting request 796879 from home:plater:blender
- Update to v1.11.4.1 to fix build with LLVM10.
- Remove incorporated patch:
  0001-Generalize-lookup-of-stdosl.h-in-install-directory-a.patch
Added patches from git:
  0001-Some-SPI-build-fixes-for-finding-the-right-llvm.patch and
  0001-LLVM-10-odds-and-ends-1135.patch.
- Created osl-pkgconfig-versions.patch to fix pc file's version
  fields. Upstreamed along with workaround for new libclang-cpp in issue #1155
Created osl-oslimageio-soname.patch to keep the library build in  line with v1.x.

OBS-URL: https://build.opensuse.org/request/show/796879
OBS-URL: https://build.opensuse.org/package/show/graphics/OpenShadingLanguage?expand=0&rev=11
2020-04-24 08:17:39 +00:00

134 lines
6.8 KiB
Diff

From ca90dc60c0f6473ff99fa0b396af4d434862bc1b Mon Sep 17 00:00:00 2001
From: Larry Gritz <lg@larrygritz.com>
Date: Mon, 30 Mar 2020 21:05:24 -0700
Subject: [PATCH] Some SPI build fixes for finding the right llvm
---
site/spi/Makefile-bits | 63 ++++++++++++++++++++++++++++++++------------------
1 file changed, 41 insertions(+), 22 deletions(-)
diff --git a/site/spi/Makefile-bits b/site/spi/Makefile-bits
index 4b148191..15eeca0e 100644
--- a/site/spi/Makefile-bits
+++ b/site/spi/Makefile-bits
@@ -66,11 +66,13 @@ endif
ifeq (${SP_OS}, rhel7)
# Rhel7 (current)
platform := rhel7
- SPI_COMPILER_PLATFORM ?= gcc-4.8
- ifeq (${SPI_COMPILER_PLATFORM},gcc-6.3)
- SPCOMP2_COMPILER ?= gcc63
- else
+ SPI_COMPILER_PLATFORM ?= gcc-6.3
+ ifeq (${SPI_COMPILER_PLATFORM},gcc-4.8)
SPCOMP2_COMPILER ?= gcc48m64
+ CMAKE_CXX_STANDARD ?= 11
+ else
+ SPCOMP2_COMPILER ?= gcc63
+ CMAKE_CXX_STANDARD ?= 14
endif
SP_PLATFORM ?= linux
SP_PROC ?= x86_64
@@ -100,7 +102,6 @@ SPCOMP2_ROOT ?= /shots/spi/home/lib/SpComp2
## Rhel7 (current)
ifeq (${SP_OS}, rhel7)
- CMAKE_CXX_STANDARD ?= 11
USE_SIMD ?= sse4.1,aes
CMAKE ?= cmake
USE_NINJA ?= 1
@@ -128,23 +129,22 @@ ifeq (${SP_OS}, rhel7)
LLVM_DIRECTORY ?= /shots/spi/home/lib/arnold/rhel7/llvm_8.0.0
ifeq (${COMPILER},clang6)
LLVM_DIRECTORY := /shots/spi/home/lib/arnold/rhel7/llvm_6.0.1
- MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=${LLVM_DIRECTORY}/bin/clang -DCMAKE_CXX_COMPILER=${LLVM_DIRECTORY}/bin/clang++
- MY_CMAKE_FLAGS += -DCMAKE_C_FLAGS="--gcc-toolchain=/usr" -DCMAKE_CXX_FLAGS="--gcc-toolchain=/usr"
+ MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=${LLVM_DIRECTORY}/bin/clang \
+ -DCMAKE_CXX_COMPILER=${LLVM_DIRECTORY}/bin/clang++
else ifeq (${COMPILER},clang7)
LLVM_DIRECTORY := /shots/spi/home/lib/arnold/rhel7/llvm_7.0.1
- MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=${LLVM_DIRECTORY}/bin/clang -DCMAKE_CXX_COMPILER=${LLVM_DIRECTORY}/bin/clang++
- MY_CMAKE_FLAGS += -DCMAKE_C_FLAGS="--gcc-toolchain=/usr" -DCMAKE_CXX_FLAGS="--gcc-toolchain=/usr"
+ MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=${LLVM_DIRECTORY}/bin/clang \
+ -DCMAKE_CXX_COMPILER=${LLVM_DIRECTORY}/bin/clang++
else ifeq (${COMPILER},clang8)
LLVM_DIRECTORY := /shots/spi/home/lib/arnold/rhel7/llvm_8.0.0
- MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=${LLVM_DIRECTORY}/bin/clang -DCMAKE_CXX_COMPILER=${LLVM_DIRECTORY}/bin/clang++
- MY_CMAKE_FLAGS += -DCMAKE_C_FLAGS="--gcc-toolchain=/usr" -DCMAKE_CXX_FLAGS="--gcc-toolchain=/usr"
+ MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=${LLVM_DIRECTORY}/bin/clang \
+ -DCMAKE_CXX_COMPILER=${LLVM_DIRECTORY}/bin/clang++
else ifeq (${COMPILER},clang9)
- LLVM_DIRECTORY := /shots/spi/home/software/packages/llvm/9.0.0/${SPI_COMPILER_PLATFORM}
- MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=${LLVM_DIRECTORY}/bin/clang -DCMAKE_CXX_COMPILER=${LLVM_DIRECTORY}/bin/clang++
- MY_CMAKE_FLAGS += -DCMAKE_C_FLAGS="--gcc-toolchain=/usr" -DCMAKE_CXX_FLAGS="--gcc-toolchain=/usr"
+ LLVM_DIRECTORY := /shots/spi/home/software/packages/llvm/9.0.1-1/${SPI_COMPILER_PLATFORM}
+ MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=${LLVM_DIRECTORY}/bin/clang \
+ -DCMAKE_CXX_COMPILER=${LLVM_DIRECTORY}/bin/clang++
else ifeq (${COMPILER},clang)
MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
- MY_CMAKE_FLAGS += -DCMAKE_C_FLAGS="--gcc-toolchain=/usr" -DCMAKE_CXX_FLAGS="--gcc-toolchain=/usr"
else ifeq (${COMPILER}, gcc6)
MY_CMAKE_FLAGS += \
-DCMAKE_C_COMPILER=/opt/rh/devtoolset-6/root/usr/bin/gcc \
@@ -156,9 +156,11 @@ ifeq (${SP_OS}, rhel7)
MY_CMAKE_FLAGS += \
-DCMAKE_C_COMPILER=${LLVM_DIRECTORY}/bin/clang \
-DCMAKE_CXX_COMPILER=${LLVM_DIRECTORY}/bin/clang++
- MY_CMAKE_FLAGS += -DCMAKE_C_FLAGS="--gcc-toolchain=/usr" \
- -DCMAKE_CXX_FLAGS="--gcc-toolchain=/usr" \
- -DTOOLCHAIN_FLAGS="--gcc-toolchain=/usr"
+ endif
+ ifeq (${SPI_COMPILER_PLATFORM},gcc-4.8)
+ MY_CMAKE_FLAGS += -DCMAKE_C_FLAGS="--gcc-toolchain=/usr" \
+ -DCMAKE_CXX_FLAGS="--gcc-toolchain=/usr" \
+ -DTOOLCHAIN_FLAGS="--gcc-toolchain=/usr"
endif
MY_CMAKE_FLAGS +=
@@ -292,6 +294,7 @@ ifeq (${SP_OS}, rhel7)
## Generic OSX machines (including LG's laptop)
else ifeq (${platform}, macosx)
+ CMAKE_CXX_STANDARD ?= 14
USE_SIMD ?= sse4.2
MY_CMAKE_FLAGS += -DCMAKE_BUILD_WITH_INSTALL_RPATH=1
MY_CMAKE_FLAGS += -DCMAKE_INSTALL_NAME_DIR="${working_dir}/dist/${platform}${variant}/lib"
@@ -317,14 +320,30 @@ else ifeq (${platform}, macosx)
MY_CMAKE_FLAGS += \
-DCMAKE_C_COMPILER=gcc-8 -DCMAKE_CXX_COMPILER=g++-8
USE_LIBCPLUSPLUS := 0
+ else ifeq (${COMPILER}, gcc9)
+ MY_CMAKE_FLAGS += \
+ -DCMAKE_C_COMPILER=gcc-9 -DCMAKE_CXX_COMPILER=g++-9
+ USE_LIBCPLUSPLUS := 0
else ifeq (${COMPILER},clang6)
- MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=/usr/local/Cellar/llvm@6/6.0.1_1/bin/clang -DCMAKE_CXX_COMPILER=/usr/local/Cellar/llvm@6/6.0.1_1/bin/clang++
+ MY_CMAKE_FLAGS += \
+ -DCMAKE_C_COMPILER=/usr/local/Cellar/llvm@6/6.0.1_2/bin/clang \
+ -DCMAKE_CXX_COMPILER=/usr/local/Cellar/llvm@6/6.0.1_2/bin/clang++
else ifeq (${COMPILER},clang7)
- MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=/usr/local/Cellar/llvm@7/7.0.1/bin/clang -DCMAKE_CXX_COMPILER=/usr/local/Cellar/llvm@7/7.0.1/bin/clang++
+ MY_CMAKE_FLAGS += \
+ -DCMAKE_C_COMPILER=/usr/local/Cellar/llvm@7/7.0.1_1/bin/clang \
+ -DCMAKE_CXX_COMPILER=/usr/local/Cellar/llvm@7/7.0.1_1/bin/clang++
else ifeq (${COMPILER},clang8)
- MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=/usr/local/Cellar/llvm/8.0.1/bin/clang -DCMAKE_CXX_COMPILER=/usr/local/Cellar/llvm/8.0.1/bin/clang++
+ MY_CMAKE_FLAGS += \
+ -DCMAKE_C_COMPILER=/usr/local/Cellar/llvm@8/8.0.1_1/bin/clang \
+ -DCMAKE_CXX_COMPILER=/usr/local/Cellar/llvm/8.0.1/bin/clang++
else ifeq (${COMPILER},clang9)
- MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=/usr/local/Cellar/llvm/9.0.0/bin/clang -DCMAKE_CXX_COMPILER=/usr/local/Cellar/llvm/9.0.0/bin/clang++
+ MY_CMAKE_FLAGS += \
+ -DCMAKE_C_COMPILER=/usr/local/Cellar/llvm@9/9.0.1/bin/clang \
+ -DCMAKE_CXX_COMPILER=/usr/local/Cellar/llvm@9/9.0.1/bin/clang++
+ else ifeq (${COMPILER},clang10)
+ MY_CMAKE_FLAGS += \
+ -DCMAKE_C_COMPILER=/usr/local/Cellar/llvm/10.0.0/bin/clang \
+ -DCMAKE_CXX_COMPILER=/usr/local/Cellar/llvm/10.0.0/bin/clang++
else ifeq (${COMPILER},clang)
MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
else ifeq (${COMPILER},gcc)
--
2.16.4