diff options
author | bartus | 2019-07-31 18:44:27 +0200 |
---|---|---|
committer | bartus | 2019-07-31 18:47:33 +0200 |
commit | b3cb2588a059744bdf234542d7a72658855fac94 (patch) | |
tree | 3dfa668dd465ae1f87069bc3f0175f82e5273a1f | |
parent | 24fcbdcceaf45f6857ba563fe096d9c1158ed1b8 (diff) | |
download | aur-b3cb2588a059744bdf234542d7a72658855fac94.tar.gz |
openimageio, openvdb, gcc9 compatibility
* pop _blenver to 282 as master is now 281
* port blender 2.80 oiio compatibility patch
* drop openvdb abi 3
* gcc9 fix openmp calls
-rw-r--r-- | .SRCINFO | 10 | ||||
-rw-r--r-- | PKGBUILD | 26 | ||||
-rw-r--r-- | gcc9.patch | 53 | ||||
-rw-r--r-- | oiio-2.0.patch | 298 | ||||
-rw-r--r-- | version.patch | 17 |
5 files changed, 371 insertions, 33 deletions
@@ -1,8 +1,8 @@ pkgbase = blender-fracture_modifier-git pkgdesc = Development version of Blenders fracture_modifier branch - pkgver = v2.79b.r2154.gc8d6bba3cce + pkgver = v2.79b.r2168.g969fca718a4 pkgrel = 1 - url = http://blender.org/ + url = https://blender.org/ install = blender.install arch = i686 arch = x86_64 @@ -44,10 +44,11 @@ pkgbase = blender-fracture_modifier-git source = blender-fracture_modifier.desktop source = SelectCudaComputeArch.patch source = gcc8.patch - source = version.patch + source = gcc9.patch source = ffmpeg.patch source = openvdb.patch source = collada1668.patch + source = oiio-2.0.patch md5sums = SKIP md5sums = SKIP md5sums = SKIP @@ -57,10 +58,11 @@ pkgbase = blender-fracture_modifier-git md5sums = 0a4847775c9eec16a76ec7d3a03a678d md5sums = 9454ff7e994f72ead5027356e227cbd2 md5sums = df6f12c3327678b0a05f9e48e9ace67c - md5sums = 975cef0e17c77517ed8727701abc8a0c + md5sums = 8679d9ab041141cf4fa1ae4da9389986 md5sums = bb325c8c879d677ad1f1c54797268716 md5sums = fe709e616e52c1acc47c1cc0f77c2694 md5sums = 4e4423315f07bc724c7703c57c4481d7 + md5sums = f98eb0576a8e00444cc3e936d31a9812 pkgname = blender-fracture_modifier-git @@ -2,21 +2,21 @@ _branch="fracture_modifier" _sufix=${_branch} -_blenver=2.81 +_blenver=2.82 _fragment="#branch=${_branch}" pkgname=blender-${_sufix}-git -pkgver=v2.79b.r2154.gc8d6bba3cce +pkgver=v2.79b.r2168.g969fca718a4 pkgrel=1 pkgdesc="Development version of Blenders ${_branch} branch" arch=('i686' 'x86_64') -url="http://blender.org/" +url="https://blender.org/" depends=('alembic' 'openjpeg' 'python-numpy' 'libgl' 'python' 'desktop-file-utils' 'hicolor-icon-theme' 'ffmpeg' 'fftw' 'openal' 'freetype2' 'libxi' 'openimageio' 'opencolorio' 'openvdb' 'opencollada' 'opensubdiv' 'openshadinglanguage' 'libtiff' 'libpng') optdepends=('cuda: CUDA support in Cycles') makedepends=('git' 'cmake' 'boost' 'mesa' 'llvm') -provides=('blender-fracture_modifier') -conflicts=('blender-fracture_modifier') +provides=("blender-${_sufix}") +conflicts=("blender-${_sufix}") #options=(!makeflags) license=('GPL') install=blender.install @@ -34,10 +34,11 @@ source=("git://git.blender.org/blender.git${_fragment}" \ blender-fracture_modifier.desktop \ SelectCudaComputeArch.patch \ gcc8.patch \ - version.patch \ + gcc9.patch \ ffmpeg.patch \ openvdb.patch \ collada1668.patch \ + oiio-2.0.patch \ ) md5sums=('SKIP' 'SKIP' @@ -48,10 +49,11 @@ md5sums=('SKIP' '0a4847775c9eec16a76ec7d3a03a678d' '9454ff7e994f72ead5027356e227cbd2' 'df6f12c3327678b0a05f9e48e9ace67c' - '975cef0e17c77517ed8727701abc8a0c' + '8679d9ab041141cf4fa1ae4da9389986' 'bb325c8c879d677ad1f1c54797268716' 'fe709e616e52c1acc47c1cc0f77c2694' - '4e4423315f07bc724c7703c57c4481d7') + '4e4423315f07bc724c7703c57c4481d7' + 'f98eb0576a8e00444cc3e936d31a9812') # determine whether we can precompile CUDA kernels _CUDA_PKG=`pacman -Qq cuda 2>/dev/null` || true @@ -75,8 +77,11 @@ prepare() { git apply -v ${srcdir}/gcc8.patch git apply -v ${srcdir}/ffmpeg.patch git apply -v ${srcdir}/openvdb.patch - git apply -v ${srcdir}/version.patch git apply -v ${srcdir}/collada1668.patch + git apply -v ${srcdir}/gcc9.patch + git apply -v ${srcdir}/oiio-2.0.patch + msg "change BLENDER_VERSION to ${_blenver/./}" + sed -i "/#define BLENDER_VERSION */s/279/${_blenver/./}/" source/blender/blenkernel/BKE_blender_version.h } build() { @@ -86,9 +91,6 @@ build() { _pyver=$(python -c "from sys import version_info; print(\"%d.%d\" % (version_info[0],version_info[1]))") msg "python version detected: ${_pyver}" - export CFLAGS="${CFLAGS} -DOPENVDB_3_ABI_COMPATIBLE" - export CXXFLAGS="${CXXFLAGS} -DOPENVDB_3_ABI_COMPATIBLE" - cmake "$srcdir/blender" \ -DCMAKE_INSTALL_PREFIX=/usr \ -DWITH_INSTALL_PORTABLE=OFF \ diff --git a/gcc9.patch b/gcc9.patch new file mode 100644 index 000000000000..d538a026205f --- /dev/null +++ b/gcc9.patch @@ -0,0 +1,53 @@ +commit e6d803fd4a383cecf8c643095f093a31c944b785 +Author: Robert-André Mauchin <zebob.m@gmail.com> +Date: Wed Apr 3 01:36:52 2019 +0200 + + Fix for GCC9 new OpenMP data sharing + + GCC 9 started implementing the OpenMP 4.0 and later behavior. When not using + default clause or when using default(shared), this makes no difference, but + if using default(none), previously the choice was not specify the const + qualified variables on the construct at all, or specify in firstprivate + clause. In GCC 9 as well as for OpenMP 4.0 compliance, those variables need + to be specified on constructs in which they are used, either in shared or + in firstprivate clause. Specifying them in firstprivate clause is one way to + achieve compatibility with both older GCC versions and GCC 9, + another option is to drop the default(none) clause. + + This patch thus drops the default(none) clause. + + See https://gcc.gnu.org/gcc-9/porting_to.html#ompdatasharing + + Signed-off-by: Robert-André Mauchin <zebob.m@gmail.com> + +diff --git a/intern/elbeem/intern/solver_main.cpp b/intern/elbeem/intern/solver_main.cpp +index 68f7c04cd54..514087b6130 100644 +--- a/intern/elbeem/intern/solver_main.cpp ++++ b/intern/elbeem/intern/solver_main.cpp +@@ -381,7 +381,7 @@ LbmFsgrSolver::mainLoop(const int lev) + GRID_REGION_INIT(); + #if PARALLEL==1 + const int gDebugLevel = ::gDebugLevel; +-#pragma omp parallel default(none) num_threads(mNumOMPThreads) \ ++#pragma omp parallel num_threads(mNumOMPThreads) \ + reduction(+: \ + calcCurrentMass,calcCurrentVolume, \ + calcCellsFilled,calcCellsEmptied, \ +@@ -1126,7 +1126,7 @@ LbmFsgrSolver::preinitGrids() + GRID_REGION_INIT(); + #if PARALLEL==1 + const int gDebugLevel = ::gDebugLevel; +-#pragma omp parallel default(none) num_threads(mNumOMPThreads) \ ++#pragma omp parallel num_threads(mNumOMPThreads) \ + reduction(+: \ + calcCurrentMass,calcCurrentVolume, \ + calcCellsFilled,calcCellsEmptied, \ +@@ -1164,7 +1164,7 @@ LbmFsgrSolver::standingFluidPreinit() + GRID_REGION_INIT(); + #if PARALLEL==1 + const int gDebugLevel = ::gDebugLevel; +-#pragma omp parallel default(none) num_threads(mNumOMPThreads) \ ++#pragma omp parallel num_threads(mNumOMPThreads) \ + reduction(+: \ + calcCurrentMass,calcCurrentVolume, \ + calcCellsFilled,calcCellsEmptied, \ diff --git a/oiio-2.0.patch b/oiio-2.0.patch new file mode 100644 index 000000000000..361ed3164e40 --- /dev/null +++ b/oiio-2.0.patch @@ -0,0 +1,298 @@ +From 66d8bfb85c61aafe3bad2edf0e7b4d9d694ee2e7 Mon Sep 17 00:00:00 2001 +From: Sergey Sharybin <sergey.vfx@gmail.com> +Date: Tue, 11 Dec 2018 12:17:26 +0100 +Subject: [PATCH] Update code to be compatible with OIIO 2.0 + +There are some changes in API of OpenImageIO, but those are quite +simple to keep working with older and newer library versions. + +Reviewers: brecht + +Reviewed By: brecht + +Differential Revision: https://developer.blender.org/D4064 + +Reinstated for fractur_modifer branch by: bartoszek +--- + intern/cycles/blender/blender_python.cpp | 2 +- + intern/cycles/graph/node_xml.cpp | 2 +- + intern/cycles/render/buffers.cpp | 4 +-- + intern/cycles/render/image.cpp | 15 ++++------ + intern/cycles/render/image.h | 3 +- + intern/cycles/util/util_unique_ptr.h | 28 +++++++++++++++++++ + .../imbuf/intern/oiio/openimageio_api.cpp | 19 ++++++------- + 7 files changed, 48 insertions(+), 25 deletions(-) + create mode 100644 intern/cycles/util/util_unique_ptr.h + +diff --git a/intern/cycles/blender/blender_python.cpp b/intern/cycles/blender/blender_python.cpp +index 54973fd1b7f..bee6dd17812 100644 +--- a/intern/cycles/blender/blender_python.cpp ++++ b/intern/cycles/blender/blender_python.cpp +@@ -493,7 +493,7 @@ static PyObject *osl_update_node_func(PyObject * /*self*/, PyObject *args) + socket_type = "NodeSocketString"; + data_type = BL::NodeSocket::type_STRING; + if(param->validdefault) +- default_string = param->sdefault[0]; ++ default_string = param->sdefault[0].string(); + } + else + continue; +diff --git a/intern/cycles/graph/node_xml.cpp b/intern/cycles/graph/node_xml.cpp +index d26b3b2c2c8..2a2410453ce 100644 +--- a/intern/cycles/graph/node_xml.cpp ++++ b/intern/cycles/graph/node_xml.cpp +@@ -250,7 +250,7 @@ void xml_read_node(XMLReader& reader, Node *node, xml_node xml_node) + } + } + +- if(node->name) ++ if(!node->name.empty()) + reader.node_map[node->name] = node; + } + +diff --git a/intern/cycles/render/buffers.cpp b/intern/cycles/render/buffers.cpp +index cf402c3f214..c96746ba211 100644 +--- a/intern/cycles/render/buffers.cpp ++++ b/intern/cycles/render/buffers.cpp +@@ -27,6 +27,7 @@ + #include "util/util_opengl.h" + #include "util/util_time.h" + #include "util/util_types.h" ++#include "util/util_unique_ptr.h" + + CCL_NAMESPACE_BEGIN + +@@ -453,7 +454,7 @@ void DisplayBuffer::write(Device *device, const string& filename) + device->pixels_copy_from(rgba, 0, w, h); + + /* write image */ +- ImageOutput *out = ImageOutput::create(filename); ++ unique_ptr<ImageOutput> out(ImageOutput::create(filename)); + ImageSpec spec(w, h, 4, TypeDesc::UINT8); + int scanlinesize = w*4*sizeof(uchar); + +@@ -468,7 +469,6 @@ void DisplayBuffer::write(Device *device, const string& filename) + + out->close(); + +- delete out; + } + + device_memory& DisplayBuffer::rgba_data() +diff --git a/intern/cycles/render/image.cpp b/intern/cycles/render/image.cpp +index 595eb46319a..a143b025194 100644 +--- a/intern/cycles/render/image.cpp ++++ b/intern/cycles/render/image.cpp +@@ -23,6 +23,7 @@ + #include "util/util_path.h" + #include "util/util_progress.h" + #include "util/util_texture.h" ++#include "util/util_unique_ptr.h" + + #ifdef WITH_OSL + #include <OSL/oslexec.h> +@@ -148,7 +149,7 @@ ImageDataType ImageManager::get_image_metadata(const string& filename, + return IMAGE_DATA_TYPE_BYTE4; + } + +- ImageInput *in = ImageInput::create(filename); ++ unique_ptr<ImageInput> in(ImageInput::create(filename)); + + if(in) { + ImageSpec spec; +@@ -194,7 +195,6 @@ ImageDataType ImageManager::get_image_metadata(const string& filename, + in->close(); + } + +- delete in; + } + + if(is_half) { +@@ -449,7 +449,7 @@ void ImageManager::tag_reload_image(const string& filename, + } + + bool ImageManager::file_load_image_generic(Image *img, +- ImageInput **in, ++ unique_ptr<ImageInput> *in, + int &width, + int &height, + int &depth, +@@ -465,7 +465,7 @@ bool ImageManager::file_load_image_generic(Image *img, + } + + /* load image from file through OIIO */ +- *in = ImageInput::create(img->filename); ++ *in = unique_ptr<ImageInput>(ImageInput::create(img->filename)); + + if(!*in) + return false; +@@ -477,8 +477,6 @@ bool ImageManager::file_load_image_generic(Image *img, + config.attribute("oiio:UnassociatedAlpha", 1); + + if(!(*in)->open(img->filename, spec, config)) { +- delete *in; +- *in = NULL; + return false; + } + +@@ -500,8 +498,6 @@ bool ImageManager::file_load_image_generic(Image *img, + if(!(components >= 1 && components <= 4)) { + if(*in) { + (*in)->close(); +- delete *in; +- *in = NULL; + } + + return false; +@@ -519,7 +515,7 @@ bool ImageManager::file_load_image(Image *img, + device_vector<DeviceType>& tex_img) + { + const StorageType alpha_one = (FileFormat == TypeDesc::UINT8)? 255 : 1; +- ImageInput *in = NULL; ++ unique_ptr<ImageInput> in = NULL; + int width, height, depth, components; + if(!file_load_image_generic(img, &in, width, height, depth, components)) { + return false; +@@ -575,7 +571,6 @@ bool ImageManager::file_load_image(Image *img, + } + cmyk = strcmp(in->format_name(), "jpeg") == 0 && components == 4; + in->close(); +- delete in; + } + else { + if(FileFormat == TypeDesc::FLOAT) { +diff --git a/intern/cycles/render/image.h b/intern/cycles/render/image.h +index db7e28a5e44..f4a14f40aab 100644 +--- a/intern/cycles/render/image.h ++++ b/intern/cycles/render/image.h +@@ -23,6 +23,7 @@ + #include "util/util_image.h" + #include "util/util_string.h" + #include "util/util_thread.h" ++#include "util/util_unique_ptr.h" + #include "util/util_vector.h" + + CCL_NAMESPACE_BEGIN +@@ -133,7 +134,7 @@ private: + bool pack_images; + + bool file_load_image_generic(Image *img, +- ImageInput **in, ++ unique_ptr<ImageInput> *in, + int &width, + int &height, + int &depth, +diff --git a/intern/cycles/util/util_unique_ptr.h b/intern/cycles/util/util_unique_ptr.h +new file mode 100644 +index 00000000000..1ceae73172e +--- /dev/null ++++ b/intern/cycles/util/util_unique_ptr.h +@@ -0,0 +1,28 @@ ++/* ++ * Copyright 2011-2013 Blender Foundation ++ * ++ * Licensed under the Apache License, Version 2.0 (the "License"); ++ * you may not use this file except in compliance with the License. ++ * You may obtain a copy of the License at ++ * ++ * http://www.apache.org/licenses/LICENSE-2.0 ++ * ++ * Unless required by applicable law or agreed to in writing, software ++ * distributed under the License is distributed on an "AS IS" BASIS, ++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ * See the License for the specific language governing permissions and ++ * limitations under the License. ++ */ ++ ++#ifndef __UTIL_UNIQUE_PTR_H__ ++#define __UTIL_UNIQUE_PTR_H__ ++ ++#include <memory> ++ ++CCL_NAMESPACE_BEGIN ++ ++using std::unique_ptr; ++ ++CCL_NAMESPACE_END ++ ++#endif /* __UTIL_UNIQUE_PTR_H__ */ +diff --git a/source/blender/imbuf/intern/oiio/openimageio_api.cpp b/source/blender/imbuf/intern/oiio/openimageio_api.cpp +index b123d508f99..7f2fac9d796 100644 +--- a/source/blender/imbuf/intern/oiio/openimageio_api.cpp ++++ b/source/blender/imbuf/intern/oiio/openimageio_api.cpp +@@ -35,6 +35,11 @@ + #include "utfconv.h" + #endif + ++// NOTE: Keep first, BLI_path_util conflicts with OIIO's format. ++#include <memory> ++#include <openimageio_api.h> ++#include <OpenImageIO/imageio.h> ++ + extern "C" + { + #include "MEM_guardedalloc.h" +@@ -48,12 +53,10 @@ extern "C" + #include "IMB_colormanagement_intern.h" + } + +-#include <openimageio_api.h> +-#include <OpenImageIO/imageio.h> +- + OIIO_NAMESPACE_USING + + using std::string; ++using std::unique_ptr; + + typedef unsigned char uchar; + +@@ -197,7 +200,6 @@ int imb_save_photoshop(struct ImBuf *ibuf, const char * /*name*/, int flags) + + struct ImBuf *imb_load_photoshop(const char *filename, int flags, char colorspace[IM_MAX_SPACE]) + { +- ImageInput *in = NULL; + struct ImBuf *ibuf = NULL; + int width, height, components; + bool is_float, is_alpha; +@@ -210,7 +212,7 @@ struct ImBuf *imb_load_photoshop(const char *filename, int flags, char colorspac + + colorspace_set_default_role(colorspace, IM_MAX_SPACE, COLOR_ROLE_DEFAULT_BYTE); + +- in = ImageInput::create(filename); ++ unique_ptr<ImageInput> in(ImageInput::create(filename)); + if (!in) { + std::cerr << __func__ << ": ImageInput::create() failed:" << std::endl + << OIIO_NAMESPACE::geterror() << std::endl; +@@ -223,7 +225,6 @@ struct ImBuf *imb_load_photoshop(const char *filename, int flags, char colorspac + if (!in->open(filename, spec, config)) { + std::cerr << __func__ << ": ImageInput::open() failed:" << std::endl + << in->geterror() << std::endl; +- delete in; + return NULL; + } + +@@ -249,19 +250,17 @@ struct ImBuf *imb_load_photoshop(const char *filename, int flags, char colorspac + if (!(components >= 1 && components <= 4)) { + if (in) { + in->close(); +- delete in; + } + return NULL; + } + + if (is_float) +- ibuf = imb_oiio_load_image_float(in, width, height, components, flags, is_alpha); ++ ibuf = imb_oiio_load_image_float(in.get(), width, height, components, flags, is_alpha); + else +- ibuf = imb_oiio_load_image(in, width, height, components, flags, is_alpha); ++ ibuf = imb_oiio_load_image(in.get(), width, height, components, flags, is_alpha); + + if (in) { + in->close(); +- delete in; + } + + if (!ibuf) +-- +2.22.0 + diff --git a/version.patch b/version.patch deleted file mode 100644 index 1c819513060e..000000000000 --- a/version.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h -index 7139c00edf6..5ac0c705c52 100644 ---- a/source/blender/blenkernel/BKE_blender_version.h -+++ b/source/blender/blenkernel/BKE_blender_version.h -@@ -27,10 +27,10 @@ - /* these lines are grep'd, watch out for our not-so-awesome regex - * and keep comment above the defines. - * Use STRINGIFY() rather than defining with quotes */ --#define BLENDER_VERSION 279 -+#define BLENDER_VERSION 281 - #define BLENDER_SUBVERSION 0 - /* Several breakages with 270, e.g. constraint deg vs rad */ --#define BLENDER_MINVERSION 270 -+#define BLENDER_MINVERSION 281 - #define BLENDER_MINSUBVERSION 6 - - /* used by packaging tools */ |