Commit Graph

2654 Commits

Author SHA1 Message Date
Brecht Van Lommel d69bb06db8 Build: remove unused lapack/hidapi/mingw32 build infrastructure
Ref T76184
2020-06-25 13:15:55 +02:00
Ray Molenkamp d3283ef121 Build: upgrade OpenImageDenoise to 1.2.1
This requires ISPC for building OpenImageDenoise, so that is now added as
a dependency as well. Blender itself does not need ISPC for building so it
is not included as part of the precompiled libraries.

Differential Revision: https://developer.blender.org/D7641
2020-06-25 13:00:58 +02:00
Brecht Van Lommel 6431b11381 Build: upgrade a few smaller Linux/macOS only libraries to latest versions
* jemalloc 5.2.1
* xml2 2.9.10
* bzip2 1.0.8
* ffi 3.3
* lzma 5.2.5
* ssl 1.1.1g
* sqlite 3.31.1

Ref T78252
2020-06-25 13:00:58 +02:00
Brecht Van Lommel d645525dae Fix missing WITH_CYCLES_EMBREE in the build configurations 2020-06-24 15:51:08 +02:00
Sybren A. Stüvel 334e5005f4 USD: Upgrade library 20.02 → 20.05
The Blender USD code didn't have to change for this upgrade. Pixar's USD
did include a change that we had in the patch, so that's been removed
from our patch now. Some of the USD code that we patched changed as
well.
2020-06-19 17:37:14 +02:00
Sergey Sharybin 2e0ac1e0c4 Buildbot: Cleanup, remove unused script and change naming
Follow upstream convention.
2020-06-17 17:39:17 +02:00
Sergey Sharybin efb1bf80df Buildbot: Cleanup, typo in logging 2020-06-16 18:12:15 +02:00
Sergey Sharybin 2c2fd9f036 Buildbot: Switch WIndows builds to MSVC 2019 2020-06-16 16:17:47 +02:00
Sergey Sharybin 76d50c51a3 Buildbot: Support multiple workers talking to single codesign server
Is achieved by replacing hard-coded signed/unsigned file names with
"<uuid>" which acts as a "request ID". This way multiple workers can
put their requests into a single directory without collisions. The
code sign server will handle the requests sequentially in an unknown
order.
2020-06-16 14:08:14 +02:00
Sergey Sharybin 21d862494b Buildbot: Don't use builder name in the build directory
The directory layout on worker goes as following:

  <Worker>
    <Builder Name>
      blender.git/
      build/
      install/
      lib/

Adding an extra <Builder Name> after build is redundant.

Differential Revision: https://developer.blender.org/D8045
2020-06-16 12:24:01 +02:00
Sybren A. Stüvel ee61c1fe22 Cleanup: removed trailing spaces from `install_deps.sh`
No functional changes.
2020-06-15 11:58:58 +02:00
Sybren A. Stüvel 0d59a643aa x264: update URL and hash in versions.cmake
The old URL did have a Git commit hash in it, but apparently the server
was ignoring it and only used the `master` that was also mentioned in the
URL. As a result, every new download would get the latest version from
the `master` branch, invalidating the SHA256 checksum.

I replaced `master` with the actual commit hash. This should make the
situation stable.

No functional changes.
2020-06-15 11:58:58 +02:00
Sybren A. Stüvel 0102b9d47e Alembic: remove HDF5 support from CMake files
This is a follup to 0c38436227.

No functional changes to Blender, just the build scripts.
2020-06-15 11:58:58 +02:00
Ray Molenkamp 4155f8dc21 deps/windows/embree: Prevent exports leaking out of blender binary
embree marks a few of its functions with a dll_export macro
forcibly exporting these symbols from whatever binary links
them. Given we link embree statically and we do not want these
exports in the blender binary, the macro needs to be a no-op.
2020-06-14 11:09:32 -06:00
Bastien Montagne 725cc959c7 install_deps: Update python default version to 3.7.7.
Re T77846.
2020-06-14 09:42:20 +02:00
Ray Molenkamp b325ecef9c Deps builder: Python 3.7.7
This updates python to the latest patch level available for 3.7
also updates some of the packages we rely on:

idna 2.9
urllib3 1.25.9
cerifi 2020.4.5.2
requests 2.23.0
numpy 1.17.5
2020-06-13 15:25:19 -06:00
Sybren A. Stüvel 0981b55182 install_deps: bumped USD library version 19.11 → 20.02 2020-06-12 17:09:53 +02:00
Sybren A. Stüvel cfff8aa067 USD: Library upgrade 19.11 → 20.02
This upgrade required a few changes:
- Some parts of our patch are no longer necessary, as the USD library
  now includes those changes.
- The rest of the patch needed adjustment as the `pxr/base/lib/*`
  directories in USD's source code have moved to `pxr/base/*`.
- Updated library names on Windows -- thanks @LazyDodo.

Note that this does not enable the USD Python API for inclusion in
Blender. It just aims at being an as-simple-as-possible version upgrade
of the USD library.
2020-06-12 16:56:31 +02:00
Sergey Sharybin 9f5cc128d9 Buildbot: Switch to devtoolset-9
Famous "should just work", but will never know until actually attempted
 to be used.

Ref T76783.
2020-06-12 16:06:54 +02:00
Bastien Montagne 14bd92b12f Installdeps: Fix broken commit rBe3396d8bfc94.
Not sure why final version of the change was lost...
2020-06-10 19:45:52 +02:00
Bastien Montagne e3396d8bfc Installdeps: better handling of python versions.
now that we stick to some outdated py version, some distro (like current
debian testing) will feature several python3 dev package, but other
dependant libs like numpy are only built against current default version
of python (3.8 now in deb testing)...

In order to be able to use distro packages we need to allow using higher
versions of python, and set relevant CMake option accordingly.
2020-06-08 15:38:11 +02:00
Bastien Montagne 7d32a259bf Installdeps: make embree use TBB.
Following changes done to makedeps in rBc7329da14b22.
2020-06-05 12:01:18 +02:00
Brecht Van Lommel c7329da14b Build: use TBB as Embree tasking system
This avoids launching additional threads and solves some console warnings on
Linux + AMD Ryzen CPU.
2020-06-05 00:58:31 +02:00
Brecht Van Lommel 0b28f0410c Fix make deps build errors with conflicting Boost system packages 2020-06-05 00:58:31 +02:00
Bastien Montagne caca3d9c97 installdeps: fix bad FFMPEG official version number.
re T77035.
2020-06-04 17:35:33 +02:00
Campbell Barton 81c33f0ba7 Cleanup: clang-format 2020-06-01 15:04:30 +10:00
Ray Molenkamp 4cb883b6b2 Deps: Update OIIO + ImageLibs + OSL + Helpers
This is the cluster of OIIO and friends , since they are all kinda tangled best to deal with this as a single unit

OIIO 2.1.15.0
png 1.6.37
jpeg 2.0.4
opencolorio 1.1.1
tiff 4.1.0
OSL 1.10.10
pugixml 1.10
openjpeg 2.3.1

Differential Revision: https://developer.blender.org/D7727
Reviewed by: brecht
2020-05-31 13:15:40 -06:00
Ray Molenkamp 6f1056ae63 Deps: iconv 1.16 2020-05-31 10:33:11 -06:00
Brecht Van Lommel c93a88413d Merge branch 'blender-v2.83-release' 2020-05-29 18:05:04 +02:00
Brecht Van Lommel a86b5df005 Blender: change bugfix release versioning from a/b/c to .1/.2/.3
The file subversion is no longer used in the Python API or user interface,
and is now internal to Blender.

User interface, Python API and file I/O metadata now use more consistent
formatting for version numbers. Official releases use "2.83.0", "2.83.1",
and releases under development use "2.90.0 Alpha", "2.90.0 Beta".

Some Python add-ons may need to lower the Blender version in bl_info to
(2, 83, 0) or (2, 90, 0) if they used a subversion number higher than 0.
https://wiki.blender.org/wiki/Reference/Release_Notes/2.83/Python_API#Compatibility

This change is in preparation of LTS releases, and also brings us more
in line with semantic versioning.

Fixes T76058.

Differential Revision: https://developer.blender.org/D7748
2020-05-29 17:48:26 +02:00
Stefan Werner ecc15c55d4 Cycles: Upgraded Embree to version 3.10.0
Enabled round linear hair in Embree.

Differential Revision: https://developer.blender.org/D7623
2020-05-27 10:10:18 +02:00
Bastien Montagne 60bed34f16 install_deps: update libraries versions.
- FFMPEG: 4.3.2
- OpenSubDiv: 3.4.3
- OpenXR SDK: 1.0.8
- Switch form SDL 1.2 to SDL 2.0

Re T77035, T77007, T77010 and T77011
2020-05-25 11:54:30 +02:00
Campbell Barton dc429d5910 Merge branch 'blender-v2.83-release' 2020-05-25 15:00:58 +10:00
Campbell Barton f274b8c102 CMake: disable WITH_USD with blender_lite configurations 2020-05-25 14:54:41 +10:00
Ray Molenkamp 5db2d9c82b Deps: ffmpeg 4.2.3 + codecs update
This diff updates:
FFmpeg : 4.3.2
libogg : 1.3.4
flac   : 1.3.3
vpx    : 1.8.2
xvid   : 1.3.7
x264   : 33f9e1474613f59392be5ab6a7e7abf60fa63622

x264 seemingly has given up on even providing snapshots
and has been updated to the latest hash available at
this time.

faad has been removed since ffmpeg has not supported
it since 2010.
2020-05-24 15:18:39 -06:00
Ray Molenkamp 525fc36a80 Deps : XR_OpenXR_SDK 1.0.8 2020-05-23 15:58:15 -06:00
Ray Molenkamp 2ddd9813ef deps: SDL 2.0.12 2020-05-23 15:41:44 -06:00
Ray Molenkamp 157b9e78a4 Deps: OpenSubDiv 3.4.3 2020-05-23 15:21:28 -06:00
Ray Molenkamp 93f60a4da5 Deps: Freetype 2.10.2 2020-05-23 14:37:17 -06:00
Ray Molenkamp f5cd06ed45 deps: OpenAL 1.20.1 2020-05-23 14:02:34 -06:00
Ray Molenkamp 08b4faef01 Properly fix: T71040 / T58983 Ocean Modifier crashes at high resolutions
For a more detailed description of the issue see the commit
message for rB497cd3d7dd6e497be484eb78a8ddb23f53b20343

This change moves fftw to a shared library and reverts the bandaid
we did for 2.83.
2020-05-19 12:28:19 -06:00
Ray Molenkamp a6c0874355 win/deps: generate sndfiles import library with ms lib tool
Unsure what it is that upsets it so much, but when linking
both sndfile and fftw dynamically, the linker gets confused
and thinks that fftw is importing sf_close from the blender
binary (which makes *NO* sense) leading to a start-up error.

Generating the import library from the .def file using the
ms lib tool creates an import library that works fine.
2020-05-19 12:22:36 -06:00
Ray Molenkamp 393050e8e5 Merge remote-tracking branch 'origin/blender-v2.83-release' 2020-05-18 16:37:57 -06:00
Ray Molenkamp 497cd3d7dd Fix: T71040 / T58983 Ocean Modifier crashes at high resolutions
This is not as much a fix as a work around, but given the real
involves replacing how we build fftw, it is not eligible for 2.83
which is in BCON3 already.

The root of the issue lies with (how we build) fftw3

The first issue is: fftw does not build with MSVC, there are other
dependencies that are not compatible with MSVC and for those we
build the libraries required with mingw64, same for fftw

The second issue is: for reasons unknown we really really really
liked all deps to link statically so wherever possible we did so.

Now during the building of the fftw it linked a few symbols from
libgcc (which we do not ship) like __chkstk_ms, for which we passed
some flags to stop generating calls to it. Problem solved! There
is no way this could possibly turn around and bite us in the rear.

fast forward to today mystery crashes that look like a race condition.

What is happening is, we tell the linker that each thread will require
a 2-megabyte stack, now if every thread immediately allocated 2 megs,
that be 'rough' on the memory usage. So, what happens is (for all apps
not just blender), 2 megs are reserved but not backed by any real memory
and the first page is allocated for use by the stack, now as the stack
grows, it will eventually grow out of that first page, and end up in
an area that has not been allocated yet, to deal with that the allocated
page is followed by a guard page, someone touches the guard page it's
time to grow the stack!

Meanwhile in FFTW is it's doing substantial allocation using alloca
(up to 64 kb) on the stack, jumping over the guard page, and ending
up in reserved but not yet committed memory, causing an access violation.

Now if you think, that doesn't sound right! something should have
protected us from that! You are correct! That thing was __chkstk_ms
which we disabled.

Given we do not want a dependency on libgcc while building with MSVC
the proper solution is to build fftw as a shared library which will
statically link any bits and pieces it needs, however that change
is a little bit too big to be doing in BCON3.

So as a work around, we change the size the stack grows from 8k to
68k which gives fftw a little bit more wiggle room to keep it out
of trouble most of the time.

Note this only sidesteps the issue, this may come up again if the
conditions are just right, and a proper solution will need to be
implemented for 2.90.
2020-05-18 16:35:53 -06:00
Brecht Van Lommel 5ca1eb96c7 Merge branch 'blender-v2.83-release' 2020-05-12 21:57:04 +02:00
Brecht Van Lommel 80953aed33 Fix CMake using different OpenEXR / USD includes and libraries in some cases
Search for all potential library names in each directory, otherwise e.g.
libImath-2_2.a from a system directory will be preferred over libImath.a even
if we specified a directory.
2020-05-12 21:50:49 +02:00
Ray Molenkamp 3c56746863 Windows: Re-enable incremental linking
It was disabled in D7520 to keep the pdb's from growing out
of control however the increased link time is just not worth
it.

I'll keep an eye on the dailies and see if we have to come up
with a different solution.
2020-05-11 10:01:54 -06:00
Ray Molenkamp f2178b7f97 deps/windows: Fix wrong crt for libjpeg and pthreads
The msvc linker had been warning about libcmt being dragged
in for a bit, finally tracked the issue down to the deps of
jpeg and pthreads which both ignored our cflags.

this diff changes them both to use the dynamic crt rather
than the static one so they'll be in line with all our
other libraries.
2020-05-09 12:47:59 -06:00
Bastien Montagne 0d0dcfd643 Install_deps: Add support to compile TBB when we cannot find version.
We now want to use fairly recent TBB (2018 at least?), so distro a bit
old will not have required package anymore...

Tested with Debian, other distro "should work" (c), but tests there are
much welcome! ;)
2020-05-08 18:05:30 +02:00
Bastien Montagne 2d30c4a35b install_deps: Fix (unreported) typo in OpenXR build code.
Was breaking up proper behavior of 'need to rebuild' checks for that
lib.
2020-05-08 18:05:30 +02:00
Bastien Montagne e517734708 install_deps: Fix (unreported) broken logic in OIIO building.
Not sure where that code was comming from, but it was breaking the
cleanup/update_deps logic...
2020-05-08 18:05:30 +02:00
Bastien Montagne 7d8c5d5623 install_deps: Fix (unreported) broken Boost source URL. 2020-05-08 18:05:30 +02:00
Bastien Montagne be3c0862ba Cleanup: install_deps: Simplify the 'no distro' code a bit.
We never deal with packages then, and only ever build (if we do
anything), no reason to make things more complicated than needed...
2020-05-08 18:05:30 +02:00
Bastien Montagne 883dfda024 install_deps: Fix (unreported) bad handling of deps between libs.
Previous code would forec built libs to always be rebuilt when one of
their deps was using a package. While this could be useful when said
package was actually updated, this generates way too much false
positives.

Now only rebuild a built lib when we actually switch from built to
package for one of its deps.
2020-05-08 18:05:30 +02:00
Brecht Van Lommel e7470c9dbe Merge branch 'blender-v2.83-release' 2020-05-05 15:14:09 +02:00
Brecht Van Lommel bb7a23bdff Fix build with precompiled libraries picking up OpenEXR from install_deps.sh 2020-05-05 15:06:49 +02:00
Ray Molenkamp ba43c2a040 Windows: Silence LNK4099 warning.
Ever since debug symbols were added for release builds the linker
has been on the chatty side about symbols being missing for our
binary libs.

There's currently no plans to supply those, so best for the linker
not to warn us about them.
2020-05-04 08:29:48 -06:00
Ray Molenkamp 33bdd91fb8 Windows: Move tbb to being dynamic library
Static tbb has always been frowned upon [1] sofar it has worked for us but
given our reliance on tbb is about to increase (D7475), I'd like to move the library
to more supported configuration. Which means moving it to be a dynamic library

The libs part of this change is in rBL62416

Reviewed By: Brecht

Differential Revision: https://developer.blender.org/D7570
2020-05-03 16:25:56 -06:00
Ray Molenkamp b523911e86 Windows: Support backtraces on release builds.
This diff add supports for crash logs on windows for
release builds. This can be toggled on/off with the
`WITH_WINDOWS_PDB` cmake option. by default it is on.

Things to take into consideration:

Release builds are hightly optimized and the resulting
backtraces can be wrong/misleading, take the backtrace
as a general area where the problem resides rather than
an exact location.

By default we ship a minimized symbol file that can only
resolve the function names. This was chosen to strike
a balance between growth in size of the download vs
functionality gained. If more detailed information is
required such as source file + line number information
a full pdb can be shipped by setting `WITH_WINDOWS_STRIPPED_PDB`
to off.

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

Reviewed by: brecht
2020-05-01 07:37:48 -06:00
Campbell Barton 7ded7610ce Cleanup: rename WITH_X11 to WITH_GHOST_X11
Matches WITH_GHOST_{SDL|WAYLAND}
2020-05-01 19:14:50 +10:00
Ray Molenkamp 03f4d20bcf Revert "Windows: Support backtraces on release builds."
Issues with older cmake.
2020-04-30 14:00:11 -06:00
Ray Molenkamp 1d63db2044 Fix: Windows build bot script error
Partial revert of D7520
2020-04-30 13:34:11 -06:00
Ray Molenkamp f90a716e68 Windows: Support backtraces on release builds.
This diff add supports for crash logs on windows for
release builds. This can be toggled on/off with the
`WITH_WINDOWS_PDB` cmake option. by default it is on.

Things to take into consideration:

Release builds are hightly optimized and the resulting
backtraces can be wrong/misleading, take the backtrace
as a general area where the problem resides rather than
an exact location.

By default we ship a minimized symbol file that can only
resolve the function names. This was chosen to strike
a balance between growth in size of the download vs
functionality gained. If more detailed information is
required such as source file + line number information
a full pdb can be shipped by setting `WITH_WINDOWS_STRIPPED_PDB`
to off.

The Release in the title of this diff refers to the
release build type, not the official blender releases.

Initially this will only be enabled for nightly build
bot versions of blender, official releases as of now
will not ship with symbols.

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

Reviewed by: brecht
2020-04-30 12:41:16 -06:00
Brecht Van Lommel d8a3f3595a Task: Use TBB as Task Scheduler
This patch enables TBB as the default task scheduler. TBB stands for Threading Building Blocks and is developed by Intel. The library contains several threading patters. This patch maps blenders BLI_task_* function to their counterpart. After this patch we can add more patterns. A promising one is TBB:graph that can be used for depsgraph, draw manager and compositor.

Performance changes depends on the actual hardware. It was tested on different hardwares from laptops to workstations and we didn't detected any downgrade of the performance.
* Linux Xeon E5-2699 v4 got FPS boost from 12 to 17 using Spring's 04_010_A.anim.blend.
* AMD Ryzen Threadripper 2990WX 32-Core Animation playback goes from 9.5-10.5 FPS to 13.0-14.0 FPS on Agent 327 , 10_03_B.anim.blend.

Reviewed By: brecht, sergey

Differential Revision: https://developer.blender.org/D7475
2020-04-30 08:09:21 +02:00
Christian Rauch 66e70fe299 GHOST: initial Wayland support
Usable with the CMake option 'WITH_GHOST_WAYLAND'

The following functionality is working:

- Building with X11 and Wayland at the same time,
  wayland is used when available.
- Keyboard, pointer handling.
- Cursor handling.
- Dedicated off-screen windows.
- Drag & drop.
- Copy & paste.
- Pointer grabbing.

See D6567 for further details.
2020-04-30 14:21:50 +10:00
Bastien Montagne 00e0034b13 Merge branch 'blender-v2.83-release' 2020-04-29 21:38:18 +02:00
Ray Molenkamp 7f5367eaae Windows: Fix RelWithDebInfo missing symbol information
issue introduced in rB55a2682348df94d0ff2f57d786b7a557312d0345
2020-04-29 09:17:34 -06:00
Brecht Van Lommel 0ddf5860f5 Fix Python bz2 module failing to import on older macOS versions
Found by failing bundled modules test. The bz2 library was compiled without
proper minimum SDK version flags.
2020-04-29 16:25:46 +02:00
Bastien Montagne 1e58255c40 Merge branch 'blender-v2.83-release' 2020-04-29 10:16:42 +02:00
Anthony Edlin b3ac6d1348 nstall_deps: USD: Add root usd library directory to build args.
Add root usd library directory to build arguments, same as other libraries.
Also fix error/typo in compile_USD regarding _is_building.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D7563
2020-04-29 10:15:55 +02:00
Nathan Craddock 490c32c425 CMake: add WITH_LINKER_LLD option for unix platforms
Can give considerably faster linking, especially for debug builds.

This may be enabled by default but needs to be more thoroughly tested.
2020-04-27 14:14:00 +10:00
Ray Molenkamp 55a2682348 Windows: Add sccache support.
sccache [1] is one of the few ccache like solutions that will
work on windows.

sccache support can be enabled with the `WITH_WINDOWS_SCCACHE`
cmake option however it will only will work with ninja as the
build system, msbuild is not supported currently.

Advanced option, developes are expected to obtain and configure
sccache on their own.

```
Full build no cache 1428.90s (100.00%)
Full build cached    434.34s ( 30.40%)
```

[1] https://github.com/mozilla/sccache

Reviewed By: nicholas_rishel, Brecht

Differential Revision: https://developer.blender.org/D7466
2020-04-20 12:51:43 -06:00
Brecht Van Lommel aaaa0a43af Build: use -no-pie for portable builds on Linux
Otherwise file browsers do not recognize the Blender executable. This is
already done for official releases.

We leave it off for non-portable builds, since that's how Linux distribution
packages will typically build Blender and we can continue to follow the OS
default there. Using a file browser to launch executables from e.g. /usr/bin
would be rare as wel.

Differential Revision: https://developer.blender.org/D7363
2020-04-07 13:32:42 +02:00
Ray Molenkamp 29b87b5615 Fix T75357: USD export broken on windows
Path to the jsons was wrong so they were not copied
2020-04-06 14:38:52 -06:00
Brecht Van Lommel bae1c243ce Build: hide USD symbols, make Blender symbols visible again
Following up to b555b8d.

Building Blender with hidden symbols but using libraries with visible symbols
was giving linker warnings, specifically for USD. So revert that for now, as
it was not needed for the bugfix.

Hide USD symbols (some of which are not in the USD namespace) to avoid potential
conflicts. May potentially help with AMD OpenCL issues in T74262.
2020-04-05 21:04:10 +02:00
Brecht Van Lommel c4ba0d1508 Fix Linux link error with pcre after recent changes, must use absolute path 2020-04-02 22:05:03 +02:00
Brecht Van Lommel 75f6e6b39e Fix link error on Linux buildbot with libxml2
On macOS this is part of the collada folder, but for Linux xml2 is in its own
folder for precompiled libraries.
2020-04-02 18:54:58 +02:00
Brecht Van Lommel 5159ba6b33 Fix (harmless) PCRE not found warning when configuring CMake on Linux
Differential Revision: https://developer.blender.org/D7309
2020-04-02 17:09:01 +02:00
Brecht Van Lommel 2aa938b0ae Cleanup: simplify Linux buildbot config, where default values already match
Ref D7309
2020-04-02 17:09:01 +02:00
Ray Molenkamp 0062813c73 make.bat: Improve messaging when not detecting MSVC
Inspired by @mrwhite in D7295
2020-03-31 13:14:16 -06:00
Brecht Van Lommel b555b8dedc Build: hide most symbols on macOS on Linux to avoid conflicts
This means symbols from Blender itself and most external libraries. We can't
just hide all because that breaks some libraries. The better solution would
be to rebuild all library dependencies with hidden visibility.

Fixes T75223: Luxrender add-on failing to load on macOS
2020-03-31 00:07:55 +02:00
Bastien Montagne 671d811323 Install_deps: Do not wipe out `WITH_PYTHON` CMake options.
This is annoying when one want to use system python and hence disables
the `WITH_PYTHON_INSTALL` options...
2020-03-27 15:46:47 +01:00
Mateusz Grzeliński 0a02c288aa install_deps: Enable PIC in Python static library.
Update for D3078, I think it should be fixed

Benefits:
- after installing python 3.7 with `./build_files/build_environment/install_deps.sh`, user will be able to run `make bpy` without linking error:
  - https://blender.stackexchange.com/questions/102933/a-working-guidance-for-building-blender-as-bpy-python-module
  - https://stackoverflow.com/questions/36779834/compiling-blender-bpy-recompile-with-fpic

To prevent errors like `/opt/lib/python-3.7.4/bin/python3.7: error while loading shared libraries: libpython3.7m.so.1.0: cannot open shared object file: No such file or directory`, add python .so lib to ldconfig

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D7177
2020-03-27 15:23:58 +01:00
Sergey Sharybin a093112696 CMake: Fix compilation with Xcode generation on Xcode 11.4
Need to give correct SDKROOT.
2020-03-26 13:07:52 +01:00
Sergey Sharybin ef2bde11d2 CMake: Fix spelling for OpenImageDenoise package
The spelling should match exactly between how package is called in
find_package and in FIND_PACKAGE_HANDLE_STANDARD_ARGS.
2020-03-26 11:35:51 +01:00
Sergey Sharybin a22471f1d1 CMake: Fix macOS SDK detection with latest Xcode and macOS
Happens on macOS 10.15.4 and Xcode 11.4.

The reason of failure is caused by following factors:

- xcodebuild reports full semantic macOS SDK version 10.15.4
- The actual SDK file path will only include major and minor part
  of the version (10.15, MacOSX10.15.sdk)
- Previous CMake code of ours expected direct match between SDK
  version and file path.

The solution is to make our detection code a bit more flexible and
additionally check for major.minor macOS SDK version in the path.
2020-03-26 11:35:51 +01:00
Sergey Sharybin f9590c8eaa CMake: Remove support of Xcode prior to 8.2
The specific goal of this change is to get rid of separate code paths
for older and newer Xcode versions.

The version 8.2 is picked since it's the latest version which runs on
macOS 10.11 (which is our current deployment target). If that turns
out too new for some reason the alternative would be to require Xcode
version 5.
2020-03-26 11:35:51 +01:00
Sergey Sharybin 03b2fc1a61 CMake: Cleanup, remove unneeded version requirement
The main CMakeLists already requires CMake 3.5, so there is no point of
requiring "newer" CMake on macOS.

This was a code from a while back where CMake 3 was not required on all
platforms.
2020-03-26 09:02:10 +01:00
Sergey Sharybin fd262d3196 CMake: Fix detection of Xcode version
Legacy code did not take into account the fact that major version can
be two digits. This was causing "Xcode 11.4" to be detected as "11.".
2020-03-26 08:59:08 +01:00
Ray Molenkamp 8e8fdf875d Windows/Cleanup: Remove VS2015 support from make.bat
VS2015 has not been supported for a while now but make.bat
still had some support for it.
2020-03-24 14:48:23 -06:00
Sybren A. Stüvel 88a86c025c Deps: TBB changed their repository URL
As a result the MD5sum of the downloaded package also changed.
2020-03-23 16:04:52 +01:00
Julian Eisel 9e8afa8817 Fix OpenXR SDK failing to compile with no JsonCpp installed
Force the SDK to use its own, bundled JsonCpp sources.
2020-03-21 21:58:17 +01:00
Julian Eisel c589fdc8db Fix install_deps.sh ignoring --skip-xr-openxr 2020-03-21 19:03:56 +01:00
Brecht Van Lommel 2be14e0ec4 Fix typo in make.bat help for build directory 2020-03-19 15:31:21 +01:00
Bastien Montagne 82fc81816e Fix openXR building with install_deps in some compilers. 2020-03-18 15:11:03 +01:00
blender ba3d49225c make deps: Fixes to make OpenXR to work on CentOS Linux
- Harvest to a proper location.
- Disable STD's filesystem which is experimental and caused
  linking errors when OpenXR is usedi n Blender.
2020-03-17 18:35:29 +01:00
Sergey Sharybin 9f48852ba4 Buildbot: Enable version character for development builds
Allows to have 2.82a as a beta version on buildbot.
2020-03-10 10:23:28 +01:00
Bastien Montagne 0d05fd9b4c Install_deps: fix wrong `XR_OPENXR_ROOT_DIR` parameter for CMake.
Should be `XR_OPENXR_SDK_ROOT_DIR`.`
2020-03-08 17:14:58 +01:00
Julian Eisel a22573e243 Build System: Add OpenXR-SDK dependency and WITH_XR_OPENXR build option
The OpenXR-SDK contains utilities for using the OpenXR standard
(https://www.khronos.org/openxr/). Namely C-headers and a so called
"loader" to manage runtime linking to OpenXR platforms ("runtimes")
installed on the user's system.

The WITH_XR_OPENXR build option is disabled by default for now, as there
is no code using it yet. On macOS it will remain disabled for now, it's
untested and there's no OpenXR runtime in sight for it.

Some points on the OpenXR-SDK dependency:
* The repository is located at
  https://github.com/KhronosGroup/OpenXR-SDK (Apache 2).
* Notes on updating the dependency:
  https://wiki.blender.org/wiki/Source/OpenXR_SDK_Dependency
* It contains a bunch of generated files, for which the sources are in a
  separate repository
  (https://github.com/KhronosGroup/OpenXR-SDK-Source).
* We could use that other repo by default, but I'd rather go with the
  simpler solution and allow people to opt in if they want advanced dev
  features.
* We currently use the OpenXR loader lib from it and the headers.
* To use the injected OpenXR API-layers from the SDK (e.g. API
  validation layers), the SDK needs to be compiled from this other
  repository.

The extra "XR_" prefix in the build option is to avoid mix-ups of OpenXR
with OpenEXR.

Most of this comes from the 2019 GSoC project, "Core Support of Virtual
Reality Headsets through OpenXR"
(https://wiki.blender.org/wiki/User:Severin/GSoC-2019/).

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

Reviewed by: Campbell Barton, Sergey Sharybin, Bastien Montagne, Ray
Molenkamp
2020-03-04 16:45:07 +01:00
Campbell Barton a5c984a57d Cleanup: cmake indentation 2020-03-04 11:02:35 +11:00
Ray Molenkamp 98c74c6a6e Fix: Excessive (re)builds of subprojects
Recent refactor external dependencies handling (D6642)
improperly linked all library dependencies with public
linkage rather than interface linkage. Causing excessive
(re)builds of subprojects when not needed.

This patch restores the interface linkage.

Reviewed By: brecht sergey

Differential Revision: https://developer.blender.org/D6983
2020-03-02 12:42:01 -07:00
Phillip Thomas 6a6ccb26ec Build: show draco library under extern folder in Visual Studio
And other code tweaks to make this library more consistent with others.

Differential Revision: https://developer.blender.org/D6864
2020-03-01 16:19:37 +01:00
Brecht Van Lommel 1ec11363bd Build: don't include WITH_SYSTEM_GLEW as part of make lite
System GLEW often is not new enough, which gives error on startup. The build
correctness should not be affected by using lite vs. full, so better to leave
this out than save compiling one extra file.
2020-02-27 16:11:07 +01:00
Brecht Van Lommel 78391def6e Cleanup: deduplicate OpenVDB library definitions/include/libs logic
This will more important when we start using OpenVDB in more modules.
2020-02-26 18:13:14 +01:00
Brecht Van Lommel 22abc7f080 Build: add compatibility between precompiled libraries and new glibc
On Linux, precompiled libraries may be made with a glibc version that is
incompatible with the system libraries that Blender is built on. To solve
this we add a few -ffast-math symbols that can be missing.

Differential Revision: https://developer.blender.org/D6930
2020-02-26 18:13:14 +01:00
Nathan Craddock 30b3bf2b57 Build: ignore system paths when using precompiled libraries on Linux
Based on work by Nathan Craddock, with further changes to apply it to all
precompiled libraries.

Differential Revision: https://developer.blender.org/D6929
2020-02-26 18:12:18 +01:00
Bastien Montagne 6dd3e7d84d install_deps: fix several issues.
Lots of fixes and cleanups, mainly addressing:
* OpenEXR building was fully broken.
* Missing dependencies of Alembic to Boost and openEXR.
* OSL had changed its CMake parameters for custom OpenEXR install path.
* Dependencies between libs were not properly handles when switching a
lib from own build to system package.
2020-02-25 15:59:26 +01:00
Brecht Van Lommel d109ea5ee5 Fix make deps failing to build opencollada on Linux, due to line endings
The OpenCOLLADA package contains a mix of files with unix and dos line endings.
Now we mark the diff as a binary file so that the patch also contains a mix of
line endings that matches the package.
2020-02-24 19:23:25 +01:00
Sergey Sharybin 1f8f4c8cfe Codesign: Make file watcher robust for network errors 2020-02-21 11:00:11 +01:00
Sergey Sharybin 20b47d77e1 Codesign: Remove archive with files after they were copied 2020-02-21 09:31:55 +01:00
Ray Molenkamp a9b184bbc4 windows: Add some more verbose logging to make.bat 2020-02-20 10:34:15 -07:00
Brecht Van Lommel 02f44049a8 Fix make deps OSL build on some systems with Qt libraries 2020-02-19 11:41:38 +01:00
Ray Molenkamp d0c159ae97 build_deps: include venv on windows 2020-02-17 18:41:24 -07:00
Stefan Werner f5740ec8cf Cycles: Enabled quaternion motion blur with Embree.
Bringing Embree's motion blur closer to Cycles' native blur.
This requries Embree 3.8.0 or newer.

Differential Revision: https://developer.blender.org/D6575
2020-02-17 23:44:12 +01:00
Sergey Sharybin 37cdfac6b9 Codesign: Harden check for archive being ready for sign
Seems like sometimes files are being only partially ready, which makes it so there
are unsigned files, failing to deliver fully signed bundle.

Now expected archive file size is stored into stamp file and is checked against
size of the archive file on another side.

There are some bare prints used for debugging, would need to switch it to a proper
logger (or to be removed).
2020-02-17 18:52:38 +01:00
Ray Molenkamp 8d60e6fa38 Fix: T73830 OSL not finding stdosl.h on linux
This extends FindOpenShadingLanguage.cmake to also look for the location of
stdosl.h and adds the path to the invocation of oslc to deal with the headers
being in different locations a little better.

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

Reviewers: brecht
2020-02-17 10:28:12 -07:00
Brecht Van Lommel c498abb103 Fix macOS LLVM precompiled link error with older Xcode versions 2020-02-17 11:35:07 +01:00
Ray Molenkamp 70ff8f4a97 BPY/Windows: Do not bundle the CRT for a bpy build
- Doesn't work
- If it worked, having a different CRT than the rest of
  the process would not be a good thing.
2020-02-16 10:38:33 -07:00
Brecht Van Lommel 50975026ff Cleanup: remove WITH_EMBREE make deps option
No other default enabled libraries have an option either.
2020-02-15 20:31:18 +01:00
Brecht Van Lommel 39fb33f0b7 Fix macOS build warnings about Boost symbol visibility
The default in Boost changed from global to hidden, but other libraries do
not use hidden symbols which gives warnings at link time on macOS.
2020-02-15 13:44:20 +01:00
Brecht Van Lommel 9531a8a10a Build: enable Embree by default for make deps
Ref T73819, T73778
2020-02-15 13:44:17 +01:00
Campbell Barton 1135c2cd17 Cleanup: CMake formatting 2020-02-15 10:40:41 +11:00
Stefan Werner 6608caef0e build_environment: Upgraded Embree to 3.8.0
The latest versions of Embree allow similar motion interpolation
as Cycles' own BVH.
2020-02-14 19:14:32 +01:00
Ray Molenkamp 75a5ea01c1 Cleanup/MSVC: Enable C++ conformance mode on compiler versions that support it.
MSVC has a conformance mode (/permissive-) where the C++ standard is more strictly
enforced. This mode is available on MSVC 15.5+ [1]

This patch enables this mode on compilers that support it and cleans up the few violations it threw up in the process.

- Mantaflow was using M_PI without requesting them using the _USE_MATH_DEFINES define to opt in to non default behaviour.
- Collada did not include the right header for std::cerr, this seemingly was fixed for other platforms already but put inside a platform guard.
- Ghost had some scoping issues regarding uninitialized variables and goto behaviour

Second landing of this patch, earlier commit was reverted due to some compiler configurations having slipped though testing

[1] https://docs.microsoft.com/en-us/cpp/build/reference/permissive-standards-conformance

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

Reviewed By: brecht
2020-02-13 17:13:07 -07:00
Ray Molenkamp 6022cd015f Revert "Cleanup/MSVC: Enable C++ conformance mode on compiler versions that support it."
It is breaking compilation on some configurations, revert for now while
i see what is wrong.

This reverts commit 9fe469c110.
2020-02-13 07:04:30 -07:00
Ray Molenkamp 9fe469c110 Cleanup/MSVC: Enable C++ conformance mode on compiler versions that support it.
MSVC has a conformance mode (/permissive-) where the C++ standard is more strictly
enforced. This mode is available on MSVC 15.5+ [1]

This patch enables this mode on compilers that support it and cleans up the few violations it threw up in the process.

- Mantaflow was using M_PI without requesting them using the _USE_MATH_DEFINES define to opt in to non default behaviour.
- Collada did not include the right header for std::cerr, this seemingly was fixed for other platforms already but put inside a platform guard.
- Ghost had some scoping issues regarding uninitialized variables and goto behaviour

[1] https://docs.microsoft.com/en-us/cpp/build/reference/permissive-standards-conformance

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

Reviewed By: brecht
2020-02-12 12:49:34 -07:00
Sergey Sharybin 5527cd4ba0 Codesign: Attempt to make macOS codesign more reliable
Is still sometimes .ready file appears prior to an actual archive.
2020-02-12 18:57:57 +01:00
Philipp Oeser 58cdab8b97 install_deps.sh: correct clang/llvm download URLs 2020-02-11 15:02:45 +01:00
Ray Molenkamp 3657bb5141 Fix: Build error on windows
USD "library" directory was not set, leading to an error
during the INSTALL phase.
2020-02-11 06:51:18 -07:00
Brecht Van Lommel 757da61606 Fix T68243: Python sqlite module not working on macOS 2020-02-11 10:17:35 +01:00
Bastien Montagne c6e28f6513 Updated install_deps to latest required OSL/LLVM. 2020-02-10 17:36:06 +01:00
Sybren A. Stüvel ec116e3d49 USD: Install USD library via install_deps.sh
This commit adds the download, extract, patch, build, and install of the
Universal Scene Description (USD) library to the `install_deps.sh`
script.

Reviewed By: mont29, LazyDodo

Differential Revision: https://developer.blender.org/D6478
2020-02-10 15:07:56 +01:00
Ray Molenkamp 94c8bbec9c Windows: Improve rebuild.cmd
Previously the MSVC environment was setup every time using vcvarsall.bat
when you ran you ran rebuild.cmd, Generally not an issue but after many
rebuilds on the same console, it grows the path environment variable
beyond what is supported and building breaks.

This patch adds a check to see if the environment is setup already
and skips the call to vcvarsall.bat

Also cleans up the double build in the msbuild's version of rebuild.cmd
install.vcxproj will build all that is needed, so no need to do a regular
build first.
2020-02-08 17:14:47 -07:00
Ray Molenkamp 6a1414dc58 Build_environment: Fix unwanted exports from oidn on windows.
oidn puts dllexport on all its functions causing the
blender binary to export these symbols.

this patch fixes this unwanted behaviour.

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

Reviewers: brecht , sergey
2020-02-08 15:32:19 -07:00
Ray Molenkamp 8c509f98e1 Build_environment: Fix unwanted exports from libxml on windows.
libxml puts dllexport on all its functions causing the
blender binary to export these symbols.

this patch fixes this unwanted behaviour.

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

Reviewers: brecht , sergey
2020-02-08 15:04:09 -07:00
Ray Molenkamp 67d3613d1a Build_environment: Freetype 2.10.1
Freeetype 2.9.1 tags dllexport on most of its functions so these
are now exported from the blender binary. (Same issue as D6563
which fixed it for USD)

Issue has already been fixed upstream so a simple version bump
fixes it.

This patch bumps freetype to 2.10.1

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

Reviewers: brecht , sergey
2020-02-08 14:23:28 -07:00
Ray Molenkamp b9c9b00171 Build_environment: OSL 1.10.9 / llvm 9.0.1
OSL 1.10.9 fixes osl-bug 866 [1] which is long standing issue
on windows where paths get un-escaped and osl breaks when you
install it to for instance c:\blender-tests\new-boolean

This patch bumps osl to 1.10.9, and since osl is llvm's
only consumer, llvm/clang were bumped 9.0.1

Removed some of the patches that were no longer needed

Builds and passes all tests on windows and linux

[1] https://github.com/imageworks/OpenShadingLanguage/issues/866

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

Reviewers: brecht
2020-02-08 13:01:31 -07:00
Ray Molenkamp 6477fcf40f BuildSystem/Cleanup: Fix warning behaviour regarding library dependencies
Adding USD to a lite build fails to build due to boost errors, when you turn
boost on and rebuild still boost errors, boost was silently turned off since
it was not deemed needed. Once boost was forced on, it still fails due to TBB
being off.

This patch fixes:

- The Silent disabling of boost
- Add a check that USD is is not on before doing that
- move the TBB checks to a central location rather than the individual platform files
- Add USD to the TBB checks.

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

Reviewers: brecht, sybren
2020-02-07 07:27:40 -07:00
Ray Molenkamp 02226ef653 Code_Cleanup_Day/Windows: Clean-up windows API Level.
Not sure when this happened but apparently the lower bar is now windows 7 [1]

This patch bumps to API version to 0x0601 (Win7) and cleans up any uses that
worked around the globally set API version.

[1] https://www.blender.org/download/requirements/

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D6758
2020-02-05 20:03:06 -07:00
Campbell Barton d2c0df2842 Merge branch 'blender-v2.82-release' 2020-02-06 01:33:23 +11:00
Campbell Barton 6d10c24062 Fix finding freetype on Linux not using pre-compiled libs
Finding X11 before platform libs caused freetype not to use
pre-compiled libraries.
2020-02-06 01:30:26 +11:00
Campbell Barton be70fcd7f2 Merge branch 'blender-v2.82-release' 2020-02-06 01:24:49 +11:00
Campbell Barton 87c18fbbc5 CMake: remove non-standard package search paths
Reduce the number of possible locations used to find libraries,
to simplify troubleshooting.

Only keep '*_ROOT_DIR' and the path used by 'install_deps.sh'.
2020-02-06 01:23:22 +11:00
Julian Eisel e4605cb155 Merge branch 'blender-v2.82-release' 2020-02-04 20:09:03 +01:00
Simon G 370a6175e0 Fix wrong glColor3usv array size check in clang array checker
Differential Revision: https://developer.blender.org/D6716
2020-02-04 17:54:51 +01:00
Sergey Sharybin 04ec64b251 Merge branch 'blender-v2.82-release' 2020-02-04 11:08:15 +01:00
Sergey Sharybin 2264590d8c CMake: Attempt to fix tests on buildbot
An educated guess to put ensure order of static libraries initialization.

A bit weird, since OpenImageDenoise should be depending on TBB, but that
is likely being ensured by bf_compositor.

Linking succeeded on my Intel machine, and blenloader_test was passing
when doing manual test on buildbot.
2020-02-04 11:05:57 +01:00
Sergey Sharybin 9dd6b0842a Merge branch 'blender-v2.82-release' 2020-02-04 10:25:34 +01:00
Sergey Sharybin ae433393af Codesign: Fix script for Windows
Apparently, there is no os.sync() on Windows.
2020-02-04 10:24:59 +01:00
Sergey Sharybin ea8975cb27 Merge branch 'blender-v2.82-release' 2020-02-04 09:50:53 +01:00
Sergey Sharybin 5dc1183580 Codesign: Possible fix for stamp appearing prior to archive
From looking into builder's logs it seems that stamp file is picked
up prior to actual archive: sometimes worker reports missing archive
file, from a code path which is only possible if there is a stamp file.

Could be something with IO scheduling where bigger file is sent to
Samba server after smaller file.

Hopefully with this change this will not happen anymore.
2020-02-04 09:47:59 +01:00
Sergey Sharybin 85776521f8 Merge branch 'blender-v2.82-release' 2020-02-03 17:53:28 +01:00
Sergey Sharybin 26ba7573e6 Codesign: Fix wrong logging message 2020-02-03 17:53:03 +01:00
Sergey Sharybin 7799890d8e Merge branch 'blender-v2.82-release' 2020-02-03 17:31:26 +01:00
Sergey Sharybin 3125cfceec Codesign: Add codesign for macOS worker
Works similarly to Windows configuration where buildbot worker and
codesign machines are communicating with each other using network
drive.
2020-02-03 17:03:51 +01:00
Sergey Sharybin f037244e2c Merge branch 'blender-v2.82-release' 2020-02-03 14:07:48 +01:00
Sergey Sharybin bc3d7faab7 Buildbot: Specify path to macOS codesign 2020-02-03 14:07:21 +01:00
Brecht Van Lommel 53d805abcb Merge branch 'blender-v2.82-release' 2020-01-31 13:03:15 +01:00
Brecht Van Lommel c82b8c5944 Fix tests failing on AMD Ryzen, due TBB initialization order issue
Similar fix as the one we did for the blender executable, see T72015.
2020-01-31 12:56:20 +01:00
Sergey Sharybin e207cba8cc Merge branch 'blender-v2.82-release' 2020-01-30 13:32:54 +01:00
Sergey Sharybin 8285a12f4e Buildbot: Make archive naming shorter and cleaner
It changes name to be blender-<version>-linux64.

Since CentOS is used as a base host for builds there is no real need
in specifying libc version. Is unlikely anything older could be used
anyway.

Also make bitness to be the same as windows. It is something what
users will read easier.
2020-01-30 13:32:22 +01:00
Sergey Sharybin 6dcb4c9b4f Buildbot: Allow building on systems without scl
Makes it easier to verify changes on local machine without scl
before committing changes to repo.
2020-01-30 13:32:22 +01:00
Sergey Sharybin 332f310b81 Merge branch 'blender-v2.82-release' 2020-01-30 10:25:36 +01:00
Sergey Sharybin 306edb7477 Buildbot: Enable 16 threads for macOS worker as well 2020-01-30 10:24:57 +01:00
Sergey Sharybin 657ff6ef5e Merge branch 'blender-v2.82-release' 2020-01-29 13:41:43 +01:00
Sergey Sharybin b683fcb628 Buildbot: Increase number of compile thread for Linux Buildbot 2020-01-29 13:41:04 +01:00
Brecht Van Lommel 5c75c8d8d0 Fix T63805: remove outdated and unused Linux package spec files
These are maintained by the various Linux distributions themselves instead.
2020-01-27 12:22:01 +01:00
Nathan Craddock 36f713e216 CMake: Fix precompiled Boost libraries on Linux
When building with precompiled libraries on Linux, CMake used boost libs
from the system outside the lib dir. This restricts CMake to use only the
libraries from the precompiled libraries.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D6659
2020-01-25 23:37:13 -07:00
Sergey Sharybin b5652f3f02 Merge branch 'blender-v2.82-release' 2020-01-24 15:24:27 +01:00
Sergey Sharybin cb6f9c2f19 Make deps: Force some boost dependencies
Boost could have picked up system-wide libbz2-dev installed and enable
this compression in iostreams. Nothing really wrong with this, but it
makes it so final Blender binary depends on bz2, which breaks default
linker flags.

This commit makes it so Boost is not using libraries which we don't
need, simplifying linking setup.

Differential Revision: https://developer.blender.org/D6668
2020-01-24 15:21:36 +01:00
Sergey Sharybin 6fff73e3f0 Merge branch 'blender-v2.82-release' 2020-01-23 16:59:50 +01:00
Sergey Sharybin 517870a4a1 CMake: Refactor external dependencies handling
This is a more correct fix to the issue Brecht was fixing in D6600.

While the fix in that patch worked fine for linking it broke ASAN
runtime under some circumstances.
For example, `make full debug developer` would compile, but trying
to start blender will cause assert failure in ASAN (related on check
that ASAN is not running already).

Top-level idea: leave it to CMake to keep track of dependency graph.

The root of the issue comes to the fact that target like "blender" is
configured to use a lot of static libraries coming from Blender sources
and to use external static libraries. There is nothing which ensures
order between blender's and external libraries. Only order of blender
libraries is guaranteed.

It was possible that due to a cycle or other circumstances some of
blender libraries would have been passed to linker after libraries
it uses, causing linker errors.

For example, this order will likely fail:

  libbf_blenfont.a libfreetype6.a libbf_blenfont.a

This change makes it so blender libraries are explicitly provided
their dependencies to an external libraries, which allows CMake to
ensure they are always linked against them.

General rule here: if bf_foo depends on an external library it is
to be provided to LIBS for bf_foo.
For example, if bf_blenkernel depends on opensubdiv then LIBS in
blenkernel's CMakeLists.txt is to include OPENSUBDIB_LIBRARIES.

The change is made based on searching for used include folders
such as OPENSUBDIV_INCLUDE_DIRS and adding corresponding libraries
to LIBS ion that CMakeLists.txt. Transitive dependencies are not
simplified by this approach, but I am not aware of any downside of
this: CMake should be smart enough to simplify them on its side.
And even if not, this shouldn't affect linking time.

Benefit of not relying on transitive dependencies is that build
system is more robust towards future changes. For example, if
bf_intern_opensubiv is no longer depends on OPENSUBDIV_LIBRARIES
and all such code is moved to bf_blenkernel this will not break
linking.

The not-so-trivial part is change to blender_add_lib (and its
version in Cycles). The complexity is caused by libraries being
provided as a single list argument which doesn't allow to use
different release and debug libraries on Windows. The idea is:

- Have every library prefixed as "optimized" or "debug" if
  separation is needed (non-prefixed libraries will be considered
  "generic").

- Loop through libraries passed to function and do simple parsing
  which will look for "optimized" and "debug" words and specify
  following library to corresponding category.

This isn't something particularly great. Alternative would be to
use target_link_libraries() directly, which sounds like more code
but which is more explicit and allows to have more flexibility
and control comparing to wrapper approach.

Tested the following configurations on Linux, macOS and Windows:

- make full debug developer
- make full release developer
- make lite debug developer
- make lite release developer

NOTE: Linux libraries needs to be compiled with D6641 applied,
otherwise, depending on configuration, it's possible to run into
duplicated zlib symbols error.

Differential Revision: https://developer.blender.org/D6642
2020-01-23 16:59:18 +01:00
Brecht Van Lommel 544ee7a4f2 Make deps: Fix zlib symbols defined twice
We compile zlib as own dependency, but are not informing BLOSC
to use it. This leads to zlib symbols defined twice when linking
Blender: one set comes from libz.a and another one from libblosc.a.

Tested on Linux Debian testing and CentOS 7.5.

It is possible that this change on its own will lead to linking
errors after libraries are re-compiled, This will be fixed as
a dedicated fix to Blender's build system.

Reviewed By: brecht, mont29, LazyDodo

Differential Revision: https://developer.blender.org/D6641
2020-01-23 16:59:18 +01:00
Campbell Barton abce4833a6 install_deps.sh: strip trailing punctuation from version numbers
Encountered this issue when enabling more libraries.
2020-01-23 03:39:06 +11:00
Campbell Barton fde6151641 install_deps.sh: fix versions such as 1.6_RC2 failing to compare
This is stripped off since it causes an error when evaluating
the strings as numbers.
2020-01-23 02:17:28 +11:00
Campbell Barton 0272acee0d install_deps.sh: fix IFS being incorrect when a version check fails
This caused quoting to fail later on.
2020-01-23 01:42:33 +11:00
Campbell Barton fc0df1ffb4 Revert "install_deps.sh: fix ffmpeg package installation on Arch"
This reverts commit 3cb212602c.

The root cause was IFS being set incorrectly.
2020-01-23 01:42:33 +11:00
Campbell Barton 3cb212602c install_deps.sh: fix ffmpeg package installation on Arch
A blank space at the start of the string caused the list to be quoted
as a single argument.
2020-01-23 00:50:33 +11:00
Campbell Barton e790f4a49f install_deps.sh: define sections with overlines
Over-lines are used in other large files (keymaps for e.g),
using this add-hoc convention for sections make it easier to
configure editors to jump between them (as I have locally).
2020-01-23 00:45:34 +11:00
Campbell Barton 2b236294bb install_deps.sh: use jack2 on Arch 2020-01-23 00:41:26 +11:00
Campbell Barton a90c2834a1 install_deps.sh: add debugging options
Add USE_DEBUG_TRAP, USE_DEBUG_LOG for trapping errors and logging
executed lines respectively.

Handy for troubleshooting issues in the script.
2020-01-23 00:41:26 +11:00
Campbell Barton 4099ad1984 install_deps.sh: quiet warning in install_deps.sh
The unquoted check gave a 'binary operator expected' warning.
2020-01-22 17:30:54 +11:00
Ray Molenkamp 4db9562246 libs/windows: Prevent USD exports from leaking into blender binary.
Even though we build USD as static, it still feels the need to mark its
symbols with declspec(dllexport) which means the blender binary now exports
these symbols.

this patch fixes that unwanted behaviour, however USD libs still need to
rebuild before this becomes visible in the blender binary

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

Reviewed By: sybren
2020-01-21 09:47:10 -07:00
Ray Molenkamp ce92e3d553 Fix: Building with clang on windows.
The USD landing broke building with clang on windows
due to a couple of reasons:

1) Some incompatibilities in their headers [1] only one
of them was important for us and is included in our patchset
now.

2) clangs lld wanted the full path to the libusd_b library
when using the whole archive link option, while msvc can
figure it out from just the library name.

Tested with clang/msvc and msbuild and ninja generators

[1] https://github.com/PixarAnimationStudios/USD/issues/1030
2020-01-21 09:46:53 -07:00
Sybren A. Stüvel 463941b6a1 Merge remote-tracking branch 'origin/blender-v2.82-release' 2020-01-21 11:13:47 +01:00
Ray Molenkamp 93a9fbb35f Windows: Update platform_win32.cmake to boost 1.70
to match the updated libs in svn.
2020-01-20 19:31:31 -07:00
Brecht Van Lommel a5a30e485f Merge branch 'blender-v2.82-release' 2020-01-20 09:50:09 +01:00
Brecht Van Lommel 02f6722350 Build: upgrade to OpenEXR 2.4.0, OpenVDB 7.0.0 and Boost 1.70.0
This aligns with the VFX reference platform 2020 along with the decision
to stick to Python 3.7, see T68774.

Blosc was downgraded to 1.5 as recommended by the OpenVDB documentation.

IlmBase and OpenEXR are now built together with CMake rather separately
using autoconf.

Differential Revision: https://developer.blender.org/D6593
2020-01-20 09:43:28 +01:00
Brecht Van Lommel 4f4435001a Fix OSL build error on macOS, no need to use external pugixml 2020-01-20 09:39:54 +01:00
Ray Molenkamp c2e62c1292 Cleanup/deps: Clean up remnants of old python packaging method 2020-01-18 12:00:42 -07:00
Ray Molenkamp 2272f380bd Merge remote-tracking branch 'origin/blender-v2.82-release' 2020-01-18 11:59:18 -07:00
Ray Molenkamp 3e11c4e63b Fix: T71159 missing python3.dll
File got forgotten during the last repack of python.
2020-01-18 11:58:38 -07:00
Brecht Van Lommel 2aa497661f Merge branch 'blender-v2.82-release' 2020-01-17 09:26:51 +01:00
Brecht Van Lommel 554f861ac1 Build: fix Linux linking errors with some combinations of build options
Differential Revision: https://developer.blender.org/D6600
2020-01-17 09:21:18 +01:00
Ray Molenkamp 86db35845a libs/windows: Prevent USD exports from leaking into blender binary.
Even though we build USD as static, it still feels the need to mark its
symbols with declspec(dllexport) which means the blender binary now exports
these symbols.

this patch fixes that unwanted behaviour, however USD libs still need to
rebuild before this becomes visible in the blender binary

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

Reviewed By: sybren
2020-01-16 13:11:07 -07:00
Ray Molenkamp 8e6c6e2ba1 Fix: Building with clang on windows.
The USD landing broke building with clang on windows
due to a couple of reasons:

1) Some incompatibilities in their headers [1] only one
of them was important for us and is included in our patchset
now.

2) clangs lld wanted the full path to the libusd_b library
when using the whole archive link option, while msvc can
figure it out from just the library name.

Tested with clang/msvc and msbuild and ninja generators

[1] https://github.com/PixarAnimationStudios/USD/issues/1030
2020-01-14 11:12:14 -07:00
Campbell Barton bbe7c278d2 CMake: enable FFTW for headless & bpy configurations
This caused the ocean modifier to be disabled.
2020-01-05 16:16:03 +11:00
Sybren A. Stüvel 4c295ad478 install_deps.sh: No longer forcing Alembic sources to be redownloaded
For no apparent reason, when building Alembic the script would always
re-download and re-extract the Alembic source code. This is no longer the
case, and it now only happens if the source directory is missing. Since the
source directory name contains the Alembic version, it will automatically
trigger a download+extract when the version changes.
2019-12-24 12:10:54 +01:00
Sybren A. Stüvel d616938449 install_deps.sh: show which parameter is wrong
Previously, when an unknown parameter was passed to `install_deps.sh`,
the script would just show "Wrong parameter!" without any context. This
can make it hard to figure out what's exactly going wrong. Now it prints
which parameter it thinks is wrong.
2019-12-24 12:10:54 +01:00
Sebastián Barschkis 41fd60db16 Mantaflow [Part 4]: Adapted build config
Smaller changes in the build files to reflect the new Mantaflow macro.

Reviewed By: sergey

Maniphest Tasks: T59995

Differential Revision: https://developer.blender.org/D3853
2019-12-16 16:32:25 +01:00