Commit Graph

1362 Commits

Author SHA1 Message Date
Ankit Meel aa95f8019e macOS: Fix unknown -Wsuggest-override warning
Added in rB7cef01b090c4c2d2703274edb91886ae37d3ce82
and rB87bfa2b207b90b5e34ebd835a23c2a82afbed878

Reviewed by: jbakker, #platform_macos
Differential Revision: https://developer.blender.org/D11012
2021-04-24 01:54:30 +05:30
Ankit Meel f061de9b3e Cleanup/CMake: warning to status to reduce noise
Correction in e5f0d176d4
2021-04-01 01:12:48 +05:30
Ankit Meel e5f0d176d4 CMake: issue warnings when changing options
Only done in top level CMakeLists, and platform_apple.

Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D10343
2021-03-30 20:28:45 +05:30
Ray Molenkamp f9eaf93d37 MSVC: ASAN support for VS 16.9
This enables ASAN support when used with VS 16.9
enable as usual in cmake with the WITH_COMPILER_ASAN
option, or when using make.bat just tag on `asan'
to the invocation, ie: `make lite 2019 asan`

MSVC: Asan support for 16.9

This enables ASAN support when used with VS 16.9
enable as usual in cmake with the WITH_COMPILER_ASAN
option, or when using make.bat just tag on `asan'
to the invocation, ie: `make lite 2019 asan`

Differential Revision: https://developer.blender.org/D7794
Reviewed By: brecht, sergey
2021-03-29 19:11:17 -06:00
Ankit Meel ad31b13f91 macOS/bpy: add support for OpenMP
Changes made:
* Add OpenMP linker flags.
* Copy the libomp.dylib to `2.93/lib/libomp.dylib`.
* Change the `LC_LOAD_DYLIB` item such that
  the lib is found at `bpy.so/../../Resources/2.93/lib/libomp.dylib`.
Installation is done by D10664.

Reviewed By: #platform_macos, brecht
Maniphest Tasks: T86579
Differential Revision: https://developer.blender.org/D10657
2021-03-27 01:08:51 +05:30
Ankit Meel 2600b27d26 Cleanup/CMake: Fix comment, sort order of options. 2021-03-23 12:11:46 +05:30
Jörg Müller 12c08ceee3 Audaspace: add support for CoreAudio on macOS
This adds CoreAudio as audio backend on macOS.
CoreAudio is the standard audio API on macOS.

Ref T86590
2021-03-16 23:21:45 +01:00
Jörg Müller bc57985306 Audaspace: add support for WASAPI on Windows
This adds WASAPI as audio backend on Windows.
WASAPI is the modern standard audio API on
Windows introduced with Windows Vista.

Ref T86590
2021-03-16 23:21:45 +01:00
Jörg Müller d33339ebf4 Audaspace: add support for PulseAudio on Linux
This adds PulseAudio as audio backend on Linux.
PulseAudio is the main audio engine used on most,
if not all, Linux distributions today.

Ref T86590
2021-03-16 23:21:45 +01:00
Jörg Müller 7b8fc307dc Audaspace: porting minor improvements from upstream
- NullDevice is now called None
- Automatic choice of best available device.
- Minor formatting, documentation and cmake fixes.
2021-03-16 23:21:45 +01:00
Brecht Van Lommel f39143bc2e CMake: reduce Neon related output on Intel platforms
* Only try to find sse2neon if Neon detected
* Only run Neon support test once
2021-03-01 19:43:54 +01:00
Brecht Van Lommel bcd369c3c1 Fix macOS SSE support not detected correctly after recent changes
Due to moving the code the test binary was incorrectly compiled with OpenMP
flags. Move setting of the OpenMP flags to the appropriate place.
2021-02-25 15:09:10 +01:00
Ray Molenkamp 4fb0c83c1c Cmake/deps: Update OSL to 1.11.10.0
This bumps OSL to 1.11.10.0. OSL Has a new build time
dependency: Clang, and more importantly it expects
clang and llvm to share a library folder, which it
previously for us did not.

This patch changes:

-OSL Update to 1.11.10.0

-refactor the llvm/clang/clang-tools-extra builds into the llvm
 build using the llvm-project tarball for building that has all
 of the subprojects in it.

-update ispc/openmp builds since clang no longer its own dependency
 and they have to depend on the llvm build now.

-Update the windows builder to use the 64 bit host tools since it
 ran out of ram linking clang

-Since OSL now needs clang to link successfully a findclang.cmake
 has been provided for linux/OSX

Differential Revision: https://developer.blender.org/D10212

Reviewed By: brecht, sebbas, sybren
2021-02-24 07:13:37 -07:00
Brecht Van Lommel db28411fd9 BLI: use sse2neon to emulate SSE instructions with Arm Neon
* WITH_CPU_SSE was renamed to WITH_CPU_SIMD, and now covers both SSE and Neon.
* For macOS sse2neon.h is included as part of the precompiled libraries.
* For Linux it is enabled if the sse2neon.h header file is detected. However
  this library does not have official releases and is not shipped with any Linux
  distribution, so manual installation and configuration is required to get this
  working.

Ref D8237, T78710
2021-02-17 16:26:24 +01:00
Brecht Van Lommel 1b4961b318 OpenColorIO: upgrade to version 2.0.0
Ref T84819

Build System
============

This is an API breaking new version, and the updated code only builds with
OpenColorIO 2.0 and later. Adding backwards compatibility was too complicated.

* Tinyxml was replaced with Expat, adding a new dependency.
* Yaml-cpp is now built as a dependency on Unix, as was already done on Windows.
* Removed currently unused LCMS code.
* Pystring remains built as part of OCIO itself, since it has no good build system.
* Linux and macOS check for the OpenColorIO verison, and disable it if too old.

Ref D10270

Processors and Transforms
=========================

CPU processors now need to be created to do CPU processing. These are cached
internally, but the cache lookup is not fast enough to execute per pixel or
texture sample, so for performance these are now also exposed in the C API.

The C API for transforms will no longer be needed afer all changes, so remove
it to simplify the API and fallback implementation.

Ref D10271

Display Transforms
==================

Needs a bit more manual work constructing the transform. LegacyViewingPipeline
could also have been used, but isn't really any simpler and since it's legacy
we better not rely on it.

We moved more logic into the opencolorio module, to simplify the API. There is
no need to wrap a dozen functions just to be able to do this in C rather than C++.
It's also tightly coupled to the GPU shader logic, and so should be in the same
module.

Ref D10271

GPU Display Shader
==================

To avoid baking exposure and gamma into the GLSL shader and requiring slow
recompiles when tweaking, we manually apply them in the shader. This leads
to some logic duplicaton between the CPU and GPU display processor, but it
seems unavoidable.

Caching was also changed. Previously this was done both on the imbuf and
opencolorio module levels. Now it's all done in the opencolorio module by
simply matching color space names. We no longer use cacheIDs from OpenColorIO
since computing them is expensive, and they are unlikely to match now that
more is baked into the shader code.

Shaders can now use multiple 2D textures, 3D textures and uniforms, rather
than a single 3D texture. So allocating and binding those adds some code.

Color space conversions for blending with overlays is now hardcoded in the
shader. This was using harcoded numbers anyway, if this every becomes a
general OpenColorIO transform it can be changed, but for now there is no
point to add code complexity.

Ref D10273

CIE XYZ
=======

We need standard CIE XYZ values for rendering effects like blackbody emission.
The relation to the scene linear role is based on OpenColorIO configuration.

In OpenColorIO 2.0 configs roles can no longer have the same name as color
spaces, which means our XYZ role and colorspace in the configuration give an
error.

Instead use the new standard aces_interchange role, which relates scene linear
to a known scene referred color space. Compatibility with the old XYZ role is
preserved, if the configuration file has no conflicting names.

Also includes a non-functional change to the configuraton file to use an
XYZ-to-ACES matrix instead of REC709-to-ACES, makes debugging a little easier
since the matrix is the same one we have in the code now and that is also
found easily in the ACES specs.

Ref D10274
2021-02-12 19:06:35 +01:00
Campbell Barton 7952ed872a CMake: update python to 3.9.1
Default to Python version 3.9.

Reviewed By: LazyDodo, sybren, sebbas

Ref D10380
2021-02-12 07:50:01 +11:00
Campbell Barton faad487b58 Cleanup: remove version check for unsupported cmake version 2021-02-11 15:57:24 +11:00
Brecht Van Lommel 677e63d518 TBB: fix deprecation warnings with newer TBB versions
* USD and OpenVDB headers use deprecated TBB headers, suppress all deprecation
  warnings there since we have no control over them.
* For our own TBB includes, use the individual headers rather than the tbb.h that
  includes everything to avoid warnings, rather than suppressing all.

This is in anticipation of the TBB 2020 upgrade in D10359. Ref D10361.
2021-02-10 19:32:24 +01:00
Campbell Barton db9d40b9d3 CMake: set compiler-ccache & build-type-init variables as advanced
These settings aren't useful for basic configuration.
2021-02-10 17:44:14 +11:00
Sergey Sharybin 62ef35db6d Fix strict uninitialized warning for C++
Allows to compile Blender without uninitialized warning in Bullet code.
2021-02-08 11:10:21 +01:00
Ankit Meel 33b8063b1f CMake: Remove duplicated code for Haru-TIFF dependency. 2021-02-02 02:15:40 +05:30
Ankit Meel 59054d906f CMake/Windows/macOS: Add Libharu
Decision: https://lists.blender.org/pipermail/bf-committers/2020-December/050836.html
Adds CMake dependency builder support. Tested on
macOS and Windows (Thanks @LazyDodo).

Reviewed By: #platform_macos, LazyDodo, sebbas
Maniphest Task: T84836
Differential Revision: https://developer.blender.org/D9928
2021-02-01 21:58:57 +05:30
Brecht Van Lommel 31f568c336 Fix: incomplete integration of PugiXML and Potrace build options
Add them to the standard build configurations, disable properly when library
not found and print as part of configuration overview.
2021-01-26 15:55:27 +01:00
Charles Flèche 532d3a103a Cycles standalone: fix missing dependencies in CMake files
Also set default CYCLES_INSTALL_PATH to CMAKE_INSTALL_PREFIX.

By default with a `make cycles` this will build to ${CMAKE_BINARY_DIR}/bin

Differential Revision: https://developer.blender.org/D9961
2021-01-26 14:39:32 +01:00
Sybren A. Stüvel 54f8a5dd73 Tests: run suites instead of individual test cases
Group all tests of a test suite into a single test command invocation.
This reduces the number of invocations by `ctest` by an order of
magnitude.

Since rB56aa5b0d8c6b663, `bin/tests/blender_test` was run for every
individual test. Having over a 1000 tests made testing slower than
necessary. Individual tests can still be run if desired by invocation of
`bin/tests/blender_test --gtest_filter=suitename.testname`.

NOTE: For this commit to have an immediate effect, it may be necessary
to remove the `tests` and `Testing` directories and some CMake files
from your build directory and rebuild. Run `ctest -N` to see the list of
tests; there should be less than 200.

Reviewed By: sergey, LazyDodo, sebbas

Maniphest Tasks: T83222

Differential Revision: https://developer.blender.org/D9649
2021-01-11 11:29:30 +01:00
Matt Hill fdb7623e09 Unix/macOS: support building with Ccache
This adds an option (WITH_COMPILER_CCACHE) to build using Ccache if it's
found. Makefiles-based, Ninja-based and Xcode generators are supported.

Pass `-DWITH_COMPILER_CCACHE=ON` to cmake to enable Ccache.
Utility option in GNUmakefile is also added: for e.g.,
`make ninja ccache`.

Reviewed By: brecht, ankitm
Differential Revision: https://developer.blender.org/D9665
2020-12-21 10:47:35 +05:30
Bastien Montagne 010f44b855 Fix several issues with handling of numpy in CMake.
Issues were:
* Abusing of `WITH_PYTHON_INSTALL_NUMPY` by both Audaspace and
  Mantaflow.
    - `PYTHON_INSTALL` options only decide whether we copy python (and
      some extra modules) in our Blender installation. On linux it
      makes much more sense to use global python installation.
    - Now we have instead a proper `WITH_PYTHON_NUMPY`
* Bad assumptions regarding path of headers relative to path of python
  module.
    - In current Debian testing, modules are under `python3.9`
      directory, while headers are under `python3` directory.
    - Now we properly `find_path` for headers as well, modifying
      `find_python_package` to take an optional argument for headers.

Note that the required changes done to `extern` libraries are in
blender-specific files that do not exist upstream.

Differential Revision: https://developer.blender.org/D9773
2020-12-14 16:44:55 +01:00
Bastien Montagne 551856ed32 Revert "Fix several issues with handling of numpy in CMake."
This reverts commit 5d570c875e.

Buildbots are still borken, need more time to investigate.
2020-12-14 12:29:34 +01:00
Bastien Montagne fdc9350a9f Revert "Fix own error in rB5d570c875eda in CMake script."
This reverts commit 6da609fcb3.

Buildbots are still broken, need more time to investigate.
2020-12-14 12:29:08 +01:00
Bastien Montagne 6da609fcb3 Fix own error in rB5d570c875eda in CMake script.
My mistake, though CMake could handle default arguments but it needs to
be explicitly passed actually.
2020-12-14 12:23:21 +01:00
Bastien Montagne 5d570c875e Fix several issues with handling of numpy in CMake.
Issues were:
* Abusing of `WITH_PYTHON_INSTALL_NUMPY` by both Audaspace and
  Mantaflow.
    - `PYTHON_INSTALL` options only decide whether we copy python (and
      some extra modules) in our Blender installation. On linux it
      makes much more sense to use global python installation.
    - Now we have instead a proper `WITH_PYTHON_NUMPY`
* Bad assumptions regarding path of headers relative to path of python
  module.
    - In current Debian testing, modules are under `python3.9`
      directory, while headers are under `python3` directory.
    - Now we properly `find_path` for headers as well, modifying
      `find_python_package` to take an optional argument for headers.

Note that the required changes done to `extern` libraries are in
blender-specific files that do not exist upstream.

Differential Revision: https://developer.blender.org/D9773
2020-12-14 11:00:28 +01:00
Ray Molenkamp f637b47064 MSVC: Enable clang-tidy analyser
This enables the use of clang-tidy in the VS IDE.

To use it:

1 - Enable WITH_CLANG_TIDY in your cmake configuration
2 - From the Analyse pull down menu select Run Code Analysis on...

The analyser is currently not enabled by default on build
given it is quite slow and there are quite a few problems
it reports that we still need to deal with.
2020-12-03 11:00:58 -07:00
Sebastián Barschkis f8d1378b84 Deps: Additional changes for PugiXML on macOS
This commit expands the Windows-specific code in rBdca9aa0053f7 and Linux-specific code in rB33b7d53df08a.

It also fixes a capitalization issue in FindPugiXML.cmake
2020-12-02 15:18:05 +01:00
Ankit Meel da22ec1254 Cleanup: Fix CMake syntax error in the last commit. 2020-12-02 13:55:52 +05:30
Ankit Meel 6535135ef7 CMake/macOS: consider MinSizeRel too for ASan. 2020-12-02 13:23:25 +05:30
Sybren A. Stüvel 33b7d53df0 Deps: Add PugiXML as an official dependency
PugiXML was historically shipped hidden embedded into OIIO, the Grease
Pencil team had a requirement for an XML library recently so pugi seems
like a natural choice since it's not really a 'new' library, we just
turn an implicit dependency into an explicit one.

This commit expands the Windows-specific code in rBdca9aa0053f7 to
include Linux. macOS support will be handled in a later commit.

NOTE: run `cmake -U'*PUGIXML*' .` in the build directory to ensure CMake
finds PugiXML in the new location.

For details see D8628
2020-12-01 16:25:51 +01:00
Brecht Van Lommel dd391d38f6 Tests: add CMake option to run Cycles regression tests on GPU devices
CYCLES_TEST_DEVICES is a list of devices (CPU, CUDA, OPTIX, OPENCL). It is set
to CPU only by default.

Test output is now writen to build/tests/cycles/<device>, and the HTML report
has separate report pages for the different devices, with option to compare
between CPU and GPU renders.

Various GPU tests are still failing due to CPU/GPU differences, these are to be
fixed or blacklisted still.

Ref T82193
2020-11-30 13:40:33 +01:00
Ray Molenkamp dca9aa0053 Deps: PugiXML 1.10
This separates out PugiXML that was previously
bundled by OIIO.

As this linux/mac libs are not available
this commit only contains the builder and windows
changes, and the option to enable pugixml is
guarded by a platform if, this can be removed
once all platforms have committed the svn libs.

For details see D8628
2020-11-29 14:01:33 -07:00
Sergey Sharybin 7146e9696e CMake: Extend strict flags cancellation flags
Becomes rather annoying to duplicate them across C/C++ GCC/Clang sets,
almost as if the test should test both C and C++, and to do it for all
compilers.

Solves strict warning in the upstream of Ceres library.
2020-11-13 11:51:49 +01:00
Patrick Mours bd6bfba64d Cycles: Enable NanoVDB usage by default
As discussed during the Rendering Metting. Ref T81454.
2020-11-10 16:20:15 +01:00
Sergey Sharybin f26e267770 CMake: Extend supported strict flags cancelation for Clang 2020-11-09 12:12:00 +01:00
Ankit Meel 84bbdfb8af Cleanup: Fix the order of info_cfg_option. 2020-11-06 12:46:58 +05:30
Campbell Barton 2bd8f7e059 Cleanup: use string APPEND/PREPEND
Replace 'set' with 'string(APPEND/PREPEND ...)'.
This avoids duplicating the variable name.
2020-11-06 12:32:54 +11:00
Ankit Meel 0802e9cf54 Use compiler check for -fmacro-prefix-map
Use a more reliable method to check the availability of the flag than
compiler versions. Some compilers have different behaviors for
C and C++.

Reviewed By: campbellbarton, ChrisLend

Differential Revision: https://developer.blender.org/D9446
2020-11-04 21:00:29 +05:30
Campbell Barton 819a9622e9 CMake: remove -fmacro-prefix-map from build-info
Quotes caused build-info to fail,
remove these flags since they're not necessary.
2020-11-04 18:41:40 +11:00
Campbell Barton 72f8a08880 CMake: use path_ensure_trailing_slash for fmacro-prefix-map
Use the native system slash so this can work on windows.
2020-11-04 16:00:37 +11:00
Ankit Meel f2c7b4a1c5 Re-enable WITH_COMPILER_SHORT_FILE_MACRO, fix build error.
The issue was in `buildinfo.c`:
  char build_c[xx]flags[] = BUILD_C[XX]FLAGS;

Non-escaped double-quotes were terminating the string early, and
causing the compile error. So use single-quotes.
2020-11-02 16:11:10 +05:30
Ankit Meel 19dec6c8a7 Turn off WITH_COMPILER_SHORT_FILE_MACRO temporarily.
It's causing build errors on compilers that I don't have. Turn it off
while I fix them.

Added in {rB1daa3c3f0a1cfd74bef527e0207f38154e591d46}.
2020-11-02 15:45:59 +05:30
Ankit Meel 1daa3c3f0a Clang/GCC: use relative path in __FILE__ macro
This change removes the user-specific information from
macros like `__FILE__` and keeps it relative to top level
source or build (for generated files) directory.
It makes traces concise.

Added option `WITH_COMPILER_SHORT_FILE_MACRO` enabled by default.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D9386
2020-11-02 15:12:10 +05:30
Nicholas Rishel cbc1c83154 Remove Wintab logging. 2020-10-30 16:29:04 -07:00