Compare commits

...
118 Commits
Author SHA1 Message Date
Larry Gritz 48be5bd710 CHANGES for 1.11.16.0
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2021-11-01 16:48:32 -07:00
Larry Gritz 1d436e3bb3 Changes to work with LLVM 13 (#1420)
And a few places to let it compile with clang 13's new warnings.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2021-10-24 15:49:46 -07:00
Luya Tshimbalanga eb67611896 Fix compatibility with LLVM 12 and up (#1412)
Upstream LLVM stopped using the compatibility
spellings of OF_{None,Text,Append} from version 12 and up.

https://reviews.llvm.org/D101650

Signed-off-by: Luya Tshimbalanga <luya@fedoraproject.org>
2021-10-24 15:49:46 -07:00
Larry Gritz b37cd9ce26 Bump version after release
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2021-10-24 15:33:04 -07:00
Larry Gritz 1602f4c577 Bump some CI versions and prepare release 1.11.15.0
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2021-09-01 00:26:06 -07:00
Larry Gritz c3d0283c96 CI set touch-ups to latest versions
Proper test against VFX Platform 2022 using the latest ASWF docker
container. This includes Python 3.9.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2021-08-28 23:08:16 -07:00
Larry Gritz 5a38e3f820 Give Symbol virtual destructor to fix UB because of derived classes. (#1397)
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2021-08-24 10:59:35 -07:00
Larry Gritz 85ba4de8b0 Move from some long-deprecated OIIO things to modern equivalents (#1388)
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2021-08-04 20:37:17 -07:00
Larry Gritz 769b81ad69 Add include to prepare for upcoming OIIO change (#1393)
OIIO 2.3 will rearrange some header files slightly. If you need to use
ImageCache, you must include imagecache.h (duh!). We were accidentally
relying on some leaked definitions in other header files, which will
soon be removed.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2021-08-04 14:35:48 -07:00
Larry Gritz d4aec84493 CI: Bump some of the "latest" releases (#1392)
latest OpenEXR/Imath -> 3.1.0
latest pybind11 -> 2.7.0
latest fmt -> 8.0.0

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2021-08-04 14:35:22 -07:00
Larry Gritz 78bbac517c Prep for release 1.1.13.2
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2021-07-01 23:04:38 -07:00
Larry Gritz bc66e85636 CI gcc and llvm testing changes (#1381)
* Update the "bleeding edge" CI test to gcc-11, and also LLVM 12,
  which we hadn't tested before.
* A "latest releases" CI test uses gcc10 and LLVM 11.
* Turns out that nothing else on the OSL side needed to be fixed to
  accommodate gcc 11 (though you need a very up-to-date OIIO if you
  want to compile it with gcc11 unless you turn warnings off).

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2021-06-21 11:38:54 -07:00
Larry Gritz 8e65cd93dc CI: speed up OIIO build for CI by not building its tests (#1380)
Was using the wrong notation before.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2021-06-21 10:33:40 -07:00
Larry Gritz d009183a38 CI: have a clang11 test (#1379)
Along the way, discovered a couple clang-specific warnings when using
C++17.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2021-06-21 10:32:31 -07:00
Larry Gritz fa00aadcf3 Bump version after release
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2021-06-01 12:44:52 -07:00
Larry Gritz d94cd2f90d CHANGES and set version for 1.11.14.1 patch release
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2021-06-01 12:44:18 -07:00
Larry Gritz 98dd811d8c Build: llvm-config --system-libs needs --static for LLVM_STATIC (#1375)
This fixes CI in the Mac test. Something about the Homebrew upgrade to llvm 12.0.0_1 made this fix necessary to build.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2021-05-26 13:08:49 -07:00
Larry Gritz 91d22ebe2f CI: Change our clang-format standard to clang11 (#1372)
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2021-05-26 11:48:23 -07:00
Larry Gritz 58abcf917a Bump version after release
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2021-05-11 20:55:29 -07:00
Larry Gritz b1ee46279d CHANGES & docs fixes for release
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2021-05-09 15:47:57 -07:00
Larry Gritz 4b0b8e2170 CI script typo kept mac from recognizing ARCH properly
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2021-05-09 11:44:33 -07:00
Larry Gritz 0befcc5bcf CI: fix OpenEXR version
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2021-05-09 11:44:33 -07:00
Euan Haahr ea95ba08e2 Various fixes for LLVM 12 compatibility (1351)
Removed use of options.PrintMachineCode since this has been removed as
of llvm 12. Converted uses of DebugLoc::get to DILocation::get since
it has been deprecated and removed as of llvm 12.

PrintMachine code will only be used if llvm is lower than version 12.
TODO: Needs to be re-added in the new way for LLVM12. (LG just doesn't
have time to figure this out right now.)

Pass adjustment as various things have been deprecated or changed
names. (LG)

Signed-off-by: Euan Haahr <euanhaahrmail2@gmail.com>
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2021-05-09 11:44:33 -07:00
Larry Gritz b650340b8b Deal with possibly C++14 OIIO
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2021-05-09 11:44:33 -07:00
Larry Gritz 17378ae351 CI Mac fix: this was no longer necessary, and seemed to be problematic (#1366)
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2021-05-09 11:44:33 -07:00
Larry Gritz c8727203d0 Use OpenImageIO targets
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2021-05-09 11:44:33 -07:00
Brecht Van Lommel ac4673868c Fix crash generating closure functions calls with LLVM 11 (#1361)
Generating code for prepare_closure and gen_closure was crashing.
The code now matches the implementation of the removed LLVM function.

Signed-off-by: Brecht Van Lommel <brecht@blender.org>
2021-04-22 09:17:38 -07:00
John Haddon a2b97d056e OSLCompiler : Check for write errors (#1360)
Fixes #1352

Signed-off-by: John Haddon <jhaddon@cinesite.com>
2021-04-22 09:17:26 -07:00
Larry Gritz e13f3cd10f Build: be robust to certain OpenEXR 2.x config files (#1356)
Ever since adding OpenEXR 3.0 support, we had some cases where
installations that built the 2.x IlmBase and OpenEXR portions
separately and installing to separate areas, had trouble being found
properly.

Remove the need to include OpenEXR/OpenEXRConfig.h

Also make some minor changes to ci.yml to make sure we are documenting
the right openexr versions used for each test.

Fix wrong oiio used for oldest tests.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2021-04-19 15:44:06 -07:00
Larry Gritz 9ea03296a1 CMake 3.20 safety (#1354)
It seems that our liberal use of cmake argument `--config` should only
be used in conjunction with the `--build` flag, not for the initial
configuration step. Apparently this was just silently ignored for a
long time, but for CMake 3.20, it is an error and breaks a lot of our
CI cases and our build_blah.bash scripts.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2021-04-02 15:56:48 -07:00
Larry Gritz 30b2f90207 Bump version after release
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2021-04-01 19:41:23 -07:00
Larry Gritz 301ca92cf2 CHANGES
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2021-04-01 19:38:51 -07:00
Larry Gritz 976f865ff4 CMake 3.20 compatibility (#1349)
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2021-03-27 22:27:01 -07:00
Mads Drøschler e7326b3815 Updated vector2.h with a mod fuction: mod(vector2,vector2); (#1312)
This is useful when working with vec2 concepts through out shaders like UV data for example.
2021-03-22 15:11:55 -07:00
sandipshukla 571ac807d7 Fix unnecessary error messages to stderr for broken point clouds (#1333)
Signed-off-by: sandipshukla <>
2021-03-22 15:11:25 -07:00
Larry Gritz 91b223774b Update old Strutil::format to new fmt conventions (#1342, #1347)
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2021-03-12 15:17:46 -08:00
Larry Gritz 91e95723fe Bump version after release
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2021-03-02 00:33:22 -08:00
Larry Gritz 4101b947f2 CHANGES
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2021-03-02 00:31:47 -08:00
Larry Gritz d1231ef0d6 Minor change for smooth build against upcoming Imath 3.0 (#1341)
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2021-03-02 00:29:48 -08:00
Larry Gritz db350bdc75 Update CI idioms (#1338)
* Separate the CI stages into separate steps. (As was prototyped in OIIO)

* Combine the dependency-building scripts for CentOS and Ubuntu into a
  single script.

* Get rid of cruft related to the CI systems we no longer use (Appveyor,
  Travis, CircleCI).

* Get rid of some needless CI verbosity

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2021-03-02 00:29:48 -08:00
Clark Chen 424b8c37ae Fix incorrect hyperlink for boost (#1339)
Signed-off-by: Clark Chen <9372896+clarkchentw@users.noreply.github.com>
2021-02-28 11:45:41 -08:00
Larry Gritz deb4d4cbaf Typo prevented visibility hiding from happening properly (#1337)
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2021-02-18 08:46:01 -08:00
Larry Gritz 0f943b2b68 CI: Use ccache + GitHub 'cache' action to greatly speed up CI runs (#1335)
This speeds up CI builds by 50% or more, for PRs that are minor
changes by reusing the compiled results from previous runs.  Most of
the remaining time cannot be squeezed down -- it's the instantiation
of docker containers and running the testsuite itself. But the build
(including of dependencies we build from scratch) is dramatically
faster.

At the same time, remove some commented-out test matrix cases. When/if
we re-enable those tests, we can add those back.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2021-02-10 15:47:16 -08:00
Larry Gritz 95d496296e Expunge Travis (#1334)
Kill the old travis CI

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2021-02-10 15:47:09 -08:00
Larry Gritz af885d09b8 Imath 3 support: ImathLimits.h no longer exists (#1332)
Also change some refs to std::abs rather than deprecated Imath functions.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2021-02-09 09:21:31 -08:00
Larry Gritz 9686ba2280 Bump version after release
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2021-02-01 22:01:34 -08:00
Larry Gritz aecf26fbb9 CHANGES
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2021-02-01 17:50:19 -08:00
Larry Gritz cfee61a908 Remove unused variable that was warning (#1325) 2021-02-01 17:50:19 -08:00
Larry Gritz bfdc9635eb Transitioning repository to ASWF (#1329)
* Rename CLA files so they no longer say "draft."

* Change CONTRIBUTING.md to correctly describe the new CLA process,
  remove language related to the old SPI CLAs. Also some touchups to
  README.md.

* Update the project_intake.md to check of various things that we've
  completed.

* Change all references to the old imageworks GitHub URLs to the new
  ASWF ones. (This touches comments at the start of basically every file.)

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2021-02-01 17:50:19 -08:00
Larry Gritz d892268952 Touch up OpenEXR include finding 2020-12-27 20:11:44 -08:00
Larry Gritz 5ff2a58401 Switch from deprecated to current version of OIIO parallel_image call (#1317)
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-12-27 17:02:58 -08:00
Larry Gritz c4cff77947 CI Mac: the uninstall of openssl no longer needed, now causes problems (#1315)
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-12-20 14:09:09 -08:00
Larry Gritz b921acb284 Amend GOVERNANCE to list new member and changing affiliations (#1314)
* Nicolas Guiard is a new TSC member representing Isotropix

* Chris Kulla has had a new affiliation for a while now

* Clean up a bit of language left over from when this document was
  just a proposal.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-12-14 22:38:00 -08:00
Larry Gritz bbbf4249e7 Embed sizzle reel video in main README (#1307)
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-12-10 21:52:19 -08:00
Larry Gritz 286335bb99 New ASWF preferred CLAs, based on Apache 2.0 CLAs (#1240)
* Replace CLA drafts with ASWF CLA 2.1

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-12-10 21:52:12 -08:00
John Mertic 5bd0240c4f Added mission statement in the charter, pulled from README (#1308)
Approved by the TSC by vote on 2020-12-10

Signed-off-by: John Mertic <jmertic@linuxfoundation.org>
2020-12-10 21:52:06 -08:00
Larry Gritz 89c6e67a32 CMake refactoring and subproject friendliness (#1304)
Modeled after recent similar changes in OIIO.

* Detect if OSL is being built as a subproject, and if so, set
  `OSL_IS_SUBPROJECT` (a.k.a. `${PROJECT_NAME}_IS_SUBPROJECT`).

* Move all the testing logic out of the main CMakeLists.txt (and a few
  testing-related macros from oiio_macros.cmake) and into a new
  src/cmake/testing.cmake.

* Move all of the packaging logic out of the main CMakeLists.txt and
  into a new src/cmake/packaging.cmake.

* Make all the testing and packaging inactive if this is being built
  as a subproject. Also disable the clang-format target for subprojects.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-12-03 11:00:12 -08:00
Larry Gritz 87dd733679 Bump version after release 2020-12-01 11:37:55 -08:00
Larry Gritz a7fd523488 CHANGES 2020-12-01 11:37:15 -08:00
Larry Gritz 3fc5c85d4b Extend checked_find_package with VERSION_MIN and VERSION_MAX (#1303)
Upon reading cmake docs mre carefully, it's clear that when you pass a
version to find_package (which does much of the heavy lifting inside
checked_find_package), it DOESN'T MEAN you want that version or
later. It means you want to find a version that is "compatible" with
the named version. The meaning of "compatible" is up to the package.
Some packages define it as being >= the requested version. Others
define it as being the same major release, or same major AND minor
release, or exact.

But generally speaking, we only care about the minimum version (e.g.,
"I want FooBar 8.0 or later"). And it's not guaranteed that is what
the package's compatibility will do. In fact, FooBar may be using
compatibility mode "SameMajorVersion", which will make our find of
FooBar succeed for 8.0, 8.1, 8.2, but if a user encounters FooBar 9.0,
our build will reject it, even though it's probably fine.

So I augmented our checked_find_package wrapper to take optional
VERSION_MIN to give the real minimum version, when that's the semantic
we really want (in which case we would omit the ordinary version
number used for the compatibility check and let VERSION_MIN do all the
work). There's also an optional (and usually omitted) VERSION_MAX that
you can use if you are sure that we must be less than a certain
version (the max is exclusive, you must be <, not <=, whereas the min
is inclusive >=).

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-11-27 12:34:00 -08:00
Larry Gritz 62d1428b2b Various fixes to CI
* Backport CI and build script fixes from master

* Fix optix build test

* Use OIIO 2.0 for oldest test

* Set CMAKE_PREFIX_PATH for so we can find OIIO in the deformer test

* Correct includes on liboslnoise

* Skip deformer test for OIIO 2.0 -- I'm too lazy to make it work for
  OIIO version too old to have a proper exported cmake config

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-11-20 15:00:21 -08:00
Larry Gritz be00d9fab5 Build against OpenEXR 3.0 + Imath 3.0 (#1299)
As OpenEXR works toward their 3.0 release, which includes splitting
Imath (the vector, matrix, math, and 'half' stuff) out into a separate
repo, their top of tree master finally breaks our "bleeding edge"
build.

This is a little tricky, because now our support of this dependency is
attempting to span 3 eras: 3.0 with the full split of openexr from
imath, recent openexr+ilmbase 2.x that supplies reliable exported
cmake configs, and older 2.x that predates cmake configs. Eventually
we'll phase out older versions and clean up.

Fixes in this patch generally include:

* Add a new CI test of VFX2021 + openexr/imath master. (This will go away
  when 3.0 is released and that's what we use for the main 2021 case.)

* For new enough versions of OpenEXR, use the exported config file and
  targets, rather than the old style OPENEXR_LIBRARIES style variables.
  We have kind of a mixed idiom use because we're still supporting older
  versions that predate use of the config files.

* Deal with the fact that the Imath headers now live inside
  `<Imath/ImathBlah.h>` rather than `<OpenEXR/ImathBlah.h>`. But of
  course, you need to start including things just to find out the
  version. It's tricky.  The logic is to look at
  `<OpenEXR/OpenEXRConfig.h>` to determine the version we're dealing
  with, then include Imath stuff from one or the other depending on
  what we found. I rearranged quite a few includes to ensure that all
  this logic only happens in a couple spots and the rest gets included
  transitively. As it turns out, quite a few of our `#include`s of
  Imath headers were redundant.

* OSL's exported config needs to look for OpenEXR.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-11-19 10:04:11 -08:00
Larry Gritz 688abe475a Minor fixes to CI homebrew -- fix Mac failure, sync with OIIO
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-11-18 22:26:32 -08:00
Larry Gritz d3fea168e9 LoadMemoryCompiledShader: ensure return false on parse failure (#1302)
Most failures in this function returned false, but if it got as far as
parsing but failed that stage, it ended up returning true (success),
which is clearly wrong.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-11-18 17:25:34 -08:00
Larry Gritz 1f51b27e0a Fix compability break with OIIO 2.0 (from change 1295)
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-11-10 14:44:55 -08:00
Larry Gritz 663ac3641c Bug fix: optimizer interaction with output param that also is userdata (#1295)
* Bug fix: optimizer interaction output param that also is userdata

There's a "pass-through parameter" idiom, where an output param gets
its initial value from an input, it gets modified by the shader, but
it's also an output.

If the modification is optimized away -- say, if it was originally
`theparam *= scale` and scale is 1 -- then it may be that you end up
with no ops in the shader that read from the parameter. If the
parameter was hooked up to userdata, then get_userdata will never be
called to retrieve the value (because it's usually lazy, only doing
the callback the first time it's needed), and so the output value of
parameter will be its parameter default value in the shader, NOT the
value of the interpolatd variable, which was never retrieved and
copied into it, and also that a shader consisting of *only* that
particular flavor of useparam is not marked as "does nothing" (thus
skipping any code generation at all).

This patch adjusts the logic somewhat so that if that output parameter
is connected downstream or is a renderer output, then we definitely
initialize it with a useparam op, even if it is otherwise apparently
not read from within the shader.

Added a new test for this specific case.

Also necessitated update to reference output of debug_uninit test,
only because the extra useparam op caused some of the instruction
numbering to change.

Signed-off-by: Larry Gritz <lg@larrygritz.com>

* testshade: allow arbitrary command line-specificed userdata

To ease testing, add `--userdata` command line option to testshade,
which constructs a ParamValueList that will be used to look up
"userdata" from the shader.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-11-09 17:35:46 -08:00
Larry Gritz 39e4e54d95 CI/Mac: fix broken tests involving oslquery (#1289)
The specific combination of Mac + Python 3.8/3.9 + the lastest
pybind11 release causes a crash in the testsuite/python-oslquery
test. It works on other platforms and with older versions of pybind11.

I've tried to understand exactly what's going wrong, and have come up
empty and can't justify spending more time on it. It's suspiciously
similar to several recently "fixed" pybind11+python interaction bugs,
I suspect there are a couple edge cases they missed and that it will
be fixed eventually in a future pybind11 release (or possibly a future
python patch, there does seem to be a problem that pybind11 uncovered
in the cpython code).

In the mean time, a slight rewrite of the loop avoids the problem for
the purposes of our CI tests.

Also a few adjustments to switch back to python 3.9 after some recent
Homebrew fixes that had made us revert back to 3.8 for a while.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-11-05 10:31:30 -08:00
Larry Gritz 229959f4f3 CI: build_opencolorio.bash: don't build gpu tests (#1288)
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-11-05 10:31:24 -08:00
Larry Gritz 76b5614560 Bump version after release
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-11-02 22:18:46 -08:00
Larry Gritz d922192fd4 CHANGES and docs for release
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-11-02 12:21:57 -08:00
Larry Gritz f4f8322a80 Build: Require exact version if PYTHON_VERSION is specified (#1286)
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-11-02 11:46:54 -08:00
Larry Gritz 5b9da095dc Let Mac CI use llvm 11 (#1287)
Also make the error artifact include CMake log files.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-11-02 11:42:19 -08:00
Larry Gritz 86687ea518 Fix OSL::assume_aligned for broken MSVS clause (#1285)
Bad cut and paste made this all wrong. Fix.

Also rename the template's AlignmentT -> Alignment to help reduce
confusion because we usually use the T end to indicate a template
parameter that's a type.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-10-31 15:05:34 -07:00
Larry Gritz d206a1f8b7 Adjust for recent OIIO master change -- ImageInput no longer has m_mutex (#1281)
While we're in there, get rid of some cruft that only applied to
OIIO 1.x.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-10-26 19:49:44 -07:00
Larry Gritz 83ad298c39 CI: Lock down on clang-format 10 for CI format check (#1278)
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-10-23 10:33:22 -07:00
Larry Gritz a0683cf7e5 Work around GHCI Mac problem with homebrew openssl (#1277)
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-10-23 10:33:15 -07:00
Declan RussellandDeclan Russell 72af1720a8 Add __CUDADEVRT_INTERNAL__ define to bitcode generation, needed to avoid duplicate cudaMalloc symbols with CUDA9+ (#1271)
Co-authored-by: Declan Russell <Declan.Russell@autodesk.com>
2020-10-19 18:10:13 -07:00
Larry Gritz 000534f74b Update ref output after recent OIIO change (#1273)
A change in OIIO master eliminated some spurious newlines in certain
error messages.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-10-17 16:04:18 -07:00
Larry Gritz 00c895fc64 Turn on clang-format for cpp files in testsuite (#1269) 2020-10-15 10:15:01 -07:00
Larry Gritz 4699b3dcdf Use 'final' liberally (#1260)
This is good for optimization, allowing "de-virtualization" of function
calls in cases when the compiler can be sure that there can be no further
subclassing.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-10-14 15:35:57 -07:00
Alex M. Wells d27b779b30 Optimization: Skip copying of output params to used layers. (1253)
Work by Alex Wells.

When generating the code to copy one layer's outputs to a downstream
layer's inputs, we can skip the copy entirely if we already know that
the downstream layer will not be run.

Signed-off-by: Alex M. Wells <alex.m.wells@intel.com>
2020-10-14 15:35:57 -07:00
Larry Gritz 8f0dbac9cb Fix typo in example-deformer/CMakeLists.txt (#1268)
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-10-14 15:35:57 -07:00
Alex M. Wells 3ba0f3bf83 Fix false positive in uninit test involving do-while loops (1252)
Work of Alex Wells.

Like we do already for "for" loops, when generating extra ops to test for
uninitialized values, "do-while" loops also need to skip testing of their
condition variable (which we know has not been written yet, under most
circumstances).

Signed-off-by: Alex M. Wells <alex.m.wells@intel.com>
2020-10-12 20:42:57 -07:00
Larry Gritz 854c95feb9 Bug fix: is_nonzero was only considering the first element (#1266)
No symptoms ever reported, but surely this is a typo bug.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-10-12 20:42:57 -07:00
Larry Gritz 06e8d24ebc Fix CI break (#2741) (#1265)
Repeat of https://github.com/OpenImageIO/oiio/pull/2741

One of our CI matrix entries recently started failing due to changes
in somethign on GHCI's Ubuntu image. Fix by switching this matrix
to use the appropriate ASWF docker image.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-10-12 13:41:16 -07:00
Larry Gritz 1215128c3d Fix status message I meant to remove earlier
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-10-12 10:49:21 -07:00
Larry Gritz 81bec68ca9 pugixml build fixes (#1262)
* Bring back the idea of a Findpugixml.cmake file because it turns out
  that (for pugixml <= 1.10) the exported config files are not reliable.

* Fix CI scripts to build PugiXML (with a few different versions). We
  previously were relying on the embedded version for all CI tests, which
  masked problems associated with using an external PugiXML.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-10-10 16:57:21 -07:00
Larry Gritz c77141ca6f Build system and CI touchups (#1247)
Periodic comparison of analogous build scripts in OIIO & OSL and
synchronize to ensure that my current most favored idioms are in both.

Split checked_find_package into separate file for easier
synchronization between projects.

Bumped OpenEXR versions to latest patches.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-10-10 16:48:14 -07:00
debaetsdandDieter De Baets 7ca797f3a5 Windows compile fixes (#1263)
* Added OSLEXECPUBLIC attributes to inner classes of LLVM_Util to fix
linker errors on MSVC

* do not include cxxabi.h on non GNUC platforms

* fixed windows linker issues

- Link with Version.lib (system lib) to prevent missing symbols in
  ClangDriver.lib
- Do not define OSL_EXPORTS for oslcomp/oslquery as they should import
  (not export)

Co-authored-by: Dieter De Baets <dieter.baets@unity3d.com>
2020-10-09 14:34:21 -07:00
marsupialandrzulak fa4f1c8479 Build against Cuda-11.0.1 and Optix 7.1 (#1232)
Co-authored-by: rzulak <rzulak@imageworks.com>
2020-10-05 16:05:02 -07:00
Larry Gritz 1f3a810554 Bump version after release
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-10-01 20:48:04 -07:00
Larry Gritz ebc98bf5be CHANGES
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-10-01 09:50:06 -07:00
Larry Gritz 1d744e5b54 Print more build/runtime info in stats and help message (#1258)
testshade --help or --runstats now print additional info about the
dependency versions, hardware capabilities enabled at build time, and
hardware capabilities detected at runtime. This should help debugging
of user experiences as an easy way to find out what OSL thinks it's
working with in terms of its environment.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-09-29 15:56:33 -07:00
Larry Gritz a7bfaf09d0 Fix typo in version string (#1257)
Extra char prevented the "release type" from being amended onto the
version string.

Also, change the OSL_INTRO_STRING to use the preferred convention
of "Open Shading Language" rather than "OpenShadingLanguage".

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-09-29 14:47:25 -07:00
timgrantandTim Grant 7802ac31f7 Explicitly set the OptiX pipeline stack size. (#1254)
Co-authored-by: Tim Grant <tgrant@nvidia.com>
2020-09-23 15:12:00 -07:00
Larry Gritz 9efefc74b9 python cleanup (#1249)
Switch from old cmake macros that were marked obsolete in cmake 3.12 to
the new FindPython.cmake module.

Instead of defaulting to python 2.7, default to whatever is found.
But user can still set PYTHON_VERSION variable to request a specific
one in case there are multiple.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-09-21 09:44:01 -07:00
Larry Gritz f6c4430870 Fix derivatives of texture calls when only Dalpha is needed (#1251)
Luke Emrose noticed that for texture calls that retrieved alpha, if
derivatives were later taken *only* of the alpha but not the main
color result of the texture call, those derivs would always end up 0,
the texture call not noticing that it needed to call the version of
texture that returns derivatives.

This patch provides a fix. It was a simple matter of it testing only
whether main result derivs were needed, when determining which variety
of texture must be called.

Curiously, this was already done correctly for texture3d!

Added testsuite/texture-alpha-derivs to test this specific situation.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-09-19 20:18:51 -07:00
Larry Gritz 3206f48898 Bump version after release
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-09-01 12:08:10 -07:00
Larry Gritz 88c37b53fe Release
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-09-01 11:22:21 -07:00
Larry Gritz 1907e0f062 CHANGES, prep for RC
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-08-29 15:13:57 -07:00
Larry Gritz bcd2162311 License file renames for uniformity and correct autodetection (#1246)
Rename LICENSE -> LICENSE.md for uniformity with other projects
and our own documentation.

Rename LICENSE-THIRD-PARTY.md -> THIRD-PARTY.md because it was
confusing GitHub's autodetection of the license (this makes many
tools, including third part such as the ASWF's landscape fail to
correctly categorize this project as BSD-3-Clause).

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-08-27 13:06:34 -07:00
Larry Gritz 1afa2caeae Fix CI build break on Mac with LLVM 10.0.1 (#1245)
There's a bug in the current Homebrew llvm 10.0.1 where
it fails to link because of missing libxml2.tbd. It's fixed
upstream in LLVM, but not yet fixed in Homebrew. Hopefully
a subsequent 10.0.x or 11.x will fix it, but for now, just
fall back to llvm@9.

Also issue a warning in the build scripts if this condition
is detected, so if a user encounters it on their system, they
have a hint about how to address it.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-08-26 10:14:05 -07:00
Larry Gritz c5b2afa46d Fix typos in comments (#1243)
Ran a spell checker on our comments. So many fixes.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-08-25 11:41:58 -07:00
Larry Gritz 991c2247c5 Use .git-blame-ignore-revs (#1244)
This new file contains the hashes of commits whose only function was
to reformat large amounts of code.

Ordinarily, this would make for confusing 'git blame' output, by
making old code written by author A appear to have a new modification
date and authorship by B, when in fact we know that B just did some
reformatting. This can make it especially hard to discern code history
after after commits that establish the use of "clang-format".

A new git feature (requiring git >= 2.23) allows pointing to a file
containing hashes of commits to be ignored by git blame:

    git blame --ignore-revs-file .git-blame-ignore-revs

To avoid having to remember this all the time, consider adding this to
your git config:

    git config blame.ignoreRevsFile .git-blame-ignore-revs

Note that git supports this feature but does not dictate the name of
the file. I'm just following the convention I'm seeing pop up in other
projects of calling it ".git-blame-ignore-revs".

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-08-25 11:41:49 -07:00
Larry Gritz 0dc6f76d2f Bump version tweak for next release candidate
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-08-22 15:11:05 -07:00
Larry Gritz 709f6e9c66 Ready release candidate
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-08-18 22:18:29 -07:00
Larry Gritz 9cc760aeb9 Rebuild docs for release
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-08-18 22:18:29 -07:00
Larry Gritz 1496406616 CHANGES
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-08-18 21:43:02 -07:00
Larry Gritz 46a6157613 Fix capitalization in new testshade options
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-08-18 21:35:05 -07:00
Larry Gritz c629e52bff Docs: Fix longstanding error in description of spline()
The implementation was always correct, but the description here was
super unclear and wrong.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-08-14 16:26:52 -07:00
Larry Gritz 1f8950d056 Fix fmt vs Cuda incompatibility (#1242)
We used to disable fmt and fall back to tinyformat, when using Cuda.
The new OIIO 2.2 removes tinyformat and the OIIO_USE_FMT preprocessor
symbol. So make sure that we also tell fmt to avoid using the int128
type, not supported by Cuda. That seems to be enough to let it use
the rest of fmt without trouble.
2020-08-14 16:25:29 -07:00
Alex M. Wells c4cd20ce70 split the opt and jit functionality of optimize_group (1226)
Work by Alex Wells.

Separate OSL optimization from JIT by adding optional parameter
`bool do_jit = true` to all optimize_group* methods. This will allow
optimization without JIT'ing for the host, or optimizing once but
JIT'ing for multiple back ends. It will be necessary if one will be
JIT'ing only for batched execution, we would not want to pay the cost
of JIT'ing a scalar version as well (but still could if we wanted both
scalar and batched versions simultaneously).

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-08-11 22:10:43 -07:00
Larry Gritz d141efa55d More flexible find of llvm-config with suffixed with '-64' (#1238)
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-08-11 11:10:27 -07:00
etheory 9d37207658 Remove null check from symbol_address for performance (#1237) 2020-08-02 21:33:15 -07:00
Alex M. Wells 93cf9fc383 testshade: make a way to force varying derivatives for testing (1227)
Work by Alex Wells

Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-08-02 21:32:22 -07:00
Larry Gritz c0d873bc38 Fix changes typos
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-08-01 17:48:12 -07:00
Larry Gritz 2835538c70 Bump version after tag
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-08-01 17:48:12 -07:00
Larry Gritz d5d0e5e003 Branch for 1.11 beta
Signed-off-by: Larry Gritz <lg@larrygritz.com>
2020-08-01 14:36:44 -07:00
821 changed files with 4465 additions and 3018 deletions
+3 -2
View File
@@ -1,6 +1,6 @@
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/imageworks/OpenShadingLanguage
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
Language: Cpp
BasedOnStyle: WebKit
@@ -84,6 +84,7 @@ IncludeCategories:
Priority: 1
IncludeIsMainRegex: '(Test)?$'
IndentCaseLabels: false
IndentExternBlock: NoIndent
IndentPPDirectives: AfterHash
IndentWidth: 4
IndentWrappedFunctionNames: false
@@ -128,7 +129,7 @@ SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
Standard: c++14
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
+8
View File
@@ -0,0 +1,8 @@
# Start using clang-format on OSL code base (#1215)
630b4c042d696c94ec9b2a1b6f5adc250bd61e05
# More clang-format (#1218)
bdb473cbdb119f3d9060d48f75f965cbd45f6d7a
# More clang-format: liboslquery, oslinfo, oslc, osl.imageio, osltoy (#1220)
bf366d7a90c46599b82071dac6dbef7c5e3ca157
+567 -212
View File
@@ -1,6 +1,6 @@
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/imageworks/OpenShadingLanguage
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
# GitHub Actions workflow file for CI
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
@@ -21,7 +21,7 @@ on:
- '**.tex'
schedule:
# Full nightly build
- cron: "0 4 * * *"
- cron: "0 8 * * *"
jobs:
@@ -29,301 +29,653 @@ jobs:
name: "Linux VFXP-2019: gcc6 C++11 llvm7 py2.7 boost-1.66 exr-2.3 OIIO-2.0 sse2"
runs-on: ubuntu-latest
container:
image: aswf/ci-osl:2019
image: aswf/ci-osl:2019-clang7
env:
CXX: g++
CC: gcc
CMAKE_CXX_STANDARD: 11
PYTHON_VERSION: 2.7
USE_PYTHON: 0
OPENIMAGEIO_VERSION: Release-2.0.14
steps:
- uses: actions/checkout@v2
- name: all
env:
CXX: g++
CC: gcc
CMAKE_CXX_STANDARD: 11
PYTHON_VERSION: 2.7
USE_PYTHON: 0
- name: Prepare ccache timestamp
id: ccache_cache_keys
shell: bash
run: |
source src/build-scripts/ci-startup.bash
source src/build-scripts/gh-installdeps-centos.bash
source src/build-scripts/ci-build-and-test.bash
echo "::set-output name=date::`date -u +'%Y-%m-%dT%H:%M:%SZ'`"
- name: ccache
id: ccache
uses: actions/cache@v2
with:
path: /tmp/ccache
key: ${{ github.job }}-${{ steps.ccache_cache_keys.outputs.date }}
restore-keys: |
${{ github.job }}-
- name: Build setup
run: |
src/build-scripts/ci-startup.bash
- name: Dependencies
run: |
# Remove pesky wrong installed OIIO version
rm -rf /usr/local/include/OpenImageIO
src/build-scripts/gh-installdeps.bash
- name: Build
run: |
src/build-scripts/ci-build.bash
- name: Testsuite
run: |
src/build-scripts/ci-test.bash
- uses: actions/upload-artifact@v2
if: failure()
with:
name: ${{ github.job }}
path: build/*/testsuite/*/*.*
path: |
build/*/testsuite/*/*.*
build/*/CMake*.{txt,log}
vfxplatform-2020:
name: "Linux VFXP-2020 gcc6/C++14 llvm7 py3.7 boost-1.70 exr-2.4 OIIO-2.1 sse4"
runs-on: ubuntu-latest
container:
image: aswf/ci-osl:2020
env:
CXX: g++
CC: gcc
CMAKE_CXX_STANDARD: 14
PYTHON_VERSION: 3.7
USE_SIMD: sse4.2
steps:
- uses: actions/checkout@v2
- name: all
env:
CXX: g++
CC: gcc
CMAKE_CXX_STANDARD: 14
PYTHON_VERSION: 3.7
USE_SIMD: sse4.2
- name: Prepare ccache timestamp
id: ccache_cache_keys
shell: bash
run: |
source src/build-scripts/ci-startup.bash
source src/build-scripts/gh-installdeps-centos.bash
source src/build-scripts/ci-build-and-test.bash
echo "::set-output name=date::`date -u +'%Y-%m-%dT%H:%M:%SZ'`"
- name: ccache
id: ccache
uses: actions/cache@v2
with:
path: /tmp/ccache
key: ${{ github.job }}-${{ steps.ccache_cache_keys.outputs.date }}
restore-keys: |
${{ github.job }}-
- name: Build setup
run: |
src/build-scripts/ci-startup.bash
- name: Dependencies
run: |
src/build-scripts/gh-installdeps.bash
- name: Build
run: |
src/build-scripts/ci-build.bash
- name: Testsuite
run: |
src/build-scripts/ci-test.bash
- uses: actions/upload-artifact@v2
if: failure()
with:
name: ${{ github.job }}
path: build/*/testsuite/*/*.*
path: |
build/*/testsuite/*/*.*
build/*/CMake*.{txt,log}
vfxplatform-2021:
name: "Linux VFXP-2021 gcc9/C++17 llvm10 py3.7 boost-1.70 exr-2.5 OIIO-2.2 avx2"
name: "Linux VFXP-2021 gcc9/C++17 llvm10 py3.7 boost-1.73 exr-2.5 OIIO-2.2 avx2"
runs-on: ubuntu-latest
container:
image: aswf/ci-osl:2021
env:
CXX: g++
CC: gcc
CMAKE_CXX_STANDARD: 17
PYTHON_VERSION: 3.7
USE_SIMD: avx2,f16c
OPENEXR_VERSION: v2.5.5
OPENIMAGEIO_VERSION: RB-2.2
steps:
- uses: actions/checkout@v2
- name: all
env:
CXX: g++
CC: gcc
CMAKE_CXX_STANDARD: 17
PYTHON_VERSION: 3.7
USE_SIMD: avx2,f16c
OPENEXR_VERSION: 2.5.0
OPENIMAGEIO_BRANCH: RB-2.2
- name: Prepare ccache timestamp
id: ccache_cache_keys
shell: bash
run: |
source src/build-scripts/ci-startup.bash
source src/build-scripts/gh-installdeps-centos.bash
source src/build-scripts/ci-build-and-test.bash
echo "::set-output name=date::`date -u +'%Y-%m-%dT%H:%M:%SZ'`"
- name: ccache
id: ccache
uses: actions/cache@v2
with:
path: /tmp/ccache
key: ${{ github.job }}-${{ steps.ccache_cache_keys.outputs.date }}
restore-keys: |
${{ github.job }}-
- name: Build setup
run: |
src/build-scripts/ci-startup.bash
- name: Dependencies
run: |
src/build-scripts/gh-installdeps.bash
- name: Build
run: |
src/build-scripts/ci-build.bash
- name: Testsuite
run: |
src/build-scripts/ci-test.bash
- uses: actions/upload-artifact@v2
if: failure()
with:
name: ${{ github.job }}
path: build/*/testsuite/*/*.*
path: |
build/*/testsuite/*/*.*
build/*/CMake*.{txt,log}
vfxplatform-2022:
name: "Linux VFXP-2022 gcc9/C++17 llvm11 py3.9 boost-1.75 exr-3.1 OIIO-2.3 avx2"
runs-on: ubuntu-latest
container:
image: aswf/ci-osl:2022-clang11
env:
CXX: g++
CC: gcc
CMAKE_CXX_STANDARD: 17
PYTHON_VERSION: 3.9
USE_SIMD: avx2,f16c
OPENCOLORIO_VERSION: v2.1.0
OPENEXR_VERSION: v3.1.1
OPENIMAGEIO_VERSION: release
PYBIND11_VERSION: v2.7.1
steps:
- uses: actions/checkout@v2
- name: Prepare ccache timestamp
id: ccache_cache_keys
shell: bash
run: |
echo "::set-output name=date::`date -u +'%Y-%m-%dT%H:%M:%SZ'`"
- name: ccache
id: ccache
uses: actions/cache@v2
with:
path: /tmp/ccache
key: ${{ github.job }}-${{ steps.ccache_cache_keys.outputs.date }}
restore-keys: |
${{ github.job }}-
- name: Build setup
run: |
src/build-scripts/ci-startup.bash
- name: Dependencies
run: |
sudo rm -rf /usr/local/include/{Imath,OpenEXR}
sudo rm -rf /usr/local/lib64/cmake/{Imath,OpenEXR}
src/build-scripts/gh-installdeps.bash
- name: Build
run: |
src/build-scripts/ci-build.bash
- name: Testsuite
run: |
src/build-scripts/ci-test.bash
- uses: actions/upload-artifact@v2
if: failure()
with:
name: ${{ github.job }}
path: |
build/*/testsuite/*/*.*
build/*/CMake*.{txt,log}
# Build for OptiX, but don't run tests (will need a GPU instance for that)
gpu-optix7-2019:
name: "Linux GPU VFXP-2019 Cuda10 gcc6/C++14 llvm10 py2.7 boost-1.70 exr-2.4 OIIO-master avx2"
runs-on: ubuntu-latest
container:
image: aswftesting/ci-osl:2019-clang10
env:
CXX: g++
CC: gcc
CMAKE_CXX_STANDARD: 14
PYTHON_VERSION: 2.7
USE_SIMD: avx2,f16c
OPENIMAGEIO_VERSION: master
OSL_CMAKE_FLAGS: -DUSE_OPTIX=1
OPTIX_VERSION: "7.0"
steps:
- uses: actions/checkout@v2
- name: Prepare ccache timestamp
id: ccache_cache_keys
shell: bash
run: |
echo "::set-output name=date::`date -u +'%Y-%m-%dT%H:%M:%SZ'`"
- name: ccache
id: ccache
uses: actions/cache@v2
with:
path: /tmp/ccache
key: ${{ github.job }}-${{ steps.ccache_cache_keys.outputs.date }}
restore-keys: |
${{ github.job }}-
- name: Build setup
run: |
src/build-scripts/ci-startup.bash
- name: Dependencies
run: |
rm -rf /usr/local/include/OpenImageIO
src/build-scripts/gh-installdeps.bash
- name: Build
run: |
src/build-scripts/ci-build.bash
# Testsuite disabled until we have GPU hardware to run on
#- name: Testsuite
# run: |
# src/build-scripts/ci-test.bash
- uses: actions/upload-artifact@v2
if: failure()
with:
name: ${{ github.job }}
path: |
build/*/testsuite/*/*.*
build/*/CMake*.{txt,log}
optix.h
linux-debug-gcc7-llvm8:
name: "Linux Debug gcc7, C++14, llvm8, OIIO release, sse4, exr2.4"
name: "Linux Debug gcc7, C++14, llvm8, OIIO release, py2.7, boost1.65, sse4, exr2.4"
runs-on: ubuntu-18.04
env:
CXX: g++-7
CMAKE_BUILD_TYPE: Debug
USE_CPP: 14
CMAKE_CXX_STANDARD: 14
# Debug build makes some tests run very slowly, increase timeout
CTEST_TEST_TIMEOUT: 240
LLVM_VERSION: 8.0.0
OPENEXR_VERSION: v2.4.1
OPENIMAGEIO_VERSION: release
USE_SIMD: sse4.2
steps:
- uses: actions/checkout@v2
- name: all
env:
CXX: g++-7
USE_CPP: 14
CMAKE_CXX_STANDARD: 14
LLVM_VERSION: 8.0.0
OPENEXR_VERSION: 2.4.0
OPENIMAGEIO_BRANCH: release
USE_SIMD: sse4.2
MY_CMAKE_FLAGS: -DCMAKE_BUILD_TYPE=Debug
- name: Prepare ccache timestamp
id: ccache_cache_keys
shell: bash
run: |
source src/build-scripts/ci-startup.bash
source src/build-scripts/gh-installdeps.bash
source src/build-scripts/ci-build-and-test.bash
echo "::set-output name=date::`date -u +'%Y-%m-%dT%H:%M:%SZ'`"
- name: ccache
id: ccache
uses: actions/cache@v2
with:
path: /tmp/ccache
key: ${{ github.job }}-${{ steps.ccache_cache_keys.outputs.date }}
restore-keys: |
${{ github.job }}-
- name: Build setup
run: |
src/build-scripts/ci-startup.bash
- name: Dependencies
run: |
src/build-scripts/gh-installdeps.bash
- name: Build
run: |
src/build-scripts/ci-build.bash
- name: Testsuite
run: |
src/build-scripts/ci-test.bash
- uses: actions/upload-artifact@v2
if: failure()
with:
name: ${{ github.job }}
path: build/*/testsuite/*/*.*
path: |
build/*/testsuite/*/*.*
build/*/CMake*.{txt,log}
linux-2020ish-clang9-llvm9:
name: "Linux clang9, C++14, llvm9, oiio release, avx, exr2.4, avx"
linux-clang9-llvm9:
name: "Linux clang9, C++14, llvm9, oiio release, boost1.66, avx2, exr2.3, py2.7"
runs-on: ubuntu-18.04
container:
image: aswf/ci-osl:2019-clang9
env:
CXX: clang++
CMAKE_CXX_STANDARD: 14
USE_SIMD: avx
OPENIMAGEIO_VERSION: release
PYTHON_VERSION: 2.7
steps:
- uses: actions/checkout@v2
- name: all
env:
CXX: clang++
USE_CPP: 14
CMAKE_CXX_STANDARD: 14
LLVM_VERSION: 9.0.0
USE_SIMD: avx
OPENEXR_VERSION: 2.4.0
OPENIMAGEIO_BRANCH: release
- name: Prepare ccache timestamp
id: ccache_cache_keys
shell: bash
run: |
source src/build-scripts/ci-startup.bash
source src/build-scripts/gh-installdeps.bash
source src/build-scripts/ci-build-and-test.bash
echo "::set-output name=date::`date -u +'%Y-%m-%dT%H:%M:%SZ'`"
- name: ccache
id: ccache
uses: actions/cache@v2
with:
path: /tmp/ccache
key: ${{ github.job }}-${{ steps.ccache_cache_keys.outputs.date }}
restore-keys: |
${{ github.job }}-
- name: Build setup
run: |
src/build-scripts/ci-startup.bash
- name: Dependencies
run: |
# Remove pesky wrong installed OIIO version
rm -rf /usr/local/include/OpenImageIO
src/build-scripts/gh-installdeps.bash
- name: Build
run: |
src/build-scripts/ci-build.bash
- name: Testsuite
run: |
src/build-scripts/ci-test.bash
- uses: actions/upload-artifact@v2
if: failure()
with:
name: ${{ github.job }}
path: build/*/testsuite/*/*.*
path: |
build/*/testsuite/*/*.*
build/*/CMake*.{txt,log}
linux-clang11-llvm11:
name: "Linux clang11/C++17 llvm-11 oiio-master avx2 exr3.0 py3.7 boost1.73"
runs-on: ubuntu-latest
container:
image: aswf/ci-osl:2021-clang11
env:
CXX: clang++
CC: clang
CMAKE_CXX_STANDARD: 17
PYTHON_VERSION: 3.7
USE_SIMD: avx2,f16c
OPENEXR_VERSION: v3.0.4
OPENIMAGEIO_VERSION: master
PYBIND11_VERSION: v2.6.2
steps:
- uses: actions/checkout@v2
- name: Prepare ccache timestamp
id: ccache_cache_keys
shell: bash
run: |
echo "::set-output name=date::`date -u +'%Y-%m-%dT%H:%M:%SZ'`"
- name: ccache
id: ccache
uses: actions/cache@v2
with:
path: /tmp/ccache
key: ${{ github.job }}-${{ steps.ccache_cache_keys.outputs.date }}
restore-keys: |
${{ github.job }}-
- name: Build setup
run: |
src/build-scripts/ci-startup.bash
- name: Dependencies
run: |
sudo rm -rf /usr/local/include/OpenEXR
sudo rm -rf /usr/local/lib64/cmake/{IlmBase,OpenEXR}
src/build-scripts/gh-installdeps.bash
- name: Build
run: |
src/build-scripts/ci-build.bash
- name: Testsuite
run: |
src/build-scripts/ci-test.bash
- uses: actions/upload-artifact@v2
if: failure()
with:
name: ${{ github.job }}
path: |
build/*/testsuite/*/*.*
build/*/CMake*.{txt,log}
linux-2021ish-gcc8-llvm10:
name: "Linux gcc8, C++17, llvm10, oiio master, avx2, exr2.5, avx2"
name: "Linux gcc8, C++17, llvm10, oiio master, avx2, exr2.5, boost1.65, avx2"
runs-on: ubuntu-18.04
env:
CXX: g++-8
CMAKE_CXX_STANDARD: 17
LLVM_VERSION: 10.0.0
USE_SIMD: avx2,f16c
OPENEXR_VERSION: v2.5.5
OPENIMAGEIO_VERSION: master
OPENIMAGEIO_CMAKE_FLAGS: -DBUILD_FMT_VERSION=7.0.1
PUGIXML_VERSION: v1.10
PYBIND11_VERSION: v2.5.0
steps:
- uses: actions/checkout@v2
- name: all
env:
CXX: g++-8
CMAKE_CXX_STANDARD: 17
LLVM_VERSION: 10.0.0
USE_SIMD: avx2,f16c
OPENEXR_VERSION: 2.5.0
OPENIMAGEIO_BRANCH: master
OPENIMAGEIO_CMAKE_FLAGS: -DBUILD_FMT_VERSION=7.0.1
PYBIND11_VERSION: 2.5.0
- name: Prepare ccache timestamp
id: ccache_cache_keys
shell: bash
run: |
source src/build-scripts/ci-startup.bash
source src/build-scripts/gh-installdeps.bash
source src/build-scripts/ci-build-and-test.bash
echo "::set-output name=date::`date -u +'%Y-%m-%dT%H:%M:%SZ'`"
- name: ccache
id: ccache
uses: actions/cache@v2
with:
path: /tmp/ccache
key: ${{ github.job }}-${{ steps.ccache_cache_keys.outputs.date }}
restore-keys: |
${{ github.job }}-
- name: Build setup
run: |
src/build-scripts/ci-startup.bash
- name: Dependencies
run: |
src/build-scripts/gh-installdeps.bash
- name: Build
run: |
src/build-scripts/ci-build.bash
- name: Testsuite
run: |
src/build-scripts/ci-test.bash
- uses: actions/upload-artifact@v2
if: failure()
with:
name: ${{ github.job }}
path: build/*/testsuite/*/*.*
path: |
build/*/testsuite/*/*.*
build/*/CMake*.{txt,log}
linux-latest-release:
# Test against development master for relevant dependencies, latest
# supported releases of everything else.
name: "Linux latest releases: gcc10/C++17, llvm12, oiio-2.3, py3.8, boost1.71, exr3.1, ocio2.1, avx2"
runs-on: ubuntu-20.04
env:
CXX: g++-10
USE_CPP: 17
CMAKE_CXX_STANDARD: 17
LLVM_VERSION: 12.0.0
LLVM_DISTRO_NAME: ubuntu-20.04
USE_SIMD: avx2,f16c
OPENEXR_VERSION: v3.1.0
OPENIMAGEIO_VERSION: release
OPENIMAGEIO_CMAKE_FLAGS: -DBUILD_FMT_VERSION=8.0.0
OPENCOLORIO_VERSION: v2.1.0
PUGIXML_VERSION: v1.11.4
PYBIND11_VERSION: v2.7.1
PYTHON_VERSION: 3.8
steps:
- uses: actions/checkout@v2
- name: Prepare ccache timestamp
id: ccache_cache_keys
shell: bash
run: |
echo "::set-output name=date::`date -u +'%Y-%m-%dT%H:%M:%SZ'`"
- name: ccache
id: ccache
uses: actions/cache@v2
with:
path: /tmp/ccache
key: ${{ github.job }}-${{ steps.ccache_cache_keys.outputs.date }}
restore-keys: |
${{ github.job }}-
- name: Build setup
run: |
src/build-scripts/ci-startup.bash
- name: Dependencies
run: |
src/build-scripts/gh-installdeps.bash
- name: Build
run: |
src/build-scripts/ci-build.bash
- name: Testsuite
run: |
src/build-scripts/ci-test.bash
- uses: actions/upload-artifact@v2
if: failure()
with:
name: ${{ github.job }}
path: |
build/*/testsuite/*/*.*
build/*/CMake*.{txt,log}
linux-bleeding-edge:
# Test against development master for relevant dependencies, latest
# supported releases of everything else.
name: "Linux bleeding edge: gcc10, C++17, llvm10, oiio/ocio/exr/pybind-master, avx2"
runs-on: ubuntu-18.04
name: "Linux bleeding edge: gcc11, C++17, llvm12, oiio/ocio/exr/pybind-master, py3.8, avx2"
runs-on: ubuntu-20.04
env:
CXX: g++-11
USE_CPP: 17
CMAKE_CXX_STANDARD: 17
LLVM_VERSION: 12.0.0
LLVM_DISTRO_NAME: ubuntu-20.04
USE_SIMD: avx2,f16c
OPENEXR_VERSION: master
OPENIMAGEIO_VERSION: master
OPENIMAGEIO_CMAKE_FLAGS: -DBUILD_FMT_VERSION=master
OPENCOLORIO_VERSION: master
PUGIXML_VERSION: master
PYBIND11_VERSION: master
PYTHON_VERSION: 3.8
OSL_BUILD_MATERIALX: 1
steps:
- uses: actions/checkout@v2
- name: all
env:
CXX: g++-10
USE_CPP: 17
CMAKE_CXX_STANDARD: 17
LLVM_VERSION: 10.0.0
USE_SIMD: avx2,f16c
OPENEXR_BRANCH: master
OPENIMAGEIO_BRANCH: master
OPENIMAGEIO_CMAKE_FLAGS: -DBUILD_FMT_VERSION=master
OCIO_BRANCH: master
PYBIND11_BRANCH: master
OSL_BUILD_MATERIALX: 1
- name: Prepare ccache timestamp
id: ccache_cache_keys
shell: bash
run: |
source src/build-scripts/ci-startup.bash
source src/build-scripts/gh-installdeps.bash
source src/build-scripts/ci-build-and-test.bash
echo "::set-output name=date::`date -u +'%Y-%m-%dT%H:%M:%SZ'`"
- name: ccache
id: ccache
uses: actions/cache@v2
with:
path: /tmp/ccache
key: ${{ github.job }}-${{ steps.ccache_cache_keys.outputs.date }}
restore-keys: |
${{ github.job }}-
- name: Build setup
run: |
src/build-scripts/ci-startup.bash
- name: Dependencies
run: |
src/build-scripts/gh-installdeps.bash
- name: Build
run: |
src/build-scripts/ci-build.bash
- name: Testsuite
run: |
src/build-scripts/ci-test.bash
- uses: actions/upload-artifact@v2
if: failure()
with:
name: ${{ github.job }}
path: build/*/testsuite/*/*.*
path: |
build/*/testsuite/*/*.*
build/*/CMake*.{txt,log}
linux-oldest:
# Oldest versions of the dependencies that we can muster, and various
# things disabled.
name: "Linux oldest everything: gcc6 C++11 llvm7 py2.7 boost-1.66 oiio-2.0 no-simd exr2.3"
name: "Linux oldest everything: gcc6/C++11 llvm7 py-no boost-1.66 oiio-2.0 no-simd exr2.3"
runs-on: ubuntu-latest
container:
image: aswf/ci-osl:2019
image: aswf/ci-osl:2019-clang7
env:
CXX: g++
CC: gcc
CMAKE_CXX_STANDARD: 11
PYTHON_VERSION: 2.7
USE_SIMD: 0
USE_PYTHON: 0
OPENIMAGEIO_VERSION: Release-2.0.14
PUGIXML_VERSION: v1.8
steps:
- uses: actions/checkout@v2
- name: all
env:
CXX: g++
CC: gcc
CMAKE_CXX_STANDARD: 11
PYTHON_VERSION: 2.7
USE_SIMD: 0
USE_PYTHON: 0
- name: Prepare ccache timestamp
id: ccache_cache_keys
shell: bash
run: |
source src/build-scripts/ci-startup.bash
source src/build-scripts/gh-installdeps-centos.bash
source src/build-scripts/ci-build-and-test.bash
echo "::set-output name=date::`date -u +'%Y-%m-%dT%H:%M:%SZ'`"
- name: ccache
id: ccache
uses: actions/cache@v2
with:
path: /tmp/ccache
key: ${{ github.job }}-${{ steps.ccache_cache_keys.outputs.date }}
restore-keys: |
${{ github.job }}-
- name: Build setup
run: |
src/build-scripts/ci-startup.bash
- name: Dependencies
run: |
rm -rf /usr/local/include/OpenImageIO
src/build-scripts/gh-installdeps.bash
- name: Build
run: |
src/build-scripts/ci-build.bash
- name: Testsuite
run: |
src/build-scripts/ci-test.bash
- uses: actions/upload-artifact@v2
if: failure()
with:
name: ${{ github.job }}
path: build/*/testsuite/*/*.*
path: |
build/*/testsuite/*/*.*
build/*/CMake*.{txt,log}
macos-py38:
name: "Mac py38"
macos-py39:
name: "Mac py39"
runs-on: macOS-latest
env:
CXX: clang++
USE_CPP: 14
CMAKE_CXX_STANDARD: 14
PYTHON_VERSION: 3.9
steps:
- uses: actions/checkout@v2
- name: all
env:
CXX: clang++
USE_CPP: 14
CMAKE_CXX_STANDARD: 14
PYTHON_VERSION: 3.8
LLVM_BC_GENERATOR: /usr/bin/clang++
MY_CMAKE_FLAGS: -DLLVM_BC_GENERATOR=/usr/bin/clang++
# ^^ Force bitcode compiles to use the system clang compiler by
# preemptively telling it the LLVM_BC_GENERATOR, to avoid some
# library mismatches we tend to see on GH CI's Mac images.
- name: Prepare ccache timestamp
id: ccache_cache_keys
shell: bash
run: |
echo "::set-output name=date::`date -u +'%Y-%m-%dT%H:%M:%SZ'`"
- name: ccache
id: ccache
uses: actions/cache@v2
with:
path: /Users/runner/.ccache
key: ${{ github.job }}-${{ steps.ccache_cache_keys.outputs.date }}
restore-keys: |
${{ github.job }}-
- name: Build setup
run: |
src/build-scripts/ci-startup.bash
- name: Dependencies
run: |
source src/build-scripts/ci-startup.bash
source src/build-scripts/install_homebrew_deps.bash
OPENIMAGEIO_CMAKE_FLAGS="-DOIIO_BUILD_TESTS=0 -DUSE_OPENGL=0"
source src/build-scripts/build_openimageio.bash
source src/build-scripts/ci-build-and-test.bash
# OPENIMAGEIO_CMAKE_FLAGS="-DOIIO_BUILD_TESTS=0 -DUSE_OPENGL=0"
# source src/build-scripts/build_openimageio.bash
brew install --display-times -q openimageio
PYTHONPATH=$PYTHONPATH:/usr/local/python${PYTHON_VERSION}/site-packages
- name: Build
run: |
src/build-scripts/ci-build.bash
- name: Testsuite
run: |
src/build-scripts/ci-test.bash
- uses: actions/upload-artifact@v2
if: failure()
with:
name: ${{ github.job }}
path: build/*/testsuite/*/*.*
# windows:
# name: "Windows"
# runs-on: windows-2019
# steps:
# - uses: actions/checkout@v2
# - name: Setup Nuget.exe
# uses: warrenbuckley/Setup-Nuget@v1
# - name: all
# shell: bash
# env:
# PYTHON_VERSION: 3.6
# CMAKE_GENERATOR: "Visual Studio 16 2019"
# OPENEXR_VERSION: 2.4.0
# run: |
# source src/build-scripts/ci-startup.bash
# source src/build-scripts/gh-win-installdeps.bash
# source src/build-scripts/ci-build-and-test.bash
# - uses: actions/upload-artifact@v2
# if: failure()
# with:
# name: ${{ github.job }}
# path: build/*/testsuite/*/*.*
# sanitizer:
# name: "Sanitizers"
# runs-on: ubuntu-18.04
# if: github.event_name == 'pull_request' || contains(github.ref, 'san') || contains(github.ref, 'RB') || contains(github.ref, 'release') || contains(github.ref, 'master') || contains(github.ref, 'gh')
# steps:
# - uses: actions/checkout@v2
# #- uses: docker://aswfstaging/ci-base:2019
# - name: all
# env:
# CXX: g++-7
# CMAKE_CXX_STANDARD: 14
# SANITIZE: address
# USE_PYTHON: 0
# run: |
# source src/build-scripts/ci-startup.bash
# source src/build-scripts/gh-installdeps.bash
# source src/build-scripts/ci-build-and-test.bash
# - uses: actions/upload-artifact@v2
# if: failure()
# with:
# name: ${{ github.job }}
# path: build/*/testsuite/*/*.*
# linux-static:
# name: "Linux static libs: gcc7, C++14, exr2.3"
# runs-on: ubuntu-18.04
# steps:
# - uses: actions/checkout@v2
# #- uses: docker://aswfstaging/ci-base:2019
# - name: all
# env:
# CXX: g++-7
# CMAKE_CXX_STANDARD: 14
# BUILD_SHARED_LIBS: OFF
# run: |
# source src/build-scripts/ci-startup.bash
# source src/build-scripts/gh-installdeps.bash
# source src/build-scripts/ci-build-and-test.bash
# - uses: actions/upload-artifact@v2
# if: failure()
# with:
# name: ${{ github.job }}
# path: build/*/testsuite/*/*.*
path: |
build/*/testsuite/*/*.*
build/*/CMake*.{txt,log}
clang-format:
# Test formatting. This test entry doesn't do a full build, it just runs
@@ -333,19 +685,22 @@ jobs:
name: "clang-format verification"
runs-on: ubuntu-18.04
container:
image: aswf/ci-osl:2021
image: aswf/ci-osl:2021-clang11
env:
BUILDTARGET: clang-format
CMAKE_CXX_STANDARD: 17
PYTHON_VERSION: 3.7
steps:
- uses: actions/checkout@v2
- name: all
env:
BUILDTARGET: clang-format
CMAKE_CXX_STANDARD: 17
PYTHON_VERSION: 3.7
SKIP_TESTS: 1
- name: Build setup
run: |
source src/build-scripts/ci-startup.bash
source src/build-scripts/gh-installdeps-centos.bash
source src/build-scripts/ci-build-and-test.bash
src/build-scripts/ci-startup.bash
- name: Dependencies
run: |
src/build-scripts/gh-installdeps.bash
- name: Build
run: |
src/build-scripts/ci-build.bash
- uses: actions/upload-artifact@v2
if: failure()
with:
+1 -1
View File
@@ -1,6 +1,6 @@
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/imageworks/OpenShadingLanguage
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
dist
build
-183
View File
@@ -1,183 +0,0 @@
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/imageworks/OpenShadingLanguage
# .travis.yml for OSL
language: cpp
osx_image: xcode10
dist: xenial
# Add-ons: specify apt packages for Linux
# We actaully specify packages per-matrix-entry, so these don't do anything
# except to tag them (&add-sources, &common-packages, &common-boost-packages)
# so they can be referened later ('*') to save repetition.
addons:
apt:
sources: &add-sources
- ubuntu-toolchain-r-test
packages: &common-packages
- libgif-dev
- libfreetype6-dev
- python-numpy
- ninja-build
- libfreetype6-dev
- libpugixml-dev
packages: &common-boost-packages
- libboost1.58-dev
- libboost-filesystem1.58
- libboost-regex1.58
- libboost-system1.58
- libboost-thread1.58
packages: &old-boost-packages
- libboost1.55-dev
- libboost-filesystem1.55
- libboost-regex1.55
- libboost-system1.55
- libboost-thread1.55
cache:
ccache: true
apt: true
directories:
- $HOME/.ccache
before_install:
- source src/build-scripts/ci-startup.bash
- export WHICHGCC=${WHICHGCC:="4.8"}
- if [ "$CXX" == "g++" ]; then export CXX="g++-${WHICHGCC}" ; fi
install:
- if [ $TRAVIS_OS_NAME == osx ] ; then source src/build-scripts/install_homebrew_deps.bash ; fi
- if [ "$BUILD_CMAKE" == "1" ] ; then source src/build-scripts/build_cmake.bash ; fi
- source src/build-scripts/build_llvm.bash ;
- if [ $TRAVIS_OS_NAME == linux ] ; then source src/build-scripts/build_pybind11.bash ; fi
- if [ $TRAVIS_OS_NAME == linux ] ; then CXX="ccache $CXX" source src/build-scripts/build_openexr.bash ; fi
# Note: can remove the ILMBASE_HOME/OPENEXR_HOME when OIIO 2.x is floor
- export OPENIMAGEIO_MAKEFLAGS="$OPENIMAGEIO_MAKEFLAGS -j2 DEBUG= USE_PYTHON=0 OIIO_BUILD_TESTS=0"
- export ENABLE_iinfo=0 ENABLE_iv=0 ENABLE_igrep=0 ENABLE_iconvert=0 ENABLE_testtex=0
- export ENABLE_cineon=0 ENABLE_DDS=0 ENABLE_DPX=0 ENABLE_FITS=0
- export ENABLE_iff=0 ENABLE_jpeg2000=0 ENABLE_PNM=0 ENABLE_PSD=0
- export ENABLE_RLA=0 ENABLE_SGI=0 ENABLE_SOCKET=0 ENABLE_SOFTIMAGE=0
- export ENABLE_TARGA=0 ENABLE_WEBP=0 ENABLE_TARGA=0
- export OPENIMAGEIO_SITE=travis
- export OPENIMAGEIO_INSTALLDIR=$HOME/ext/OpenImageIO/dist/$ARCH
- export OSL_SITE=travis
- source src/build-scripts/build_openimageio.bash
- if [ $TRAVIS_OS_NAME == linux ] ; then
export BUILD_FLAGS="$BUILD_FLAGS LLVM_STATIC=1" ;
export TEST_FLAGS="-E broken\|render-cornell\|render-oren-nayar\|render-veachmis\|render-ward" ;
fi
# ^^^ Linux only, can't make these test work. Exclude for now and return later. ;
# before_script:
script:
- export LD_LIBRARY_PATH=$OpenImageIO_ROOT/lib:$OSL_ROOT/lib:$LD_LIBRARY_PATH
- export DYLD_LIBRARY_PATH=$OpenImageIO_ROOT/lib:$OSL_ROOT/lib:$DYLD_LIBRARY_PATH
- source src/build-scripts/ci-build-and-test.bash
branches:
only:
- master
- /RB-/
- /lg-/
matrix:
fast_finish: true
include:
- name: "VFX Platform 2018 (gcc6, c++14), llvm 7, OIIO master, OpenEXR 2.3, avx/f16c"
os: linux
compiler: gcc
addons:
apt:
sources: *add-sources
packages:
- *common-packages
- *common-boost-packages
- g++-6
env: WHICHGCC=6 USE_CPP=14 LLVM_VERSION=7.0.1 OPENIMAGEIO_BRANCH=master OPENEXR_VERSION=2.3.0 USE_SIMD=avx,f16c BUILD_CMAKE=1
- name: "MacOS (latest Apple clang, llvm 7, OIIO master, latest homebrew libs"
os: osx
compiler: clang
env: PYTHON_VERSION=3.7 USE_CPP=14
- name: "VFX Platform 2017 (gcc48, c++11), llvm 7, OIIO release, OpenEXR 2.3, sse4.2"
os: linux
dist: trusty
compiler: gcc
addons:
apt:
sources: *add-sources
packages:
- *common-packages
- *old-boost-packages
env: WHICHGCC=4.8 USE_CPP=11 LLVM_VERSION=7.0.1 USE_SIMD=sse4.2 OPENIMAGEIO_BRANCH=release OPENEXR_VERSION=2.3.0 BUILD_CMAKE=1
- name: "Older things: OIIO 2.0, llvm 7, boost 1.58, OpenEXR 2.2"
os: linux
dist: trusty
compiler: gcc
addons:
apt:
sources: *add-sources
packages:
- *common-packages
- *old-boost-packages
env: WHICHGCC=4.8 USE_CPP=11 LLVM_VERSION=7.0.1 USE_SIMD=sse4.2 OPENIMAGEIO_BRANCH=RB-2.0 OPENEXR_VERSION=2.2.0 BUILD_CMAKE=1
if: branch =~ /(master|RB|travis)/ OR type = pull_request
- name: "gcc7, llvm7, C++14"
os: linux
compiler: gcc
addons:
apt:
sources: *add-sources
packages:
- *common-packages
- *common-boost-packages
- g++-7
env: WHICHGCC=7 USE_CPP=14 LLVM_VERSION=7.0.0 BUILD_CMAKE=1
if: branch =~ /(master|RB|travis)/ OR type = pull_request
- name: "Future: gcc8, C++14, LLVM 7, OIIO master, AVX/f16c"
os: linux
compiler: gcc
addons:
apt:
sources: *add-sources
packages:
- *common-packages
- *common-boost-packages
- g++-8
env: WHICHGCC=8 USE_CPP=14 LLVM_VERSION=7.0.0 USE_SIMD=avx,f16c BUILD_CMAKE=1
- name: "DEBUG build, LLVM 7, OIIO master"
os: linux
compiler: gcc
addons:
apt:
sources: *add-sources
packages:
- *common-packages
- *common-boost-packages
- g++-6
env: DEBUG=1 WHICHGCC=6 LLVM_VERSION=7.0.0 OPENIMAGEIO_BRANCH=master BUILD_CMAKE=1
- name: "Oldest everything: gcc4.8, LLVM 7, OIIO 2.0, OpenEXR 2.2, no simd"
os: linux
dist: trusty
compiler: gcc
addons:
apt:
sources: *add-sources
packages:
- *common-packages
- *old-boost-packages
env: USE_SIMD=0 LLVM_VERSION=7.0.1 OPENIMAGEIO_BRANCH=RB-2.0 OPENEXR_VERSION=2.2.0 BUILD_CMAKE=1
if: branch =~ /(master|RB|travis)/ OR type = pull_request
notifications:
email:
# recipients:
# -
on_success: change
on_failure: always
-58
View File
@@ -1,58 +0,0 @@
Corporate Contributor License Agreement ("Agreement")
Thank you for your interest in the Open Shading Language Project a Series of
LF Projects, LLC (hereinafter "Project"). In order to clarify the
intellectual property licenses granted with Contributions from any corporate
entity to the Project, LF Projects, LLC ("LF Projects") is required to have
a Corporate Contributor License Agreement (CCLA) on file that has been
signed by each contributing corporation.
Each contributing corporation ("You") must accept and agree that, for any
Contribution (as defined below), You and all other individuals and entities
that control You, are controlled by You, or are under common control with
You, are bound by the licenses granted and representations made as though
all such individuals and entities are a single contributor. For the purposes
of this definition, "control" means (i) the power, direct or indirect, to
cause the direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"Contribution" means any code, documentation or other original work of
authorship that is submitted to LF Projects for inclusion in the Project by
Your employee or by any individual or entity that controls You, or is under
common control with You or is controlled by You and authorized to make the
submission on Your behalf.
You accept and agree that all of Your present and future Contributions to
the Project shall be:
Submitted under a Developer's Certificate of Origin v. 1.1 (DCO); and
Licensed under the BSD-3-Clause License.
You agree that You shall be bound by the terms of the BSD-3-Clause License
for all contributions made by You and Your employees. Your designated
employees are those listed by Your CLA Manager(s) on the system of record
for the Project. You agree to identify Your initial CLA Manager below and
thereafter maintain current CLA Manager records in the Project's system of
record.
Initial CLA Manager (Name and Email): ______________________________________
Corporate Signature:
Company Name: ____________________________________________
Signature: _______________________________________________
Name: _______________________________________________
Title _______________________________________________
Date: _______________________________________________
+149
View File
@@ -0,0 +1,149 @@
Project Name: Open Shading Language
Project Entity: Open Shading Language Project a Series of LF Projects, LLC
If emailing signed PDF, send to: manager@lfprojects.org
**Software Grant and Corporate Contributor License Agreement ("Agreement") v2.1**
Thank you for your interest in the project specified above (the “Project”). In
order to clarify the intellectual property license granted with Contributions
from any person or entity, the Project must have a Contributor License Agreement
(CLA) on file that has been signed by each Contributor, indicating agreement to
the license terms below. This license is for your protection as a Contributor as
well as the protection of the Project and its users; it does not change your
rights to use your own Contributions for any other purpose.
This version of the Agreement allows an entity (the “Corporation”) to submit
Contributions to the Project, to authorize Contributions submitted by its
designated employees to the Project, and to grant copyright and patent licenses
thereto.
If you have not already done so, please complete and sign this Agreement using
the electronic signature portal made available to you by the Project or its
third-party service providers, or email a PDF of the signed agreement to the
email address specified above. Please read this document carefully before
signing and keep a copy for your records.
You accept and agree to the following terms and conditions for Your present and
future Contributions submitted to the Project. In return, the Project shall not
use Your Contributions in a way that is contrary to the public benefit or
inconsistent with its charter at the time of the Contribution. Except for the
license granted herein to the Project and recipients of software distributed by
the Project, You reserve all right, title, and interest in and to Your
Contributions.
1. Definitions.
“You” (or “Your”) shall mean the copyright owner or legal entity authorized by
the copyright owner that is making this Agreement with the Project. For legal
entities, the entity making a Contribution and all other entities that
control, are controlled by, or are under common control with that entity are
considered to be a single Contributor. For the purposes of this definition,
“control” means (i) the power, direct or indirect, to cause the direction or
management of such entity, whether by contract or otherwise, or (ii) ownership
of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial
ownership of such entity.
“Contribution” shall mean the code, documentation or other original works of
authorship, including any modifications or additions to an existing work, that
is intentionally submitted by You to the Project for inclusion in, or
documentation of, any of the products owned or managed by the Project (the
“Work”). For the purposes of this definition, “submitted” means any form
of electronic, verbal, or written communication sent to the Project or its
representatives, including but not limited to communication on electronic
mailing lists, source code control systems, and issue tracking systems that
are managed by, or on behalf of, the Project for the purpose of discussing and
improving the Work, but excluding communication that is conspicuously marked
or otherwise designated in writing by You as “Not a Contribution.”
2. Grant of Copyright License. Subject to the terms and conditions of this
Agreement, You hereby grant to the Project and to recipients of software
distributed by the Project a perpetual, worldwide, non-exclusive, no-charge,
royalty-free, irrevocable copyright license to reproduce, prepare
derivative works of, publicly display, publicly perform, sublicense,
and distribute Your Contributions and such derivative works.
3. Grant of Patent License. Subject to the terms and conditions of this
Agreement, You hereby grant to the Project and to recipients of software
distributed by the Project a perpetual, worldwide, non-exclusive, no-charge,
royalty-free, irrevocable (except as stated in this section) patent
license to make, have made, use, offer to sell, sell, import, and
otherwise transfer the Work, where such license applies only to
those patent claims licensable by You that are necessarily infringed
by Your Contribution(s) alone or by combination of Your
Contribution(s) with the Work to which such Contribution(s) were
submitted. If any entity institutes patent litigation against You or
any other entity (including a cross-claim or counterclaim in a
lawsuit) alleging that your Contribution, or the Work to which
you have contributed, constitutes direct or contributory patent
infringement, then any patent licenses granted to that entity under
this Agreement for that Contribution or Work shall terminate as of
the date such litigation is filed.
4. You represent that You are legally entitled to grant the above license. You
represent further that the employee of the Corporation designated as the Initial
CLA Manager below (and each who is designated in a subsequent written
modification to the list of CLA Managers) (each, a “CLA Manager”) is
authorized to maintain with the Project (1) the list of employees of the
Corporation who are authorized to submit Contributions on behalf of the
Corporation, and (2) the list of CLA Managers.
5. You represent that each of Your Contributions is Your original creation (see
section 7 for submissions on behalf of others).
6. You are not expected to provide support for Your Contributions, except to the
extent You desire to provide support. You may provide support for free, for a
fee, or not at all. Unless required by applicable law or agreed to in writing,
You provide Your Contributions on an “AS IS” BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied, including, without
limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT,
MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.
7. Should You wish to submit work that is not Your original creation, You may
submit it to the Project separately from any Contribution, identifying the
complete details of its source and of any license or other restriction
(including, but not limited to, related patents, trademarks, and license
agreements) of which you are personally aware, and conspicuously marking the
work as “Submitted on behalf of a third-party: [named here]”.
8. It is your responsibility to notify the Project when any change is required
to the list of designated employees authorized to submit Contributions on behalf
of the Corporation, or to the list of the CLA Managers.
\[Please complete and sign on the next page.\]
::: {style="page-break-after: always; visibility: hidden"}
```{=tex}
\pagebreak
```
:::
Please sign:
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ Date:
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
Signatory Name:
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
Signatory E-mail:
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
Signatory Title:
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
Corporation Name:
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
Corporation Address:
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
Initial CLA Manager Name:
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
Initial CLA Manager E-Mail:
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
-33
View File
@@ -1,33 +0,0 @@
Individual Contributor License Agreement ("Agreement")
Thank you for your interest in the Open Shading Language Project a Series of
LF Projects, LLC (hereinafter "Project"). In order to clarify the
intellectual property licenses granted with Contributions from any corporate
entity to the Project, LF Projects, LLC ("LF Projects") is required to have
an Individual Contributor License Agreement (ICLA) on file that has been
signed by each contributing individual. (For legal entities, please use the
Corporate Contributor License Agreement (CCLA).)
Each contributing individual ("You") must accept and agree that, for any
Contribution (as defined below), You are bound by the licenses granted and
representations made herein.
"Contribution" means any code, documentation or other original work of
authorship that is submitted to LF Projects for inclusion in the Project by
You or by another person authorized to make the submission on Your behalf.
You accept and agree that all of Your present and future Contributions to
the Project shall be:
Submitted under a Developer's Certificate of Origin v. 1.1 (DCO); and
Licensed under the BSD-3-Clause License.
Signature: __________________________________________
Name: _______________________________________________
Date: _______________________________________________
+137
View File
@@ -0,0 +1,137 @@
Project Name: Open Shading Language
Project Entity: Open Shading Language Project a Series of LF Projects, LLC
If emailing signed PDF, send to: manager@lfprojects.org
**Individual Contributor License Agreement ("Agreement") v2.1**
Thank you for your interest in the project specified above (the “Project”). In
order to clarify the intellectual property license granted with Contributions
from any person or entity, the Project must have a Contributor License Agreement
(CLA) on file that has been signed by each Contributor, indicating agreement to
the license terms below. This license is for your protection as a Contributor as
well as the protection of the Project and its users; it does not change your
rights to use your own Contributions for any other purpose.
If you have not already done so, please complete and sign this Agreement using
the electronic signature portal made available to you by the Project or its
third-party service providers, or email a PDF of the signed agreement to the
email address specified above. Please read this document carefully before
signing and keep a copy for your records.
You accept and agree to the following terms and conditions for Your present and
future Contributions submitted to the Project. In return, the Project shall not
use Your Contributions in a way that is contrary to the public benefit or
inconsistent with its charter at the time of the Contribution. Except for the
license granted herein to the Project and recipients of software distributed by
the Project, You reserve all right, title, and interest in and to Your
Contributions.
1. Definitions.
“You” (or “Your”) shall mean the copyright owner or legal entity authorized by
the copyright owner that is making this Agreement with the Project. For legal
entities, the entity making a Contribution and all other entities that control,
are controlled by, or are under common control with that entity are considered
to be a single Contributor. For the purposes of this definition, “control”
means (i) the power, direct or indirect, to cause the direction or management
of such entity, whether by contract or otherwise, or (ii) ownership of fifty
percent (50%) or more of the outstanding shares, or (iii) beneficial ownership
of such entity.
“Contribution” shall mean the code, documentation or other original works of
authorship, including any modifications or additions to an existing work, that
is intentionally submitted by You to the Project for inclusion in, or
documentation of, any of the products owned or managed by the Project (the
“Work”). For the purposes of this definition, “submitted” means any form of
electronic, verbal, or written communication sent to the Project or its
representatives, including but not limited to communication on electronic
mailing lists, source code control systems, and issue tracking systems that are
managed by, or on behalf of, the Project for the purpose of discussing and
improving the Work, but excluding communication that is conspicuously marked or
otherwise designated in writing by You as “Not a Contribution.”
2. Grant of Copyright License. Subject to the terms and conditions of this
Agreement, You hereby grant to the Project and to recipients of software
distributed by the Project a perpetual, worldwide, non-exclusive, no-charge,
royalty-free, irrevocable copyright license to reproduce, prepare
derivative works of, publicly display, publicly perform, sublicense,
and distribute Your Contributions and such derivative works.
3. Grant of Patent License. Subject to the terms and conditions of this
Agreement, You hereby grant to the Project and to recipients of software
distributed by the Project a perpetual, worldwide, non-exclusive, no-charge,
royalty-free, irrevocable (except as stated in this section) patent
license to make, have made, use, offer to sell, sell, import, and
otherwise transfer the Work, where such license applies only to
those patent claims licensable by You that are necessarily infringed
by Your Contribution(s) alone or by combination of Your
Contribution(s) with the Work to which such Contribution(s) were
submitted. If any entity institutes patent litigation against You or
any other entity (including a cross-claim or counterclaim in a
lawsuit) alleging that your Contribution, or the Work to which
you have contributed, constitutes direct or contributory patent
infringement, then any patent licenses granted to that entity under
this Agreement for that Contribution or Work shall terminate as of
the date such litigation is filed.
4. You represent that you are legally entitled to grant the above license. If
your employer(s) has rights to intellectual property that you create that
includes your Contributions, you represent that you have received permission to
make Contributions on behalf of that employer, that your employer has waived
such rights for your Contributions to the Project, or that your employer has
executed a separate Corporate CLA with the Project.
5. You represent that each of Your Contributions is Your original creation (see
section 7 for submissions on behalf of others). You represent that Your
Contribution submissions include complete details of any third-party license or
other restriction (including, but not limited to, related patents and
trademarks) of which you are personally aware and which are associated with
any part of Your Contributions.
6. You are not expected to provide support for Your Contributions, except to the
extent You desire to provide support. You may provide support for free, for a
fee, or not at all. Unless required by applicable law or agreed to in writing,
You provide Your Contributions on an “AS IS” BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied, including, without
limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT,
MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.
7. Should You wish to submit work that is not Your original creation, You may
submit it to the Project separately from any Contribution, identifying the
complete details of its source and of any license or other restriction
(including, but not limited to, related patents, trademarks, and license
agreements) of which you are personally aware, and conspicuously marking the
work as “Submitted on behalf of a third-party: [named here]”.
8. You agree to notify the Project of any facts or circumstances of which you
become aware that would make these representations inaccurate in any respect.
\[Please complete and sign on the next page.\]
::: {style="page-break-after: always; visibility: hidden"}
```{=tex}
\pagebreak
```
:::
Please sign:
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
Date: \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
Full name:
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
Mailing Address:
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
------------------------------------------------------------------------
------------------------------------------------------------------------
Country:
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
E-Mail:
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
+4 -3
View File
@@ -10,8 +10,9 @@ must comply with the terms of this Charter.
### 1. Mission and Scope of the Project
* **a.** The mission of the Project is to develop an open source project
with the goals indicated in the "README" file within the Project's code
repository.
for programmable shading in advanced renderers and other applications,
ideal for describing materials, lights, displacement, and pattern
generation.
* **b.** The scope of the Project includes software development under an
OSI-approved open source license supporting the mission, including
@@ -199,7 +200,7 @@ must comply with the terms of this Charter.
- **i.** All new inbound code contributions to the Project must be made
using the BSD 3-Clause License (available here:
https://github.com/imageworks/OpenShadingLanguage/blob/master/LICENSE)
https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/blob/master/LICENSE)
(the "Project License").
- **ii.** All new inbound code contributions must:
+1 -1
View File
@@ -36,7 +36,7 @@ Additional attendees:
* Charter / legalities
- All the proposed documents are in this PR:
https://github.com/imageworks/OpenShadingLanguage/pull/1137
https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1137
- **Action**: Everybody please look over the charter, etc., give a +1,
raise any objections or ask questions.
- **Action**: Look at the CLA, show to your legal depts if they care. It's
+17 -17
View File
@@ -4,27 +4,27 @@ This is a checklist for TSC's to review as part of the intake process. The TSC s
- Existing Project Governance
- [X] Project License exists ( [LICENSE.md](../LICENSE.md) ) and is OSI-approved
- [X] Any third-party components/dependencies included are listed along with thier licenses ( [THIRD_PARTY.md](../THIRD_PARTY.md) )
- [X] Governamce defined, outlining community roles and how decsions are made ( [GOVERNANCE.md](../GOVERNANCE.md] )
- Closed by https://github.com/imageworks/OpenShadingLanguage/pull/1137
- [X] Any third-party components/dependencies included are listed along with their licenses ( [THIRD_PARTY.md](../THIRD_PARTY.md) )
- [X] Governance defined, outlining community roles and how decsions are made ( [GOVERNANCE.md](../GOVERNANCE.md] )
- Closed by https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1137
- [X] Contribution Policy defined ( [CONTRIBUTING.md](../CONTRIBUTING.md) )
- Closed by https://github.com/imageworks/OpenShadingLanguage/pull/1137
- Closed by https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1137
- [X] Code of Conduct defined ( existing or pull from [ASWF Sample Project](https://github.com/AcademySoftwareFoundation/aswf-sample-project/blob/master/CODE_OF_CONDUCT.md) )
- Closed by https://github.com/imageworks/OpenShadingLanguage/pull/1137
- Closed by https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1137
- [ ] Release methodology defined ( [release.md](process/release.md) )
- New Project Goverance
- New Project Governance
- [X] TSC members identified
- [X] First TSC meeting held
- [X] TSC meeting cadence set and added to project calendar
- [ ] CLA Approved ( if used ) ( [CCLA](ccla.md) and [ICLA](icla.md) )
- [X] CLA Approved ( if used ) ( [CCLA](CLA-corporate.md) and [ICLA](CLA-individual.md) )
- Project charter ( [charter.md](charter.md) )
- [X] Approved by TSC
- Closed by https://github.com/imageworks/OpenShadingLanguage/pull/1137
- [ ] Filed ( create pull request against [foundation repo](https://github.com/AcademySoftwareFoundation/foundation) )
- Closed by https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1137
- [X] Filed ( create pull request against [foundation repo](https://github.com/AcademySoftwareFoundation/foundation) )
- Current tools
- [X] Source Control ( https://github.com/imageworks/OpenShadingLanguage )
- [X] Issue/feature tracker ( https://github.com/imageworks/OpenShadingLanguage/issues )
- Collaboration tools
- [X] Source Control ( https://github.com/AcademySoftwareFoundation/OpenShadingLanguage )
- [X] Issue/feature tracker ( https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/issues )
- Collaboration tools
- [X] Mailing lists (old: http://groups.google.com/group/osl-dev )
- [X] Move to groups.io ( create [issue on foundation repo](https://github.com/AcademySoftwareFoundation/foundation/issues/new ) to setup/transfer
- [X] Slack or IRC ( #openshadinglanguage )
@@ -36,9 +36,9 @@ This is a checklist for TSC's to review as part of the intake process. The TSC s
- Project assets
- [X] Domain name
- [X] Logo(s) ( https://github.com/AcademySoftwareFoundation/artwork/blob/master/examples/incubating.md#open-shading-language-logos )
- [ ] Trademarks/mark ownership rights ( John to follow up with Larry on this )
- [X] Trademarks/mark ownership rights
- Outreach
- [X] New project annoucement done ( https://www.aswf.io/osl-joins-aswf/ )
- [X] New project announcement done ( https://www.aswf.io/osl-joins-aswf/ )
- [X] Project added to ASWF website and ASWF landscape
- Graduation
- [ ] CII Badge achieved
@@ -48,6 +48,6 @@ This is a checklist for TSC's to review as part of the intake process. The TSC s
- [X] TAC representative appointed
- Chris Kulla, TSC chair, is our TAC rep for the project
- [X] License scan completed and no issues found
- Minor issues were found but already fixed in PR https://github.com/imageworks/OpenShadingLanguage/pull/1145
- [ ] Code repository imported to ASWF GitHub organization
- [ ] Developer Certificate of Origin past commit signoff done and DCO Probot enabled.
- Minor issues were found but already fixed in PR https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1145
- [X] Code repository imported to ASWF GitHub organization
- [ ] Developer Certificate of Origin past commit signoff done and DCO Probot enabled.
+185 -55
View File
@@ -1,7 +1,112 @@
<!-- SPDX-License-Identifier: CC-BY-4.0 -->
<!-- Copyright Contributors to the Open Shading Language Project. -->
Release 1.11 --1 Sept 2020 (compared to 1.10)
Release 1.11.16.0 -- 1 Nov 2021 (compared to 1.11.15.0)
-------------------------------------------------------
* Fixes to work with LLVM 13, and to compile with clang 13. #1412 #1420
Release 1.11.15.0 -- 1 Sep 2021 (compared to 1.11.14.2)
-------------------------------------------------------
* Changes for compatibility with OpenImageIO 2.3. #1393 #1388
* Fix potential crashes (or at least undefined behavior) due to missing
virtual destructor of internal Symbol type. #1397
Release 1.11.14.2 -- 1 Jul 2021 (compared to 1.11.14.1)
-------------------------------------------------------
* Fix warnings that occur when compiling with clang and C++17 mode. #1379
* CI/testing: Additional CI tests for clang+c++17 (#1379), gcc11 (#1381),
llvm 12 (#1381), speed up CI builds by not building the testing components
of OIIO (#1380).
Release 1.11.14.1 -- 1 Jun 2021 (compared to 1.11.14.0)
-------------------------------------------------------
* Fix library setup for LLVM installations consisting of static libraries.
This fixes a build problem that can crop up on MacOS using
Homebrew-installed LLVM 12. #1375
Release 1.11.14 -- 10 May 2021 (compared to 1.11.13)
----------------------------------------------------
* oslc/OSLCompiler: Check for errors when when writing oslc (for example,
disk volume full). #1360
* Fix crash generating closure function calls with LLVM 11. #1361
* Build: LLVM 12 compatibility. #1351
* Build: Support for CMake 3.20 #1354
* Build: Be robust to certain OpenEXR 2.x config fies. #1356
* Build: Fixes to deal with newer OIIO builds that are C++14.
Release 1.11.13 -- 1 Apr 2021 (compared to 1.11.12)
----------------------------------------------------
* Updated vector2.h with a `mod(vector2,vector2)` function. #1312
* Fix unnecesary error messages to stderr when encountering broken point
clouds. #1333
Release 1.11.12 -- 1 Mar 2021 (compared to 1.11.11)
----------------------------------------------------
* Build: Changes for smooth compile against upcoming Imath 3.0. #1332 #1341
* Build: We weren't properly hiding non-public symbols. #1337
* CI: Cleanup and get rid of the last Travis vestiges. #1334
* CI: Speed up CI runs by using GHA cache + ccache. #1335
* CI: Separate CI process into several individual "steps." #1338
Release 1.11.11 -- 1 Feb 2021 (compared to 1.11.10)
----------------------------------------------------
* Build: Make the CMake build system more friendly to being a subproject.
#1304
* Build: Improve dependency on Imath/OpenEXR include files.
* CI: Fixes to Mac CI. #1315
* Docs: Update CLAs, Charter, GOVERNANCE, particularly after acceptance of
new CLAs and moving the repo to the ASWF GitHub account. #1308 #1240 #1314
* Internals: Switch from deprecated call to OIIO::parallel_image to the new
version. #1317
Release 1.11.10 -- 1 Dec 2020 (compared to 1.11.9)
---------------------------------------------------
* Bug fix: optimizer interaction with output param that also is userdata.
#1295
* Ensure that LoadMemoryCompiledShader returns false upon parse failure.
#1302
* Work to ensure that OIIO will build correctly against the upcoming
Imath 3.0 and OpenEXR 3.0. #1299
Release 1.11.9 -- 1 Nov 2020 (compared to 1.11.8)
---------------------------------------------------
* Build properly against Cuda 11 and OptiX 7.1. #1232
* Windows compile fixes. #1263 #1285
* PugiXML build fixes on some systems. #1262
* Fix asymptomatic potential runtime optimizer bug where certain
multi-component values were not correctly recognized as nonzero. #1266
* Fix false positive with "debug_uninit" where certain while loops might be
flagged as using uninitialized values when in fact they were not. #1252
* Slightly optimize by not copying output params to layers that will not be
used. #1253
* Internals: use the `final` keyword in certain internal classes where
applicable. #1260
* Cuda/OptiX back end: Add `__CUDADEVRT_INTERNAL__` define to bitcode
generation, needed to avoid duplicate cudaMalloc symbols with CUDA9+ #1271
* Fix build break against recent OIIO master change where m_mutex field was
removed from ImageInput. #1281
Release 1.11.8 -- 1 Oct 2020 (compared to 1.11.7)
---------------------------------------------------
* Fix broken derivatives of the optional "alpha" return of texture calls
when the normal color channels return don't have their derivatives used
but the alpha does. #1258
* Building vs Python: instead of defaulting to searching for python 2.7
specifically and needing to set PYTHON_VERSION if you want (or have) a
different one, default to whichever version is found. If multiple versions
of Python are on the system, you can still use the PYTHON_VERSION cmake
variable to disambiguate which one you want. #1249
* For the experimental OptiX support, explicitly set the OptiX pipeline
stack size (fixes some bugs). #1254
* ShadingSystem statistics output (which is printed with `testshade --help`,
by the way) now includes information about the SIMD capabilities specified
at OSL build time, those available at runtime, and the versions of LLVM,
OIIO, and Imath used. This should help in debugging and issue reporting
by making it easy to know certain build time choices just by running
testshade. #1258
Release 1.11 -- 1 Sept 2020 (compared to 1.10)
--------------------------------------------------
ASWF adoption changes:
* GOVERNANCE.md and ASWF/Technical-Charter.md document the project
@@ -107,8 +212,6 @@ OSL Standard library:
color spaces. #1013 (1.11.0)
* `cbrt()` cube root was added to the standard library. #1164 #1166 (1.11.6)
Shaders:
API changes, new options, new ShadingSystem features (for renderer writers):
* `ShadingSystem::convert_value()` will now allow promotion of int or
float to `float[4]`. #940 (1.11.0)
@@ -148,11 +251,14 @@ API changes, new options, new ShadingSystem features (for renderer writers):
system attribute) now defaults to 1, not 0. That should be the best
performance while still having reasonable JIT times. #1114 (1.11.4)
* We no longer automatically build the MaterialX shaders (you need to set
build option OSL_BUILD_MATRIALX to ON). This will eventually be deprecated
build option OSL_BUILD_MATERIALX to ON). This will eventually be deprecated
entirely. #1136 (1.11.5)
* Helper varieties of ShadingSystem::Parameter() and ReParameter() that
handle the common cases of a single float, int, or string. #1195 #1196
(1.11.6)
* `ShaingSystem::optimize_group()` now takes an optional parameter that
allows the caller to only do the optimize step without the JIT step.
#1226 (1.11.71)
Continued work on experimental SIMD batched shading mode:
* Continued work on SIMD-friendly math and noise: #1108 (1.11.4)
@@ -173,7 +279,7 @@ Continued work on experimental OptiX rendering:
* Work on matrix ops. #1054 (1.11.1)
* Allow init ops. #1059 (1.11.1)
* Fixes to string closure params. #1061 (1.11.1)
# Add support for OptiX 7 #1111 #1203 (1.11.6)
* Add support for OptiX 7 #1111 #1203 (1.11.6)
Performance improvements:
* Constant fold array accesses even if they are out of bounds. #1035 (1.11.0)
@@ -185,8 +291,10 @@ Performance improvements:
* Range checking of matrix component access is skipped for certain cases
where it was unnecessary. #1174 (1.11.6)
* LLVM JIT+optimize time has been sped up around 10% by doing a better job
of pruning unused functions and symbols in the generated modul. #1172
of pruning unused functions and symbols in the generated module. #1172
(1.11.6)
* `ShadingSystem::symbol_address()` no longer checks for the symbol to be
NULL (though it will assert on a debug build). #1237 (1.11.7.1)
Bug fixes and other improvements (internals):
* Fix bug in implementation of `splineinverse()` when computing with
@@ -229,13 +337,13 @@ Bug fixes and other improvements (internals):
Internals/developer concerns:
* Switch much of the internals where we do string formatting using printf-like
conventions to errorf(), etc., naming convention, reserving the non-f
names for future use with C++20 std::format/python convenetions. #1076
names for future use with C++20 std::format/python conventions. #1076
(1.11.3)
* Remove pointless assertions from the TypeSpec class. #1079
* Assertion overhaul: use OSL_ASSERT/OSL_DASSERT instead of borrowing from
OIIO's dassert.h. Note that OSL_ASSERT always tests, prints error if the
test fails, but then only aborts for debug builds (no abort for release
builds). In ocntrast, OSL_DASSERT does all for debug builds, and none
builds). In contrast, OSL_DASSERT does all for debug builds, and none
(not even the test) for release builds. #1080 #1087 (1.11.3)
* Refactor the implementation of the `Dual` template to support more
efficient code generation when used in vectorized loops (this will be
@@ -278,21 +386,48 @@ Build & test system improvements:
hidden that is not part of the public API.
- The ENABLERTTI build option has been renamed `ENABLE_RTTI`.
- Config based install and usage.
* Testshade makes sure that no unreported errors accumulted in the texture
system or image cache. #939 (1.11.0)
* testshade: Check that no leftover errors are in the TextureSystem or
ImageCache at the end of the test (that would indicate that someplace in
OSL we are failing to check texture errors). #939 (1.10.3/1.11.0)
* testshade:
- Make sure that no unreported errors accumulated in the texture system
or image cache. #939 (1.11.0)
- Check that no leftover errors are in the TextureSystem or ImageCache
at the end of the test (that would indicate that someplace in OSL we
are failing to check texture errors). #939 (1.10.3/1.11.0)
- `testshade -o` : now `null` as the filename will not produce any
output. This is handy to mark a renderer output but without storing
the results as an image. #1193 (1.11.6)
- `--vary_pdxdy`, `--vary_udxdy` and `--vary_vdxdy` allow a way to
force P, u, v to have varying derivatives (for testing purposes).
#1227 (1.11.7.1)
* Supporting dependencies:
- Build script finding of LLVM is now more robust to certain library
configurations of llvm, particularly where everything is bundled in
just one libLLVM without a separate libLLVMMCJIT. #976 (1.10.4/1.11.0)
- Support for LLVM 4 has been dropped. #981 (1.11.0)
- Simplified finding of flex/bison, rely more on CMake's built-in
flex/bison find packages. #977 (1.11.0)
- Verified that OSL can be built with Clang 8 and LLVM 8.0.
- When building against recent OIIO versions whose Sysutil supports
stack dumps, crashes in the command line tools (including testshade)
will print stack traces to aid debugging. #1019 (1.11.0)
- Improve finding of OpenEXR/IlmBase. #1022 (1.11.0)
- Fix problems when building against Qt 5.13 due to deprecated calls.
#1043 (1.11.0)
- Fixes for CI when using OIIO 2.1 master that has changed its own cmake
minimum to 3.12. #1065 (1.11.1)
- Improvement for how the build system figures out which LLVM static
libraries are needed. #1070 (1.11.1)
- Improvements in finding Partio. #1125 (1.11.5)
- Fixes to support Qt 5.15 (currently, osltoy is the only component that
uses Qt). #1204 (1.11.6)
- Better able to find LLVM when the system installation of LLVM has its
llvm-config named `llvm-config-64`. #1238 (1.11.7.1)
- Fixes for OIIO 2.2 which has eliminated use of tinyformat in favor of
always relying on fmtlib. #1242 (1.11.7.1)
- Address problem with LLVM 10.0.1 on Mac when installed by Homebrew.
#1245 (1.11.7.2)
* A new build-time CMake variable `OSL_LIBNAME_SUFFIX` lets you optionally
add a custom suffix to the main libraries that are built. (Use with
caution.) #970 (1.11.0)
* Build script finding of LLVM is now more robust to certain library
configurations of llvm, particularly where everything is bundled in just
one libLLVM without a separate libLLVMMCJIT. #976 (1.10.4/1.11.0)
* Support for LLVM 4 has been dropped. #981 (1.11.0)
* Simplified finding of flex/bison, rely more on CMake's built-in flex/bison
find packages. #977 (1.11.0)
* Verified that OSL can be built with Clang 8 and LLVM 8.0.
* Add a build-time option GLIBCXX_USE_CXX11_ABI to force the "new/old string
ABI" to something other than the default for your version of gcc. #995
(1.10.5/1.11.0)
@@ -302,25 +437,15 @@ Build & test system improvements:
#956 (1.10.0)
* When OptiX mode is enabled (USE_OPTIX=1), the testsuite will some tests in
an additional time forcing OptiX mode: any test containing a file named
`OPTIX` in its test directory; or all tests if enviroment variable
`OPTIX` in its test directory; or all tests if environment variable
`TESTSUITE_OPTIX=1` (except tests that contain a file named `NOOPTIX` in
their directory. #1004 (1.10.0)
* Allow OSL to build with `USE_LLVM_BITCODE` enabled on Windows. #998 (1.10.0)
* Various Windows compilation improvements. #1017 #1020
* When building against recent OIIO versions whose Sysutil supports stack
dumps, crashes in the command line tools (including testshade) will
print stack traces to aid debugging. #1019 (1.11.0)
* Improve finding of OpenEXR/IlmBase. #1022 (1.11.0)
* Fix signed/unsigned comparison warnings. #1037 (1.11.0)
* Fix problems when building against Qt 5.13 due to deprecated calls. #1043
(1.11.0)
* Fixes for MinGW compiler on Windows. #1047 #1048 (1.11.0)
* Fixes for CI when using OIIO 2.1 master that has changed its own cmake
minimum to 3.12. #1065 (1.11.1)
* Scripts and tests utilizing Python have all been visited to make sure they
are compatible with both Python 2.x and Python 3.x. #1071 (1.11.1)
* Improvement for how the build system figures out which LLVM static
libraries are needed. #1070 (1.11.1)
* Build: on OSX, better logic about the OIIO plugin must be built as a
module or as a shared library. #1078 (1.11.3/1.10.8)
* Removed support for Boost Wave for preprocessing osl input. We now always
@@ -330,19 +455,18 @@ Build & test system improvements:
up during testing, mostly related to unused function paramters. #1106 (1.11.3)
* The testsuite can run in parallel, with a number of threads set by the
environment variable `CTEST_PARALLEL_LEVEL`. #1119 (1.11.4)
* Improvements in finding Partio. #1125 (1.11.5)
* oslconfig.h is now generated by a cmake configure_file step, from
oslconfig.h.in. #1141 (1.11.5)
* Use ASWF docker images to speed up many of the CI matrix entries, as well
as to excactly test several VFX Platform specs. #1169 (1.11.6)
as to exactly test several VFX Platform specs. #1169 (1.11.6)
* Fix typo that botched the version in the .pc pkgconfig file. #1168 (1.11.6)
* CI test against gcc9 and gcc10. #1192 (1.11.6)
* Propagate RTTI compile options to exported cmake config. #1194 (1.11.6)
* `testshade -o` : now `null` as the filename will not produce any output.
This is handy to mark a renderer output but without storing the results
as an image. #1193 (1.11.6)
* Fixes to support Qt 5.15 (currently, osltoy is the only component that
uses Qt). #1204 (1.11.6)
* New file .git-blame-ignore-revs lists the hashes of commits that only
performed bulk reformatting, so that they don't misattribute authorship
or modification date. Everybody do this in your local repo:
`git config blame.ignoreRevsFile .git-blame-ignore-revs`
#1244 (1.11.7.2)
Documentation:
* Make it clear that the documentation is licensed under the CC-BY-4.0
@@ -352,6 +476,12 @@ Documentation:
deformer. #1199 (1.11.6)
* `testrender` now contains a progressive sampler, which might be a good
example for others writing renderers. #1202 (1.11.6)
* Fix incorrect descripton in `spline()` regarding the number of spline
values required for each interpolation type. #1239 (1.11.7.1)
* Extensive fixing of typos and misspellings in docs and comments. #1243
(1.11.7.2)
* Renamed "LICENSE-THIRD-PARTY.md" to "THIRD-PARTY.md" to avoid confusing
GitHub's reporting of the project's license. (1.11.7.2)
Release 1.10.13 -- 1 Aug 2020 (compared to 1.10.12)
@@ -607,7 +737,7 @@ Shaders:
* mandelbrot.osl: computes Mandelbrot and Julia images. #827 (1.10.0)
* MaterialX support:
* Improved support for MaterialX 1.36: add sin, cos, tan, atan2, ceil,
sqrt, exp, determinent, ln, transpose, sign, rotate, transforms,
sqrt, exp, determinant, ln, transpose, sign, rotate, transforms,
rgb/hsv convert, extract, separate, tiledimage. Rename exponent ->
power, pack -> combine, hsvadjust -> hueshift. Add some color2/4
mutual conversion operators. Fixes to ramp4, clean up texture mapping
@@ -665,7 +795,7 @@ API changes, new options, new ShadingSystem features (for renderer writers):
Bug fixes and other improvements (internals):
* The context's `texture_thread_info` is now properly passed to the
RenderServices callbacks instead of passing NULL. (1.10.0)
* Symbols are enbled in the JIT, allowing Intel Vtune profiler to correctly
* Symbols are enabled in the JIT, allowing Intel Vtune profiler to correctly
report which JITed OSL code is being executed. #830 (1.10.0)
* ASTNode and OSLCompilerImpl -- add info() and message() methods to
complement the existing error and warning. #854 (1.10.0)
@@ -746,7 +876,7 @@ Release 1.9.10 -- 1 Sep 2018 (compared to 1.9.9)
* Add more functions to color2.h, color4.h, vector2.h, vector4.h: ceil,
sqrt, exp, log2, log, sign, sin, cos, tan, asin, acos, atan2. #903, #904
* Improved support for MaterialX 1.36: add sin, cos, tan, atan2, ceil, sqrt,
exp, determinent, ln, transpose, sign, rotate, transforms, rgb/hsv convert,
exp, determinant, ln, transpose, sign, rotate, transforms, rgb/hsv convert,
extract, separate, tiledimage. Rename exponent -> power, pack -> combine,
hsvadjust -> hueshift. Add some color2/4 mutual conversion operators.
Fixes to ramp4, clean up texture mapping nodes, fixes to triplanarprojection
@@ -831,7 +961,7 @@ Standard library additions/changes:
* `smoothstep()` has been extended to `T smoothstep(T edge0, T edge1, T x)`
for T of any the `triple` types (previously, `smoothstep` only came in
the `float` variety). #765 (1.9.0/1.8.10)
* `mix()` has been extenended to support
* `mix()` has been extended to support
`color closure mix (color closure A, color closure B, color x)`
#766 (1.9.0/1.8.10)
* `hashnoise()` is like cellnoise (1D, 2D, 3D, or 4D input, 1D or 4D output
@@ -1028,7 +1158,7 @@ Developer goodies:
This lets you use the `Dual` templates for automatic differentiation of
of ordinary 1D functions (e.g., `Dual<float,1>`) or 3D volumetric
computations (e.g., `Dual<float,3>`). Most of OSL internals use automatic
differentiation on 2 dimenstions (`Dual<float,2>` a.k.a. `Dual2<float>`),
differentiation on 2 dimensions (`Dual<float,2>` a.k.a. `Dual2<float>`),
but this change makes `dual.h` a lot more useful outside of OSL.
#803 (1.9.1)
@@ -1168,7 +1298,7 @@ Language features:
nested `{ {...}, {...} }`. #640 (1.8.0)
* oslc (and liboslcomp) now supports UTF-8 filenames, including on
Windows. #643 (1.8.0)
* osl now accepts hexidecimal integer constants (such as `0x01ff`).
* osl now accepts hexadecimal integer constants (such as `0x01ff`).
#653 (1.8.1)
Standard library additions/changes:
@@ -1184,7 +1314,7 @@ Standard library additions/changes:
message passed to the renderer (leaving error handling and reporting
entirely up to the shader). #686 (1.8.2)
* `select(a,b,cond)` is similar to `mix`, but without interpolation --
if cond is 0, returns a, else return b (per comonent). #696 (1.8.3)
if cond is 0, returns a, else return b (per component). #696 (1.8.3)
API changes, new options, new ShadingSystem features (for renderer writers):
* ShadingSystem API changes:
@@ -1214,7 +1344,7 @@ API changes, new options, new ShadingSystem features (for renderer writers):
* When the attribute "profile" is set, the statistics report will
include a count of the total number of noise calls. #642 (1.8.0)
* ShadingSystem and shader group attribute "exec_repeat" (int; default is
1) can artifically manipulate how many times the shader is executed.
1) can artificially manipulate how many times the shader is executed.
This can sometimes be handy for tricky benchmarks. #659 (1.8.2)
* Attribute "force_derivs" can force derivatives to be computed
everywhere. (Mostly good for debugging or benchmarking derivatives,
@@ -1227,7 +1357,7 @@ Performance improvements:
output parameters and what optimizations can be done based on that. #657
(1.8.1)
* Better runtime optimization of certain matrix constructors. #676 (1.8.2)
* Improved alias analyis for parameters with simple initialization ops.
* Improved alias analysis for parameters with simple initialization ops.
#679 (1.8.2)
* Runtime optimizer now constant-folds bitwise `&`, `|`, `^`, `~`
operators. #682 (1.8.2)
@@ -1348,7 +1478,7 @@ Release 1.7.2 -- 1 Mar 2016 (compared to 1.7.1)
Release 1.7 [1.7.1] -- 29 Jan 2016 (compared to 1.6)
--------------------------------------------------
Language, standard libary, and compiler changes (for shader writers):
Language, standard library, and compiler changes (for shader writers):
* Language features:
* Support for closure arrays in shader inputs. #544 (1.7.0)
* Disallow quote strings from spanning lines (just like you can't in
@@ -1359,7 +1489,7 @@ Language, standard libary, and compiler changes (for shader writers):
* isconstant(expr) returns 1 if the expression can be turned into
a constant at runtime (with full knowledge of the shader group's
parameter values and connections). This is helpful mostly for advanced
shader writers to verify their assuptions about which expressions can
shader writers to verify their assumptions about which expressions can
end up being fully constant-folded by the runtime optimizer. #578 (1.7.1)
* New behavior of isconnected(parmaname): return 1 if the parameter
is connected to an upstream layer, 2 if connected to a downstream layer,
@@ -1393,7 +1523,7 @@ API changes, new options, new ShadingSystem features (for renderer writers):
users). (1.7.0)
* "opt_passes" controls the number of optimization passes over each
instance (default: 10). This is mainly for developer debugging, you
should not need to change or expost this. #576 (1.7.1)
should not need to change or expose this. #576 (1.7.1)
* "connection_error" controls whether a bad connection is considered
a true error (or is just ignored). #583 (1.7.1)
* Shader group attribute additions/changes:
@@ -1491,7 +1621,7 @@ Documentation:
Release 1.6 -- 26 May 2015 (compared to 1.5)
-----------------------------------------------
Language, standard libary, and compiler changes (for shader writers):
Language, standard library, and compiler changes (for shader writers):
* It is now supported to have shader parameters that are arrays of
unspecified length (like 'float foo[] = {...}'). Their length will be
fixed when they are assigned an instance value of fixed length, or when
@@ -1632,11 +1762,11 @@ Bug fixes and other improvements:
* Improved detection of shader groups that optimize away to nothing. (1.6.2)
* Fix of possible (but never reported) bug with instancing merging.
#431 (1.6.2)
* Fix incorrect oslc code generation when assigining an element of an
* Fix incorrect oslc code generation when assigning an element of an
array-of-structs to another element of array-of-structs. #432 (1.6.2)
* Bug fix in code generation of constant folding of getmatrix() calls
(never reported symptomatic). #440 (1.6.2)
* Fixes to constuction of temporary filename used for group serialization
* Fixes to construction of temporary filename used for group serialization
archive. (1.6.2)
* Internals fix: logb() incorrectly declaring derivative functions (it
has no derivs). #437 (1.5.12/1.6.2)
@@ -1652,7 +1782,7 @@ Bug fixes and other improvements:
* Bug fix: runtime optimizer should not consider a layer unused if its
outputs are renderer outputs. Also fix subtle bug in detecting whether
an output param is a renderer output. #457 (1.6.2)
* Clear derivatives properly in the implementaiton of gettextureinfo.
* Clear derivatives properly in the implementation of gettextureinfo.
#463 (1.6.2)
* Correct handling of point-like shader parameters defined with default
values that use the constructors that provide "space" names. #465 (1.6.2)
@@ -1816,7 +1946,7 @@ API changes, new options, new ShadingSystem features (for renderer writers):
a good way to "extract" a shader network from the midst of a complex
renderer and then be able to reconstitute it inside a debugging test
harness like testshade. (1.5.8) (#381) For more detail and explanation,
please see https://github.com/imageworks/OpenShadingLanguage/pull/381
please see https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/381
* New per-ShaderGroup attributes:
* ShadingSystem::getattribute(group,...) allows queries that retrieve
all the names and types of userdata the compiled group may need
+22 -295
View File
@@ -1,20 +1,24 @@
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/imageworks/OpenShadingLanguage
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
cmake_minimum_required (VERSION 3.12)
project (OSL VERSION 1.11.7.0
project (OSL VERSION 1.11.16.0
LANGUAGES CXX C
HOMEPAGE_URL "https://github.com/imageworks/OpenShadingLanguage")
HOMEPAGE_URL "https://github.com/AcademySoftwareFoundation/OpenShadingLanguage")
set (PROJ_NAME ${PROJECT_NAME}) # short name
string (TOLOWER ${PROJ_NAME} PROJ_NAME_LOWER) # short name lower case
string (TOUPPER ${PROJ_NAME} PROJ_NAME_UPPER) # short name upper case
set (PROJECT_VERSION_RELEASE_TYPE "dev") # "dev", "betaX", "RCY", ""
set (PROJECT_VERSION_RELEASE_TYPE "") # "dev", "betaX", "RCY", ""
set (${PROJECT_NAME}_VERSION_RELEASE_TYPE ${PROJECT_VERSION_RELEASE_TYPE})
set (${PROJECT_NAME}_SUPPORTED_RELEASE 1) # Change to 1 after release branch
set (PROJECT_AUTHORS "Contributors to the Open Shading Language project")
message (STATUS "Building ${PROJECT_NAME} ${PROJECT_VERSION}")
message (STATUS "CMake version is ${CMAKE_VERSION}")
# Identify whether this is included as a subproject of something else
if (NOT "${CMAKE_PROJECT_NAME}" STREQUAL "${PROJECT_NAME}")
set (${PROJECT_NAME}_IS_SUBPROJECT ON)
message (STATUS "${PROJECT_NAME} is configuring as a CMake subproject")
endif ()
if (NOT CMAKE_BUILD_TYPE)
set (CMAKE_BUILD_TYPE "Release")
@@ -127,20 +131,23 @@ list (APPEND CMAKE_MODULE_PATH
# Helpful functions and macros for our project
include (colors)
include (check_is_enabled)
include (checked_find_package)
# All the C++ and compiler related options and adjustments live here
# All the C++ and compiler related options and adjustments
include (compiler)
# Utilities and options related to finding python and making python bindings
include (pythonutils)
include (externalpackages)
include (flexbison)
include (cuda_macros)
# Utilities related to finding python and making python bindings
include (pythonutils)
# Include all our testing apparatus and utils, but not if it's a subproject
if (${PROJECT_NAME}_BUILD_TESTS AND NOT ${PROJECT_NAME}_IS_SUBPROJECT)
include (testing)
endif ()
# We want CTest for testing, so this must be added before all the calls to
# add_subdirectory, or their add_test commands will not register.
include (CTest)
include_directories (
@@ -248,289 +255,9 @@ install (EXPORT OSL_EXPORTED_TARGETS
#########################################################################
# Testing
# Make a build/platform/testsuite directory, and copy the master runtest.py
# there. The rest is up to the tests themselves.
file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/testsuite")
file (COPY "${CMAKE_CURRENT_SOURCE_DIR}/testsuite/common"
DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/testsuite")
add_custom_command (OUTPUT "${CMAKE_BINARY_DIR}/testsuite/runtest.py"
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_SOURCE_DIR}/testsuite/runtest.py"
"${CMAKE_BINARY_DIR}/testsuite/runtest.py"
MAIN_DEPENDENCY "${CMAKE_SOURCE_DIR}/testsuite/runtest.py")
add_custom_target ( CopyFiles ALL DEPENDS "${CMAKE_BINARY_DIR}/testsuite/runtest.py" )
# add_one_testsuite() - set up one testsuite entry
#
# Usage:
# add_one_testsuite ( testname
# testsrcdir - Current test directory in ${CMAKE_SOURCE_DIR}
# testdir - Current test sandbox in ${CMAKE_BINARY_DIR}
# [ENV env1=val1 env2=val2 ... ] - env vars to set
# [COMMAND cmd...] - optional override of launch command
# )
#
macro (add_one_testsuite testname testsrcdir)
cmake_parse_arguments (_tst "" "" "ENV;COMMAND" ${ARGN})
set (testsuite "${CMAKE_SOURCE_DIR}/testsuite")
set (testdir "${CMAKE_BINARY_DIR}/testsuite/${testname}")
if (NOT _tst_COMMAND)
set (_tst_COMMAND python "${testsuite}/runtest.py" ${testdir})
if (MSVC_IDE)
list (APPEND _tst_COMMAND --devenv-config $<CONFIGURATION>
--solution-path "${CMAKE_BINARY_DIR}" )
endif ()
endif ()
list (APPEND _tst_ENV
OpenImageIO_ROOT=${OpenImageIO_ROOT}
OSL_SOURCE_DIR=${CMAKE_SOURCE_DIR}
OSL_BUILD_DIR=${CMAKE_BINARY_DIR}
OSL_TESTSUITE_ROOT=${testsuite}
OSL_TESTSUITE_SRC=${testsrcdir}
OSL_TESTSUITE_CUR=${testdir}
)
file (MAKE_DIRECTORY "${testdir}")
add_test ( NAME ${testname} COMMAND ${_tst_COMMAND} )
# message ("Test -- env ${_tst_ENV} cmd ${_tst_COMMAND}")
set_tests_properties (${testname} PROPERTIES ENVIRONMENT "${_tst_ENV}" )
# Certain tests are already internally multi-threaded, so to keep them
# from piling up together, allocate a few cores each.
if (${testname} MATCHES "^render-")
set_tests_properties (${testname} PROPERTIES LABELS render
PROCESSORS 4 COST 10)
endif ()
# Some labeling for fun
if (${testname} MATCHES "^texture-")
set_tests_properties (${testname} PROPERTIES LABELS texture
PROCESSORS 2 COST 4)
endif ()
if (${testname} MATCHES "noise")
set_tests_properties (${testname} PROPERTIES LABELS noise
PROCESSORS 2 COST 4)
endif ()
if (${testname} MATCHES "optix")
set_tests_properties (${testname} PROPERTIES LABELS optix)
endif ()
endmacro ()
osl_add_all_tests()
macro ( TESTSUITE )
cmake_parse_arguments (_ats "" "LABEL;FOUNDVAR;TESTNAME" "" ${ARGN})
# If there was a FOUNDVAR param specified and that variable name is
# not defined, mark the test as broken.
if (_ats_FOUNDVAR AND NOT ${_ats_FOUNDVAR})
set (_ats_LABEL "broken")
endif ()
set (test_all_optix $ENV{TESTSUITE_OPTIX})
# Add the tests if all is well.
set (ALL_TEST_LIST "")
set (_testsuite "${CMAKE_SOURCE_DIR}/testsuite")
foreach (_testname ${_ats_UNPARSED_ARGUMENTS})
set (_testsrcdir "${_testsuite}/${_testname}")
if (_ats_TESTNAME)
set (_testname "${_ats_TESTNAME}")
endif ()
if (_ats_LABEL MATCHES "broken")
set (_testname "${_testname}-broken")
endif ()
set (ALL_TEST_LIST "${ALL_TEST_LIST} ${_testname}")
# Run the test unoptimized, unless it matches a few patterns that
# we don't test unoptimized (or has an OPTIMIZEONLY marker file).
if (NOT _testname MATCHES "^getattribute-shader" AND
NOT _testname MATCHES "optix" AND
NOT EXISTS "${_testsrcdir}/OPTIMIZEONLY")
add_one_testsuite ("${_testname}" "${_testsrcdir}"
ENV TESTSHADE_OPT=0 )
endif ()
# Run the same test again with aggressive -O2 runtime
# optimization, triggered by setting TESTSHADE_OPT env variable.
# Skip OptiX-only tests and those with a NOOPTIMIZE marker file.
if (NOT _testname MATCHES "optix"
AND NOT EXISTS "${_testsrcdir}/NOOPTIMIZE")
add_one_testsuite ("${_testname}.opt" "${_testsrcdir}"
ENV TESTSHADE_OPT=2 )
endif ()
# When building for OptiX support, also run it in OptiX mode
# if there is an OPTIX marker file in the directory.
# If an environment variable $TESTSUITE_OPTIX is nonzero, then
# run all tests with OptiX, even if there's no OPTIX marker.
if (USE_OPTIX
AND (EXISTS "${_testsrcdir}/OPTIX" OR test_all_optix OR _testname MATCHES "optix")
AND NOT EXISTS "${_testsrcdir}/NOOPTIX"
AND NOT EXISTS "${_testsrcdir}/NOOPTIX-FIXME")
# Unoptimized
if (NOT EXISTS "${_testsrcdir}/OPTIMIZEONLY")
add_one_testsuite ("${_testname}.optix" "${_testsrcdir}"
ENV TESTSHADE_OPT=0 TESTSHADE_OPTIX=1 )
endif ()
# and optimized
add_one_testsuite ("${_testname}.optix.opt" "${_testsrcdir}"
ENV TESTSHADE_OPT=2 TESTSHADE_OPTIX=1 )
endif ()
endforeach ()
if (VERBOSE)
message (STATUS "Added tests: ${ALL_TEST_LIST}")
endif ()
endmacro ()
if (OSL_BUILD_TESTS)
# List all the individual testsuite tests here, except those that need
# special installed tests.
TESTSUITE ( aastep allowconnect-err and-or-not-synonyms arithmetic
array array-derivs array-range array-aassign
blackbody blendmath breakcont
bug-array-heapoffsets bug-locallifetime bug-outputinit
bug-param-duplicate bug-peep bug-return
cellnoise closure closure-array color comparison
compile-buffer
component-range
connect-components
const-array-params const-array-fill
debugnan debug-uninit
derivs derivs-muldiv-clobber
draw_string
error-dupes error-serialized
example-deformer
exit exponential
fprintf
function-earlyreturn function-simple function-outputelem
function-overloads function-redef
geomath getattribute-camera getattribute-shader
getsymbol-nonheap gettextureinfo
group-outputs groupstring
hash hashnoise hex hyperb
ieee_fp if incdec initlist initops intbits isconnected isconstant
layers layers-Ciassign layers-entry layers-lazy layers-lazyerror
layers-nonlazycopy layers-repeatedoutputs
linearstep
logic loop matrix message
mergeinstances-duplicate-entrylayers
mergeinstances-nouserdata mergeinstances-vararray
metadata-braces miscmath missing-shader
named-components
noise noise-cell
noise-gabor noise-gabor2d-filter noise-gabor3d-filter
noise-perlin noise-simplex
pnoise pnoise-cell pnoise-gabor pnoise-perlin
operator-overloading
opt-warnings
oslc-comma oslc-D oslc-M
oslc-err-arrayindex oslc-err-assignmenttypes
oslc-err-closuremul oslc-err-field
oslc-err-format oslc-err-funcoverload
oslc-err-intoverflow oslc-err-write-nonoutput
oslc-err-noreturn oslc-err-notfunc
oslc-err-initlist-args oslc-err-initlist-return
oslc-err-named-components
oslc-err-outputparamvararray oslc-err-paramdefault
oslc-err-struct-array-init oslc-err-struct-ctr
oslc-err-struct-dup oslc-err-struct-print
oslc-err-unknown-ctr
oslc-warn-commainit
oslc-variadic-macro
oslc-version
oslinfo-arrayparams oslinfo-colorctrfloat
oslinfo-metadata oslinfo-noparams
osl-imageio
paramval-floatpromotion
pragma-nowarn
printf-whole-array
raytype raytype-specialized reparam
render-background render-bumptest
render-cornell render-furnace-diffuse
render-microfacet render-oren-nayar render-veachmis render-ward
select shortcircuit spline splineinverse splineinverse-ident
spline-boundarybug spline-derivbug
string
struct struct-array struct-array-mixture
struct-err struct-init-copy
struct-isomorphic-overload struct-layers
struct-operator-overload struct-return struct-with-array
struct-nested struct-nested-assign struct-nested-deep
ternary
testshade-expr
texture-alpha texture-blur texture-connected-options
texture-derivs texture-errormsg
texture-firstchannel texture-interp
texture-missingalpha texture-missingcolor texture-simple
texture-smallderivs texture-swirl texture-udim
texture-width texture-withderivs texture-wrap
trailing-commas
transitive-assign
transform transformc trig typecast
unknown-instruction
userdata
vararray-connect vararray-default
vararray-deserialize vararray-param
vecctr vector
wavelength_color Werror xml )
# Add tests that require the Python bindings if we built them.
# We also exclude these tests if this is a sanitizer build on Linux,
# because the Python interpreter itself won't be linked with the right asan
# libraries to run correctly.
if (USE_PYTHON AND NOT SANITIZE_ON_LINUX)
TESTSUITE ( python-oslquery )
if (NOT ${PROJECT_NAME}_IS_SUBPROJECT)
include (packaging)
endif ()
# Only run field3d-related tests if the local OIIO was built with f3d support.
EXECUTE_PROCESS ( COMMAND ${OPENIMAGEIO_BIN} --help
OUTPUT_VARIABLE oiiotool_help )
if (oiiotool_help MATCHES "field3d")
TESTSUITE ( texture-field3d )
endif()
# Only run pointcloud tests if Partio is found
if (PARTIO_FOUND)
TESTSUITE ( pointcloud pointcloud-fold )
endif ()
# Only run the OptiX tests if OptiX and CUDA are found
if (OPTIX_FOUND AND CUDA_FOUND)
TESTSUITE ( testoptix testoptix-noise )
endif ()
# FIXME: still working on MaterialX testsuite
# add_subdirectory(testsuite/MaterialX)
endif (OSL_BUILD_TESTS)
#########################################################################
# Packaging
set (CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set (CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
set (CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
# "Vendor" is only used in copyright notices, so we use the same thing that
# the rest of the copyright notices say.
set (CPACK_PACKAGE_VENDOR ${PROJECT_AUTHORS})
set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "OpenShadingLanguage is...")
set (CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/src/doc/Description.txt")
set (CPACK_PACKAGE_FILE_NAME ${PROJECT_NAME}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}-${platform})
file (COPY "${PROJECT_SOURCE_DIR}/LICENSE" DESTINATION "${CMAKE_BINARY_DIR}")
file (RENAME "${CMAKE_BINARY_DIR}/LICENSE" "${CMAKE_BINARY_DIR}/License.txt")
set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_BINARY_DIR}/License.txt")
file (COPY "${PROJECT_SOURCE_DIR}/README.md" DESTINATION "${CMAKE_BINARY_DIR}")
file (RENAME "${CMAKE_BINARY_DIR}/README.md" "${CMAKE_BINARY_DIR}/Readme.txt")
set (CPACK_RESOURCE_FILE_README "${CMAKE_BINARY_DIR}/Readme.txt")
set (CPACK_RESOURCE_FILE_WELCOME "${PROJECT_SOURCE_DIR}/src/doc/Welcome.txt")
#set (CPACK_PACKAGE_EXECUTABLES I'm not sure what this is for)
#set (CPACK_STRIP_FILES Do we need this?)
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set (CPACK_GENERATOR "TGZ;STGZ;RPM;DEB")
set (CPACK_SOURCE_GENERATOR "TGZ")
endif ()
if (APPLE)
set (CPACK_GENERATOR "TGZ;STGZ;PackageMaker")
set (CPACK_SOURCE_GENERATOR "TGZ")
endif ()
set (CPACK_SOURCE_PACKAGE_FILE_NAME ${PROJECT_NAME}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}-source)
#set (CPACK_SOURCE_STRIP_FILES ...FIXME...)
set (CPACK_SOURCE_IGNORE_FILES ".*~")
include (CPack)
+35 -39
View File
@@ -10,8 +10,8 @@ why it's an open source project. Please review this document to get a
briefing on our process.
Mail List
---------
Mail List and Slack
-------------------
Contributors should be reading the osl-dev mail list:
@@ -19,12 +19,19 @@ Contributors should be reading the osl-dev mail list:
You can sign up for the mail list on your own using the link above.
We also have an `openshadinglanguage` channel on the
[ASWF Slack](https://slack.aswf.io/). But note that the Slack channel is
not archived, so while it's ok for fleeting comments, it is unreliable as
a permanent repository of useful information. Serious discussions that are
we would want to refer to over time should be sent to the mail list instead.
Bug Reports and Issue Tracking
------------------------------
We use GitHub's issue tracking system for bugs and enhancements:
https://github.com/imageworks/OpenShadingLanguage/issues
We use GitHub's issue tracking system for reporting bugs and requesting
enhancements:
https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/issues
**If you are merely asking a question ("how do I...")**, please do not file an
issue, but instead ask the question on the [OSL developer mail
@@ -48,41 +55,30 @@ Contributor License Agreement (CLA) and Intellectual Property
To protect the project -- and the contributors! -- we do require a
Contributor License Agreement (CLA) for anybody submitting changes.
**While the repo is still under github.com/imageworks**
* If you are an individual writing the code on your own time and you're SURE
you are the sole owner of any intellectual property you contribute, use the
[Individual CLA](http://opensource.imageworks.com/cla/pdf/Imageworks_Contributor_License_Agreement_Individual.pdf).
* If you are writing the code as part of your job, or if there is any
possibility that your employers might think they own any intellectual
property you create, then you should use the [Corporate
CLA](http://opensource.imageworks.com/cla/pdf/Imageworks_Contributor_License_Agreement_Corporate.pdf).
Download the appropriate CLA from the links above, print, sign, and rescan
it (or just add a digital signature directly), and email it to:
opensource@imageworks.com
Our CLA's are based on those used by Apache and many other open source
projects.
**After the repo is moved to github.com/AcademySoftwareFoundation**
OSL uses EasyCLA for managing CLAs, which automatically checks to ensure
CLAs are signed by a contributor before a commit can be merged.
* If you are an individual writing the code on your own time and
you're SURE you are the sole owner of any intellectual property you
contribute, you can [sign the CLA as an individual contributor](https://github.com/communitybridge/easycla/blob/master/contributors/sign-a-cla-as-an-individual-contributor-to-github.md).
* If you are writing the code as part of your job, or if there is any
* [Corporate CLA](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/ASWF/OSL-CLA-corporate.md)
If you are writing the code as part of your job, or if there is any
possibility that your employers might think they own any intellectual
property you create, then you should use the [Corporate Contributor
Licence Agreement](https://github.com/communitybridge/easycla/blob/master/contributors/contribute-to-a-github-company-project.md).
property you create. This needs to be executed by someone who has
signatory power for the company.
* [Individual]((https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/ASWF/OSL-CLA-individual.md)).
If you are an individual writing the code on your own time and you're SURE
you are the sole owner of any intellectual property you contribute.
The easiest way to sign CLAs is digitally [using EasyCLA](https://corporate.v1.easycla.lfx.linuxfoundation.org).
Companies who prefer not to use the online tools may sign, scan, and email
the executed copy to manager@lfprojects.org.
The CLA allows a company to name a "CLA Manager" (who does not need
signatory power) who has the ability to use the online system to add or
delete individual employees of the company who are authorized to submit pull
requests, without needing to get an executive to amend and sign the
agreement each time.
Please note that these CLAs are based on the Apache 2.0 CLAs, and differ
minimally, only as much as was required to correctly describe the EasyCLA
process and our use of a CLA manager.
The OSL CLAs may be previewed here:
[Corporate](https://github.com/imageworks/OpenShadingLanguage/ASWF/OSL-CLA-corporate.md),
[Individual]((https://github.com/imageworks/OpenShadingLanguage/ASWF/OSL-CLA-individual.md)).
** Contribution sign off
@@ -115,7 +111,7 @@ The best way to submit changes is via GitHub Pull Request. GitHub has a
All code must be formally reviewed before being merged into the official
repository. The protocol is like this:
1. Get a GitHub account, fork imageworks/OpenShadingLanguage to create your
1. Get a GitHub account, fork AcademySoftwareFoundation/OpenShadingLanguage to create your
own repository on GitHub, and then clone it to get a repository on your
local machine.
@@ -309,7 +305,7 @@ Namespaces: yes, use them!
Prefer C++11 `std` rather than Boost or other third party libraries, where
both can do the same task.
If you see a third party libary already used as a dependency (such as OIIO,
If you see a third party library already used as a dependency (such as OIIO,
Boost, Ilmbase, or LLVM), feel free to any of its public features in OSL
internals (provided those features are present in the minimum version of
that library that we support).
+4 -4
View File
@@ -125,15 +125,15 @@ represents the project at all ASWF TAC meetings.
### TSC Members
(Proposed list, subject to revision, some are placeholders while their
organizations decide who should be the permanent representative)
Current voting members of the TSC are:
* **Chair and TAC repreentative**: Chris Kulla - Sony Pictures Imageworks
* **Chief Architect**: Larry Gritz, Sony Pictures Imageworks
* **Chair and TAC representative**: Chris Kulla - Epic Games
* **Chief Architect**: Larry Gritz - Sony Pictures Imageworks
* Luke Emrose - Animal Logic
* Eric Enderton - NVIDIA
* Stephen Friedman - Pixar
* Nicolas Guiard - Isotropix
* Derek Haase - DNEG
* Adrien Herubel - Autodesk
* Lee Kerley - Sony Pictures Imageworks
+18 -15
View File
@@ -12,11 +12,11 @@ Dependencies
OSL requires the following dependencies or tools.
NEW or CHANGED dependencies since the last major release are **bold**.
* Build system: [CMake](https://cmake.org/) 3.12 or newer (tested through 3.18)
* Build system: [CMake](https://cmake.org/) 3.12 or newer (tested through 3.21)
* A suitable C++11 compiler to build OSL itself, which may be any of:
- GCC 4.8.5 or newer (tested through gcc 10)
- Clang 3.4 or newer (tested through clang 10)
- GCC 4.8.5 or newer (tested through gcc 11.2)
- Clang 3.4 or newer (tested through clang 13)
- Microsoft Visual Studio 2015 or newer
- Intel C++ compiler icc version 13 (?) or newer
@@ -24,7 +24,7 @@ NEW or CHANGED dependencies since the last major release are **bold**.
required (unless you are using LLVM >= 10, in which case at least C++14
is needed).
* **[OpenImageIO](http://openimageio.org) 2.0 or newer** (tested through 2.2)
* **[OpenImageIO](http://openimageio.org) 2.0 or newer** (tested through 2.3)
OSL uses OIIO both for its texture mapping functionality as well as
numerous utility classes. If you are integrating OSL into an existing
@@ -43,25 +43,28 @@ NEW or CHANGED dependencies since the last major release are **bold**.
DYLD_LIBRARY_PATH on OS X) and then OSL's build scripts will be able
to find it.
* **[LLVM](http://www.llvm.org) 7, 8, 9, or 10**, including
clang libraries.
* **[LLVM](http://www.llvm.org) 7, 8, 9, 10, 11, 12, or 13**, including clang
libraries.
Note that LLVM 10 is not compatible with C++11, and requires C++14 or
Note that LLVM 10+ is not compatible with C++11, and requires C++14 or
later. If you *must* build OSL with C++11, you need to use an LLVM that
is LLVM 9 or earlier.
* [Boost](www.boost.org) 1.55 or newer (tested through boost 1.73)
* [Ilmbase](http://openexr.com/downloads.html) 2.0 or newer (tested through 2.5)
* [Flex](https://github.com/westes/flex) and
[GNU Bison](https://www.gnu.org/software/bison/)
* [Boost](https://www.boost.org) 1.55 or newer (tested through boost 1.76)
* [Ilmbase or Imath](http://openexr.com/downloads.html) 2.0 or newer (tested through 3.1)
* [Flex](https://github.com/westes/flex) 2.5.35 or newer and
[GNU Bison](https://www.gnu.org/software/bison/) 2.7 or newer.
Note that on some MacOS/xcode releases, the system-installed Bison is too
old, and it's better to install a newer Bison (via Homebrew is one way to
do this easily).
* [PugiXML](http://pugixml.org/)
* (optional) [Partio](https://www.disneyanimation.com/technology/partio.html)
If it is not found at build time, the OSL `pointcloud` functions will not
be operative.
* (optional) Python: If you are building the Python bindings or running the
testsuite:
* Python >= 2.7 (tested against 2.7, 3.6, 3.7, 3.8)
* pybind11 >= 2.4.2 (Tested through 2.5)
* Python >= 2.7 (tested against 2.7, 3.6, 3.7, 3.8, 3.9)
* pybind11 >= 2.4.2 (Tested through 2.7).
* NumPy
* (optional) Qt >= 5.6 (tested through 5.15). If not found at build time,
the `osltoy` application will be disabled.
@@ -77,7 +80,7 @@ Here are the steps to check out, build, and test the OSL distribution:
1. Check out a copy of the source code from the Git repository:
git clone https://github.com/imageworks/OpenShadingLanguage.git osl
git clone https://github.com/AcademySoftwareFoundation/OpenShadingLanguage.git osl
2. Change to the distribution directory and 'make'
@@ -118,4 +121,4 @@ Here are the steps to check out, build, and test the OSL distribution:
Troubleshooting
----------------
- [Build issues on macOS Catalina (fatal error: 'wchar.h' file not found)](https://github.com/imageworks/OpenShadingLanguage/issues/1055#issuecomment-581920327)
- [Build issues on macOS Catalina (fatal error: 'wchar.h' file not found)](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/issues/1055#issuecomment-581920327)
View File
+19 -3
View File
@@ -1,6 +1,6 @@
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/imageworks/OpenShadingLanguage
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
#########################################################################
#
@@ -33,7 +33,7 @@ endif
MY_MAKE_FLAGS ?=
MY_NINJA_FLAGS ?=
MY_CMAKE_FLAGS += -g3
MY_CMAKE_FLAGS ?=
BUILDSENTINEL ?= Makefile
NINJA ?= ninja
CMAKE ?= cmake
@@ -223,6 +223,22 @@ ifneq (${USE_OPTIX},)
MY_CMAKE_FLAGS += -DUSE_OPTIX:BOOL=${USE_OPTIX}
endif
ifneq (${USE_PYTHON},)
MY_CMAKE_FLAGS += -DUSE_PYTHON:BOOL=${USE_PYTHON}
endif
ifneq (${PYTHON_VERSION},)
MY_CMAKE_FLAGS += -DPYTHON_VERSION:STRING=${PYTHON_VERSION}
endif
ifneq (${PYLIB_LIB_PREFIX},)
MY_CMAKE_FLAGS += -DPYLIB_LIB_PREFIX:BOOL=${PYLIB_LIB_PREFIX}
endif
ifneq (${PYLIB_INCLUDE_SONAME},)
MY_CMAKE_FLAGS += -DPYLIB_INCLUDE_SONAME:BOOL=${PYLIB_INCLUDE_SONAME}
endif
#$(info MY_CMAKE_FLAGS = ${MY_CMAKE_FLAGS})
#$(info MY_MAKE_FLAGS = ${MY_MAKE_FLAGS})
@@ -307,7 +323,7 @@ test: build
LD_LIBRARY_PATH=${INSTALL_PREFIX}/lib:${LD_LIBRARY_PATH} \
DYLD_LIBRARY_PATH=${INSTALL_PREFIX}/lib:${DYLD_LIBRARY_PATH} \
OIIO_LIBRARY_PATH=${INSTALL_PREFIX}/lib:${OIIO_LIBRARY_PATH} \
PYTHONPATH=${working_dir}/${build_dir}/src/python:${PYTHONPATH} \
PYTHONPATH=${working_dir}/${build_dir}/lib/python/site-packages:${PYTHONPATH} \
ctest -E broken ${TEST_FLAGS} \
)
@ ( if [[ "${CODECOV}" == "1" ]] ; then \
+43 -31
View File
@@ -1,15 +1,13 @@
<div align="center">
<img src="https://github.com/imageworks/OpenShadingLanguage/blob/master/src/doc/Figures/osl-short.png" width=256 height=128>
<img src="https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/blob/master/src/doc/Figures/osl-short.png" width=256 height=128>
<H1>Open Shading Language</H1>
</div>
[![Open Shading Language Reel 2020](http://img.youtube.com/vi/nmwMz1YnGPA/0.jpg)](https://www.youtube.com/watch?v=nmwMz1YnGPA "Open Shading Language Reel 2020")
Open Shading Language
=====================
Build status:
[![Build Status](https://github.com/imageworks/OpenShadingLanguage/workflows/CI/badge.svg)](https://github.com/imageworks/OpenShadingLanguage/actions)
[![License](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg?style=flat-square)](https://github.com/imageworks/OpenShadingLanguage/LICENSE)
[![Build Status](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/workflows/CI/badge.svg)](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/actions)
[![License](https://img.shields.io/badge/license-BSD%203--Clause-blue.svg?style=flat-square)](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/LICENSE.md)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/3061/badge)](https://bestpractices.coreinfrastructure.org/projects/3061)
@@ -38,7 +36,7 @@ renderers used for high-end VFX and animation work. For a full list of films
and products, see the [filmography](#where-osl-has-been-used).
The OSL code is distributed under the
["New/3-clause BSD" license](https://github.com/imageworks/OpenShadingLanguage/LICENSE),
["New/3-clause BSD" license](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/LICENSE.md),
and the documentation under the [Creative Commons Attribution 4.0 International
License](https://creativecommons.org/licenses/by/4.0/). In short, you are
free to use OSL in your own applications, whether they are free or
@@ -332,7 +330,7 @@ Films using OSL (grouped by year of release date):
The Kid Who Would Be King,
Alita: Battle Angel,
Lego Movie 2,
Lucky 13,
Lucky 13 (Love, Death, and Robots),
Captain Marvel,
Triple Frontier,
Avengers: Endgame,
@@ -347,19 +345,36 @@ Films using OSL (grouped by year of release date):
Angry Birds 2,
The Art of Racing in the Rain,
Secret Life of Pets,
The Mandalorian,
The Mandalorian (S1),
The Dark Crystal: Age of Resistance,
The King,
Jumanji: The Next Level,
Richard Jewell,
Game of Thrones,
Lost in Space,
* **(2020 / upcoming)**
Game of Thrones (S8),
Lost in Space (S1),
Togo
* **(2020)**
Underwater,
Birds of Prey,
Onward,
Bloodshot,
Greyhound,
The Old Guard,
Mulan,
Tenet,
The New Mutants,
Artemis Fowl,
The Eight Hundred,
Over the Moon,
Wonder Woman 1984,
Soul,
The Mandalorian (S2)
* **(2021 / upcoming)**
Chaos Walking,
Peter Rabbit 2: The Runaway,
The Falcon and the Winder Soldier,
Secret Magic Control Agency,
The Mitchells vs the Machines,
...
@@ -386,12 +401,12 @@ Simple "how do I...", "I'm having trouble", or "is this a bug" questions are
best asked on the [osl-dev developer mail
list](https://lists.aswf.io/g/osl-dev).
That's where the most people will see it and potentially be able to answer
your question quickly (moreso than a GH "issue").
your question quickly (more so than a GH "issue").
Bugs, build problems, and discovered vulnerabilities that you are relatively
certain is a legit problem in the code, and for which you can give clear
instructions for how to reproduce, should be [reported as
issues](https://github.com/imageworks/OpenShadingLanguage/issues).
issues](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/issues).
If confidentiality precludes a public question or issue, you may contact the
project administrator privately at [lg@imageworks.com](lg@imageworks.com),
@@ -401,36 +416,33 @@ including for security-related issues.
Contributing
------------
OSL welcomes code contributions, and nearly 50 people
have done so over the years. We take code contributions via the usual GitHub
pull request (PR) mechanism. Please see [CONTRIBUTING](CONTRIBUTING.md) for
detailed instructions.
OSL welcomes code contributions, and nearly 50 people have done so over the
years. We take code contributions via the usual GitHub pull request (PR)
mechanism. Please see [CONTRIBUTING](CONTRIBUTING.md) for detailed
instructions.
Contacts, Links, and References
-------------------------------
[OSL GitHub page](https://github.com/imageworks/OpenShadingLanguage)
[OSL GitHub page](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage)
[Read or subscribe to the OSL development mail list](https://lists.aswf.io/g/osl-dev)
Email the lead architect: lg AT imageworks DOT com
[Most recent PDF of the OSL language specification](https://github.com/imageworks/OpenShadingLanguage/blob/master/src/doc/osl-languagespec.pdf
[Most recent PDF of the OSL language specification](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/blob/master/src/doc/osl-languagespec.pdf
)
[OSL home page at SPI](http://opensource.imageworks.com/?p=osl)
[OSL home page at SPI](http://openshadinglanguage.org)
[Sony Pictures Imageworks main open source page](http://opensource.imageworks.com)
If you want to contribute code back to the project, you'll need to
sign [a Contributor License Agreement](http://opensource.imageworks.com/cla/).
Credits
-------
The current project leadership is documented in the GOVERNANCE.md file.
The current project leadership is documented in the
[Governance](GOVERNANCE.md) file.
Many people have contributed features, bug fixes, and other changes to OSL
over the years: Steve Agland, Shane Ambler, Martijn Berger, Farchad
@@ -469,9 +481,9 @@ developers and users at other VFX and animation studios.
The OSL implementation depends upon several other open source packages,
all with compatible licenses:
* [OpenImageIO (c) Larry Gritz, et al](http://www.openimageio.org)
* [Boost - various authors](http://www.boost.org)
* [IlmBase (c) Industrial Light & Magic](http://www.openexr.com)
* [OpenImageIO](http://www.openimageio.org)
* [Boost](http://www.boost.org)
* [IlmBase](http://www.openexr.com)
* [LLVM Compiler Infrastructure](http://llvm.org)
OSL's documentation incorporates parts of [Markdeep](https://casual-effects.com/markdeep/)
+1 -1
View File
@@ -12,7 +12,7 @@ In no particular order:
BSD 3-Clause License
SPDX-License-Identifier: BSD-3-Clause
* OpenImgageIO Copyright (c) Larry Gritz, et al.
* OpenImageIO Copyright (c) Larry Gritz, et al.
https://github.com/OpenImageIO/oiio
Many bits of code flow back and forth between OIIO and OSL, especially
-200
View File
@@ -1,200 +0,0 @@
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/imageworks/OpenShadingLanguage
clone_depth: 10
version: '{branch}-{build}'
# Disable Appveyor's test discovery which is not used
test: off
branches:
only:
- master
- release
- appveyor
- /RB-/
- /lg-/
skip_tags: true
build:
parallel: true
verbosity: detailed
platform:
- x64
# - x86
configuration:
#- Debug
- Release
environment:
matrix:
- TOOLSET: msvc14
os:
- Visual Studio 2015
cache:
- C:\projects\OSLdeps -> appveyor.yml
# The -> means that the cache dir is discarded if appveyor.yml has changed
before_build:
- ps: |
$OSL_INSTALL_BEGIN=Get-Date
Write-Output "Configuration: $env:CONFIGURATION"
Write-Output "Platform: $env:PLATFORM"
ls C:\Program Files\LLVM
Get-ChildItem Env:
[Array]$OSL_BUILD_FLAGS = "--", "/nologo", "/verbosity:minimal";
$DWN_DIR = "C:\projects\OSLdownloads"
$DEP_DIR = "C:\projects\OSLdeps"
$BOOST_ROOT = "C:\Libraries\boost_1_69_0"
$PYTHON_DIR = "C:\Python27"
$LLVM_DIR = "C:\Program Files\LLVM\bin"
#$LLVM_DIR = "$DEP_DIR"
$env:Path += ";$DEP_DIR\lib;$DEP_DIR\bin"
$OSL_INT_DIR = "build\windows$env:PLATFORM"
# RDP into the build-bot to try some stuff out
# iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
# $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
# Choose the VisualStudio generator
$GENERATOR = switch ($env:TOOLSET)
{
"msvc14" {"Visual Studio 14 2015"}
"msvc12" {"Visual Studio 12 2013"}
"msvc11" {"Visual Studio 11 2012"}
"msvc10" {"Visual Studio 10 2010"}
}
# Final setup based on 64 or 32 bit
if ($env:PLATFORM -eq "x64") {
$GENERATOR = "$GENERATOR Win64"
$PYTHON_DIR = "$PYTHON_DIR-x64"
$BOOST_LIBRARYDIR = "$BOOST_ROOT\lib64-msvc-14.0"
} else {
$BOOST_LIBRARYDIR = "$BOOST_ROOT\lib32-msvc-14.0"
}
# Always create the download directory
md $DWN_DIR -Force | Out-Null;
# If the dependency directory exists/cached, use it
if(!(Test-Path -Path $DEP_DIR )){
md $DEP_DIR -Force | Out-Null; cd $DEP_DIR
md $DEP_DIR\include -Force | Out-Null; cd $DEP_DIR
md $DEP_DIR\lib -Force | Out-Null; cd $DEP_DIR
cd $DWN_DIR
nuget install libtiff-$env:TOOLSET-$env:PLATFORM-master -Version 4.0.6.85 -Source https://ci.appveyor.com/nuget/libtiff-i3h8tqqy7o7b
mv .\libtiff*\*.h $DEP_DIR\include\
mv .\libtiff*\*.lib $DEP_DIR\lib\
mv .\libtiff*\*.dll $DEP_DIR\lib\
nuget install libpng-$env:TOOLSET-$env:PLATFORM-master -Version 1.6.18.44 -Source https://ci.appveyor.com/nuget/libpng-7hwq4pmmrc48
mv .\libpng*\*.h $DEP_DIR\include\
mv .\libpng*\*.lib $DEP_DIR\lib\
mv .\libpng*\*.dll $DEP_DIR\lib\
nuget install libjpeg-$env:TOOLSET-$env:PLATFORM-master -Version 1.4.80.21 -Source https://ci.appveyor.com/nuget/libjpegturbo-o6k4js4y7pjw
mv .\libjpeg*\*.h $DEP_DIR\include\
mv .\libjpeg*\*.lib $DEP_DIR\lib\
mv .\libjpeg*\*.dll $DEP_DIR\lib\
nuget install freetype
mv .\freetype.2.8.0.1\build\native\include\* $DEP_DIR\include\
mv .\freetype.2.8.0.1\build\native\lib\$env:PLATFORM\v140\dynamic\$env:CONFIGURATION\*.lib $DEP_DIR\lib\
mv .\freetype.redist.2.8.0.1\build\native\bin\$env:PLATFORM\v140\dynamic\$env:CONFIGURATION\*.dll $DEP_DIR\lib\
# ZLib
cd $DWN_DIR
Start-FileDownload https://github.com/madler/zlib/archive/v1.2.8.tar.gz
tar -xzf v1.2.8.tar.gz; cd zlib-1.2.8; md "$OSL_INT_DIR" -Force | Out-Null; cd "$OSL_INT_DIR"
cmake ..\.. -G "$GENERATOR" -DCMAKE_CONFIGURATION_TYPES="$env:CONFIGURATION" -DCMAKE_PREFIX_PATH="$DEP_DIR" -DCMAKE_INSTALL_PREFIX="$DEP_DIR"
cmake --build . --config $env:CONFIGURATION --target INSTALL $OSL_BUILD_FLAGS
# IlmBase
cd $DWN_DIR
Start-FileDownload http://download.savannah.nongnu.org/releases/openexr/ilmbase-2.2.1.tar.gz
tar -xzf ilmbase-2.2.1.tar.gz ; cd ilmbase* ; md "$OSL_INT_DIR" -Force | Out-Null; cd "$OSL_INT_DIR"
cmake ..\.. -G "$GENERATOR" -DCMAKE_CONFIGURATION_TYPES="$env:CONFIGURATION" -DCMAKE_PREFIX_PATH="$DEP_DIR" -DCMAKE_INSTALL_PREFIX="$DEP_DIR" -DCMAKE_CXX_FLAGS=" /W1 /EHsc /DWIN32=1 "
cmake --build . --config $env:CONFIGURATION --target INSTALL $OSL_BUILD_FLAGS
# LLVM
# This shouldn't be necessary, we use the pre-installed LLVM
# cd $DWN_DIR
# git clone --depth 10 --branch release_40 https://github.com/llvm-mirror/llvm.git
# cd llvm; md "$OSL_INT_DIR" -Force | Out-Null; cd "$OSL_INT_DIR"
# cmake ..\.. -G "$GENERATOR" -DCMAKE_CONFIGURATION_TYPES="$env:CONFIGURATION" -DCMAKE_PREFIX_PATH="$DEP_DIR" -DCMAKE_INSTALL_PREFIX="$DEP_DIR" -DLLVM_TARGETS_TO_BUILD="X86"
# cmake --build . --config $env:CONFIGURATION --target INSTALL $OSL_BUILD_FLAGS
# OpenEXR
cd $DWN_DIR
Start-FileDownload http://download.savannah.nongnu.org/releases/openexr/openexr-2.2.1.tar.gz
tar -xzf openexr-2.2.1.tar.gz ; cd openexr* ; md "$OSL_INT_DIR" -Force | Out-Null; cd "$OSL_INT_DIR"
cmake ..\.. -G "$GENERATOR" -DCMAKE_CONFIGURATION_TYPES="$env:CONFIGURATION" -DCMAKE_PREFIX_PATH="$DEP_DIR" -DCMAKE_INSTALL_PREFIX="$DEP_DIR" -DILMBASE_PACKAGE_PREFIX="$DEP_DIR" -DCMAKE_CXX_FLAGS=" /W1 /EHsc /DWIN32=1 "
cmake --build . --config $env:CONFIGURATION --target INSTALL $OSL_BUILD_FLAGS
}
# Always do this
cinst winflexbison
build_script:
- ps: |
# OpenImageIO
$env:OpenImageIO_ROOT = "C:\projects\oiio"
$env:FREETYPE_DIR = "$DEP_DIR"
$FREETYPE_LIBRARY = "$DEP_DIR\lib\freetype28.lib"
cd $DWN_DIR
git clone --depth 10 https://github.com/OpenImageIO/oiio.git oiiosrc
cd .\oiiosrc; md "$OSL_INT_DIR" -Force | Out-Null; cd "$OSL_INT_DIR"
cmake ..\.. -G "$GENERATOR" -DCMAKE_CONFIGURATION_TYPES="$env:CONFIGURATION" -DCMAKE_INSTALL_PREFIX="$env:OpenImageIO_ROOT" -DCMAKE_PREFIX_PATH="$DEP_DIR;$BOOST_ROOT" -DBOOST_LIBRARYDIR="$BOOST_LIBRARYDIR" -DFREETYPE_LIBRARY="$FREETYPE_LIBRARY" -DUSE_PYTHON=OFF -DOIIO_BUILD_TESTS=OFF -DUSE_NUKE=OFF
cmake --build . --config $env:CONFIGURATION --target INSTALL $OSL_BUILD_FLAGS
# Build OSL
cd $env:APPVEYOR_BUILD_FOLDER
md "$OSL_INT_DIR" -Force | Out-Null; cd "$OSL_INT_DIR"
cmake ..\.. -G "$GENERATOR" -DCMAKE_CONFIGURATION_TYPES="$env:CONFIGURATION" -DCMAKE_PREFIX_PATH="$env:OpenImageIO_ROOT;$DEP_DIR;$BOOST_ROOT;$LLVM_DIR" -DCMAKE_INSTALL_PREFIX="$DEP_DIR" -DLLVM_DIRECTORY="$LLVM_DIR" -DLLVM_STATIC=ON -DOpenImageIO_ROOT="$env:OpenImageIO_ROOT" -DBOOST_LIBRARYDIR="$BOOST_LIBRARYDIR" -DFLEX_EXECUTABLE="C:\ProgramData\chocolatey\lib\winflexbison\tools\win_flex.exe" -DBISON_EXECUTABLE="C:\ProgramData\chocolatey\lib\winflexbison\tools\win_bison.exe" -DUSE_QT=OFF -DBUILD_SHARED_LIBS=ON -DLINKSTATIC=OFF
# OSL's CMake should probably be handling Windows config better...
$OSL_BUILD_DIR = "$env:APPVEYOR_BUILD_FOLDER\$OSL_INT_DIR"
$env:OSL_ROOT = "$env:APPVEYOR_BUILD_FOLDER\src"
$env:OIIO_LIBRARY_PATH = "$OSL_BUILD_DIR\src\osl.imageio\$env:CONFIGURATION"
$env:Path += ";$OSL_BUILD_DIR\src\oslc\$env:CONFIGURATION"
$env:Path += ";$OSL_BUILD_DIR\src\oslinfo\$env:CONFIGURATION"
$env:Path += ";$OSL_BUILD_DIR\src\liboslcomp\$env:CONFIGURATION"
$env:Path += ";$OSL_BUILD_DIR\src\liboslexec\$env:CONFIGURATION"
$env:Path += ";$OSL_BUILD_DIR\src\liboslnoise\$env:CONFIGURATION"
$env:Path += ";$OSL_BUILD_DIR\src\liboslquery\$env:CONFIGURATION"
$env:Path += ";$env:OpenImageIO_ROOT\lib;$env:OpenImageIO_ROOT\bin"
$env:Path += ";$BOOST_LIBRARYDIR"
cmake --build . --config $env:CONFIGURATION $OSL_BUILD_FLAGS
$OSL_BUILD_END=Get-Date
if(($OSL_BUILD_END-$OSL_INSTALL_BEGIN).TotalMinutes -gt 50) {
# Change to appveyor.yml means the cache needs to be rebuilt leaving
# us with not enough time to run the tests.
echo "OSL tests skipped in favor of uploading dependency cache"
# Echo to build log and Appveyors message page
Add-AppveyorMessage -Message "OSL tests skipped in favor of uploading dependency cache" -Category Warning
} else {
# Test OSL
ctest -C $env:CONFIGURATION --output-on-failure
}
#init:
#- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
#on_failure:
#- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
+14 -35
View File
@@ -1,6 +1,6 @@
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/imageworks/OpenShadingLanguage
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
# SPI-specific settings
ifneq (${VERBOSE},)
@@ -95,7 +95,6 @@ else
$(error Unknown SP_OS=${SP_OS} platform=${platform})
endif # endif ${SP_OS}
PYTHON_VERSION ?= 2.7
MY_CMAKE_FLAGS += -DSP_OS=${SP_OS} -DSP_PLATFORM=${SP_PLATFORM}
MY_CMAKE_FLAGS += -DSP_PROC=${SP_PROC} -DSP_REZ_OS=${SP_REZ_OS}
MY_CMAKE_FLAGS += -DSPI_COMPILER_PLATFORM=${SPI_COMPILER_PLATFORM}
@@ -108,6 +107,7 @@ SPCOMP2_ROOT ?= /shots/spi/home/lib/SpComp2
## Rhel7 (current)
ifeq (${SP_OS}, rhel7)
PYTHON_VERSION ?= 2.7
USE_SIMD ?= sse4.1,aes
CMAKE ?= cmake
USE_NINJA ?= 1
@@ -217,46 +217,25 @@ ifeq (${SP_OS}, rhel7)
#
# Python
#
PYTHON_INCLUDE_DIR ?= /usr/include/python${PYTHON_VERSION}
Python_INCLUDE_DIR ?= /usr/include/python${PYTHON_VERSION}
PYTHON_LIBRARY_DIR ?= /usr/lib64
PYTHON_LIBRARY ?= ${PYTHON_LIBRARY_DIR}/libpython${PYTHON_VERSION}.so
Python_LIBRARY ?= ${PYTHON_LIBRARY_DIR}/libpython${PYTHON_VERSION}.so
ifeq (${PYTHON_VERSION},3.6)
# Special sauce for Python 3.6
PYTHON_INCLUDE_DIR := /usr/include/python${PYTHON_VERSION}m
PYTHON_LIBRARY := ${PYTHON_LIBRARY_DIR}/libpython${PYTHON_VERSION}m.so
MY_CMAKE_FLAGS += \
-DPYTHONINTERP_FOUND=1 \
-DPYTHON_VERSION_STRING=3.6.3 \
-DPYTHON_VERSION_MAJOR=3 \
-DPYTHON_VERSION_MINOR=6 \
-DPYTHON_VERSION_PATCH=3 \
-DPython_ADDITIONAL_VERSIONS="${PYTHON_VERSION}"
Python_INCLUDE_DIR := /usr/include/python${PYTHON_VERSION}m
Python_LIBRARY := ${PYTHON_LIBRARY_DIR}/libpython${PYTHON_VERSION}m.so
else ifeq (${PYTHON_VERSION},3.7)
# Special sauce for Python 3.7
PYTHON_INCLUDE_DIR := /usr/include/python${PYTHON_VERSION}m
PYTHON_LIBRARY := ${PYTHON_LIBRARY_DIR}/libpython${PYTHON_VERSION}m.so
MY_CMAKE_FLAGS += \
-DPYTHONINTERP_FOUND=1 \
-DPYTHON_VERSION_STRING=3.7.3 \
-DPYTHON_VERSION_MAJOR=3 \
-DPYTHON_VERSION_MINOR=7 \
-DPYTHON_VERSION_PATCH=3 \
-DPython_ADDITIONAL_VERSIONS="${PYTHON_VERSION}"
Python_INCLUDE_DIR := /usr/include/python${PYTHON_VERSION}m
Python_LIBRARY := ${PYTHON_LIBRARY_DIR}/libpython${PYTHON_VERSION}m.so
else ifeq (${PYTHON_VERSION},2.7)
# Special sauce for Python 2.7
PYTHON_INCLUDE_DIR := /usr/include/python${PYTHON_VERSION}
PYTHON_LIBRARY := ${PYTHON_LIBRARY_DIR}/libpython${PYTHON_VERSION}.so
MY_CMAKE_FLAGS += \
-DPYTHONINTERP_FOUND=1 \
-DPYTHON_VERSION_STRING=2.7.5 \
-DPYTHON_VERSION_MAJOR=2 \
-DPYTHON_VERSION_MINOR=7 \
-DPYTHON_VERSION_PATCH=5 \
-DPython_ADDITIONAL_VERSIONS="${PYTHON_VERSION}"
Python_INCLUDE_DIR := /usr/include/python${PYTHON_VERSION}
Python_LIBRARY := ${PYTHON_LIBRARY_DIR}/libpython${PYTHON_VERSION}.so
endif
MY_CMAKE_FLAGS += \
-DPYTHON_INCLUDE_DIR:STRING=${PYTHON_INCLUDE_DIR} \
-DPYTHON_LIBRARY:STRING=${PYTHON_LIBRARY} \
-DPython_INCLUDE_DIR:STRING=${Python_INCLUDE_DIR} \
-DPython_LIBRARY:STRING=${Python_LIBRARY} \
-Dpybind11_ROOT:STRING=${REZ_PACKAGE_ROOT}/pybind11/2.4.3/python-${PYTHON_VERSION}
@@ -302,8 +281,8 @@ ifeq (${SP_OS}, rhel7)
# Cuda/OptiX
USE_OPTIX ?= 1
CUDA_VERSION ?= 10.1u2
OPTIX_VERSION ?= 6.0.0
CUDA_VERSION ?= 11.0.1
OPTIX_VERSION ?= 7.1.0
# CUDA_TOOLKIT_ROOT_DIR = $(shell rez-env -b cuda-${CUDA_VERSION} ${SPI_COMPILER_PLATFORM} -c "echo '$CUDA_TOOLKIT_ROOT'")
CUDA_TOOLKIT_ROOT_DIR ?= /shots/spi/home/lib/arnold/rhel7/cuda_${CUDA_VERSION}
CUDA_EXTRA_LIBS ?= ${CUDA_TOOLKIT_ROOT_DIR}/lib64/libnvrtc.so
+1 -1
View File
@@ -1,6 +1,6 @@
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/imageworks/OpenShadingLanguage
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
option (${PROJ_NAME}_SPIREZ "Enable extra bits for building for SPI Rez install" OFF)
set (${PROJ_NAME}_REZ_PACKAGE_NAME CACHE STRING "${PROJECT_NAME}")
+1 -1
View File
@@ -2,7 +2,7 @@
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/imageworks/OpenShadingLanguage
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
# This helper script takes a major.minor.patch semantic version string
# ("2.1.1") and reformats it into the dot-less zero-padded version like
+1 -1
View File
@@ -1,6 +1,6 @@
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/imageworks/OpenShadingLanguage
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
cmake_minimum_required(VERSION 2.8)
+1 -1
View File
@@ -2,7 +2,7 @@
#
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/imageworks/OpenShadingLanguage
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
#
# Documentation on packages and available attributes can be found at:
# https://github.com/nerdvegas/rez/wiki/Package-Definition-Guide
+19 -4
View File
@@ -1,10 +1,10 @@
#!/bin/bash
#!/usr/bin/env bash
# Utility script to download and build cmake
#
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/imageworks/OpenShadingLanguage
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
# Exit the whole script if any command fails.
set -ex
@@ -16,10 +16,25 @@ CMAKE_VERSION=${CMAKE_VERSION:=3.12.4}
LOCAL_DEPS_DIR=${LOCAL_DEPS_DIR:=${PWD}/ext}
CMAKE_INSTALL_DIR=${CMAKE_INSTALL_DIR:=${LOCAL_DEPS_DIR}/cmake}
if [[ `uname` == "Linux" ]] ; then
mkdir -p ${CMAKE_INSTALL_DIR} && true
if [[ `uname` == "Linux" && `uname -m` == "x86_64" ]] ; then
mkdir -p ${CMAKE_INSTALL_DIR} || true
curl --location "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-Linux-x86_64.sh" -o "cmake.sh"
sh cmake.sh --skip-license --prefix=${CMAKE_INSTALL_DIR}
export PATH=${CMAKE_INSTALL_DIR}/bin:$PATH
fi
if [[ `uname` == "Linux" && `uname -m` == "aarch64" ]] ; then
mkdir -p ${CMAKE_INSTALL_DIR} || true
curl --location https://anaconda.org/conda-forge/cmake/3.17.0/download/linux-aarch64/cmake-3.17.0-h28c56e5_0.tar.bz2 -o cmake-3.17.0-h28c56e5_0.tar.bz2
tar -xjf cmake-3.17.0-h28c56e5_0.tar.bz2 -C ${CMAKE_INSTALL_DIR}
export PATH=${CMAKE_INSTALL_DIR}/bin:$PATH
# In case we ever need to build from scratch:
# curl --location "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}.tar.gz" -o cmake.tar.gz
# tar xzf cmake.tar.gz
# pushd cmake-${CMAKE_VERSION}
# CXX="ccache $CXX" ./bootstrap --parallel=${PARALLEL:=4} --enable-ccache
# CXX="ccache $CXX" timeout 2100 time make ${PAR_MAKEFAGS} || true
# export PATH=${CMAKE_INSTALL_DIR}/bin:$PWD/bin:$PATH
# popd
fi
+4 -4
View File
@@ -1,10 +1,10 @@
#!/bin/bash
#!/usr/bin/env bash
# Utility script to download and build LLVM & clang
#
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/imageworks/OpenShadingLanguage
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
# Exit the whole script if any command fails.
set -ex
@@ -29,7 +29,7 @@ if [[ `uname` == "Linux" ]] ; then
fi
LLVMTAR=clang+llvm-${LLVM_VERSION}-x86_64-linux-gnu-${LLVM_DISTRO_NAME}.tar.xz
echo LLVMTAR = $LLVMTAR
if [ "$LLVM_VERSION" == "10.0.0" ] ; then
if [[ "$LLVM_VERSION" == "10.0.0" ]] || [[ "$LLVM_VERSION" == "11.0.0" ]] || [[ "$LLVM_VERSION" == "11.1.0" ]] || [[ "$LLVM_VERSION" == "12.0.0" ]] ; then
# new
curl --location https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/${LLVMTAR} -o $LLVMTAR
else
@@ -43,5 +43,5 @@ if [[ `uname` == "Linux" ]] ; then
mv clang+llvm*/* $LLVM_INSTALL_DIR
export LLVM_DIRECTORY=$LLVM_INSTALL_DIR
export PATH=${LLVM_INSTALL_DIR}/bin:$PATH
ls -a $LLVM_DIRECTORY
# ls -a $LLVM_DIRECTORY
fi
+63
View File
@@ -0,0 +1,63 @@
#!/usr/bin/env bash
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
# Utility script to download and build OpenColorIO
# Exit the whole script if any command fails.
set -ex
# Which OCIO to retrieve, how to build it
OPENCOLORIO_REPO=${OPENCOLORIO_REPO:=https://github.com/AcademySoftwareFoundation/OpenColorIO.git}
OPENCOLORIO_VERSION=${OPENCOLORIO_VERSION:=v1.1.1}
# Where to install the final results
LOCAL_DEPS_DIR=${LOCAL_DEPS_DIR:=${PWD}/ext}
OPENCOLORIO_SOURCE_DIR=${OPENCOLORIO_BUILD_DIR:=${LOCAL_DEPS_DIR}/OpenColorIO}
OPENCOLORIO_BUILD_DIR=${OPENCOLORIO_BUILD_DIR:=${LOCAL_DEPS_DIR}/OpenColorIO-build}
OPENCOLORIO_INSTALL_DIR=${OPENCOLORIO_INSTALL_DIR:=${LOCAL_DEPS_DIR}/dist}
OPENCOLORIO_CXX_FLAGS=${OPENCOLORIO_CXX_FLAGS:="-Wno-unused-function -Wno-deprecated-declarations -Wno-cast-qual -Wno-write-strings"}
# Just need libs:
OPENCOLORIO_BUILDOPTS="-DOCIO_BUILD_APPS=OFF -DOCIO_BUILD_NUKE=OFF \
-DOCIO_BUILD_DOCS=OFF -DOCIO_BUILD_TESTS=OFF \
-DOCIO_BUILD_GPU_TESTS=OFF \
-DOCIO_BUILD_PYTHON=OFF -DOCIO_BUILD_PYGLUE=OFF \
-DOCIO_BUILD_JAVA=OFF \
-DOCIO_BUILD_STATIC=${OCIO_BUILD_STATIC:=OFF}"
BASEDIR=`pwd`
pwd
echo "OpenColorIO install dir will be: ${OPENCOLORIO_INSTALL_DIR}"
mkdir -p ${LOCAL_DEPS_DIR}
pushd ${LOCAL_DEPS_DIR}
# Clone OpenColorIO project from GitHub and build
if [[ ! -e OpenColorIO ]] ; then
echo "git clone ${OPENCOLORIO_REPO} OpenColorIO"
git clone ${OPENCOLORIO_REPO} OpenColorIO
fi
cd OpenColorIO
echo "git checkout ${OPENCOLORIO_VERSION} --force"
git checkout ${OPENCOLORIO_VERSION} --force
mkdir -p build
cd build
time cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${OPENCOLORIO_INSTALL_DIR} \
-DCMAKE_CXX_FLAGS="${OPENCOLORIO_CXX_FLAGS}" \
${OPENCOLORIO_BUILDOPTS} ..
time cmake --build . --config Release --target install
popd
# ls -R ${OPENCOLORIO_INSTALL_DIR}
#echo "listing .."
#ls ..
# Set up paths. These will only affect the caller if this script is
# run with 'source' rather than in a separate shell.
export OpenColorIO_ROOT=$OPENCOLORIO_INSTALL_DIR
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${OPENCOLORIO_INSTALL_DIR}/lib
+18 -15
View File
@@ -1,10 +1,10 @@
#!/bin/bash
#!/usr/bin/env bash
# Utility script to download and build OpenEXR & IlmBase
#
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/imageworks/OpenShadingLanguage
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
# Exit the whole script if any command fails.
@@ -12,14 +12,13 @@ set -ex
# Which OpenEXR to retrieve, how to build it
OPENEXR_REPO=${OPENEXR_REPO:=https://github.com/openexr/openexr.git}
OPENEXR_VERSION=${OPENEXR_VERSION:=2.4.0}
OPENEXR_BRANCH=${OPENEXR_BRANCH:=v${OPENEXR_VERSION}}
OPENEXR_VERSION=${OPENEXR_VERSION:=v2.4.1}
# Where to install the final results
LOCAL_DEPS_DIR=${LOCAL_DEPS_DIR:=${PWD}/ext}
OPENEXR_SOURCE_DIR=${OPENEXR_SOURCE_DIR:=${LOCAL_DEPS_DIR}/openexr}
OPENEXR_BUILD_DIR=${OPENEXR_BUILD_DIR:=${LOCAL_DEPS_DIR}/openexr-build}
OPENEXR_INSTALL_DIR=${OPENEXR_INSTALL_DIR:=${LOCAL_DEPS_DIR}/openexr-install}
OPENEXR_INSTALL_DIR=${OPENEXR_INSTALL_DIR:=${LOCAL_DEPS_DIR}/dist}
OPENEXR_BUILD_TYPE=${OPENEXR_BUILD_TYPE:=Release}
CMAKE_GENERATOR=${CMAKE_GENERATOR:="Unix Makefiles"}
OPENEXR_CMAKE_FLAGS=${OPENEXR_CMAKE_FLAGS:=""}
@@ -27,9 +26,9 @@ OPENEXR_CXX_FLAGS=${OPENEXR_CXX_FLAGS:=""}
BASEDIR=$PWD
pwd
echo "Building OpenEXR ${OPENEXR_BRANCH}"
echo "EXR build dir will be: ${OPENEXR_BUILD_DIR}"
echo "EXR install dir will be: ${OPENEXR_INSTALL_DIR}"
echo "Building OpenEXR ${OPENEXR_VERSION}"
echo "OpenEXR build dir will be: ${OPENEXR_BUILD_DIR}"
echo "OpenEXR install dir will be: ${OPENEXR_INSTALL_DIR}"
echo "CMAKE_PREFIX_PATH is ${CMAKE_PREFIX_PATH}"
echo "OpenEXR Build type is ${OPENEXR_BUILD_TYPE}"
@@ -47,19 +46,21 @@ mkdir -p ${OPENEXR_INSTALL_DIR} && true
mkdir -p ${OPENEXR_BUILD_DIR} && true
pushd ${OPENEXR_SOURCE_DIR}
git checkout ${OPENEXR_BRANCH} --force
git checkout ${OPENEXR_VERSION} --force
if [[ ${OPENEXR_BRANCH} == "v2.2.0" ]] || [[ ${OPENEXR_BRANCH} == "v2.2.1" ]] ; then
if [[ ${OPENEXR_VERSION} == "v2.2.0" ]] || [[ ${OPENEXR_VERSION} == "v2.2.1" ]] \
|| [[ ${OPENEXR_VERSION} == "v2.2.2" ]] ; then
mkdir -p ${OPENEXR_BUILD_DIR}/IlmBase && true
mkdir -p ${OPENEXR_BUILD_DIR}/OpenEXR && true
cd ${OPENEXR_BUILD_DIR}/IlmBase
cmake --config ${OPENEXR_BUILD_TYPE} ${OPENEXR_GENERATOR_CMD} \
cmake -DCMAKE_BUILD_TYPE=${OPENEXR_BUILD_TYPE} ${OPENEXR_GENERATOR_CMD} \
-DCMAKE_INSTALL_PREFIX="${OPENEXR_INSTALL_DIR}" \
-DCMAKE_CXX_FLAGS="${OPENEXR_CXX_FLAGS}" \
-DCMAKE_CXX_STANDARD=11 \
${OPENEXR_CMAKE_FLAGS} ${OPENEXR_SOURCE_DIR}/IlmBase
time cmake --build . --target install --config ${OPENEXR_BUILD_TYPE}
cd ${OPENEXR_BUILD_DIR}/OpenEXR
cmake --config ${OPENEXR_BUILD_TYPE} ${OPENEXR_GENERATOR_CMD} \
cmake -DCMAKE_BUILD_TYPE=${OPENEXR_BUILD_TYPE} ${OPENEXR_GENERATOR_CMD} \
-DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}\;${OPENEXR_INSTALL_DIR}" \
-DCMAKE_INSTALL_PREFIX="${OPENEXR_INSTALL_DIR}" \
-DILMBASE_PACKAGE_PREFIX="${OPENEXR_INSTALL_DIR}" \
@@ -67,10 +68,10 @@ if [[ ${OPENEXR_BRANCH} == "v2.2.0" ]] || [[ ${OPENEXR_BRANCH} == "v2.2.1" ]] ;
-DCMAKE_CXX_FLAGS="${OPENEXR_CXX_FLAGS}" \
${OPENEXR_CMAKE_FLAGS} ${OPENEXR_SOURCE_DIR}/OpenEXR
time cmake --build . --target install --config ${OPENEXR_BUILD_TYPE}
elif [[ ${OPENEXR_BRANCH} == "v2.3.0" ]] ; then
elif [[ ${OPENEXR_VERSION} == "v2.3.0" ]] ; then
# Simplified setup for 2.3+
cd ${OPENEXR_BUILD_DIR}
cmake --config ${OPENEXR_BUILD_TYPE} -G "$CMAKE_GENERATOR" \
cmake -DCMAKE_BUILD_TYPE=${OPENEXR_BUILD_TYPE} -G "$CMAKE_GENERATOR" \
-DCMAKE_INSTALL_PREFIX="${OPENEXR_INSTALL_DIR}" \
-DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" \
-DILMBASE_PACKAGE_PREFIX="${OPENEXR_INSTALL_DIR}" \
@@ -83,7 +84,7 @@ elif [[ ${OPENEXR_BRANCH} == "v2.3.0" ]] ; then
else
# Simplified setup for 2.4+
cd ${OPENEXR_BUILD_DIR}
cmake --config ${OPENEXR_BUILD_TYPE} -G "$CMAKE_GENERATOR" \
cmake -DCMAKE_BUILD_TYPE=${OPENEXR_BUILD_TYPE} -G "$CMAKE_GENERATOR" \
-DCMAKE_INSTALL_PREFIX="${OPENEXR_INSTALL_DIR}" \
-DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" \
-DILMBASE_PACKAGE_PREFIX="${OPENEXR_INSTALL_DIR}" \
@@ -91,6 +92,8 @@ else
-DBUILD_TESTING=0 \
-DPYILMBASE_ENABLE=0 \
-DOPENEXR_VIEWERS_ENABLE=0 \
-DINSTALL_OPENEXR_EXAMPLES=0 \
-DOPENEXR_INSTALL_EXAMPLES=0 \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_CXX_FLAGS="${OPENEXR_CXX_FLAGS}" \
${OPENEXR_CMAKE_FLAGS} ${OPENEXR_SOURCE_DIR}
+8 -4
View File
@@ -1,16 +1,20 @@
#!/bin/bash
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
# Install OpenImageIO
# Exit the whole script if any command fails.
set -ex
OPENIMAGEIO_REPO=${OPENIMAGEIO_REPO:=OpenImageIO/oiio}
OPENIMAGEIO_BRANCH=${OPENIMAGEIO_BRANCH:=master}
OPENIMAGEIO_VERSION=${OPENIMAGEIO_VERSION:=master}
LOCAL_DEPS_DIR=${LOCAL_DEPS_DIR:=${PWD}/ext}
OPENIMAGEIO_SRCDIR=${OPENIMAGEIO_SRCDIR:=${LOCAL_DEPS_DIR}/OpenImageIO}
OPENIMAGEIO_BUILD_DIR=${OPENIMAGEIO_BUILD_DIR:=${OPENIMAGEIO_SRCDIR}/build/$PLATFORM}
OPENIMAGEIO_INSTALLDIR=${OPENIMAGEIO_INSTALLDIR:=$OPENIMAGEIO_SRCDIR/dist/$PLATFORM}
OPENIMAGEIO_INSTALLDIR=${OPENIMAGEIO_INSTALLDIR:=${LOCAL_DEPS_DIR}/dist}
OPENIMAGEIO_CMAKE_FLAGS=${OPENIMAGEIO_CMAKE_FLAGS:=""}
OPENIMAGEIO_BUILD_TYPE=${OPENIMAGEIO_BUILD_TYPE:=Release}
OPENIMAGEIO_CXXFLAGS=${OPENIMAGEIO_CXXFLAGS:=""}
@@ -27,7 +31,7 @@ mkdir -p ${OPENIMAGEIO_BUILD_DIR} && true
pushd $OPENIMAGEIO_SRCDIR
git fetch --all -p
git checkout $OPENIMAGEIO_BRANCH --force
git checkout $OPENIMAGEIO_VERSION --force
if [[ "$USE_SIMD" != "" ]] ; then
OPENIMAGEIO_CMAKE_FLAGS="$OPENIMAGEIO_CMAKE_FLAGS -DUSE_SIMD=$USE_SIMD"
@@ -60,4 +64,4 @@ export PYTHONPATH=$OpenImageIO_ROOT/lib/python${PYTHON_VERSION}/site-packages:$P
echo "DYLD_LIBRARY_PATH = $DYLD_LIBRARY_PATH"
echo "LD_LIBRARY_PATH = $LD_LIBRARY_PATH"
echo "OpenImageIO_ROOT $OpenImageIO_ROOT"
ls -R $OpenImageIO_ROOT
# ls -R $OpenImageIO_ROOT
+10 -10
View File
@@ -4,22 +4,22 @@
#
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/imageworks/OpenShadingLanguage
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
# Exit the whole script if any command fails.
set -ex
# Repo and branch/tag/commit of pugixml to download if we don't have it yet
PUGIXML_REPO=${PUGIXML_REPO:=https://github.com/zeux/pugixml.git}
PUGIXML_VERSION=${PUGIXML_VERSION:=1.10}
PUGIXML_BRANCH=${PUGIXML_BRANCH:=v${PUGIXML_VERSION}}
PUGIXML_VERSION=${PUGIXML_VERSION:=v1.10}
# Where to put pugixml repo source (default to the ext area)
PUGIXML_SRC_DIR=${PUGIXML_SRC_DIR:=${PWD}/ext/pugixml}
# Temp build area (default to a build/ subdir under source)
PUGIXML_BUILD_DIR=${PUGIXML_BUILD_DIR:=${PUGIXML_SRC_DIR}/build}
# Install area for pugixml (default to ext/dist)
PUGIXML_INSTALL_DIR=${PUGIXML_INSTALL_DIR:=${PWD}/ext/dist}
LOCAL_DEPS_DIR=${LOCAL_DEPS_DIR:=${PWD}/ext}
PUGIXML_INSTALL_DIR=${PUGIXML_INSTALL_DIR:=${LOCAL_DEPS_DIR}/dist}
#PUGIXML_BUILD_OPTS=${PUGIXML_BUILD_OPTS:=}
pwd
@@ -34,19 +34,19 @@ if [[ ! -e ${PUGIXML_SRC_DIR} ]] ; then
git clone ${PUGIXML_REPO} ${PUGIXML_SRC_DIR}
fi
cd ${PUGIXML_SRC_DIR}
echo "git checkout ${PUGIXML_BRANCH} --force"
git checkout ${PUGIXML_BRANCH} --force
echo "git checkout ${PUGIXML_VERSION} --force"
git checkout ${PUGIXML_VERSION} --force
mkdir -p ${PUGIXML_BUILD_DIR}
cd ${PUGIXML_BUILD_DIR}
time cmake --config Release \
-DCMAKE_BUILD_TYPE=Release \
time cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${PUGIXML_INSTALL_DIR} \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_TESTS=OFF \
${PUGIXML_BUILD_OPTS} ..
time cmake --build . --config Release --target install
ls -R ${PUGIXML_INSTALL_DIR}
# ls -R ${PUGIXML_INSTALL_DIR}
popd
#echo "listing .."
@@ -55,4 +55,4 @@ popd
# Set up paths. These will only affect the caller if this script is
# run with 'source' rather than in a separate shell.
export pugixml_ROOT=$PUGIXML_INSTALL_DIR
export LD_LIBRARY_PATH=$pugixml_ROOT/lib:$pugixml_ROOT/lib64:$LD_LIBRARY_PATH
+7 -8
View File
@@ -4,15 +4,14 @@
#
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/imageworks/OpenShadingLanguage
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
# Exit the whole script if any command fails.
set -ex
# Repo and branch/tag/commit of pybind11 to download if we don't have it yet
PYBIND11_REPO=${PYBIND11_REPO:=https://github.com/pybind/pybind11.git}
PYBIND11_VERSION=${PYBIND11_VERSION:=2.4.3}
PYBIND11_BRANCH=${PYBIND11_BRANCH:=v${PYBIND11_VERSION}}
PYBIND11_VERSION=${PYBIND11_VERSION:=v2.4.3}
# Where to put pybind11 repo source (default to the ext area)
PYBIND11_SRC_DIR=${PYBIND11_SRC_DIR:=${PWD}/ext/pybind11}
@@ -21,7 +20,7 @@ PYBIND11_BUILD_DIR=${PYBIND11_BUILD_DIR:=${PYBIND11_SRC_DIR}/build}
# Install area for pybind11 (default to ext/dist)
LOCAL_DEPS_DIR=${LOCAL_DEPS_DIR:=${PWD}/ext}
PYBIND11_INSTALL_DIR=${PYBIND11_INSTALL_DIR:=${LOCAL_DEPS_DIR}/dist}
#PYBIND11_BUILD_OPTS=${PYBIND11_BUILD_OPTS:=}
PYBIND11_BUILD_OPTS=${PYBIND11_BUILD_OPTS:=}
if [[ "${PYTHON_VERSION}" != "" ]] ; then
PYBIND11_BUILD_OPTS+=" -DPYBIND11_PYTHON_VERSION=${PYTHON_VERSION}"
@@ -39,18 +38,18 @@ if [[ ! -e ${PYBIND11_SRC_DIR} ]] ; then
git clone ${PYBIND11_REPO} ${PYBIND11_SRC_DIR}
fi
cd ${PYBIND11_SRC_DIR}
echo "git checkout ${PYBIND11_BRANCH} --force"
git checkout ${PYBIND11_BRANCH} --force
echo "git checkout ${PYBIND11_VERSION} --force"
git checkout ${PYBIND11_VERSION} --force
mkdir -p ${PYBIND11_BUILD_DIR}
cd ${PYBIND11_BUILD_DIR}
time cmake --config Release \
time cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=${PYBIND11_INSTALL_DIR} \
-DPYBIND11_TEST=OFF \
${PYBIND11_BUILD_OPTS} ..
time cmake --build . --config Release --target install
ls -R ${PYBIND11_INSTALL_DIR}
# ls -R ${PYBIND11_INSTALL_DIR}
popd
#echo "listing .."
@@ -2,27 +2,14 @@
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/imageworks/OpenShadingLanguage
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
# Important: set -ex causes this whole script to terminate with error if
# any command in it fails. This is crucial for CI tests.
set -ex
# This script is run when CI system first starts up.
# It expects that ci-setenv.bash was run first, so $PLATFORM and $ARCH
# have been set.
if [[ -e src/build-scripts/ci-setenv.bash ]] ; then
source src/build-scripts/ci-setenv.bash
fi
mkdir -p build/$PLATFORM dist/$PLATFORM && true
if [[ "$USE_SIMD" != "" ]] ; then
MY_CMAKE_FLAGS="$MY_CMAKE_FLAGS -DUSE_SIMD=$USE_SIMD"
fi
if [[ "$DEBUG" == "1" ]] ; then
MY_CMAKE_FLAGS="$MY_CMAKE_FLAGS -DCMAKE_BUILD_TYPE=Debug"
OSL_CMAKE_FLAGS="$OSL_CMAKE_FLAGS -DUSE_SIMD=$USE_SIMD"
fi
pushd build/$PLATFORM
@@ -30,21 +17,20 @@ cmake ../.. -G "$CMAKE_GENERATOR" \
-DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" \
-DCMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH" \
-DCMAKE_INSTALL_PREFIX="$OSL_ROOT" \
-DUSE_PYTHON="${USE_PYTHON}" \
-DUSE_PYTHON="${USE_PYTHON:=1}" \
-DPYTHON_VERSION="$PYTHON_VERSION" \
-DCMAKE_INSTALL_LIBDIR="$OSL_ROOT/lib" \
-DCMAKE_CXX_STANDARD="$CMAKE_CXX_STANDARD" \
$MY_CMAKE_FLAGS -DVERBOSE=1
$OSL_CMAKE_FLAGS -DVERBOSE=1
time cmake --build . --target ${BUILDTARGET:=install} --config ${CMAKE_BUILD_TYPE}
popd
#make $MAKEFLAGS VERBOSE=1 $BUILD_FLAGS config
#make $MAKEFLAGS $PAR_MAKEFLAGS $BUILD_FLAGS $BUILDTARGET
if [[ "$SKIP_TESTS" == "" ]] ; then
$OSL_ROOT/bin/testshade --help
export OIIO_LIBRARY_PATH=$OSL_ROOT/lib:$OIIO_LIBRARY_PATH
TESTSUITE_CLEANUP_ON_SUCCESS=1
make $BUILD_FLAGS test
if [[ "${DEBUG_CI:=0}" != "0" ]] ; then
echo "PATH=$PATH"
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
echo "PYTHONPATH=$PYTHONPATH"
echo "ldd testshade"
ldd $OSL_ROOT/bin/testshade
fi
if [[ "$BUILDTARGET" == clang-format ]] ; then
@@ -55,7 +41,3 @@ if [[ "$BUILDTARGET" == clang-format ]] ; then
exit 1
fi
fi
#if [[ "$CODECOV" == 1 ]] ; then
# bash <(curl -s https://codecov.io/bash)
#fi
+44 -25
View File
@@ -2,25 +2,28 @@
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/imageworks/OpenShadingLanguage
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
# This script is run when CI system first starts up.
# Since it sets many env variables needed by the caller, it should be run
# with 'source', not in a separate shell.
# Figure out the platform
if [[ $TRAVIS_OS_NAME == osx || $RUNNER_OS == macOS ]] ; then
export ARCH=macosx
fi
if [[ $TRAVIS_OS_NAME == linux || $RUNNER_OS == Linux || $CIRCLECI == true ]] ; then
export ARCH=linux64
fi
if [[ $RUNNER_OS == Windows ]] ; then
export ARCH=windows64
if [[ $RUNNER_OS == macOS ]] ; then
export ARCH=macosx
elif [[ $RUNNER_OS == Linux ]] ; then
export ARCH=linux64
elif [[ $RUNNER_OS == Windows ]] ; then
export ARCH=windows64
elif [[ `uname -m` == aarch64 ]] ; then
export ARCH=aarch64
else
export ARCH=unknown
exit -1
fi
export PLATFORM=$ARCH
if [[ "$DEBUG" == 1 ]] ; then
if [[ "${DEBUG:=0}" != "0" ]] ; then
export PLATFORM=${PLATFORM}.debug
fi
@@ -28,8 +31,15 @@ echo "Architecture is $ARCH"
echo "Build platform name is $PLATFORM"
# Environment variables we always need
export USE_CCACHE=1
export PATH=/usr/local/bin/_ccache:/usr/lib/ccache:$PATH
export USE_CCACHE=${USE_CCACHE:=1}
export CCACHE_CPP2=1
export CCACHE_DIR=/tmp/ccache
if [[ "${RUNNER_OS}" == "macOS" ]] ; then
export CCACHE_DIR=$HOME/.ccache
fi
mkdir -p $CCACHE_DIR
export OSL_ROOT=$PWD/dist/$PLATFORM
export DYLD_LIBRARY_PATH=$OSL_ROOT/lib:$DYLD_LIBRARY_PATH
export LD_LIBRARY_PATH=$OSL_ROOT/lib:$LD_LIBRARY_PATH
@@ -46,33 +56,42 @@ export BUILD_MISSING_DEPS=${BUILD_MISSING_DEPS:=1}
export COMPILER=${COMPILER:=gcc}
export CXX=${CXX:=g++}
export CI=true
export USE_NINJA=1
export USE_NINJA=${USE_NINJA:=1}
export CMAKE_GENERATOR=${CMAKE_GENERATOR:=Ninja}
export CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:=Release}
export CMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD:=11}
if [[ $TRAVIS == true ]] ; then
export PARALLEL=2
elif [[ $CIRCLECI == true ]] ; then
export PARALLEL=4
elif [[ $GITHUB_ACTIONS == true ]] ; then
export PARALLEL=4
fi
export PARALLEL=${PARALLEL:=4}
export PAR_MAKEFLAGS=-j${PARALLEL}
export CMAKE_BUILD_PARALLEL_LEVEL=${PARALLEL}
export CTEST_PARALLEL_LEVEL=${PARALLEL}
export CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL:=${PARALLEL}}
export CTEST_PARALLEL_LEVEL=${CTEST_PARALLEL_LEVEL:=${PARALLEL}}
export LOCAL_DEPS_DIR=${LOCAL_DEPS_DIR:=$HOME/ext}
export CMAKE_PREFIX_PATH=${LOCAL_DEPS_DIR}:${CMAKE_PREFIX_PATH}
export CMAKE_PREFIX_PATH=${LOCAL_DEPS_DIR}/dist:${CMAKE_PREFIX_PATH}
export LD_LIBRARY_PATH=${LOCAL_DEPS_DIR}/dist/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=${LOCAL_DEPS_DIR}/dist/lib64:$LD_LIBRARY_PATH
export DYLD_LIBRARY_PATH=${LOCAL_DEPS_DIR}/dist/lib:$DYLD_LIBRARY_PATH
uname -a
uname -n
export TESTSUITE_CLEANUP_ON_SUCCESS=${TESTSUITE_CLEANUP_ON_SUCCESS:=1}
mkdir -p build/$PLATFORM dist/$PLATFORM
echo "HOME = $HOME"
echo "PWD = $PWD"
echo "LOCAL_DEPS_DIR = $LOCAL_DEPS_DIR"
echo "uname -a: " `uname -a`
echo "uname -m: " `uname -m`
echo "uname -s: " `uname -s`
echo "uname -n: " `uname -n`
pwd
ls
env | sort
if [[ $ARCH == linux64 ]] ; then
if [[ `uname -s` == "Linux" ]] ; then
head -40 /proc/cpuinfo
elif [[ $ARCH == macosx ]] ; then
sysctl machdep.cpu.features
fi
# Save the env for use by other stages
src/build-scripts/save-env.bash
+22
View File
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
# Important: set -ex causes this whole script to terminate with error if
# any command in it fails. This is crucial for CI tests.
set -ex
$OSL_ROOT/bin/testshade --help
echo "Parallel test " ${CTEST_PARALLEL_LEVEL}
pushd build/$PLATFORM
time ctest -C ${CMAKE_BUILD_TYPE} -E broken --force-new-ctest-process \
--output-on-failure --timeout ${CTEST_TEST_TIMEOUT:=180} ${CTEST_ARGS}
popd
# if [[ "$CODECOV" == 1 ]] ; then
# bash <(curl -s https://codecov.io/bash)
# fi
+2 -2
View File
@@ -1,9 +1,9 @@
#!/usr/bin/env python3
#!/usr/bin/env python
from __future__ import print_function, absolute_import
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/imageworks/OpenShadingLanguage
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
# ----------------------------------------------------------------------
@@ -1,60 +0,0 @@
#!/usr/bin/env bash
#
set -ex
echo "Which g++ " `which g++`
g++ --version && true
ls /usr/bin/g++* && true
/usr/bin/g++ --version && true
export PATH=/opt/rh/devtoolset-6/root/usr/bin:/usr/local/bin:$PATH
#ls /opt/rh/devtoolset-6/root/usr/bin && true
#ls /usr/local/bin
ls /etc/yum.repos.d
#sudo yum install -y giflib giflib-devel && true
sudo yum install -y Field3D Field3D-devel && true
#sudo rpm -v --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro && true
#sudo rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm && true
#sudo yum install -y ffmpeg ffmpeg-devel && true
if [[ "$LLVM_BRANCH" != "" || "$LLVM_VERSION" != "" ]] ; then
source src/build-scripts/build_llvm.bash
fi
# Build or download LLVM
#source src/build-scripts/build_llvm.bash
source src/build-scripts/build_pybind11.bash
CXXFLAGS=-fPIC src/build-scripts/build_pugixml.bash
# Only build OpenEXR if a specific version is requested
if [[ "$OPENEXR_BRANCH" != "" || "$OPENEXR_VERSION" != "" ]] ; then
source src/build-scripts/build_openexr.bash
fi
# Only build OpenColorIO if a specific version is requested
if [[ "$OCIO_BRANCH" != "" || "$OCIO_VERSION" != "" ]] ; then
# Temporary (?) fix: GH ninja having problems, fall back to make
CMAKE_GENERATOR="Unix Makefiles" \
source src/build-scripts/build_ocio.bash
fi
# Only build OpenImageIO if a specific version is requested
if [[ "$OPENIMAGEIO_BRANCH" != "" || "$OPENIMAGEIO_VERSION" != "" ]] ; then
# There are many parts of OIIO we don't need to build
export ENABLE_iinfo=0 ENABLE_iv=0 ENABLE_igrep=0 ENABLE_iconvert=0 ENABLE_testtex=0
export ENABLE_cineon=0 ENABLE_DDS=0 ENABLE_DPX=0 ENABLE_FITS=0
export ENABLE_iff=0 ENABLE_jpeg2000=0 ENABLE_PNM=0 ENABLE_PSD=0
export ENABLE_RLA=0 ENABLE_SGI=0 ENABLE_SOCKET=0 ENABLE_SOFTIMAGE=0
export ENABLE_TARGA=0 ENABLE_WEBP=0
export OPENIMAGEIO_MAKEFLAGS="OIIO_BUILD_TESTS=0 USE_OPENGL=0"
source src/build-scripts/build_openimageio.bash
fi
+93 -57
View File
@@ -2,79 +2,115 @@
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/imageworks/OpenShadingLanguage
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
set -ex
#dpkg --list
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
time sudo apt-get update
#
# Install system packages when those are acceptable for dependencies.
#
if [[ "$ASWF_ORG" != "" ]] ; then
# Using ASWF CentOS container
time sudo apt-get -q install -y \
git \
cmake \
ninja-build \
g++ \
ccache \
libboost-dev libboost-thread-dev \
libboost-filesystem-dev libboost-regex-dev \
libtiff-dev \
libilmbase-dev libopenexr-dev \
python-dev python-numpy \
libgif-dev \
libpng-dev \
flex bison libbison-dev \
opencolorio-tools \
libsquish-dev \
libpugixml-dev \
qt5-default
export PATH=/opt/rh/devtoolset-6/root/usr/bin:/usr/local/bin:$PATH
#ls /etc/yum.repos.d
sudo yum install -y giflib giflib-devel && true
sudo yum install -y opencv opencv-devel && true
sudo yum install -y Field3D Field3D-devel && true
sudo yum install -y ffmpeg ffmpeg-devel && true
export CMAKE_PREFIX_PATH=/usr/lib/x86_64-linux-gnu:$CMAKE_PREFIX_PATH
else
# Using native Ubuntu runner
if [[ "$CXX" == "g++-4.8" ]] ; then
time sudo apt-get install -y g++-4.8
elif [[ "$CXX" == "g++-6" ]] ; then
time sudo apt-get install -y g++-6
elif [[ "$CXX" == "g++-7" ]] ; then
time sudo apt-get install -y g++-7
elif [[ "$CXX" == "g++-8" ]] ; then
time sudo apt-get install -y g++-8
elif [[ "$CXX" == "g++-9" ]] ; then
time sudo apt-get install -y g++-9
elif [[ "$CXX" == "g++-10" ]] ; then
time sudo apt-get install -y g++-10
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
time sudo apt-get update
time sudo apt-get -q install -y \
git cmake ninja-build ccache g++ \
libboost-dev libboost-thread-dev \
libboost-filesystem-dev libboost-regex-dev \
libilmbase-dev libopenexr-dev \
python-dev python-numpy \
libtiff-dev libgif-dev libpng-dev \
flex bison libbison-dev \
libpugixml-dev \
libopencolorio-dev \
qt5-default
export CMAKE_PREFIX_PATH=/usr/lib/x86_64-linux-gnu:$CMAKE_PREFIX_PATH
if [[ "$CXX" == "g++-4.8" ]] ; then
time sudo apt-get install -y g++-4.8
elif [[ "$CXX" == "g++-6" ]] ; then
time sudo apt-get install -y g++-6
elif [[ "$CXX" == "g++-7" ]] ; then
time sudo apt-get install -y g++-7
elif [[ "$CXX" == "g++-8" ]] ; then
time sudo apt-get install -y g++-8
elif [[ "$CXX" == "g++-9" ]] ; then
time sudo apt-get install -y g++-9
elif [[ "$CXX" == "g++-10" ]] ; then
time sudo apt-get install -y g++-10
elif [[ "$CXX" == "g++-11" ]] ; then
time sudo apt-get install -y g++-11
fi
source src/build-scripts/build_llvm.bash
fi
# time sudo apt-get install -y clang
# time sudo apt-get install -y llvm
#time sudo apt-get install -y libopenjpeg-dev
#time sudo apt-get install -y libjpeg-turbo8-dev
#dpkg --list
# Build or download LLVM
source src/build-scripts/build_llvm.bash
if [[ "$OPTIX_VERSION" != "" ]] ; then
echo "Requested OPTIX_VERSION = '${OPTIX_VERSION}'"
mkdir -p $LOCAL_DEPS_DIR/dist/include/internal
OPTIXLOC=https://developer.download.nvidia.com/redist/optix/v${OPTIX_VERSION}
for f in optix.h optix_device.h optix_function_table.h \
optix_function_table_definition.h optix_host.h \
optix_stack_size.h optix_stubs.h optix_types.h optix_7_device.h \
optix_7_host.h optix_7_types.h \
internal/optix_7_device_impl.h \
internal/optix_7_device_impl_exception.h \
internal/optix_7_device_impl_transformations.h
do
curl --retry 100 -m 120 --connect-timeout 30 \
$OPTIXLOC/include/$f > $LOCAL_DEPS_DIR/dist/include/$f
done
export OptiX_ROOT=$LOCAL_DEPS_DIR/dist
fi
# Build pybind11
CXX="ccache $CXX" source src/build-scripts/build_pybind11.bash
CXXFLAGS=-fPIC src/build-scripts/build_pugixml.bash
source src/build-scripts/build_pybind11.bash
# Build OpenEXR
CXX="ccache $CXX" source src/build-scripts/build_openexr.bash
if [[ "$OPENEXR_VERSION" != "" ]] ; then
source src/build-scripts/build_openexr.bash
fi
# We don't need OCIO, but if we ever want it, turn this on:
#CXX="ccache $CXX" source src/build-scripts/build_ocio.bash
# if [[ "$PUGIXML_VERSION" != "" ]] ; then
source src/build-scripts/build_pugixml.bash
export MY_CMAKE_FLAGS+=" -DUSE_EXTERNAL_PUGIXML=1 "
# fi
# There are many parts of OIIO we don't need to build
export ENABLE_iinfo=0 ENABLE_iv=0 ENABLE_igrep=0 ENABLE_iconvert=0 ENABLE_testtex=0
export ENABLE_cineon=0 ENABLE_DDS=0 ENABLE_DPX=0 ENABLE_FITS=0
export ENABLE_iff=0 ENABLE_jpeg2000=0 ENABLE_PNM=0 ENABLE_PSD=0
export ENABLE_RLA=0 ENABLE_SGI=0 ENABLE_SOCKET=0 ENABLE_SOFTIMAGE=0
export ENABLE_TARGA=0 ENABLE_WEBP=0
export OPENIMAGEIO_MAKEFLAGS="OIIO_BUILD_TESTS=0 USE_OPENGL=0"
source src/build-scripts/build_openimageio.bash
if [[ "$OPENCOLORIO_VERSION" != "" ]] ; then
# Temporary (?) fix: GH ninja having problems, fall back to make
CMAKE_GENERATOR="Unix Makefiles" \
source src/build-scripts/build_opencolorio.bash
fi
if [[ "$OPENIMAGEIO_VERSION" != "" ]] ; then
# There are many parts of OIIO we don't need to build
export ENABLE_iinfo=0 ENABLE_iv=0 ENABLE_igrep=0
export ENABLE_iconvert=0 ENABLE_testtex=0
export ENABLE_BMP=0 ENABLE_cineon=0 ENABLE_DDS=0 ENABLE_DPX=0 ENABLE_FITS=0
export ENABLE_ICO=0 ENABLE_iff=0 ENABLE_jpeg2000=0 ENABLE_PNM=0 ENABLE_PSD=0
export ENABLE_RLA=0 ENABLE_SGI=0 ENABLE_SOCKET=0 ENABLE_SOFTIMAGE=0
export ENABLE_TARGA=0 ENABLE_WEBP=0
export OPENIMAGEIO_CMAKE_FLAGS="-DOIIO_BUILD_TESTS=0 -DUSE_OPENGL=0"
source src/build-scripts/build_openimageio.bash
fi
# Save the env for use by other stages
src/build-scripts/save-env.bash
+74 -51
View File
@@ -2,14 +2,7 @@
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/imageworks/OpenShadingLanguage
if [[ ! -e build/$PLATFORM ]] ; then
mkdir -p build/$PLATFORM
fi
if [[ ! -e dist/$PLATFORM ]] ; then
mkdir -p dist/$PLATFORM
fi
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
# DEP_DIR="$PWD/ext/dist"
DEP_DIR="$PWD/dist/$PLATFORM"
@@ -19,21 +12,45 @@ VCPKG_INSTALLATION_ROOT=/c/vcpkg
export CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH:=.}
export CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH;$DEP_DIR"
export BOOST_ROOT=${BOOST_ROOT_1_72_0}
BOOST_UNIX_PATH=$(echo "/$BOOST_ROOT" | sed -e 's/\\/\//g' -e 's/://')
echo "BOOST_UNIX_PATH=$BOOST_UNIX_PATH"
export CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH;$BOOST_ROOT"
export CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH;$VCPKG_INSTALLATION_ROOT/installed/x64-windows"
export PATH="$PATH:$DEP_DIR/bin:$DEP_DIR/lib:$VCPKG_INSTALLATION_ROOT/installed/x64-windows/bin:/bin"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$DEP_DIR/bin:$VCPKG_INSTALLATION_ROOT/installed/x64-windows/bin"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$DEP_DIR/lib:$VCPKG_INSTALLATION_ROOT/installed/x64-windows/lib"
# export MY_CMAKE_FLAGS="$MY_CMAKE_FLAGS -DCMAKE_TOOLCHAIN_FILE=$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake"
# export OSL_CMAKE_FLAGS="$OSL_CMAKE_FLAGS -DCMAKE_TOOLCHAIN_FILE=$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake"
# export OPENEXR_CMAKE_FLAGS="$OPENEXR_CMAKE_FLAGS -DCMAKE_TOOLCHAIN_FILE=$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake"
ls -l "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC"
#ls -l "C:/Program Files (x86)/Microsoft Visual Studio/*/Enterprise/VC/Tools/MSVC" && true
#ls -l "C:/Program Files (x86)/Microsoft Visual Studio" && true
if [[ "$PYTHON_VERSION" == "3.6" ]] ; then
export CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH;/c/hostedtoolcache/windows/Python/3.6.8/x64"
else
export CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH;/c/hostedtoolcache/windows/Python/3.7.9/x64"
export Python_EXECUTABLE="/c/hostedtoolcache/windows/Python/3.7.9/x64/python.exe"
export PYTHONPATH=$OpenImageIO_ROOT/lib/python${PYTHON_VERSION}/site-packages
fi
pip install numpy
########################################################################
# Dependency method #1: Use vcpkg (disabled)
#
# Currently we are not using this, but here it is for reference:
#
echo "All pre-installed VCPkg installs:"
vcpkg list
vcpkg update
# vcpkg install zlib:x64-windows
echo "---------------"
# vcpkg update
#
# # vcpkg install zlib:x64-windows
vcpkg install tiff:x64-windows
vcpkg install libpng:x64-windows
#vcpkg install giflib:x64-windows
@@ -46,48 +63,56 @@ vcpkg install libpng:x64-windows
# vcpkg install ffmpeg:x64-windows # takes FOREVER!
# vcpkg install webp:x64-windows # No such vcpkg package?a
echo "$VCPKG_INSTALLATION_ROOT"
ls "$VCPKG_INSTALLATION_ROOT"
echo "$VCPKG_INSTALLATION_ROOT/installed/x64-windows"
ls "$VCPKG_INSTALLATION_ROOT/installed/x64-windows"
echo "$VCPKG_INSTALLATION_ROOT/installed/x64-windows/lib"
ls "$VCPKG_INSTALLATION_ROOT/installed/x64-windows/lib"
echo "$VCPKG_INSTALLATION_ROOT/installed/x64-windows/bin"
ls "$VCPKG_INSTALLATION_ROOT/installed/x64-windows/bin"
# echo "$VCPKG_INSTALLATION_ROOT"
# ls "$VCPKG_INSTALLATION_ROOT"
# echo "$VCPKG_INSTALLATION_ROOT/installed/x64-windows"
# ls "$VCPKG_INSTALLATION_ROOT/installed/x64-windows"
# echo "$VCPKG_INSTALLATION_ROOT/installed/x64-windows/lib"
# ls "$VCPKG_INSTALLATION_ROOT/installed/x64-windows/lib"
# echo "$VCPKG_INSTALLATION_ROOT/installed/x64-windows/bin"
# ls "$VCPKG_INSTALLATION_ROOT/installed/x64-windows/bin"
echo "All VCPkg installs:"
vcpkg list
#
########################################################################
# curl --location https://ffmpeg.zeranoe.com/builds/win64/shared/ffmpeg-4.2.1-win64-shared.zip -o ffmpeg-libs.zip
# unzip ffmpeg-libs.zip
curl --location https://ffmpeg.zeranoe.com/builds/win64/dev/ffmpeg-4.2.1-win64-dev.zip -o ffmpeg-dev.zip
unzip ffmpeg-dev.zip
ls
ls -R *ffmpeg*
FFmpeg_ROOT=$PWD/ffmpeg-4.2.1-win64-dev
########################################################################
# Dependency method #2: Build from source ourselves
#
#
src/build-scripts/build_zlib.bash
export ZLIB_ROOT=$PWD/ext/dist
src/build-scripts/build_libpng.bash
export PNG_ROOT=$PWD/ext/dist
# We're currently getting libtiff from vcpkg
#src/build-scripts/build_libtiff.bash
#export TIFF_ROOT=$PWD/ext/dist
# We're currently getting jpeg from vcpkg
# LIBJPEGTURBO_CONFIG_OPTS=-DWITH_SIMD=OFF
# # ^^ because we're too lazy to build nasm
# src/build-scripts/build_libjpeg-turbo.bash
# export JPEGTurbo_ROOT=$PWD/ext/dist
source src/build-scripts/build_pybind11.bash
#export pybind11_ROOT=$PWD/ext/dist
# curl --location https://ffmpeg.zeranoe.com/builds/win64/dev/ffmpeg-4.2.1-win64-dev.zip -o ffmpeg-dev.zip
# unzip ffmpeg-dev.zip
# FFmpeg_ROOT=$PWD/ffmpeg-4.2.1-win64-dev
echo "CMAKE_PREFIX_PATH = $CMAKE_PREFIX_PATH"
mkdir ext
# ZLib
pushd ext
git clone -b v1.2.11 https://github.com/madler/zlib.git
cd zlib
mkdir -p $INT_DIR
cd $INT_DIR
cmake ../.. -G "$CMAKE_GENERATOR" -DCMAKE_CONFIGURATION_TYPES="$CMAKE_BUILD_TYPE" -DCMAKE_PREFIX_PATH="$DEP_DIR" -DCMAKE_INSTALL_PREFIX="$DEP_DIR"
cmake --build . --config $CMAKE_BUILD_TYPE --target install
popd
export MY_CMAKE_FLAGS="$MY_CMAKE_FLAGS -DZLIB_LIBRARY=$DEP_DIR/lib/zlib.lib"
export OPENEXR_CMAKE_FLAGS="$OPENEXR_CMAKE_FLAGS -DZLIB_LIBRARY=$DEP_DIR/lib/zlib.lib"
source src/build-scripts/build_pybind11.bash
OPENEXR_CXX_FLAGS=" /W1 /EHsc /DWIN32=1 "
#OPENEXR_BUILD_TYPE=$CMAKE_BUILD_TYPE
OPENEXR_INSTALL_DIR=$DEP_DIR
OPENEXR_BRANCH=v2.4.0
source src/build-scripts/build_openexr.bash
export PATH="$OPENEXR_INSTALL_DIR/bin:$OPENEXR_INSTALL_DIR/lib:$PATH"
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PATH
@@ -97,7 +122,6 @@ cp $DEP_DIR/lib/*.lib $DEP_DIR/bin
cp $DEP_DIR/bin/*.dll $DEP_DIR/lib
#OPENIMAGEIO_REPO=lgritz/oiio
#OPENIMAGEIO_BRANCH=lg-cmake312
OPENIMAGEIO_INSTALLDIR=$DEP_DIR
OPENIMAGEIO_CMAKE_FLAGS+=" -DOIIO_BUILD_TESTS=0 -DOIIO_BUILD_TOOLS=0"
@@ -123,12 +147,11 @@ export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$VCPKG_INSTALLATION_ROOT/installed/x64-
# source src/build-scripts/build_openexr.bash
# export CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH;$ILMBASE_ROOT;$OPENEXR_ROOT"
# source src/build-scripts/build_ocio.bash
# source src/build-scripts/build_opencolorio.bash
if [[ "$PYTHON_VERSION" == "3.6" ]] ; then
export CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH;/c/hostedtoolcache/windows/Python/3.6.8/x64"
fi
# For CI on Windows, prefer to pick up static libs where possible
MY_CMAKE_FLAGS="$MY_CMAKE_FLAGS -DLINKSTATIC=1 -DBUILD_SHARED_LIBS=0"
OSL_CMAKE_FLAGS="$OSL_CMAKE_FLAGS -DLINKSTATIC=1 -DBUILD_SHARED_LIBS=0"
# Save the env for use by other stages
src/build-scripts/save-env.bash
+25 -18
View File
@@ -1,12 +1,12 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/imageworks/OpenShadingLanguage
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
# This script, which assumes it is runnign on a Mac OSX with Homebrew
# installed, does a "brew install" in all packages reasonably needed by
# OIIO.
# OSL and its dependencies.
if [[ `uname` != "Darwin" ]] ; then
echo "Don't run this script unless you are on Mac OSX"
@@ -20,25 +20,26 @@ if [[ `which brew` == "" ]] ; then
fi
brew update >/dev/null
#brew update >/dev/null
echo ""
echo "Before my brew installs:"
brew list --versions
if [[ $PYTHON_VERSION != "2.7" ]] ; then
brew uninstall python@2 && true
fi
brew install --display-times gcc ccache cmake ninja boost && true
brew install --display-times -q gcc ccache cmake ninja boost || true
brew link --overwrite gcc
brew install --display-times python pybind11 && true
brew upgrade --display-times python && true
brew link --overwrite python
brew install --display-times flex bison
brew install --display-times libtiff ilmbase openexr
brew install --display-times opencolorio partio pugixml
brew install --display-times freetype libpng && true
brew install --display-times llvm${LLVMBREWVER}
brew install --display-times qt
brew unlink python@2.7 || true
brew unlink python@3.9 || true
brew unlink python@3.8 || true
brew link --overwrite --force python@${PYTHON_VERSION} || true
brew upgrade --display-times -q cmake || true
brew install --display-times -q libtiff ilmbase openexr
brew install --display-times -q libpng giflib webp jpeg-turbo freetype
brew install --display-times -q opencolorio partio pugixml
brew install --display-times -q pybind11 numpy || true
brew install --display-times -q tbb || true
brew install --display-times -q flex bison
brew install --display-times -q llvm${LLVMBREWVER}
brew install --display-times -q qt
echo ""
echo "After brew installs:"
@@ -56,4 +57,10 @@ fi
export PATH=/usr/local/opt/qt5/bin:$PATH
export PATH=/usr/local/opt/python/libexec/bin:$PATH
export PYTHONPATH=/usr/local/lib/python${PYTHON_VERSION}/site-packages:$PYTHONPATH
export PATH=/usr/local/opt/llvm/bin:$PATH
export PATH=/usr/local/opt/llvm${LLVMBREWVER}/bin:$PATH
export LLVM_DIRECTORY=/usr/local/opt/llvm${LLVMBREWVER}
export LLVM_ROOT=/usr/local/opt/llvm${LLVMBREWVER}
export PATH=/usr/local/opt/flex/bin:/usr/local/opt/bison/bin:$PATH
# Save the env for use by other stages
src/build-scripts/save-env.bash
+1 -1
View File
@@ -5,7 +5,7 @@ includedir=${prefix}/include
Name: oslcomp
Description: oslcomp Compile OSL shaders from source
URL: https://github.com/imageworks/OpenShadingLanguage
URL: https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
Version: @PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@
Libs: -L${libdir} -loslcomp
Cflags: -I${includedir}
+1 -1
View File
@@ -5,7 +5,7 @@ includedir=${prefix}/include
Name: oslexec
Description: oslexec Execute compiled OSL shaders
URL: https://github.com/imageworks/OpenShadingLanguage
URL: https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
Version: @PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@
Libs: -L${libdir} -loslexec
Cflags: -I${includedir}
+1 -1
View File
@@ -5,7 +5,7 @@ includedir=${prefix}/include
Name: oslquery
Description: oslquery Query parameters of OSL compiled shaders
URL: https://github.com/imageworks/OpenShadingLanguage
URL: https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
Version: @PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@
Libs: -L${libdir} -loslquery
Cflags: -I${includedir}
+19
View File
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
# Save the env for use by other stages. Exclude things that we know aren't
# needed.
printenv \
| sort \
| grep -v ASWF_ \
| grep -v GITHUB_ \
| grep -v NVIDIA_ \
| grep -v RUNNER_ \
| grep -v _= \
| fgrep -v "\*" \
>> $GITHUB_ENV
echo "save-env: GITHUB_ENV=${GITHUB_ENV}"
cat $GITHUB_ENV
echo "---------"
+13 -5
View File
@@ -1,15 +1,23 @@
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/imageworks/OpenShadingLanguage
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
@PACKAGE_INIT@
include(CMakeFindDependencyMacro)
# add here all the find_dependency() whenever switching to config based
# dependencies e.g. if switching to Boost::Boost instead of using
# ${Boost_LIBRARY_DIRS} the add:
# find_dependency(Boost @Boost_VERSION@)
# add here all the find_dependency() whenever switching to config based dependencies
if (@OpenEXR_VERSION@ VERSION_GREATER_EQUAL 3.0)
find_dependency(Imath @OpenEXR_VERSION@)
elseif (@OpenEXR_VERSION@ VERSION_GREATER_EQUAL 2.4 AND @FOUND_OPENEXR_WITH_CONFIG@)
find_dependency(IlmBase @OpenEXR_VERSION@)
find_dependency(OpenEXR @OpenEXR_VERSION@)
find_dependency(ZLIB @ZLIB_VERSION@) # Because OpenEXR doesn't do it
find_dependency(Threads) # Because OpenEXR doesn't do it
endif ()
find_dependency(OpenImageIO @OpenImageIO_VERSION@ REQUIRED)
set_and_check (@PROJECT_NAME@_INCLUDE_DIR "@CMAKE_INSTALL_FULL_INCLUDEDIR@")
set_and_check (@PROJECT_NAME@_INCLUDES "@CMAKE_INSTALL_FULL_INCLUDEDIR@")
+1 -1
View File
@@ -5,7 +5,7 @@
# Is the named package "enabled" via our disabling convention? If either
# USE_pkgname (or the all-uppercase USE_PKGNAME, or ENABLE_pkgname, or
# ENABLE_PKGNAME) exists as either a CMake or environment variable, is
# nonempty by contains a non-true/nonnzero value, store false in the
# nonempty by contains a non-true/nonzero value, store false in the
# variable named by <enablevar>, otherwise store true.
function (check_is_enabled pkgname enablevar)
string (TOUPPER ${pkgname} pkgname_upper)
+157
View File
@@ -0,0 +1,157 @@
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
set (REQUIED_DEPS "" CACHE STRING
"Additional dependencies to consider required (semicolon-separated list, or ALL)")
set (OPTIONAL_DEPS "" CACHE STRING
"Additional dependencies to consider optional (semicolon-separated list, or ALL)")
# checked_find_package(Pkgname ...) is a wrapper for find_package, with the
# following extra features:
# * If either `USE_Pkgname` or the all-uppercase `USE_PKGNAME` (or
# `ENABLE_Pkgname` or `ENABLE_PKGNAME`) exists as either a CMake or
# environment variable, is nonempty by contains a non-true/nonzero
# value, do not search for or use the package. The optional ENABLE <var>
# arguments allow you to override the name of the enabling variable. In
# other words, support for the dependency is presumed to be ON, unless
# turned off explicitly from one of these sources.
# * Print a message if the package is enabled but not found. This is based
# on ${Pkgname}_FOUND or $PKGNAME_FOUND.
# * Optional DEFINITIONS <string> are passed to add_definitions if the
# package is found.
# * Optional PRINT <list> is a list of variables that will be printed
# if the package is found, if VERBOSE is on.
# * Optional DEPS <list> is a list of hard dependencies; for each one, if
# dep_FOUND is not true, disable this package with an error message.
# * Optional ISDEPOF <downstream> names another package for which the
# present package is only needed because it's a dependency, and
# therefore if <downstream> is disabled, we don't bother with this
# package either.
# * Optional VERSION_MIN and VERSION_MAX, if supplied, give minimum and
# maximum versions that will be accepted. The min is inclusive, the max
# is exclusive (i.e., check for min <= version < max). Note that this is
# not the same as providing a version number to find_package, which
# checks compatibility, not minimum. Sometimes we really do just want to
# say a minimum or a range. (N.B. When our minimum CMake >= 3.19, the
# built-in way to do this is with version ranges passed to
# find_package.)
# * Optional RECOMMEND_MIN, if supplied, gives a minimum recommended
# version, accepting but warning if it is below this number (even
# if above the true minimum version accepted). The warning message
# can give an optional explanation, passed as RECOMMEND_MIN_REASON.
#
# N.B. This needs to be a macro, not a function, because the find modules
# will set(blah val PARENT_SCOPE) and we need that to be the global scope,
# not merely the scope for this function.
macro (checked_find_package pkgname)
cmake_parse_arguments(_pkg # prefix
# noValueKeywords:
"REQUIRED"
# singleValueKeywords:
"ENABLE;ISDEPOF;VERSION_MIN;VERSION_MAX;RECOMMEND_MIN;RECOMMEND_MIN_REASON"
# multiValueKeywords:
"DEFINITIONS;PRINT;DEPS"
# argsToParse:
${ARGN})
string (TOLOWER ${pkgname} pkgname_lower)
string (TOUPPER ${pkgname} pkgname_upper)
if (NOT VERBOSE)
set (${pkgname}_FIND_QUIETLY true)
set (${pkgname_upper}_FIND_QUIETLY true)
endif ()
if ("${pkgname}" IN_LIST REQUIRED_DEPS OR "ALL" IN_LIST REQUIRED_DEPS)
set (_pkg_REQUIRED 1)
endif ()
if ("${pkgname}" IN_LIST OPTIONAL_DEPS OR "ALL" IN_LIST OPTIONAL_DEPS)
set (_pkg_REQUIRED 0)
endif ()
set (_quietskip false)
check_is_enabled (${pkgname} _enable)
set (_disablereason "")
foreach (_dep ${_pkg_DEPS})
if (_enable AND NOT ${_dep}_FOUND)
set (_enable false)
set (ENABLE_${pkgname} OFF PARENT_SCOPE)
set (_disablereason "(because ${_dep} was not found)")
endif ()
endforeach ()
if (_pkg_ISDEPOF)
check_is_enabled (${_pkg_ISDEPOF} _dep_enabled)
if (NOT _dep_enabled)
set (_enable false)
set (_quietskip true)
endif ()
endif ()
if (_enable OR _pkg_REQUIRED)
find_package (${pkgname} ${_pkg_UNPARSED_ARGUMENTS})
if ((${pkgname}_FOUND OR ${pkgname_upper}_FOUND)
AND ${pkgname}_VERSION
AND (_pkg_VERSION_MIN OR _pkg_VERSION_MAX))
if ((_pkg_VERSION_MIN AND ${pkgname}_VERSION VERSION_LESS _pkg_VERSION_MIN)
OR (_pkg_VERSION_MAX AND ${pkgname}_VERSION VERSION_GREATER _pkg_VERSION_MAX))
message (STATUS "${ColorRed}${pkgname} ${${pkgname}_VERSION} is outside the required range ${_pkg_VERSION_MIN}...${_pkg_VERSION_MAX} ${ColorReset}")
unset (${pkgname}_FOUND)
unset (${pkgname}_VERSION)
unset (${pkgname_upper}_FOUND)
unset (${pkgname_upper}_VERSION)
endif ()
endif ()
if (${pkgname}_FOUND OR ${pkgname_upper}_FOUND)
foreach (_vervar ${pkgname_upper}_VERSION ${pkgname}_VERSION_STRING
${pkgname_upper}_VERSION_STRING)
if (NOT ${pkgname}_VERSION AND ${_vervar})
set (${pkgname}_VERSION ${${_vervar}})
endif ()
endforeach ()
message (STATUS "${ColorGreen}Found ${pkgname} ${${pkgname}_VERSION} ${ColorReset}")
if (VERBOSE)
set (_vars_to_print ${pkgname}_INCLUDES ${pkgname_upper}_INCLUDES
${pkgname}_INCLUDE_DIR ${pkgname_upper}_INCLUDE_DIR
${pkgname}_INCLUDE_DIRS ${pkgname_upper}_INCLUDE_DIRS
${pkgname}_LIBRARIES ${pkgname_upper}_LIBRARIES
${_pkg_PRINT})
list (REMOVE_DUPLICATES _vars_to_print)
foreach (_v IN LISTS _vars_to_print)
if (NOT "${${_v}}" STREQUAL "")
message (STATUS " ${_v} = ${${_v}}")
endif ()
endforeach ()
endif ()
add_definitions (${_pkg_DEFINITIONS})
if (_pkg_RECOMMEND_MIN)
if (${${pkgname}_VERSION} VERSION_LESS ${_pkg_RECOMMEND_MIN})
message (STATUS "${ColorYellow}Recommend ${pkgname} >= ${_pkg_RECOMMEND_MIN} ${_pkg_RECOMMEND_MIN_REASON} ${ColorReset}")
endif ()
endif ()
else ()
message (STATUS "${ColorRed}${pkgname} library not found ${ColorReset}")
if (${pkgname}_ROOT)
message (STATUS "${ColorRed} ${pkgname}_ROOT was: ${${pkgname}_ROOT} ${ColorReset}")
elseif ($ENV{${pkgname}_ROOT})
message (STATUS "${ColorRed} ENV ${pkgname}_ROOT was: ${${pkgname}_ROOT} ${ColorReset}")
else ()
message (STATUS "${ColorRed} Try setting ${pkgname}_ROOT ? ${ColorReset}")
endif ()
if (EXISTS "${PROJECT_SOURCE_DIR}/src/build-scripts/build_${pkgname}.bash")
message (STATUS "${ColorRed} Maybe this will help: src/build-scripts/build_${pkgname}.bash ${ColorReset}")
elseif (EXISTS "${PROJECT_SOURCE_DIR}/src/build-scripts/build_${pkgname_upper}.bash")
message (STATUS "${ColorRed} Maybe this will help: src/build-scripts/build_${pkgname_upper}.bash ${ColorReset}")
elseif (EXISTS "${PROJECT_SOURCE_DIR}/src/build-scripts/build_${pkgname_lower}.bash")
message (STATUS "${ColorRed} Maybe this will help: src/build-scripts/build_${pkgname_lower}.bash ${ColorReset}")
elseif (EXISTS "${PROJECT_SOURCE_DIR}/src/build-scripts/build_lib${pkgname_lower}.bash")
message (STATUS "${ColorRed} Maybe this will help: src/build-scripts/build_lib${pkgname_lower}.bash ${ColorReset}")
endif ()
if (_pkg_REQUIRED)
message (FATAL_ERROR "${ColorRed}${pkgname} is required, aborting.${ColorReset}")
endif ()
endif()
else ()
if (NOT _quietskip)
message (STATUS "${ColorRed}Not using ${pkgname} -- disabled ${_disablereason} ${ColorReset}")
endif ()
endif ()
endmacro()
+13 -11
View File
@@ -1,6 +1,6 @@
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/imageworks/OpenShadingLanguage
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
###########################################################################
#
@@ -80,7 +80,7 @@ endif ()
###########################################################################
# Turn on more detailed warnings and optionally consider warnings as errors
#
option (STOP_ON_WARNING "Stop building if there are any compiler warnings" ON)
option (STOP_ON_WARNING "Stop building if there are any compiler warnings" OFF)
option (EXTRA_WARNINGS "Enable lots of extra pedantic warnings" OFF)
if (NOT MSVC)
add_compile_options ("-Wall")
@@ -89,9 +89,8 @@ if (NOT MSVC)
endif ()
if (STOP_ON_WARNING OR DEFINED ENV{CI})
add_compile_options ("-Werror")
# N.B. Force CI builds (Travis defines $CI) to use -Werror, even if
# STOP_ON_WARNING has been switched off by default, which we may do
# in release branches.
# N.B. Force CI builds to use -Werror, even if STOP_ON_WARNING has
# been switched off by default, which we may do in release branches.
endif ()
endif ()
@@ -116,7 +115,7 @@ if (${CXX_VISIBILITY_PRESET} STREQUAL "hidden" AND
(CMAKE_SYSTEM_NAME MATCHES "Linux|kFreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "GNU"))
# Linux/FreeBSD/Hurd: also hide all the symbols of dependent libraries
# to prevent clashes if an app using this project is linked against
# other verions of our dependencies.
# other versions of our dependencies.
set (VISIBILITY_MAP_COMMAND "-Wl,--version-script=${VISIBILITY_MAP_FILE}")
endif ()
@@ -202,9 +201,9 @@ endif ()
# Use ccache if found
#
# This can really speed up compilation by caching object files that have
# been compiled previously with idential arguments and inputs. Putting this
# been compiled previously with identical arguments and inputs. Putting this
# logic here makes it work even if the user is unaware of ccache. If it's
# not found on the system, it will simply be silnetly not used.
# not found on the system, it will simply be silently not used.
option (USE_CCACHE "Use ccache if found" ON)
find_program (CCACHE_FOUND ccache)
if (CCACHE_FOUND AND USE_CCACHE)
@@ -249,8 +248,8 @@ endif ()
###########################################################################
# SIMD and machine architecture options.
#
# The USE_SIMD optinon may be set to a comma-separated list of machine /
# instruction set optinos, such as "avx3,f16c". The list will be parsed and
# The USE_SIMD option may be set to a comma-separated list of machine /
# instruction set options, such as "avx3,f16c". The list will be parsed and
# the proper compiler directives added to generate code for those ISA
# capabilities.
#
@@ -426,6 +425,7 @@ set (CLANG_FORMAT_INCLUDES # "src/*.h" "src/*.cpp"
"src/osl.imageio/*.cpp"
"src/osltoy/*.cpp"
"src/osltoy/*.h"
"testsuite/*.cpp"
CACHE STRING "Glob patterns to include for clang-format")
set (CLANG_FORMAT_EXCLUDES
# Files "imported and modified" that we don't want to reformat, so
@@ -445,6 +445,8 @@ set (CLANG_FORMAT_EXCLUDES
"src/include/OSL/device_string.h"
"src/include/OSL/oslexec.h"
"src/testrender/cuda/*"
# Header files in testsuite are almost certainly osl headers, not C++
"testsuite/*.h"
""
CACHE STRING "Glob patterns to exclude for clang-format")
find_program (CLANG_FORMAT_EXE
@@ -532,7 +534,7 @@ endif ()
###########################################################################
# Any extra logic to be run only for CI builds goes here.
#
if (DEFINED ENV{TRAVIS} OR DEFINED ENV{APPVEYOR} OR DEFINED ENV{CI} OR DEFINED ENV{GITHUB_ACTIONS})
if (DEFINED ENV{CI} OR DEFINED ENV{GITHUB_ACTIONS})
add_definitions ("-D${PROJ_NAME}_CI=1" "-DBUILD_CI=1")
if (APPLE)
# Keep Mono framework from being incorrectly searched for include
+33 -7
View File
@@ -1,6 +1,6 @@
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/imageworks/OpenShadingLanguage
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
# Compile a CUDA file to PTX using NVCC
function ( NVCC_COMPILE cuda_src ptx_generated extra_nvcc_args )
@@ -11,6 +11,13 @@ function ( NVCC_COMPILE cuda_src ptx_generated extra_nvcc_args )
set (${ptx_generated} ${cuda_ptx} PARENT_SCOPE)
file ( GLOB cuda_headers "${cuda_src_dir}/*.h" )
list (TRANSFORM IMATH_INCLUDES PREPEND -I
OUTPUT_VARIABLE ALL_IMATH_INCLUDES)
list (TRANSFORM OPENEXR_INCLUDES PREPEND -I
OUTPUT_VARIABLE ALL_OPENEXR_INCLUDES)
list (TRANSFORM OpenImageIO_INCLUDES PREPEND -I
OUTPUT_VARIABLE ALL_OpenImageIO_INCLUDES)
add_custom_command ( OUTPUT ${cuda_ptx}
COMMAND ${CUDA_NVCC_EXECUTABLE}
"-I${OPTIX_INCLUDES}"
@@ -19,14 +26,15 @@ function ( NVCC_COMPILE cuda_src ptx_generated extra_nvcc_args )
"-I${CMAKE_BINARY_DIR}/include"
"-I${PROJECT_SOURCE_DIR}/src/include"
"-I${PROJECT_SOURCE_DIR}/src/cuda_common"
"-I${OPENIMAGEIO_INCLUDES}"
"-I${ILMBASE_INCLUDES}"
${ALL_OpenImageIO_INCLUDES}
${ALL_IMATH_INCLUDES}
${ALL_OPENEXR_INCLUDES}
"-I${Boost_INCLUDE_DIRS}"
"-DFMT_DEPRECATED=\"\""
${LLVM_COMPILE_FLAGS}
-DOSL_USE_FAST_MATH=1
-m64 -arch ${CUDA_TARGET_ARCH} -ptx
--std=c++11 -dc -O3 --use_fast_math --expt-relaxed-constexpr
--std=c++${CMAKE_CXX_STANDARD} -dc -O3 --use_fast_math --expt-relaxed-constexpr
${extra_nvcc_args}
${cuda_src} -o ${cuda_ptx}
MAIN_DEPENDENCY ${cuda_src}
@@ -68,6 +76,23 @@ function ( MAKE_CUDA_BITCODE src suffix generated_bc extra_clang_args )
message (STATUS "Using LLVM_BC_GENERATOR ${LLVM_BC_GENERATOR} to generate bitcode.")
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
# fix compilation error when using MSVC
set (CLANG_MSVC_FIX "-DBOOST_CONFIG_REQUIRES_THREADS_HPP")
# these are warnings triggered by the dllimport/export attributes not being supported when
# compiling for Cuda. When all 3rd parties have their export macro fixed these warnings
# can be restored.
set (CLANG_MSVC_FIX "${CLANG_MSVC_FIX} -Wno-ignored-attributes -Wno-unknown-attributes")
endif ()
list (TRANSFORM IMATH_INCLUDES PREPEND -I
OUTPUT_VARIABLE ALL_IMATH_INCLUDES)
list (TRANSFORM OPENEXR_INCLUDES PREPEND -I
OUTPUT_VARIABLE ALL_OPENEXR_INCLUDES)
list (TRANSFORM OpenImageIO_INCLUDES PREPEND -I
OUTPUT_VARIABLE ALL_OpenImageIO_INCLUDES)
add_custom_command (OUTPUT ${bc_cuda}
COMMAND ${LLVM_BC_GENERATOR}
"-I${OPTIX_INCLUDES}"
@@ -76,11 +101,12 @@ function ( MAKE_CUDA_BITCODE src suffix generated_bc extra_clang_args )
"-I${CMAKE_BINARY_DIR}/include"
"-I${PROJECT_SOURCE_DIR}/src/include"
"-I${PROJECT_SOURCE_DIR}/src/cuda_common"
"-I${OPENIMAGEIO_INCLUDE_DIR}"
"-I${ILMBASE_INCLUDE_DIR}"
${ALL_OpenImageIO_INCLUDES}
${ALL_IMATH_INCLUDES}
${ALL_OPENEXR_INCLUDES}
"-I${Boost_INCLUDE_DIRS}"
${LLVM_COMPILE_FLAGS} ${CUDA_LIB_FLAGS}
-D__CUDACC__ -DOSL_COMPILING_TO_BITCODE=1 -DNDEBUG -DOIIO_NO_SSE
-D__CUDACC__ -DOSL_COMPILING_TO_BITCODE=1 -DNDEBUG -DOIIO_NO_SSE -D__CUDADEVRT_INTERNAL__
--language=cuda --cuda-device-only --cuda-gpu-arch=${CUDA_TARGET_ARCH}
-Wno-deprecated-register -Wno-format-security
-O3 -fno-math-errno -ffast-math -S -emit-llvm ${extra_clang_args}
+81 -144
View File
@@ -1,6 +1,6 @@
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/imageworks/OpenShadingLanguage
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
###########################################################################
# Find external dependencies
@@ -8,23 +8,8 @@
# When not in VERBOSE mode, try to make things as quiet as possible
if (NOT VERBOSE)
set (Bison_FIND_QUIETLY true)
set (Boost_FIND_QUIETLY true)
set (Curses_FIND_QUIETLY true)
set (Flex_FIND_QUIETLY true)
# set (LLVM_FIND_QUIETLY true)
set (OpenEXR_FIND_QUIETLY true)
# set (OpenImageIO_FIND_QUIETLY true)
# set (Partio_FIND_QUIETLY true)
set (PkgConfig_FIND_QUIETLY true)
set (PugiXML_FIND_QUIETLY TRUE)
set (PythonInterp_FIND_QUIETLY true)
set (PythonLibs_FIND_QUIETLY true)
set (Qt5_FIND_QUIETLY true)
set (Threads_FIND_QUIETLY true)
set (ZLIB_FIND_QUIETLY true)
set (CUDA_FIND_QUIETLY true)
set (OptiX_FIND_QUIETLY true)
endif ()
message (STATUS "${ColorBoldWhite}")
@@ -43,117 +28,6 @@ set (OSL_LOCAL_DEPS_DIR "${CMAKE_SOURCE_DIR}/ext/dist" CACHE STRING
list (INSERT CMAKE_PREFIX_PATH 0 ${OSL_LOCAL_DEPS_DIR})
message (STATUS "CMAKE_PREFIX_PATH = ${CMAKE_PREFIX_PATH}")
set (REQUIED_DEPS "" CACHE STRING
"Additional dependencies to consider required (semicolon-separated list, or ALL)")
set (OPTIONAL_DEPS "" CACHE STRING
"Additional dependencies to consider optional (semicolon-separated list, or ALL)")
# checked_find_package(pkgname ..) is a wrapper for find_package, with the
# following extra features:
# * If either `USE_pkgname` or the all-uppercase `USE_PKGNAME` (or
# `ENABLE_pkgname` or `ENABLE_PKGNAME`) exists as either a CMake or
# environment variable, is nonempty by contains a non-true/nonnzero
# value, do not search for or use the package. The optional ENABLE <var>
# arguments allow you to override the name of the enabling variable. In
# other words, support for the dependency is presumed to be ON, unless
# turned off explicitly from one of these sources.
# * Print a message if the package is enabled but not found. This is based
# on ${pkgname}_FOUND or $PKGNNAME_FOUND.
# * Optional DEFINITIONS <string> are passed to add_definitions if the
# package is found.
# * Optional PRINT <list> is a list of variables that will be printed
# if the package is found, if VERBOSE is on.
# * Optional DEPS <list> is a list of hard dependencies; for each one, if
# dep_FOUND is not true, disable this package with an error message.
# * Optional ISDEPOF <downstream> names another package for which the
# present package is only needed because it's a dependency, and
# therefore if <downstream> is disabled, we don't bother with this
# package either.
#
# N.B. This needs to be a macro, not a function, because the find modules
# will set(blah val PARENT_SCOPE) and we need that to be the global scope,
# not merely the scope for this function.
macro (checked_find_package pkgname)
cmake_parse_arguments(_pkg "REQUIRED" "ENABLE;ISDEPOF" "DEFINITIONS;PRINT;DEPS" ${ARGN})
# Arguments: <prefix> noValueKeywords singleValueKeywords multiValueKeywords argsToParse
string (TOUPPER ${pkgname} pkgname_upper)
if (NOT VERBOSE)
set (${pkgname}_FIND_QUIETLY true)
set (${pkgname_upper}_FIND_QUIETLY true)
endif ()
if ("${pkgname}" IN_LIST REQUIRED_DEPS OR "ALL" IN_LIST REQUIRED_DEPS)
set (_pkg_REQUIRED 1)
endif ()
if ("${pkgname}" IN_LIST OPTIONAL_DEPS OR "ALL" IN_LIST OPTIONAL_DEPS)
set (_pkg_REQUIRED 0)
endif ()
set (_quietskip false)
check_is_enabled (${pkgname} _enable)
set (_disablereason "")
foreach (_dep ${_pkg_DEPS})
if (_enable AND NOT ${_dep}_FOUND)
set (_enable false)
set (ENABLE_${pkgname} OFF PARENT_SCOPE)
set (_disablereason "(because ${_dep} was not found)")
endif ()
endforeach ()
if (_pkg_ISDEPOF)
check_is_enabled (${_pkg_ISDEPOF} _dep_enabled)
if (NOT _dep_enabled)
set (_enable false)
set (_quietskip true)
endif ()
endif ()
if (_enable OR _pkg_REQUIRED)
find_package (${pkgname} ${_pkg_UNPARSED_ARGUMENTS})
if (${pkgname}_FOUND OR ${pkgname_upper}_FOUND)
foreach (_vervar ${pkgname_upper}_VERSION ${pkgname}_VERSION_STRING
${pkgname_upper}_VERSION_STRING)
if (NOT ${pkgname}_VERSION AND ${_vervar})
set (${pkgname}_VERSION ${${_vervar}})
endif ()
endforeach ()
message (STATUS "${ColorGreen}Found ${pkgname} ${${pkgname}_VERSION} ${ColorReset}")
if (VERBOSE)
set (_vars_to_print ${pkgname}_INCLUDES ${pkgname_upper}_INCLUDES
${pkgname}_INCLUDE_DIR ${pkgname_upper}_INCLUDE_DIR
${pkgname}_INCLUDE_DIRS ${pkgname_upper}_INCLUDE_DIRS
${pkgname}_LIBRARIES ${pkgname_upper}_LIBRARIES
${_pkg_PRINT})
list (REMOVE_DUPLICATES _vars_to_print)
foreach (_v IN LISTS _vars_to_print)
if (NOT "${${_v}}" STREQUAL "")
message (STATUS " ${_v} = ${${_v}}")
endif ()
endforeach ()
endif ()
add_definitions (${_pkg_DEFINITIONS})
else ()
message (STATUS "${ColorRed}${pkgname} library not found ${ColorReset}")
if (${pkgname}_ROOT)
message (STATUS "${ColorRed} ${pkgname}_ROOT was: ${${pkgname}_ROOT} ${ColorReset}")
elseif ($ENV{${pkgname}_ROOT})
message (STATUS "${ColorRed} ENV ${pkgname}_ROOT was: ${${pkgname}_ROOT} ${ColorReset}")
else ()
message (STATUS "${ColorRed} Try setting ${pkgname}_ROOT ? ${ColorReset}")
endif ()
if (EXISTS "${PROJECT_SOURCE_DIR}/src/build-scripts/build_${pkgname}.bash")
message (STATUS "${ColorRed} Maybe this will help: src/build-scripts/build_${pkgname}.bash ${ColorReset}")
endif ()
if (_pkg_REQUIRED)
message (FATAL_ERROR "${ColorRed}${pkgname} is required, aborting.${ColorReset}")
endif ()
endif()
else ()
if (NOT _quietskip)
message (STATUS "${ColorRed}Not using ${pkgname} -- disabled ${_disablereason} ${ColorReset}")
endif ()
endif ()
endmacro()
include (ExternalProject)
@@ -183,8 +57,11 @@ else ()
# to set the expected variables printed below. So until that's fixed
# force FindBoost.cmake to use the original brute force path.
set (Boost_NO_BOOST_CMAKE ON)
checked_find_package (Boost 1.55 REQUIRED
checked_find_package (Boost REQUIRED
VERSION_MIN 1.55
COMPONENTS ${Boost_COMPONENTS}
RECOMMEND_MIN 1.66
RECOMMEND_MIN_REASON "Boost 1.66 is the oldest version our CI tests against"
PRINT Boost_INCLUDE_DIRS Boost_LIBRARIES
)
endif ()
@@ -205,10 +82,19 @@ link_directories ("${Boost_LIBRARY_DIRS}")
checked_find_package (ZLIB REQUIRED) # Needed by several packages
# IlmBase & OpenEXR
checked_find_package (OpenEXR 2.0 REQUIRED)
# We use Imath so commonly, may as well include it everywhere.
include_directories ("${OPENEXR_INCLUDES}" "${ILMBASE_INCLUDES}"
"${ILMBASE_INCLUDES}/OpenEXR")
checked_find_package (OpenEXR REQUIRED
VERSION_MIN 2.0
RECOMMEND_MIN 2.2
RECOMMEND_MIN_REASON
"OpenEXR 2.2 is the oldest version our CI tests against, and the minimum that supports DWA compression"
PRINT IMATH_INCLUDES
)
# Force Imath includes to be before everything else to ensure that we have
# the right Imath/OpenEXR version, not some older version in the system
# library. This shoudn't be necessary, except for the common case of people
# building against Imath/OpenEXR 3.x when there is still a system-level
# install version of 2.x.
include_directories(BEFORE ${IMATH_INCLUDES})
if (CMAKE_COMPILER_IS_CLANG AND OPENEXR_VERSION VERSION_LESS 2.3)
# clang C++ >= 11 doesn't like 'register' keyword in old exr headers
add_compile_options (-Wno-deprecated-register)
@@ -217,22 +103,31 @@ if (MSVC AND NOT LINKSTATIC)
add_definitions (-DOPENEXR_DLL) # Is this needed for new versions?
endif ()
if (OPENEXR_VERSION VERSION_GREATER_EQUAL 2.5.99)
set (OSL_USING_IMATH 3)
else ()
set (OSL_USING_IMATH 2)
endif ()
# OpenImageIO
set (OIIO_LIBNAME_SUFFIX "" CACHE STRING
"Optional name appended to OIIO libraries that are built")
checked_find_package (OpenImageIO 2.0 REQUIRED
checked_find_package (OpenImageIO REQUIRED
VERSION_MIN 2.0
PRINT OIIOTOOL_BIN)
if (OPENIMAGEIO_FOUND)
include_directories ("${OPENIMAGEIO_INCLUDES}")
endif ()
checked_find_package (pugixml REQUIRED)
checked_find_package (pugixml REQUIRED
VERSION_MIN 1.8)
# LLVM library setup
checked_find_package (LLVM 7.0 REQUIRED
checked_find_package (LLVM REQUIRED
VERSION_MIN 7.0
PRINT LLVM_SYSTEM_LIBRARIES CLANG_LIBRARIES)
# ensure include directory is added (in case of non-standard locations
include_directories (BEFORE SYSTEM "${LLVM_INCLUDES}")
@@ -255,10 +150,25 @@ if (LLVM_VERSION VERSION_GREATER_EQUAL 10.0.0 AND
"icc >= 7, MSVS >= 2017. "
"If you must use C++11, you need to build against LLVM 9 or earlier.")
endif ()
if (APPLE AND LLVM_VERSION VERSION_EQUAL 10.0.1 AND EXISTS "/usr/local/Cellar/llvm")
message (WARNING
"${ColorYellow}If you are using LLVM 10.0.1 installed by Homebrew, "
"please note that a known bug in LLVM may produce a link error where "
"it says it can't find libxml2.tbd. If you encounter this, please "
"try downgrading to LLVM 9: \n"
" brew uninstall llvm \n"
" brew install llvm@9 \n"
" export LLVM_DIRECTORY=/usr/local/opt/llvm@9 "
"${ColorReset}\n")
endif ()
checked_find_package (partio)
# From pythonutils.cmake
find_python ()
# Qt -- used for osltoy
set (qt5_modules Core Gui Widgets)
if (OPENGL_FOUND)
@@ -282,14 +192,15 @@ if (USE_CUDA OR USE_OPTIX)
message (STATUS "CUDA_TOOLKIT_ROOT_DIR = ${CUDA_TOOLKIT_ROOT_DIR}")
endif ()
checked_find_package (CUDA 8.0 REQUIRED
checked_find_package (CUDA REQUIRED
VERSION_MIN 8.0
PRINT CUDA_INCLUDES)
set (CUDA_INCLUDES ${CUDA_TOOLKIT_ROOT_DIR}/include)
include_directories (BEFORE "${CUDA_INCLUDES}")
STRING (FIND ${LLVM_TARGETS} "NVPTX" nvptx_index)
if (NOT ${nvptx_index} GREATER -1)
message (FATAL_ERROR "NVTPX target is not available in the provided LLVM build")
message (FATAL_ERROR "NVPTX target is not available in the provided LLVM build")
endif()
if (${CUDA_VERSION} VERSION_GREATER 8 AND ${LLVM_VERSION} VERSION_LESS 6)
@@ -297,14 +208,40 @@ if (USE_CUDA OR USE_OPTIX)
endif ()
set (CUDA_LIB_FLAGS "--cuda-path=${CUDA_TOOLKIT_ROOT_DIR}")
endif ()
find_library(cuda_lib NAMES cudart
PATHS "${CUDA_TOOLKIT_ROOT_DIR}/lib64" "${CUDA_TOOLKIT_ROOT_DIR}/x64"
REQUIRED)
set(CUDA_LIBRARIES ${cuda_lib})
# OptiX setup
if (USE_OPTIX)
checked_find_package (OptiX 5.1 REQUIRED)
include_directories (BEFORE "${OPTIX_INCLUDES}")
if (NOT USE_LLVM_BITCODE OR NOT USE_FAST_MATH)
message (FATAL_ERROR "Enabling OptiX requires USE_LLVM_BITCODE=1 and USE_FAST_MATH=1")
# testrender & testshade need libnvrtc
if ("${CUDA_VERSION}" VERSION_GREATER_EQUAL "10.0")
find_library(nvrtc_lib NAMES nvrtc
PATHS "${CUDA_TOOLKIT_ROOT_DIR}/lib64" "${CUDA_TOOLKIT_ROOT_DIR}/x64"
REQUIRED)
set(CUDA_LIBRARIES ${CUDA_LIBRARIES} ${nvrtc_lib})
set(CUDA_EXTRA_LIBS ${CUDA_EXTRA_LIBS} dl)
endif()
# OptiX setup
if (USE_OPTIX)
checked_find_package (OptiX REQUIRED
VERSION_MIN 5.1)
include_directories (BEFORE "${OPTIX_INCLUDES}")
if (NOT USE_LLVM_BITCODE OR NOT USE_FAST_MATH)
message (FATAL_ERROR "Enabling OptiX requires USE_LLVM_BITCODE=1 and USE_FAST_MATH=1")
endif ()
endif ()
function (osl_optix_target TARGET)
target_include_directories (${TARGET} BEFORE PRIVATE ${CUDA_INCLUDES} ${OPTIX_INCLUDES})
## XXX: Should -DPTX_PATH point to (or include) CMAKE_CURRENT_BINARY_DIR so tests can run before installation ?
target_compile_definitions (${TARGET} PRIVATE "-DPTX_PATH=\"${OSL_PTX_INSTALL_DIR}\"")
target_link_libraries (${TARGET} PRIVATE ${CUDA_LIBRARIES} ${CUDA_EXTRA_LIBS} ${OPTIX_LIBRARIES} ${OPTIX_EXTRA_LIBS})
endfunction()
else ()
function (osl_optix_target TARGET)
endfunction()
endif ()
+3 -3
View File
@@ -1,12 +1,12 @@
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/imageworks/OpenShadingLanguage
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
# Macro to add an executable build target. The executable name can be
# specified with NAME, otherwise is inferred from the subdirectory name. The
# source files of the binary can be specifeied with SRC, otherwise are
# source files of the binary can be specified with SRC, otherwise are
# inferred to be all the .cpp files within the subdirectory. Optional
# compile DEFINITIONS, private INCLUDE_DIRS, and priviate LINK_LIBRARIES may
# compile DEFINITIONS, private INCLUDE_DIRS, and private LINK_LIBRARIES may
# also be specified.
#
# The executable may be disabled individually using any of the usual
+1 -1
View File
@@ -1,6 +1,6 @@
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/imageworks/OpenShadingLanguage
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
# LG's macros for using flex and bison.
# Merely including this file will require flex and bison to be found.
+32 -23
View File
@@ -1,6 +1,6 @@
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/imageworks/OpenShadingLanguage
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
# Module to find LLVM
#
@@ -30,9 +30,11 @@ list (APPEND LLVM_CONFIG_PATH_HINTS
"/usr/local/opt/llvm/bin/")
find_program (LLVM_CONFIG
NAMES llvm-config-${LLVM_VERSION} llvm-config
llvm-config-64-${LLVM_VERSION} llvm-config-64
HINTS ${LLVM_CONFIG_PATH_HINTS} NO_DEFAULT_PATH)
find_program (LLVM_CONFIG
NAMES llvm-config-${LLVM_VERSION} llvm-config
llvm-config-64-${LLVM_VERSION} llvm-config-64
HINTS ${LLVM_CONFIG_PATH_HINTS})
if (NOT LLVM_FIND_QUIETLY)
message (STATUS "Found llvm-config '${LLVM_CONFIG}'")
@@ -56,9 +58,35 @@ execute_process (COMMAND ${LLVM_CONFIG} --includedir
execute_process (COMMAND ${LLVM_CONFIG} --targets-built
OUTPUT_VARIABLE LLVM_TARGETS
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process (COMMAND ${LLVM_CONFIG} --system-libs
OUTPUT_VARIABLE LLVM_SYSTEM_LIBRARIES
OUTPUT_STRIP_TRAILING_WHITESPACE)
############ HACK ##############
# On OSX, the Homebrew (and maybe any build) of LLVM 10.0 seems to have a
# link conflict with its dependency on the llvm libc++ and the system
# libc++, both can end up dynamically linked and lead to very subtle and
# frustrating behavior failures (in particular, osl's use of libclang will
# botch include file parsing any time LD_LIBRARY_PATH doesn't have the llvm
# libc++ first).
#
# It seems that this is not a problem when linking against the llvm and
# libclang libraries statically. So on apple and when LLVM 10+ are involved,
# just force that choice. Other than larger executables, it seems harmless,
# and in any case a better choice than this beastly bug.
#
# We can periodically revisit this with new version of LLVM, maybe they will
# fix things and we won't require this preemptive static linking.
if (APPLE AND LLVM_VERSION VERSION_GREATER_EQUAL 10.0)
set (LLVM_STATIC ON)
endif ()
if (LLVM_STATIC)
execute_process (COMMAND ${LLVM_CONFIG} --system-libs --link-static
OUTPUT_VARIABLE LLVM_SYSTEM_LIBRARIES
OUTPUT_STRIP_TRAILING_WHITESPACE)
else ()
execute_process (COMMAND ${LLVM_CONFIG} --system-libs
OUTPUT_VARIABLE LLVM_SYSTEM_LIBRARIES
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif ()
string (REPLACE " " ";" LLVM_SYSTEM_LIBRARIES "${LLVM_SYSTEM_LIBRARIES}")
find_library ( LLVM_LIBRARY
@@ -103,25 +131,6 @@ foreach (COMPONENT clangFrontend clangDriver clangSerialization
endforeach ()
############ HACK ##############
# On OSX, the Homebrew (and maybe any build) of LLVM 10.0 seems to have a
# link conflict with its dependency on the llvm libc++ and the system
# libc++, both can end up dynamically linked and lead to very subtle and
# frustrating behavior failures (in particular, osl's use of libclang will
# botch include file parsing any time LD_LIBRARY_PATH doesn't have the llvm
# libc++ first).
#
# It seems that this is not a problem when linking against the llvm and
# libclang libraries statically. So on apple and when LLVM 10+ are involved,
# just force that choice. Other than larger execubales, it seems harmless,
# and in any case a better choice than this beastly bug.
#
# We can periodically revisit this with new version of LLVM, maybe they will
# fix things and we won't require this preemptive static linking.
if (APPLE AND LLVM_VERSION VERSION_GREATER_EQUAL 10.0)
set (LLVM_STATIC ON)
endif ()
# shared llvm library may not be available, this is not an error if we use LLVM_STATIC.
if ((LLVM_LIBRARY OR LLVM_LIBRARIES OR LLVM_STATIC) AND LLVM_INCLUDES AND LLVM_DIRECTORY AND LLVM_LIB_DIR)
if (LLVM_STATIC)
+114 -6
View File
@@ -1,19 +1,122 @@
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/imageworks/OpenShadingLanguage
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
# Module to find OpenEXR.
# Module to find OpenEXR and Imath.
#
# I'm afraid this is a mess, due to needing to support a wide range of
# OpenEXR versions.
#
# For OpenEXR & Imath 3.0, this will establish the following imported
# targets:
#
# Imath::Imath
# Imath::Half
# OpenEXR::OpenEXR
# OpenEXR::Iex
# OpenEXR::IlmThread
#
# For OpenEXR 2.4 & 2.5, it will establish the following imported targets:
#
# IlmBase::Imath
# IlmBase::Half
# IlmBase::Iex
# IlmBase::IlmThread
# OpenEXR::IlmImf
#
# For all versions -- but for OpenEXR < 2.4 the only thing this sets --
# are the following CMake variables:
#
# This module will set
# OPENEXR_FOUND true, if found
# OPENEXR_INCLUDES directory where headers are found
# OPENEXR_INCLUDES directory where OpenEXR headers are found
# OPENEXR_LIBRARIES libraries for OpenEXR + IlmBase
# ILMBASE_LIBRARIES libraries just IlmBase
# OPENEXR_VERSION OpenEXR version (accurate for >= 2.0.0,
# otherwise will just guess 1.6.1)
# IMATH_INCLUDES directory where Imath headers are found
# ILMBASE_INCLUDES directory where IlmBase headers are found
# ILMBASE_LIBRARIES libraries just IlmBase
#
#
# First, try to fine just the right config files
find_package(Imath CONFIG)
if (NOT TARGET Imath::Imath)
# Couldn't find Imath::Imath, maybe it's older and has IlmBase?
find_package(IlmBase CONFIG)
endif ()
find_package(OpenEXR CONFIG)
if (TARGET OpenEXR::OpenEXR AND TARGET Imath::Imath)
# OpenEXR 3.x if both of these targets are found
set (FOUND_OPENEXR_WITH_CONFIG 1)
if (NOT OpenEXR_FIND_QUIETLY)
message (STATUS "Found CONFIG for OpenEXR 3 (OPENEXR_VERSION=${OpenEXR_VERSION})")
endif ()
# Mimic old style variables
set (OPENEXR_VERSION ${OpenEXR_VERSION})
get_target_property(IMATH_INCLUDES Imath::Imath INTERFACE_INCLUDE_DIRECTORIES)
get_target_property(ILMBASE_INCLUDES Imath::Imath INTERFACE_INCLUDE_DIRECTORIES)
get_target_property(ILMBASE_IMATH_LIBRARY Imath::Imath INTERFACE_LINK_LIBRARIES)
get_target_property(IMATH_LIBRARY Imath::Imath INTERFACE_LINK_LIBRARIES)
get_target_property(OPENEXR_IEX_LIBRARY OpenEXR::Iex INTERFACE_LINK_LIBRARIES)
get_target_property(OPENEXR_ILMTHREAD_LIBRARY OpenEXR::IlmThread INTERFACE_LINK_LIBRARIES)
set (ILMBASE_LIBRARIES ${ILMBASE_IMATH_LIBRARY})
set (ILMBASE_FOUND true)
get_target_property(OPENEXR_INCLUDES OpenEXR::OpenEXR INTERFACE_INCLUDE_DIRECTORIES)
get_target_property(OPENEXR_ILMIMF_LIBRARY OpenEXR::OpenEXR INTERFACE_LINK_LIBRARIES)
set (OPENEXR_LIBRARIES ${OPENEXR_ILMIMF_LIBRARY} ${OPENEXR_IEX_LIBRARY} ${OPENEXR_ILMTHREAD_LIBRARY} ${ILMBASE_LIBRARIES})
set (OPENEXR_FOUND true)
# Link with pthreads if required
find_package (Threads)
if (CMAKE_USE_PTHREADS_INIT)
list (APPEND ILMBASE_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
endif ()
elseif (TARGET OpenEXR::IlmImf AND TARGET IlmBase::Imath AND
(OPENEXR_VERSION VERSION_GREATER_EQUAL 2.4 OR OpenEXR_VERSION VERSION_GREATER_EQUAL 2.4))
# OpenEXR 2.4 or 2.5 with exported config
set (FOUND_OPENEXR_WITH_CONFIG 1)
if (NOT OpenEXR_FIND_QUIETLY)
message (STATUS "Found CONFIG for OpenEXR 2 (OPENEXR_VERSION=${OpenEXR_VERSION})")
endif ()
# Mimic old style variables
get_target_property(ILMBASE_INCLUDES IlmBase::IlmBaseConfig INTERFACE_INCLUDE_DIRECTORIES)
get_target_property(IMATH_INCLUDES IlmBase::IlmBaseConfig INTERFACE_INCLUDE_DIRECTORIES)
get_target_property(ILMBASE_Imath_LIBRARY IlmBase::Imath INTERFACE_LINK_LIBRARIES)
get_target_property(ILMBASE_IMATH_LIBRARY IlmBase::Imath INTERFACE_LINK_LIBRARIES)
get_target_property(ILMBASE_HALF_LIBRARY IlmBase::Half INTERFACE_LINK_LIBRARIES)
get_target_property(OPENEXR_IEX_LIBRARY IlmBase::Iex INTERFACE_LINK_LIBRARIES)
get_target_property(OPENEXR_ILMTHREAD_LIBRARY IlmBase::IlmThread INTERFACE_LINK_LIBRARIES)
set (ILMBASE_LIBRARIES ${ILMBASE_IMATH_LIBRARY} ${ILMBASE_HALF_LIBRARY} ${OPENEXR_IEX_LIBRARY} ${OPENEXR_ILMTHREAD_LIBRARY})
set (ILMBASE_FOUND true)
get_target_property(OPENEXR_INCLUDES OpenEXR::IlmImfConfig INTERFACE_INCLUDE_DIRECTORIES)
get_target_property(OPENEXR_ILMIMF_LIBRARY OpenEXR::IlmImf INTERFACE_LINK_LIBRARIES)
set (OPENEXR_LIBRARIES ${OPENEXR_ILMIMF_LIBRARY} ${ILMBASE_LIBRARIES})
set (OPENEXR_FOUND true)
# Link with pthreads if required
find_package (Threads)
if (CMAKE_USE_PTHREADS_INIT)
list (APPEND ILMBASE_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
endif ()
# Correct for how old OpenEXR config exports set the directory one
# level lower than we prefer it.
string(REGEX REPLACE "include/OpenEXR$" "include" ILMBASE_INCLUDES "${ILMBASE_INCLUDES}")
string(REGEX REPLACE "include/OpenEXR$" "include" IMATH_INCLUDES "${IMATH_INCLUDES}")
string(REGEX REPLACE "include/OpenEXR$" "include" OPENEXR_INCLUDES "${OPENEXR_INCLUDES}")
else ()
# OpenEXR 2.x older versions without a config or whose configs we don't
# trust.
set (FOUND_OPENEXR_WITH_CONFIG 0)
# Other standard issue macros
include (FindPackageHandleStandardArgs)
include (SelectLibraryConfigurations)
@@ -135,17 +238,20 @@ find_package_handle_standard_args (OpenEXR
REQUIRED_VARS ILMBASE_INCLUDE_PATH OPENEXR_INCLUDE_PATH
OPENEXR_IMATH_LIBRARY OPENEXR_ILMIMF_LIBRARY
OPENEXR_IEX_LIBRARY OPENEXR_HALF_LIBRARY
VERSION_VAR OPENEXR_VERSION
)
if (OPENEXR_FOUND)
set (OpenEXR_VERSION ${OPENEXR_VERSION})
set (ILMBASE_FOUND TRUE)
set (ILMBASE_INCLUDES ${ILMBASE_INCLUDE_PATH})
set (IMATH_INCLUDES ${ILMBASE_INCLUDE_PATH})
set (OPENEXR_INCLUDES ${OPENEXR_INCLUDE_PATH})
set (ILMBASE_INCLUDE_DIR ${ILMBASE_INCLUDE_PATH})
set (IMATH_INCLUDE_DIR ${ILMBASE_INCLUDE_PATH})
set (OPENEXR_INCLUDE_DIR ${OPENEXR_INCLUDE_PATH})
set (ILMBASE_LIBRARIES ${OPENEXR_IMATH_LIBRARY} ${OPENEXR_IEX_LIBRARY} ${OPENEXR_HALF_LIBRARY} ${OPENEXR_ILMTHREAD_LIBRARY} ${ILMBASE_PTHREADS} CACHE STRING "The libraries needed to use IlmBase")
set (OPENEXR_LIBRARIES ${OPENEXR_ILMIMF_LIBRARY} ${ILMBASE_LIBRARIES} ${ZLIB_LIBRARIES} CACHE STRING "The libraries needed to use OpenEXR")
set (FINDOPENEXR_FALLBACK TRUE)
endif ()
mark_as_advanced(
@@ -157,3 +263,5 @@ mark_as_advanced(
# Restore the original CMAKE_FIND_LIBRARY_SUFFIXES
set (CMAKE_FIND_LIBRARY_SUFFIXES ${_openexr_orig_suffixes})
endif ()
+12 -2
View File
@@ -41,14 +41,20 @@
# NOTE: This file is deprecated.
#
# In OIIO 2.1+, we generate OpenImageIOConfig.cmake files that are now the
# preferred way for downstream projecs to find an installed OIIO. There
# preferred way for downstream projects to find an installed OIIO. There
# should be no need to copy this FindOpenImageIO.cmake file into downstream
# projects, *unless* they need to work with a range of OIIO vesions that
# projects, *unless* they need to work with a range of OIIO versions that
# may include <2.1, which would lack the generated config files.
#
###########################################################################
# Prefer an OpenImageIO cmake config file if it can be found
find_package(OpenImageIO CONFIG)
if (TARGET OpenImageIO::OpenImageIO)
set (OPENIMAGEIO_VERSION ${OpenImageIO_VERSION})
else ()
# If 'OPENIMAGE_HOME' not set, use the env variable of that name if available
if (NOT OPENIMAGEIO_ROOT_DIR AND NOT $ENV{OPENIMAGEIO_ROOT_DIR} STREQUAL "")
set (OPENIMAGEIO_ROOT_DIR $ENV{OPENIMAGEIO_ROOT_DIR})
@@ -94,7 +100,9 @@ find_package_handle_standard_args (OpenImageIO
)
if (OPENIMAGEIO_FOUND)
set (OpenImageIO_VERSION ${OPENIMAGEIO_VERSION})
set (OPENIMAGEIO_INCLUDES ${OPENIMAGEIO_INCLUDE_DIR})
set (OpenImageIO_INCLUDES ${OPENIMAGEIO_INCLUDE_DIR})
set (OPENIMAGEIO_LIBRARIES ${OPENIMAGEIO_LIBRARY})
get_filename_component (OPENIMAGEIO_LIBRARY_DIRS "${OPENIMAGEIO_LIBRARY}" DIRECTORY)
if (NOT OpenImageIO_FIND_QUIETLY)
@@ -124,3 +132,5 @@ mark_as_advanced (
OPENIMAGEIO_INCLUDE_DIR
OPENIMAGEIO_LIBRARY
)
endif ()
+12 -10
View File
@@ -1,13 +1,13 @@
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/imageworks/OpenShadingLanguage
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
###########################################################################
# CMake module to find OptiX
#
# This module will set
# OPTIX_FOUND True, if OptiX is found
# OPTIX_INCLUDE_DIR directory where OptiX headers are found
# OPTIX_INCLUDES directory where OptiX headers are found
# OPTIX_LIBRARIES libraries for OptiX
#
# Special inputs:
@@ -52,16 +52,18 @@ macro(OPTIX_find_api_library name version)
endif()
endmacro()
# Pull out the API version from optix.h
file(STRINGS ${OPTIX_INCLUDE_DIR}/optix.h OPTIX_VERSION_LINE LIMIT_COUNT 1 REGEX "define OPTIX_VERSION")
string(REGEX MATCH "([0-9]+)" OPTIX_VERSION_STRING "${OPTIX_VERSION_LINE}")
math(EXPR OPTIX_VERSION_MAJOR "${OPTIX_VERSION_STRING}/10000")
math(EXPR OPTIX_VERSION_MINOR "(${OPTIX_VERSION_STRING}%10000)/100")
math(EXPR OPTIX_VERSION_MICRO "${OPTIX_VERSION_STRING}%100")
set(OPTIX_VERSION "${OPTIX_VERSION_MAJOR}.${OPTIX_VERSION_MINOR}.${OPTIX_VERSION_MICRO}")
if (OPTIX_INCLUDE_DIR)
# Pull out the API version from optix.h
file(STRINGS ${OPTIX_INCLUDE_DIR}/optix.h OPTIX_VERSION_LINE LIMIT_COUNT 1 REGEX "define OPTIX_VERSION")
string(REGEX MATCH "([0-9]+)" OPTIX_VERSION_STRING "${OPTIX_VERSION_LINE}")
math(EXPR OPTIX_VERSION_MAJOR "${OPTIX_VERSION_STRING}/10000")
math(EXPR OPTIX_VERSION_MINOR "(${OPTIX_VERSION_STRING}%10000)/100")
math(EXPR OPTIX_VERSION_MICRO "${OPTIX_VERSION_STRING}%100")
set(OPTIX_VERSION "${OPTIX_VERSION_MAJOR}.${OPTIX_VERSION_MINOR}.${OPTIX_VERSION_MICRO}")
endif ()
# OptiX 7 doesn't link to any libraries
if (${OPTIX_VERSION_MAJOR} LESS 7)
if (OPTIX_VERSION VERSION_LESS 7)
OPTIX_find_api_library(optix ${OPTIX_VERSION})
OPTIX_find_api_library(optixu ${OPTIX_VERSION})
OPTIX_find_api_library(optix_prime ${OPTIX_VERSION})
+1 -1
View File
@@ -1,6 +1,6 @@
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/imageworks/OpenShadingLanguage
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
# Find the Partio library.
#
+79
View File
@@ -0,0 +1,79 @@
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
# Find the pugixml XML parsing library.
#
# Sets the usual variables expected for find_package scripts:
#
# PUGIXML_INCLUDES - header location
# PUGIXML_LIBRARIES - library to link against
# PUGIXML_FOUND - true if pugixml was found.
# First try the config files and hope they're good enough
find_package (pugixml CONFIG)
if (TARGET pugixml::pugixml)
# New pugixml (>= 1.11) has nice config files we can rely on and makes a
# pugixml::pugixml target.
message (STATUS "Found CONFIG for pugixml (>=1.11)")
set (PUGIXML_FOUND true)
set (pugixml_FOUND true)
get_target_property(PUGIXML_INCLUDES pugixml::pugixml INTERFACE_INCLUDE_DIRECTORIES)
get_target_property(PUGIXML_LIBRARIES pugixml::pugixml INTERFACE_LINK_LIBRARIES)
# elseif (TARGET pugixml)
# # But older pugixml (<= 1.10) has mediocre config files that are not
# # reliable in practice. They also only define a "pugixml" target but
# # not "pugixml::pugixml". So just fall through to the "no config" case
# # below, and figure everything out by hand.
else ()
# If no config file is found for PugiXML, do it the old fashioned way.
find_path (PUGIXML_INCLUDE_DIR
NAMES pugixml.hpp
#HINTS ${OpenImageIO_INCLUDE_DIR}/detail/pugixml
PATH_SUFFIXES pugixml-1.8 pugixml-1.9 pugixml-1.10)
set (pugixml_required_vars PUGIXML_INCLUDE_DIR)
find_library (PUGIXML_LIBRARY
NAMES pugixml
PATH_SUFFIXES pugixml-1.8 pugixml-1.9 pugixml-1.10)
if (PUGIXML_INCLUDE_DIR)
file (STRINGS "${PUGIXML_INCLUDE_DIR}/pugixml.hpp" TMP REGEX "define PUGIXML_VERSION .*$")
string (REGEX MATCHALL "[0-9]+" PUGIXML_CODED_VERSION ${TMP})
if (PUGIXML_CODED_VERSION VERSION_GREATER_EQUAL 1000)
math (EXPR PUGIXML_VERSION_MAJOR "${PUGIXML_CODED_VERSION} / 1000")
math (EXPR PUGIXML_VERSION_MINOR "(${PUGIXML_CODED_VERSION} % 1000) / 10")
else ()
math (EXPR PUGIXML_VERSION_MAJOR "${PUGIXML_CODED_VERSION} / 100")
math (EXPR PUGIXML_VERSION_MINOR "(${PUGIXML_CODED_VERSION} % 100) / 10")
endif ()
set (PUGIXML_VERSION ${PUGIXML_VERSION_MAJOR}.${PUGIXML_VERSION_MINOR})
endif ()
# Support the REQUIRED and QUIET arguments, and set PUGIXML_FOUND if found.
include (FindPackageHandleStandardArgs)
find_package_handle_standard_args (pugixml DEFAULT_MSG
#PUGIXML_LIBRARY
PUGIXML_INCLUDE_DIR)
if (PUGIXML_FOUND OR pugixml_FOUND)
set (PUGIXML_INCLUDES ${PUGIXML_INCLUDE_DIR})
set (PUGIXML_LIBRARIES ${PUGIXML_LIBRARY})
if (NOT TARGET pugixml::pugixml)
add_library(pugixml::pugixml UNKNOWN IMPORTED)
set_target_properties(pugixml::pugixml PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${PUGIXML_INCLUDES}")
if (PUGIXML_LIBRARIES)
set_property(TARGET pugixml::pugixml APPEND PROPERTY
IMPORTED_LOCATION "${PUGIXML_LIBRARIES}")
endif ()
endif ()
endif ()
mark_as_advanced (PUGIXML_LIBRARY PUGIXML_INCLUDE_DIR)
endif()
+34
View File
@@ -0,0 +1,34 @@
# Copyright Contributors to the Open Shading Languge project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/
#########################################################################
# Packaging
set (CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set (CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
set (CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
# "Vendor" is only used in copyright notices, so we use the same thing that
# the rest of the copyright notices say.
set (CPACK_PACKAGE_VENDOR ${PROJECT_AUTHORS})
set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "Open Shading Language is the de facto standard for shading in modern path tracers used in film VFX and animation")
set (CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/src/doc/Description.txt")
set (CPACK_PACKAGE_FILE_NAME ${PROJECT_NAME}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}-${platform})
file (COPY "${PROJECT_SOURCE_DIR}/LICENSE.md" DESTINATION "${CMAKE_BINARY_DIR}")
set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_BINARY_DIR}/LICENSE.md")
file (COPY "${PROJECT_SOURCE_DIR}/README.md" DESTINATION "${CMAKE_BINARY_DIR}")
set (CPACK_RESOURCE_FILE_README "${CMAKE_BINARY_DIR}/README.md")
set (CPACK_RESOURCE_FILE_WELCOME "${PROJECT_SOURCE_DIR}/src/doc/Welcome.txt")
#set (CPACK_PACKAGE_EXECUTABLES I'm not sure what this is for)
#set (CPACK_STRIP_FILES Do we need this?)
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set (CPACK_GENERATOR "TGZ;STGZ;RPM;DEB")
set (CPACK_SOURCE_GENERATOR "TGZ")
endif ()
if (APPLE)
set (CPACK_GENERATOR "TGZ;STGZ;PackageMaker")
set (CPACK_SOURCE_GENERATOR "TGZ")
endif ()
set (CPACK_SOURCE_PACKAGE_FILE_NAME ${PROJECT_NAME}-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}-source)
#set (CPACK_SOURCE_STRIP_FILES ...FIXME...)
set (CPACK_SOURCE_IGNORE_FILES ".*~")
include (CPack)
+31 -30
View File
@@ -1,10 +1,10 @@
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/imageworks/OpenShadingLanguage
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
# Python-related options.
option (USE_PYTHON "Build the Python bindings" ON)
set (PYTHON_VERSION "2.7" CACHE STRING "Target version of python to find")
set (PYTHON_VERSION "" CACHE STRING "Target version of python to try to find")
option (PYLIB_INCLUDE_SONAME "If ON, soname/soversion will be set for Python module library" OFF)
option (PYLIB_LIB_PREFIX "If ON, prefix the Python module with 'lib'" OFF)
set (PYMODULE_SUFFIX "" CACHE STRING "Suffix to add to Python module init namespace")
@@ -12,10 +12,6 @@ set (PYMODULE_SUFFIX "" CACHE STRING "Suffix to add to Python module init namesp
# Find Python. This macro should only be called if python is required. If
# Python cannot be found, it will be a fatal error.
# Variables set by this macro:
# PYTHON_INCLUDES_PATH - directory where python headers are found
# PYTHON_LIBRARIES - python libraries to link
# PYTHON_SITE_DIR - our own install dir where our python moduels go
macro (find_python)
if (NOT VERBOSE)
set (PythonInterp_FIND_QUIETLY true)
@@ -24,34 +20,41 @@ macro (find_python)
# Attempt to find the desired version, but fall back to other
# additional versions.
checked_find_package (PythonInterp ${PYTHON_VERSION} REQUIRED)
unset (_req)
if (USE_PYTHON)
set (_req REQUIRED)
if (PYTHON_VERSION)
list (APPEND _req EXACT)
endif ()
endif ()
checked_find_package (Python ${PYTHON_VERSION}
${_req}
COMPONENTS Interpreter Development
PRINT Python_Development_FOUND Python_VERSION
Python_EXECUTABLE Python_LIBRARIES
Python_Development_FOUND Python_Interpreter_FOUND)
# The version that was found may not be the default or user
# defined one.
set (PYTHON_VERSION_FOUND ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR})
set (PYTHON_VERSION_FOUND ${Python_VERSION_MAJOR}.${Python_VERSION_MINOR})
if (NOT ${PYTHON_VERSION} VERSION_EQUAL ${PYTHON_VERSION_FOUND} )
message (WARNING "The requested version ${PYTHON_VERSION} was not found.")
message (WARNING "Using ${PYTHON_VERSION_FOUND} instead.")
endif ()
checked_find_package (PythonLibs ${PYTHON_VERSION_FOUND} REQUIRED)
if (VERBOSE)
message (STATUS " Python include dirs ${PYTHON_INCLUDE_PATH}")
message (STATUS " Python libraries ${PYTHON_LIBRARIES}")
message (STATUS " Python site packages dir ${PYTHON_SITE_DIR}")
message (STATUS " Python to include 'lib' prefix: ${PYLIB_LIB_PREFIX}")
message (STATUS " Python to include SO version: ${PYLIB_INCLUDE_SONAME}")
message (STATUS " Python version ${PYTHON_VERSION_STRING}")
message (STATUS " Python version major: ${PYTHON_VERSION_MAJOR} minor: ${PYTHON_VERSION_MINOR}")
endif ()
# Give hints to subsequent pybind11 searching to ensure that it finds
# exactly the same version that we found.
set (PythonInterp_FIND_VERSION PYTHON_VERSION_FOUND)
set (PythonInterp_FIND_VERSION_MAJOR ${Python_VERSION_MAJOR})
if (NOT DEFINED PYTHON_SITE_DIR)
set (PYTHON_SITE_DIR "${CMAKE_INSTALL_LIBDIR}/python${PYTHON_VERSION_FOUND}/site-packages")
endif ()
if (VERBOSE)
message (STATUS " Python site packages dir ${PYTHON_SITE_DIR}")
message (STATUS " Python to include 'lib' prefix: ${PYLIB_LIB_PREFIX}")
message (STATUS " Python to include SO version: ${PYLIB_INCLUDE_SONAME}")
endif ()
endmacro()
###########################################################################
# pybind11
@@ -69,16 +72,14 @@ macro (setup_python_module)
# Add the library itself
add_library (${target_name} MODULE ${lib_SOURCES})
# Set up include dirs for python & pybind11
target_include_directories (${target_name} SYSTEM PRIVATE ${PYTHON_INCLUDE_PATH})
# Declare the libraries it should link against
target_link_libraries (${target_name} PRIVATE
pybind11::pybind11 ${lib_LIBS} ${SANITIZE_LIBRARIES})
target_link_libraries (${target_name}
PRIVATE
pybind11::pybind11
Python::Python
${lib_LIBS} ${SANITIZE_LIBRARIES})
if (APPLE)
set_target_properties (${target_name} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
else ()
target_link_libraries (${target_name} PRIVATE ${PYTHON_LIBRARIES})
endif ()
# Exclude the 'lib' prefix from the name
+264
View File
@@ -0,0 +1,264 @@
# Copyright Contributors to the Open Shading Languge project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/
include (CTest)
# Make a build/platform/testsuite directory, and copy the master runtest.py
# there. The rest is up to the tests themselves.
file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/testsuite")
file (COPY "${CMAKE_CURRENT_SOURCE_DIR}/testsuite/common"
DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/testsuite")
add_custom_command (OUTPUT "${CMAKE_BINARY_DIR}/testsuite/runtest.py"
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_SOURCE_DIR}/testsuite/runtest.py"
"${CMAKE_BINARY_DIR}/testsuite/runtest.py"
MAIN_DEPENDENCY "${CMAKE_SOURCE_DIR}/testsuite/runtest.py")
add_custom_target ( CopyFiles ALL DEPENDS "${CMAKE_BINARY_DIR}/testsuite/runtest.py" )
# add_one_testsuite() - set up one testsuite entry
#
# Usage:
# add_one_testsuite ( testname
# testsrcdir - Current test directory in ${CMAKE_SOURCE_DIR}
# testdir - Current test sandbox in ${CMAKE_BINARY_DIR}
# [ENV env1=val1 env2=val2 ... ] - env vars to set
# [COMMAND cmd...] - optional override of launch command
# )
#
macro (add_one_testsuite testname testsrcdir)
cmake_parse_arguments (_tst "" "" "ENV;COMMAND" ${ARGN})
set (testsuite "${CMAKE_SOURCE_DIR}/testsuite")
set (testdir "${CMAKE_BINARY_DIR}/testsuite/${testname}")
if (NOT _tst_COMMAND)
set (_tst_COMMAND ${Python_EXECUTABLE} "${testsuite}/runtest.py" ${testdir})
if (MSVC_IDE)
list (APPEND _tst_COMMAND --devenv-config $<CONFIGURATION>
--solution-path "${CMAKE_BINARY_DIR}" )
endif ()
endif ()
list (APPEND _tst_ENV
OpenImageIO_ROOT=${OpenImageIO_ROOT}
OSL_SOURCE_DIR=${CMAKE_SOURCE_DIR}
OSL_BUILD_DIR=${CMAKE_BINARY_DIR}
OSL_TESTSUITE_ROOT=${testsuite}
OSL_TESTSUITE_SRC=${testsrcdir}
OSL_TESTSUITE_CUR=${testdir}
)
file (MAKE_DIRECTORY "${testdir}")
add_test ( NAME ${testname} COMMAND ${_tst_COMMAND} )
# message ("Test -- env ${_tst_ENV} cmd ${_tst_COMMAND}")
set_tests_properties (${testname} PROPERTIES ENVIRONMENT "${_tst_ENV}" )
# Certain tests are already internally multi-threaded, so to keep them
# from piling up together, allocate a few cores each.
if (${testname} MATCHES "^render-")
set_tests_properties (${testname} PROPERTIES LABELS render
PROCESSORS 4 COST 10)
endif ()
# Some labeling for fun
if (${testname} MATCHES "^texture-")
set_tests_properties (${testname} PROPERTIES LABELS texture
PROCESSORS 2 COST 4)
endif ()
if (${testname} MATCHES "noise")
set_tests_properties (${testname} PROPERTIES LABELS noise
PROCESSORS 2 COST 4)
endif ()
if (${testname} MATCHES "optix")
set_tests_properties (${testname} PROPERTIES LABELS optix)
if ("${CUDA_VERSION}" VERSION_GREATER_EQUAL "10.0")
# Make sure libnvrtc-builtins.so is reachable
set_property (TEST ${testname} APPEND PROPERTY ENVIRONMENT LD_LIBRARY_PATH=${CUDA_TOOLKIT_ROOT_DIR}/lib64)
endif()
endif ()
endmacro ()
macro ( TESTSUITE )
cmake_parse_arguments (_ats "" "LABEL;FOUNDVAR;TESTNAME" "" ${ARGN})
# If there was a FOUNDVAR param specified and that variable name is
# not defined, mark the test as broken.
if (_ats_FOUNDVAR AND NOT ${_ats_FOUNDVAR})
set (_ats_LABEL "broken")
endif ()
set (test_all_optix $ENV{TESTSUITE_OPTIX})
# Add the tests if all is well.
set (ALL_TEST_LIST "")
set (_testsuite "${CMAKE_SOURCE_DIR}/testsuite")
foreach (_testname ${_ats_UNPARSED_ARGUMENTS})
set (_testsrcdir "${_testsuite}/${_testname}")
if (_ats_TESTNAME)
set (_testname "${_ats_TESTNAME}")
endif ()
if (_ats_LABEL MATCHES "broken")
set (_testname "${_testname}-broken")
endif ()
set (ALL_TEST_LIST "${ALL_TEST_LIST} ${_testname}")
# Run the test unoptimized, unless it matches a few patterns that
# we don't test unoptimized (or has an OPTIMIZEONLY marker file).
if (NOT _testname MATCHES "^getattribute-shader" AND
NOT _testname MATCHES "optix" AND
NOT EXISTS "${_testsrcdir}/OPTIMIZEONLY")
add_one_testsuite ("${_testname}" "${_testsrcdir}"
ENV TESTSHADE_OPT=0 )
endif ()
# Run the same test again with aggressive -O2 runtime
# optimization, triggered by setting TESTSHADE_OPT env variable.
# Skip OptiX-only tests and those with a NOOPTIMIZE marker file.
if (NOT _testname MATCHES "optix"
AND NOT EXISTS "${_testsrcdir}/NOOPTIMIZE")
add_one_testsuite ("${_testname}.opt" "${_testsrcdir}"
ENV TESTSHADE_OPT=2 )
endif ()
# When building for OptiX support, also run it in OptiX mode
# if there is an OPTIX marker file in the directory.
# If an environment variable $TESTSUITE_OPTIX is nonzero, then
# run all tests with OptiX, even if there's no OPTIX marker.
if (USE_OPTIX
AND (EXISTS "${_testsrcdir}/OPTIX" OR test_all_optix OR _testname MATCHES "optix")
AND NOT EXISTS "${_testsrcdir}/NOOPTIX"
AND NOT EXISTS "${_testsrcdir}/NOOPTIX-FIXME")
# Unoptimized
if (NOT EXISTS "${_testsrcdir}/OPTIMIZEONLY")
add_one_testsuite ("${_testname}.optix" "${_testsrcdir}"
ENV TESTSHADE_OPT=0 TESTSHADE_OPTIX=1 )
endif ()
# and optimized
add_one_testsuite ("${_testname}.optix.opt" "${_testsrcdir}"
ENV TESTSHADE_OPT=2 TESTSHADE_OPTIX=1 )
endif ()
endforeach ()
if (VERBOSE)
message (STATUS "Added tests: ${ALL_TEST_LIST}")
endif ()
endmacro ()
macro (osl_add_all_tests)
# List all the individual testsuite tests here, except those that need
# special installed tests.
TESTSUITE ( aastep allowconnect-err and-or-not-synonyms arithmetic
array array-derivs array-range array-aassign
blackbody blendmath breakcont
bug-array-heapoffsets bug-locallifetime bug-outputinit
bug-param-duplicate bug-peep bug-return
cellnoise closure closure-array color comparison
compile-buffer
component-range
connect-components
const-array-params const-array-fill
debugnan debug-uninit
derivs derivs-muldiv-clobber
draw_string
error-dupes error-serialized
exit exponential
fprintf
function-earlyreturn function-simple function-outputelem
function-overloads function-redef
geomath getattribute-camera getattribute-shader
getsymbol-nonheap gettextureinfo
group-outputs groupstring
hash hashnoise hex hyperb
ieee_fp if incdec initlist initops intbits isconnected isconstant
layers layers-Ciassign layers-entry layers-lazy layers-lazyerror
layers-nonlazycopy layers-repeatedoutputs
linearstep
logic loop matrix message
mergeinstances-duplicate-entrylayers
mergeinstances-nouserdata mergeinstances-vararray
metadata-braces miscmath missing-shader
named-components
noise noise-cell
noise-gabor noise-gabor2d-filter noise-gabor3d-filter
noise-perlin noise-simplex
pnoise pnoise-cell pnoise-gabor pnoise-perlin
operator-overloading
opt-warnings
oslc-comma oslc-D oslc-M
oslc-err-arrayindex oslc-err-assignmenttypes
oslc-err-closuremul oslc-err-field
oslc-err-format oslc-err-funcoverload
oslc-err-intoverflow oslc-err-write-nonoutput
oslc-err-noreturn oslc-err-notfunc
oslc-err-initlist-args oslc-err-initlist-return
oslc-err-named-components
oslc-err-outputparamvararray oslc-err-paramdefault
oslc-err-struct-array-init oslc-err-struct-ctr
oslc-err-struct-dup oslc-err-struct-print
oslc-err-unknown-ctr
# oslc-pragma-warnerr
oslc-warn-commainit
oslc-variadic-macro
oslc-version
oslinfo-arrayparams oslinfo-colorctrfloat
oslinfo-metadata oslinfo-noparams
osl-imageio
paramval-floatpromotion
pragma-nowarn
printf-whole-array
raytype raytype-specialized reparam
render-background render-bumptest
render-cornell render-furnace-diffuse
render-microfacet render-oren-nayar render-veachmis render-ward
select shortcircuit spline splineinverse splineinverse-ident
spline-boundarybug spline-derivbug
string
struct struct-array struct-array-mixture
struct-err struct-init-copy
struct-isomorphic-overload struct-layers
struct-operator-overload struct-return struct-with-array
struct-nested struct-nested-assign struct-nested-deep
ternary
testshade-expr
texture-alpha texture-alpha-derivs
texture-blur texture-connected-options
texture-derivs texture-errormsg
texture-firstchannel texture-interp
texture-missingalpha texture-missingcolor texture-simple
texture-smallderivs texture-swirl texture-udim
texture-width texture-withderivs texture-wrap
trailing-commas
transitive-assign
transform transformc trig typecast
unknown-instruction
userdata userdata-passthrough
vararray-connect vararray-default
vararray-deserialize vararray-param
vecctr vector
wavelength_color Werror xml )
if (OPENIMAGEIO_VERSION VERSION_GREATER_EQUAL 2.1)
# I'm too lazy to set this test up to work with OIIO versions too
# old to have proper exported cmake config files. So just skip it
# for OIIO 2.0.
TESTSUITE (example-deformer)
endif ()
# Add tests that require the Python bindings if we built them.
# We also exclude these tests if this is a sanitizer build on Linux,
# because the Python interpreter itself won't be linked with the right asan
# libraries to run correctly.
if (USE_PYTHON AND NOT SANITIZE_ON_LINUX)
TESTSUITE ( python-oslquery )
endif ()
# Only run field3d-related tests if the local OIIO was built with f3d support.
execute_process ( COMMAND ${OPENIMAGEIO_BIN} --help
OUTPUT_VARIABLE oiiotool_help )
if (oiiotool_help MATCHES "field3d")
TESTSUITE ( texture-field3d )
endif()
# Only run pointcloud tests if Partio is found
if (PARTIO_FOUND)
TESTSUITE ( pointcloud pointcloud-fold )
endif ()
# Only run the OptiX tests if OptiX and CUDA are found
if (OPTIX_FOUND AND CUDA_FOUND)
TESTSUITE ( testoptix testoptix-noise example-cuda)
endif ()
endmacro()
+3 -3
View File
@@ -1,6 +1,6 @@
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/imageworks/OpenShadingLanguage
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
set (public_docs osl-languagespec.pdf
testshade.md.html
@@ -11,7 +11,7 @@ set (public_docs osl-languagespec.pdf
install (FILES ${public_docs} DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT documentation)
install ( FILES "${PROJECT_SOURCE_DIR}/LICENSE"
install ( FILES "${PROJECT_SOURCE_DIR}/LICENSE.md"
"${PROJECT_SOURCE_DIR}/INSTALL.md"
"${PROJECT_SOURCE_DIR}/CHANGES.md"
"${PROJECT_SOURCE_DIR}/README.md"
@@ -43,7 +43,7 @@ macro (docdeep_generate)
endif ()
set (docdeep_program ${CMAKE_SOURCE_DIR}/src/build-scripts/docdeep.py)
add_custom_command (OUTPUT ${mdfile}
COMMAND python ${docdeep_program} -d ${_docdeep_NAME} -s docs.css
COMMAND ${Python_EXECUTABLE} ${docdeep_program} -d ${_docdeep_NAME} -s docs.css
${_docdeep_SOURCE} > "${CMAKE_CURRENT_BINARY_DIR}/${mdfile}"
MAIN_DEPENDENCY ${docdeep_program}
DEPENDS ${_docdeep_SOURCE}
+1 -1
View File
@@ -1,6 +1,6 @@
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/imageworks/OpenShadingLanguage
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
PDFLATEX_FLAGS = -interaction=errorstopmode ### "--shell-escape"
+7 -5
View File
@@ -1,7 +1,7 @@
% Copyright 2009-present Contributors to the Open Shading Language project.
% SPDX-License-Identifier: CC-BY-4.0
% SPDX-License-Identifier: BSD-3-Clause
% https://github.com/imageworks/OpenShadingLanguage
% https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
\documentclass[11pt,letterpaper]{book}
\setlength{\oddsidemargin}{0.5in}
@@ -66,7 +66,7 @@ All rights reserved.
Editor: Larry Gritz \\
\emph{lg@imageworks.com}
}
\date{{\large Date: 1 Aug 2020 \\
\date{{\large Date: 11 Aug 2020 \\
% (with corrections, 21 Jul 2020)
}
\bigskip
@@ -3064,7 +3064,7 @@ Returns 1 if $x>0$, -1 if $x<0$, 0 if $x=0$.
\emph{type} {\ce trunc} (\emph{type} x) }
\indexapi{floor()} \indexapi{ceil()} \indexapi{round()} \indexapi{trunc()}
Various rouinding methods: {\cf floor} returns the largest integer less
Various rounding methods: {\cf floor} returns the largest integer less
than or equal to $x$; {\cf ceil} returns the smallest integer greater than
or equal to $x$; {\cf round} returns the closest integer to $x$, in
either direction; and {\cf trunc} returns the integral part of $x$
@@ -3756,8 +3756,10 @@ The type of interpolation is specified by the \emph{basis} name,
\qkw{bezier}, \qkw{bspline}, \qkw{hermite}, \qkw{linear}, or
\qkw{constant}. Some basis
types require particular numbers of knot values -- Bezier splines
require $4n+3$ values, Hermite splines require $4n+2$ values,
Catmull-Rom and linear splines may use any number of values $n\ge 4$.
require $3n+1$ values, Hermite splines require $2n+2$ values, and all of
Catmull-Rom, linear, and constant requires $3+n$, where in all cases,
$n \ge 1$ is the number of spline segments.
To maintain consistency with the other spline types, \qkw{linear} splines will
ignore the first and last data value; interpolating piecewise-linearly
between $y_1$ and $y_{n-2}$, and \qkw{constant} splines ignore the first
+1 -1
View File
@@ -8,7 +8,7 @@
% Copyright Contributors to the Open Shading Language project.
% SPDX-License-Identifier: BSD-3-Clause
% https://github.com/imageworks/OpenShadingLanguage
% https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
%
Binary file not shown.
+1 -1
View File
@@ -1,6 +1,6 @@
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/imageworks/OpenShadingLanguage
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
file (GLOB public_headers OSL/*.h)
file (GLOB public_headers_imathx OSL/Imathx/*.h)
+13 -13
View File
@@ -1,6 +1,6 @@
// Copyright Contributors to the Open Shading Language project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/imageworks/OpenShadingLanguage
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
// Extensions to Imath classes for use in OSL's internals.
@@ -161,12 +161,12 @@ affineInverse(const Matrix44 &m)
ScalarT(1));
auto r = m.x[0][0] * s.x[0][0] + m.x[0][1] * s.x[1][0] + m.x[0][2] * s.x[2][0];
auto abs_r = IMATH_INTERNAL_NAMESPACE::abs (r);
auto abs_r = std::abs (r);
int may_have_divided_by_zero = 0;
if (OSL_UNLIKELY(abs_r < ScalarT(1)))
{
auto mr = abs_r / Imath::limits<ScalarT>::smallest();
auto mr = abs_r / std::numeric_limits<ScalarT>::min();
#if 0
OSL_PRAGMA(unroll)
for (int i = 0; i < 3; ++i)
@@ -174,7 +174,7 @@ affineInverse(const Matrix44 &m)
OSL_PRAGMA(unroll)
for (int j = 0; j < 3; ++j)
{
if (mr <= IMATH_INTERNAL_NAMESPACE::abs (s.x[i][j]))
if (mr <= std::abs (s.x[i][j]))
{
may_have_divided_by_zero = 1;
}
@@ -184,15 +184,15 @@ affineInverse(const Matrix44 &m)
// NOTE: using bitwise OR to avoid C++ semantics that cannot evaluate
// the right hand side of logical OR unless left hand side is false
if (
(mr <= IMATH_INTERNAL_NAMESPACE::abs (s.x[0][0])) |
(mr <= IMATH_INTERNAL_NAMESPACE::abs (s.x[0][1])) |
(mr <= IMATH_INTERNAL_NAMESPACE::abs (s.x[0][2])) |
(mr <= IMATH_INTERNAL_NAMESPACE::abs (s.x[1][0])) |
(mr <= IMATH_INTERNAL_NAMESPACE::abs (s.x[1][1])) |
(mr <= IMATH_INTERNAL_NAMESPACE::abs (s.x[1][2])) |
(mr <= IMATH_INTERNAL_NAMESPACE::abs (s.x[2][0])) |
(mr <= IMATH_INTERNAL_NAMESPACE::abs (s.x[2][1])) |
(mr <= IMATH_INTERNAL_NAMESPACE::abs (s.x[2][2]))
(mr <= std::abs (s.x[0][0])) |
(mr <= std::abs (s.x[0][1])) |
(mr <= std::abs (s.x[0][2])) |
(mr <= std::abs (s.x[1][0])) |
(mr <= std::abs (s.x[1][1])) |
(mr <= std::abs (s.x[1][2])) |
(mr <= std::abs (s.x[2][0])) |
(mr <= std::abs (s.x[2][1])) |
(mr <= std::abs (s.x[2][2]))
) {
may_have_divided_by_zero = 1;
}
+1 -1
View File
@@ -1,6 +1,6 @@
// Copyright Contributors to the Open Shading Language project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/imageworks/OpenShadingLanguage
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
#pragma once
+1 -1
View File
@@ -1,6 +1,6 @@
// Copyright Contributors to the Open Shading Language project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/imageworks/OpenShadingLanguage
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
#pragma once
+1 -1
View File
@@ -1,6 +1,6 @@
// Copyright Contributors to the Open Shading Language project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/imageworks/OpenShadingLanguage
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
// clang-format off
+1 -1
View File
@@ -1,6 +1,6 @@
// Copyright Contributors to the Open Shading Language project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/imageworks/OpenShadingLanguage
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
// clang-format off
+1 -1
View File
@@ -1,6 +1,6 @@
// Copyright Contributors to the Open Shading Language project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/imageworks/OpenShadingLanguage
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
#pragma once
+1 -1
View File
@@ -1,6 +1,6 @@
// Copyright Contributors to the Open Shading Language project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/imageworks/OpenShadingLanguage
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
// clang-format off
+17 -6
View File
@@ -1,6 +1,6 @@
// Copyright Contributors to the Open Shading Language project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/imageworks/OpenShadingLanguage
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
#pragma once
@@ -74,7 +74,7 @@ enum class TargetISA
/// tied to OSL internals at all.
class OSLEXECPUBLIC LLVM_Util {
public:
struct PerThreadInfo {
struct OSLEXECPUBLIC PerThreadInfo {
PerThreadInfo() {}
~PerThreadInfo();
private:
@@ -93,7 +93,7 @@ public:
// controlled by the the existence of ScopedJitMemoryUser objects.
// When the last ScopedJitMemoryUser goes out of scope or is deleted,
// then the underlying memory managers will be deleted
struct ScopedJitMemoryUser {
struct OSLEXECPUBLIC ScopedJitMemoryUser {
ScopedJitMemoryUser();
~ScopedJitMemoryUser();
};
@@ -577,6 +577,9 @@ public:
llvm::Value *src, int srcalign, int len);
/// Dereference a pointer: return *ptr
/// type is the type of the thing being pointed to.
llvm::Value *op_load (llvm::Type* type, llvm::Value *ptr);
// Blind pointer version that's deprecated as of LLVM13:
llvm::Value *op_load (llvm::Value *ptr);
/// Store to a dereferenced pointer: *ptr = val
@@ -589,17 +592,25 @@ public:
/// Generate a GEP (get element pointer) where the element index is an
/// llvm::Value, which can be generated from either a constant or a
/// runtime-computed integer element index.
/// runtime-computed integer element index. `type` is the type of the data
/// we're retrieving.
llvm::Value *GEP (llvm::Type* type, llvm::Value *ptr, llvm::Value *elem);
// Blind pointer version that's deprecated as of LLVM13:
llvm::Value *GEP (llvm::Value *ptr, llvm::Value *elem);
/// Generate a GEP (get element pointer) with an integer element
/// offset.
/// offset. `type` is the type of the data we're retrieving.
llvm::Value *GEP (llvm::Type* type, llvm::Value *ptr, int elem);
// Blind pointer version that's deprecated as of LLVM13:
llvm::Value *GEP (llvm::Value *ptr, int elem);
/// Generate a GEP (get element pointer) with two integer element
/// offsets. This is just a special (and common) case of GEP where
/// we have a 2-level hierarchy and we have fixed element indices
/// that are known at compile time.
/// that are known at compile time. `type` is the type of the data we're
/// retrieving.
llvm::Value *GEP (llvm::Type* type, llvm::Value *ptr, int elem1, int elem2);
// Blind pointer version that's deprecated as of LLVM13:
llvm::Value *GEP (llvm::Value *ptr, int elem1, int elem2);
// Arithmetic ops. It auto-detects the type (int vs float).
+2 -1
View File
@@ -1,6 +1,6 @@
// Copyright Contributors to the Open Shading Language project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/imageworks/OpenShadingLanguage
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
// Extend Imath matrix classes to include 2x2, as analogous as possible
@@ -15,6 +15,7 @@
#pragma once
#define OSL_MATRIX22_H
#include <OSL/oslconfig.h>
+1 -1
View File
@@ -1,6 +1,6 @@
// Copyright Contributors to the Open Shading Language project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/imageworks/OpenShadingLanguage
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
#pragma once
+1 -1
View File
@@ -1,6 +1,6 @@
// Copyright Contributors to the Open Shading Language project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/imageworks/OpenShadingLanguage
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
#pragma once
+1 -1
View File
@@ -1,6 +1,6 @@
// Copyright Contributors to the Open Shading Language project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/imageworks/OpenShadingLanguage
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
#pragma once
+30 -17
View File
@@ -1,6 +1,6 @@
// Copyright Contributors to the Open Shading Language project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/imageworks/OpenShadingLanguage
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
#pragma once
@@ -11,19 +11,28 @@
// All the things we need from Imath.
// We've replicated some Imath files in OSL/Imathx, adding the decorations
// needed for them to be safe to compile with Cuda (and sometimes other
// improvements). We will eventually push all of these fixes to OpenEXR.
#include <OSL/Imathx/ImathLimits.h>
#include <OSL/Imathx/ImathVec.h>
#include <OSL/Imathx/ImathMatrix.h>
#include <OSL/Imathx/ImathColor.h>
#include <OSL/matrix22.h>
#define OSL_USING_IMATH @OSL_USING_IMATH@
#if OSL_USING_IMATH >= 3
# include <Imath/ImathVec.h>
# include <Imath/ImathMatrix.h>
# include <Imath/ImathColor.h>
#else
// OpenEXR 2.x lacks the Cuda decorators we need, so we replicated some
// Imath files in OSL/Imathx, adding the decorations needed for them to
// be safe to compile with Cuda (and sometimes other improvements).
# include <OSL/Imathx/ImathLimits.h>
# include <OSL/Imathx/ImathVec.h>
# include <OSL/Imathx/ImathMatrix.h>
# include <OSL/Imathx/ImathColor.h>
# include <OSL/matrix22.h>
#endif
// Temporary bug fix: having trouble with cuda complaining about {fmt} lib.
// Work around by disabling it from oiio headers.
// The fmt library causes trouble for Cuda. Work around by disabling it from
// oiio headers (OIIO <= 2.1) or telling fmt not to use the troublesome
// int128 that Cuda doesn't understand (OIIO >= 2.2).
#ifdef __CUDA_ARCH__
# define OIIO_USE_FMT 0
# define FMT_USE_INT128 0
#endif
// All the things we need from OpenImageIO
@@ -58,13 +67,17 @@ typedef float Float;
/// matrices have the same data layout as Float[n][n]; and (c) your
/// classes have most of the obvious constructors and overloaded
/// operators one would expect from a C++ vector/matrix/color class.
typedef Imath::Vec3<Float> Vec3;
typedef Imath::Matrix33<Float> Matrix33;
typedef Imath::Matrix44<Float> Matrix44;
typedef Imath::Color3<Float> Color3;
typedef Imath::Vec2<Float> Vec2;
using Vec2 = Imath::Vec2<Float>;
using Vec3 = Imath::Vec3<Float>;
using Color3 = Imath::Color3<Float>;
using Matrix33 = Imath::Matrix33<Float>;
using Matrix44 = Imath::Matrix44<Float>;
typedef Imathx::Matrix22<Float> Matrix22;
#if OSL_USING_IMATH >= 3
using Matrix22 = Imath::Matrix22<Float>;
#else
using Matrix22 = Imathx::Matrix22<Float>;
#endif
/// Assume that we are dealing with OpenImageIO's texture system. It
+10 -10
View File
@@ -1,6 +1,6 @@
// Copyright Contributors to the Open Shading Language project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/imageworks/OpenShadingLanguage
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
#pragma once
@@ -88,7 +88,7 @@ public:
/// int no_pointcloud Skip pointcloud lookups. (0)
/// int exec_repeat How many times to run each group (1).
/// int opt_warnings Warn on certain failure to runtime-optimize
/// cetain shader constructs. (0)
/// certain shader constructs. (0)
/// int gpu_opt_error Consider a hard error if certain shader
/// constructs cannot be optimized away. (0)
/// 2. Attributes that should be set by applications/renderers that
@@ -468,7 +468,7 @@ public:
/// Replace a parameter value in a previously-declared shader group.
/// This is meant to called after the ShaderGroupBegin/End, but will
/// fail if the shader has already been irrevocably optimized/compiled,
/// unless the paraticular parameter is marked as lockgeom=0 (which
/// unless the particular parameter is marked as lockgeom=0 (which
/// indicates that it's a parameter that may be overridden by the
/// geometric primitive). This call gives you a way of changing the
/// instance value, even if it's not a geometric override.
@@ -667,20 +667,20 @@ public:
/// to the optimizer, and will be determined strictly at execution time.
void set_raytypes(ShaderGroup *group, int raytypes_on, int raytypes_off);
/// Ensure that the group has been optimized and JITed. The ctx pointer
/// Ensure that the group has been optimized and optionally JITed. The ctx pointer
/// supplies a ShadingContext to use.
void optimize_group (ShaderGroup *group, ShadingContext *ctx);
void optimize_group (ShaderGroup *group, ShadingContext *ctx, bool do_jit = true);
/// Ensure that the group has been optimized and JITed. This is a
/// Ensure that the group has been optimized and optionally JITed. This is a
/// convenience function that simply calls set_raytypes followed by
/// optimize_group. The ctx supplies a ShadingContext to use.
void optimize_group (ShaderGroup *group, int raytypes_on,
int raytypes_off, ShadingContext *ctx);
int raytypes_off, ShadingContext *ctx, bool do_jit = true);
/// If option "greedyjit" was set, this call will trigger all
/// shader groups that have not yet been compiled to do so with the
/// specified number of threads (0 means use all available HW cores).
void optimize_all_groups (int nthreads=0);
void optimize_all_groups (int nthreads=0, bool do_jit = true);
/// Return a pointer to the TextureSystem being used.
TextureSystem * texturesys () const;
@@ -713,7 +713,7 @@ public:
/// float -> triple replicate x3
/// float -> float[4] replicate x4
/// float -> int truncate like a (int) type cast
/// triple -> triple copy, regarless of differing vector types
/// triple -> triple copy, regardless of differing vector types
/// 3. Additional rules not allowed in OSL source code:
/// float -> float[2] replicate x2
/// int -> float[2] convert to float and replicate x2
@@ -768,7 +768,7 @@ shade_image(ShadingSystem& shadingsys, ShaderGroup& group,
cspan<ustring> outputs,
ShadeImageLocations shadelocations = ShadePixelCenters,
OIIO::ROI roi = OIIO::ROI(),
OIIO::ImageBufAlgo::parallel_image_options popt = 0);
OIIO::parallel_options popt = 0);
#endif
+3 -3
View File
@@ -1,6 +1,6 @@
// Copyright Contributors to the Open Shading Language project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/imageworks/OpenShadingLanguage
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
// clang-format off
@@ -62,7 +62,7 @@ template <typename S, typename T> OSL_HOSTDEVICE Vec3 vnoise (S x, T y);
// Cell noise on 1-4 dimensional domain, range [0,1].
// cellnoise is constant within each unit cube (cell) on the domain, but
// discontinuous at integer boundaries (and uncorrellated from cell to
// discontinuous at integer boundaries (and uncorrelated from cell to
// cell).
template <typename S > OSL_HOSTDEVICE float cellnoise (S x);
template <typename S, typename T> OSL_HOSTDEVICE float cellnoise (S x, T y);
@@ -71,7 +71,7 @@ template <typename S, typename T> OSL_HOSTDEVICE Vec3 vcellnoise (S x, T y);
// Hash noise on 1-4 dimensional domain, range [0,1].
// hashnoise is like cellnoise, but without the 'floor' -- in other words,
// it's an uncorrellated hash that is different for every floating point
// it's an uncorrelated hash that is different for every floating point
// value.
template <typename S > OSL_HOSTDEVICE float hashnoise (S x);
template <typename S, typename T> OSL_HOSTDEVICE float hashnoise (S x, T y);
+2 -2
View File
@@ -1,6 +1,6 @@
// Copyright Contributors to the Open Shading Language project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/imageworks/OpenShadingLanguage
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
/*
The code in this file is based somewhat on code released by NVIDIA as
@@ -136,7 +136,7 @@ public:
bool open(string_view shadername, string_view searchpath = string_view());
///< For an uninitialized `OSLQuery` object, initialize it with info on
/// the named shader with optional searcphath. Return true for success,
/// the named shader with optional searchpath. Return true for success,
/// false if the shader could not be found or opened properly.
bool open_bytecode(string_view buffer);
+3 -3
View File
@@ -1,6 +1,6 @@
// Copyright Contributors to the Open Shading Language project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/imageworks/OpenShadingLanguage
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
#ifndef OSLVERSION_H
@@ -30,7 +30,7 @@
#define OSL_LIBRARY_VERSION_MINOR @PROJECT_VERSION_MINOR@
#define OSL_LIBRARY_VERSION_PATCH @PROJECT_VERSION_PATCH@
#define OSL_LIBRARY_VERSION_TWEAK @PROJECT_VERSION_TWEAK@
#define OSL_LIBRARY_VERSION_RELEASE_TYPE @OPROJECT_VERSION_RELEASE_TYPE@
#define OSL_LIBRARY_VERSION_RELEASE_TYPE @PROJECT_VERSION_RELEASE_TYPE@
#define OSL_LIBRARY_VERSION_CODE (10000 * OSL_VERSION_MAJOR + \
100 * OSL_VERSION_MINOR + \
@@ -44,7 +44,7 @@
OSL_LIBRARY_VERSION_MINOR, \
OSL_LIBRARY_VERSION_PATCH, \
OSL_LIBRARY_VERSION_RELEASE_TYPE)
#define OSL_INTRO_STRING "OpenShadingLanguage " OSL_LIBRARY_VERSION_STRING
#define OSL_INTRO_STRING "Open Shading Language " OSL_LIBRARY_VERSION_STRING
#define OSL_COPYRIGHT_STRING "Copyright Contributors to the Open Shading Language project."
+8 -8
View File
@@ -1,6 +1,6 @@
// Copyright Contributors to the Open Shading Language project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/imageworks/OpenShadingLanguage
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
/////////////////////////////////////////////////////////////////////////
// \file
@@ -160,7 +160,7 @@
// Generic pragma definition
#if defined(_MSC_VER)
// Of couse MS does it in a quirky way
// Of course MS does it in a quirky way
#define OSL_PRAGMA(UnQuotedPragma) __pragma(UnQuotedPragma)
#else
// All other compilers seem to support C99 _Pragma
@@ -271,7 +271,7 @@
// calls should be inlined, and so on recursively. Has no affect on function calls to
// whose definition exists in different translation units or calls that are not
// legal to inline (possibly by OSL_NOINLINE). Intent is to ensure that entire
// contents of a SIMD loop body is are fully inlined avoiding compiler hueristcs.
// contents of a SIMD loop body is are fully inlined avoiding compiler heuristics.
// However if any debugging code exists inside the code block, then the amount
// of code inlined could explode. So great care should be used when placing
// code inside one of these forced inline blocks. Note that if OSL_DEBUG is true,
@@ -454,7 +454,7 @@ using std::assume_aligned;
// Until we have c++20, we can provide our own version of std::assume_aligned
// http://open-std.org/JTC1/SC22/WG21/docs/papers/2018/p1007r0.pdf
template<int AlignmentT, class DataT>
template<int Alignment, class DataT>
OSL_NODISCARD
#ifndef __INTEL_COMPILER // constexpr not compatible with ICC's __assume_aligned
constexpr
@@ -462,18 +462,18 @@ OSL_NODISCARD
DataT* assume_aligned(DataT* ptr)
{
#ifdef __INTEL_COMPILER
__assume_aligned(ptr, AlignmentT);
__assume_aligned(ptr, Alignment);
return ptr;
#elif defined(__clang__) || defined(__GNUC__)
return reinterpret_cast<DataT*>(__builtin_assume_aligned(ptr, AlignmentT));
return reinterpret_cast<DataT*>(__builtin_assume_aligned(ptr, Alignment));
#elif defined(_MSC_VER)
constexpr std::uintptr_t unaligned_bit_mask = ((1 << N) - 1);
constexpr std::uintptr_t unaligned_bit_mask = (Alignment - 1);
if ((reinterpret_cast<std::uintptr_t>(ptr) & unaligned_bit_mask) == 0)
return ptr;
else
__assume(0); // let compiler know we should never reach this branch
#else
#error unknown compiler, update osl_assume_aligned to handle (or explicitly ignore) emitting a pointer alignment hint
#error unknown compiler, update assume_aligned to handle (or explicitly ignore) emitting a pointer alignment hint
return ptr;
#endif
}
+2 -2
View File
@@ -1,6 +1,6 @@
// Copyright Contributors to the Open Shading Language project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/imageworks/OpenShadingLanguage
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
// clang-format off
@@ -129,7 +129,7 @@ public:
/// the name of one of the coordinate systems). A renderer is free
/// to not implement this, in which case the default implementation
/// is simply to make appropriate calls to get_matrix and
/// get_inverse_matrix. The existance of this method is to allow
/// get_inverse_matrix. The existence of this method is to allow
/// some renderers to provide transformations that cannot be
/// expressed by a 4x4 matrix.
///
+1 -1
View File
@@ -1,6 +1,6 @@
// Copyright Contributors to the Open Shading Language project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/imageworks/OpenShadingLanguage
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
// clang-format off
+30 -13
View File
@@ -1,6 +1,6 @@
// Copyright Contributors to the Open Shading Language project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/imageworks/OpenShadingLanguage
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
// Contributions Copyright (c) 2017 Intel Inc., et al.
// clang-format off
@@ -8,13 +8,12 @@
#pragma once
#include <cmath>
#include <limits>
#include "dual.h"
#include "dual_vec.h"
#include <OSL/Imathx/Imathx.h>
#include <OpenEXR/ImathFun.h>
#include <OpenEXR/ImathMatrix.h>
#include <OpenImageIO/fmath.h>
@@ -144,8 +143,23 @@ namespace sfm
#endif
}
#if OSL_USING_IMATH >= 3
// Imath 3.0 has adequate optimized versions of these.
// because lengthTiny does alot of work including another
OSL_FORCEINLINE OSL_HOSTDEVICE
float length(const Vec3 &N)
{
return N.length();
}
OSL_FORCEINLINE OSL_HOSTDEVICE Vec3
normalize(const Vec3 &N)
{
return N.normalized();
}
#else
// because lengthTiny does a lot of work including another
// sqrt, we really want to skip that if possible because
// with SIMD execution, we end up doing the sqrt twice
// and blending the results. Although code could be
@@ -187,7 +201,7 @@ namespace sfm
absY /= max;
absZ /= max;
return max * Imath::Math<float>::sqrt (absX * absX + absY * absY + absZ * absZ);
return max * std::sqrt(absX * absX + absY * absY + absZ * absZ);
}
OSL_FORCEINLINE OSL_HOSTDEVICE
@@ -195,10 +209,10 @@ namespace sfm
{
float length2 = N.dot (N);
if (OSL_UNLIKELY(length2 < float (2) * Imath::limits<float>::smallest()))
if (OSL_UNLIKELY(length2 < 2.0f * std::numeric_limits<float>::min()))
return accessibleTinyLength(N);
return Imath::Math<float>::sqrt (length2);
return std::sqrt(length2);
}
OSL_FORCEINLINE OSL_HOSTDEVICE Vec3
@@ -211,7 +225,7 @@ namespace sfm
return Vec3 (N.x / l, N.y / l, N.z / l);
}
#endif
OSL_FORCEINLINE OSL_HOSTDEVICE Dual2<Vec3>
normalize (const Dual2<Vec3> &a)
@@ -243,10 +257,13 @@ namespace sfm
return (right > left)? right: left;
}
class Matrix33 : public Imath::Matrix33<float>
#if OSL_USING_IMATH >= 3
using Matrix33 = OSL::Matrix33;
#else
class Matrix33 : public OSL::Matrix33
{
public:
typedef Imath::Matrix33<float> parent;
typedef OSL::Matrix33 parent;
OSL_FORCEINLINE OSL_HOSTDEVICE Matrix33 (Imath::Uninitialized uninit)
: parent(uninit)
@@ -264,14 +281,14 @@ namespace sfm
: parent(a,b,c,d,e,f,g,h,i)
{}
OSL_FORCEINLINE OSL_HOSTDEVICE Matrix33 (const Imath::Matrix33<float> &a)
OSL_FORCEINLINE OSL_HOSTDEVICE Matrix33 (const OSL::Matrix33 &a)
: parent(a)
{}
// Avoid the memcpy that is part of the Imath::Matrix33
OSL_FORCEINLINE OSL_HOSTDEVICE
Matrix33 (const float a[3][3])
: Imath::Matrix33<float>(
: OSL::Matrix33(
a[0][0], a[0][1], a[0][2],
a[1][0], a[1][1], a[1][2],
a[2][0], a[2][1], a[2][2])
@@ -339,7 +356,7 @@ namespace sfm
return tmp;
}
};
#endif
OSL_FORCEINLINE OSL_HOSTDEVICE sfm::Matrix33
make_matrix33_cols (const Vec3 &a, const Vec3 &b, const Vec3 &c)
+2 -2
View File
@@ -1,6 +1,6 @@
// Copyright Contributors to the Open Shading Language project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/imageworks/OpenShadingLanguage
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
#pragma once
@@ -98,7 +98,7 @@ struct ShaderGlobals {
TransformationPtr object2common;
TransformationPtr shader2common;
/// The output closure will be placed here. The rendererer should
/// The output closure will be placed here. The renderer should
/// initialize this to NULL before shading execution, and this is where
/// it can retrieve the output closure from after shader execution has
/// completed.
+1 -1
View File
@@ -1,6 +1,6 @@
// Copyright Contributors to the Open Shading Language project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/imageworks/OpenShadingLanguage
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
// This file contains "declarations" for all the strings that might get used in
+1 -1
View File
@@ -1,6 +1,6 @@
// Copyright Contributors to the Open Shading Language project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/imageworks/OpenShadingLanguage
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
// Contributions Copyright (c) 2017 Intel Inc., et al.
// clang-format off
+1 -1
View File
@@ -1,6 +1,6 @@
// Copyright Contributors to the Open Shading Language project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/imageworks/OpenShadingLanguage
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
#pragma once
+12 -12
View File
@@ -1,6 +1,6 @@
// Copyright Contributors to the Open Shading Language project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/imageworks/OpenShadingLanguage
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
#pragma once
@@ -484,7 +484,7 @@ public:
{
}
Symbol() : m_data(NULL), m_free_data(false) {}
~Symbol()
virtual ~Symbol()
{
if (m_free_data)
delete[](char*) m_data;
@@ -764,15 +764,15 @@ protected:
char m_symtype; ///< Kind of symbol (param, local, etc.)
unsigned m_has_derivs : 1; ///< Step to derivs (0 == has no derivs)
unsigned m_const_initializer : 1; ///< initializer is a constant expression
unsigned m_connected_down : 1; ///< Connected to a later/downtream layer
unsigned m_initialized : 1; ///< If a param, has it been initialized?
unsigned m_lockgeom : 1; ///< Is the param not overridden by geom?
unsigned m_allowconnect : 1; ///< Is the param not overridden by geom?
unsigned m_renderer_output : 1; ///< Is this sym a renderer output?
unsigned m_readonly : 1; ///< read-only symbol
char m_valuesource; ///< Where did the value come from?
bool m_free_data; ///< Free m_data upon destruction?
short m_fieldid; ///< Struct field of this var (or -1)
unsigned m_connected_down : 1; ///< Connected to a later/downstream layer
unsigned m_initialized : 1; ///< If a param, has it been initialized?
unsigned m_lockgeom : 1; ///< Is the param not overridden by geom?
unsigned m_allowconnect : 1; ///< Is the param not overridden by geom?
unsigned m_renderer_output : 1; ///< Is this sym a renderer output?
unsigned m_readonly : 1; ///< read-only symbol
char m_valuesource; ///< Where did the value come from?
bool m_free_data; ///< Free m_data upon destruction?
short m_fieldid; ///< Struct field of this var (or -1)
short m_layer; ///< Layer (within the group) this belongs to
int m_scope; ///< Scope where this symbol was declared
int m_dataoffset; ///< Offset of the data (-1 for unknown)
@@ -792,7 +792,7 @@ typedef std::vector<Symbol*> SymbolPtrVec;
/// Intermediate Represenatation opcode
/// Intermediate Representation opcode
///
class Opcode {
public:
+19 -5
View File
@@ -1,6 +1,6 @@
# Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/imageworks/OpenShadingLanguage
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
set (local_lib oslcomp)
file (GLOB lib_src "*.cpp")
@@ -20,18 +20,32 @@ add_library (${local_lib} ${lib_src})
target_include_directories(${local_lib}
PUBLIC
${CMAKE_INSTALL_FULL_INCLUDEDIR}
${OPENIMAGEIO_INCLUDES}
${ILMBASE_INCLUDES}
${IMATH_INCLUDES}
)
target_compile_definitions (${local_lib} PRIVATE OSL_EXPORTS)
target_link_libraries (${local_lib}
PUBLIC
${OPENIMAGEIO_LIBRARIES} ${ILMBASE_LIBRARIES}
OpenImageIO::OpenImageIO
# For OpenEXR/Imath 3.x:
$<$<TARGET_EXISTS:Imath::Imath>:Imath::Imath>
$<$<TARGET_EXISTS:Imath::Half>:Imath::Half>
# For OpenEXR >= 2.4/2.5 with reliable exported targets
$<$<TARGET_EXISTS:IlmBase::Imath>:IlmBase::Imath>
$<$<TARGET_EXISTS:IlmBase::Half>:IlmBase::Half>
$<$<TARGET_EXISTS:IlmBase::IlmThread>:IlmBase::IlmThread>
$<$<TARGET_EXISTS:IlmBase::Iex>:IlmBase::Iex>
# For OpenEXR <= 2.3:
${ILMBASE_LIBRARIES}
PRIVATE
${Boost_LIBRARIES} ${CMAKE_DL_LIBS}
${CLANG_LIBRARIES} ${LLVM_LIBRARIES} ${LLVM_LDFLAGS}
${LLVM_SYSTEM_LIBRARIES})
# link with (system) library to prevent missing symbols inside clangDriver.lib
if (MSVC)
target_link_libraries (${local_lib} PRIVATE "Version.lib")
endif()
set_target_properties (${local_lib}
PROPERTIES
VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}
@@ -41,7 +55,7 @@ set_target_properties (${local_lib}
)
if (VISIBILITY_COMMAND)
if (VISIBILITY_MAP_COMMAND)
set_property (TARGET ${local_lib}
APPEND PROPERTY LINK_FLAGS ${VISIBILITY_MAP_COMMAND})
endif ()
+1 -1
View File
@@ -1,6 +1,6 @@
// Copyright Contributors to the Open Shading Language project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/imageworks/OpenShadingLanguage
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
#include <algorithm>
#include <functional>
+27 -26
View File
@@ -1,6 +1,6 @@
// Copyright Contributors to the Open Shading Language project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/imageworks/OpenShadingLanguage
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
#pragma once
@@ -176,7 +176,7 @@ public:
return this;
}
/// Detatch any 'next' nodes.
/// Detach any 'next' nodes.
void detach_next() { m_next.reset(); }
/// Concatenate ASTNode sequences A and B, returning a raw pointer to
@@ -320,7 +320,7 @@ protected:
void typecheck_children(TypeSpec expected = TypeSpec());
/// Helper for check_arglist: simple case of checking a single arg type
/// agaisnt the front of the formals list (which will be advanced).
/// against the front of the formals list (which will be advanced).
bool check_simple_arg(const TypeSpec& argtype, const char*& formals,
bool coerce);
@@ -383,7 +383,7 @@ protected:
bool is_constructor = false,
Symbol* arrayindex = nullptr);
// Codegen an array assignemnt: lval[index] = src
// Codegen an array assignment: lval[index] = src
// If no index is provided the constant i is used.
// Will return either src or a temporary that was codegened.
Symbol* codegen_aassign(TypeSpec elemtype, Symbol* src, Symbol* lval,
@@ -422,7 +422,7 @@ private:
class ASTshader_declaration : public ASTNode {
class ASTshader_declaration final : public ASTNode {
public:
ASTshader_declaration(OSLCompilerImpl* comp, int stype, ustring name,
ASTNode* form, ASTNode* stmts, ASTNode* meta);
@@ -444,7 +444,7 @@ private:
class ASTfunction_declaration : public ASTNode {
class ASTfunction_declaration final : public ASTNode {
public:
ASTfunction_declaration(OSLCompilerImpl* comp, TypeSpec type, ustring name,
ASTNode* form, ASTNode* stmts, ASTNode* meta,
@@ -474,7 +474,7 @@ private:
class ASTvariable_declaration : public ASTNode {
class ASTvariable_declaration final : public ASTNode {
public:
ASTvariable_declaration(OSLCompilerImpl* comp, const TypeSpec& type,
ustring name, ASTNode* init, bool isparam,
@@ -531,7 +531,7 @@ private:
class ASTvariable_ref : public ASTNode {
class ASTvariable_ref final : public ASTNode {
public:
ASTvariable_ref(OSLCompilerImpl* comp, ustring name);
const char* nodetypename() const { return "variable_ref"; }
@@ -550,7 +550,7 @@ private:
class ASTpreincdec : public ASTNode {
class ASTpreincdec final : public ASTNode {
public:
ASTpreincdec(OSLCompilerImpl* comp, int op, ASTNode* expr);
const char* nodetypename() const
@@ -566,7 +566,7 @@ public:
class ASTpostincdec : public ASTNode {
class ASTpostincdec final : public ASTNode {
public:
ASTpostincdec(OSLCompilerImpl* comp, int op, ASTNode* expr);
const char* nodetypename() const
@@ -582,7 +582,7 @@ public:
class ASTindex : public ASTNode {
class ASTindex final : public ASTNode {
public:
// ASTindex (OSLCompilerImpl *comp, ASTNode *expr, ASTNode *index);
// ASTindex (OSLCompilerImpl *comp, ASTNode *expr, ASTNode *index, ASTNode *index2);
@@ -617,7 +617,7 @@ public:
class ASTstructselect : public ASTNode {
class ASTstructselect final : public ASTNode {
public:
ASTstructselect(OSLCompilerImpl* comp, ASTNode* expr, ustring field);
const char* nodetypename() const { return "structselect"; }
@@ -653,7 +653,7 @@ private:
class ASTconditional_statement : public ASTNode {
class ASTconditional_statement final : public ASTNode {
public:
ASTconditional_statement(OSLCompilerImpl* comp, ASTNode* cond,
ASTNode* truestmt, ASTNode* falsestmt = NULL)
@@ -674,7 +674,7 @@ public:
class ASTloop_statement : public ASTNode {
class ASTloop_statement final : public ASTNode {
public:
enum LoopType { LoopWhile, LoopDo, LoopFor };
@@ -695,7 +695,7 @@ public:
class ASTloopmod_statement : public ASTNode {
class ASTloopmod_statement final : public ASTNode {
public:
enum LoopModType { LoopModBreak, LoopModContinue };
@@ -713,7 +713,7 @@ public:
class ASTreturn_statement : public ASTNode {
class ASTreturn_statement final : public ASTNode {
public:
ASTreturn_statement(OSLCompilerImpl* comp, ASTNode* expr)
: ASTNode(return_statement_node, comp, 0, expr)
@@ -763,7 +763,8 @@ public:
};
class ASTcompound_initializer : public ASTtype_constructor {
class ASTcompound_initializer final : public ASTtype_constructor {
bool m_ctor;
TypeSpec typecheck(TypeSpec expected, unsigned mode);
@@ -787,7 +788,7 @@ public:
class ASTassign_expression : public ASTNode {
class ASTassign_expression final : public ASTNode {
public:
ASTassign_expression(OSLCompilerImpl* comp, ASTNode* var, Operator op,
ASTNode* expr);
@@ -804,7 +805,7 @@ public:
class ASTunary_expression : public ASTNode {
class ASTunary_expression final : public ASTNode {
public:
ASTunary_expression(OSLCompilerImpl* comp, int op, ASTNode* expr);
@@ -823,7 +824,7 @@ private:
class ASTbinary_expression : public ASTNode {
class ASTbinary_expression final : public ASTNode {
public:
ASTbinary_expression(OSLCompilerImpl* comp, Operator op, ASTNode* left,
ASTNode* right);
@@ -847,7 +848,7 @@ private:
class ASTternary_expression : public ASTNode {
class ASTternary_expression final : public ASTNode {
public:
ASTternary_expression(OSLCompilerImpl* comp, ASTNode* cond,
ASTNode* trueexpr, ASTNode* falseexpr)
@@ -867,7 +868,7 @@ public:
class ASTcomma_operator : public ASTNode {
class ASTcomma_operator final : public ASTNode {
public:
ASTcomma_operator(OSLCompilerImpl* comp, ASTNode* exprlist)
: ASTNode(comma_operator_node, comp, Nothing, exprlist)
@@ -884,7 +885,7 @@ public:
class ASTtypecast_expression : public ASTNode {
class ASTtypecast_expression final : public ASTNode {
public:
ASTtypecast_expression(OSLCompilerImpl* comp, TypeSpec typespec,
ASTNode* expr)
@@ -903,7 +904,7 @@ public:
class ASTfunction_call : public ASTNode {
class ASTfunction_call final : public ASTNode {
public:
ASTfunction_call(OSLCompilerImpl* comp, ustring name, ASTNode* args,
FunctionSymbol* funcsym = nullptr);
@@ -942,7 +943,7 @@ private:
void typecheck_builtin_specialcase();
/// Make sure the printf-like format string matches the list of
/// arguments poitned to by arg. If ok, return true, otherwise
/// arguments pointed to by arg. If ok, return true, otherwise
/// return false and call an appropriate error().
bool typecheck_printf_args(const char* format, ASTNode* arg);
@@ -1019,7 +1020,7 @@ private:
class ASTliteral : public ASTNode {
class ASTliteral final : public ASTNode {
public:
ASTliteral(OSLCompilerImpl* comp, int i)
: ASTNode(literal_node, comp), m_i(i)
+5 -5
View File
@@ -1,6 +1,6 @@
// Copyright Contributors to the Open Shading Language project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/imageworks/OpenShadingLanguage
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
#include <iostream>
#include <string>
@@ -154,7 +154,7 @@ OSLCompilerImpl::add_struct_fields(StructSpec* structspec, ustring basename,
arr ? NULL : init);
} else {
if (node && init && !arr) {
// Remember the pairing of this field and the iniial expr.
// Remember the pairing of this field and the initial expr.
((ASTvariable_declaration*)node)
->register_struct_init(fieldname, init);
}
@@ -911,7 +911,7 @@ ASTNode::codegen_initlist(ref init, TypeSpec type, Symbol* sym)
ASTvariable_declaration* v = (ASTvariable_declaration*)this;
std::string out;
if (v->param_default_literals(fieldsym, init.get(), out))
continue; // Skip if we had a static initalizer
continue; // Skip if we had a static initializer
}
codegen_initlist(init, fieldsym->typespec(), fieldsym);
}
@@ -1338,7 +1338,7 @@ ASTstructselect::codegen_assign(Symbol* dest, Symbol* src)
// A struct select needs to decypher whether there is an array index
// A struct select needs to decipher whether there is an array index
// necessary in the chain of events. The only kind of assignment that
// makes sense is a series of struct field selections, array indexings,
// or (last) a direct variable reference (for the top level struct).
@@ -1831,7 +1831,7 @@ ASTfunction_call::codegen(Symbol* dest)
TypeSpec formaltype = (i < (int)polyargs.size())
? polyargs[i]
: TypeSpec(TypeDesc::UNKNOWN);
bool writearg = argwrite(i + returnarg);
bool writearg = argwrite(i + returnarg);
codegen_arg(argdest, index, index2, index3, i, a, form, formaltype,
writearg, indexed_output_params);
if (form)
+8 -1
View File
@@ -1,6 +1,6 @@
// Copyright Contributors to the Open Shading Language project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/imageworks/OpenShadingLanguage
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
#include <cerrno>
@@ -490,6 +490,13 @@ OSLCompilerImpl::compile(string_view filename,
write_oso_file(OIIO::Strutil::join(options, " "),
preprocess_result);
OSL_DASSERT(m_osofile == nullptr);
oso_output.close();
if (!oso_output.good()) {
errorf(ustring(), 0, "Failed to write to \"%s\"",
m_output_filename);
return false;
}
}
oslcompiler = nullptr;

Some files were not shown because too many files have changed in this diff Show More