Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ab7b8cea3c | ||
|
|
e5552e0097 | ||
|
|
ac508f91b7 | ||
|
|
0428618794 | ||
|
|
45ae428d47 | ||
|
|
10d121cc90 | ||
|
|
3c9af6495c | ||
|
|
b7fff57a2a | ||
|
|
1a72c471fe | ||
|
|
0abda7e635 | ||
|
|
1f8d3948f1 | ||
|
|
6f7b968690 | ||
|
|
6f7e47f872 | ||
|
|
bdab36793d | ||
|
|
0c0f22893c | ||
|
|
179771698a | ||
|
|
b6f08c8fd6 | ||
|
|
c3be3c6c4e | ||
|
|
2e38787c27 | ||
|
|
9fe3a0b256 | ||
|
|
9d9ccd09dc | ||
|
|
37bf53b756 | ||
|
|
d9dfaa2ee2 | ||
|
|
3d22bcc582 | ||
|
|
6f2dfd1710 | ||
|
|
11e8baa294 | ||
|
|
84b696da7c | ||
|
|
f2cd0ff4a8 | ||
|
|
9a1a8e2e9a | ||
|
|
0a8278d509 | ||
|
|
481852f8a9 | ||
|
|
f9121bb666 | ||
|
|
1627fe394e | ||
|
|
70f542fc19 | ||
|
|
259ba8c143 | ||
|
|
d282e12a7c | ||
|
|
a2a7fb49ed | ||
|
|
3dd1d94fe0 | ||
|
|
603b03b978 | ||
|
|
14840fd6e5 | ||
|
|
3985c0fa62 | ||
|
|
7bcf83eb85 | ||
|
|
a0eb54e611 | ||
|
|
344fded69a | ||
|
|
11739968de | ||
|
|
3ac1fb39f7 | ||
|
|
5f6bb88677 | ||
|
|
8265a0705a | ||
|
|
12474fd6b5 | ||
|
|
bd96957b2c | ||
|
|
ae8fa4e7f0 | ||
|
|
826b75e6bc | ||
|
|
354ece3415 | ||
|
|
46627c701b | ||
|
|
9b4487f111 | ||
|
|
66c4dcb34b | ||
|
|
b5f2069e22 | ||
|
|
f2f70f329d | ||
|
|
44eba69f7e | ||
|
|
d4e959aa1f | ||
|
|
693ed85fdd | ||
|
|
f7fc1c3ed8 | ||
|
|
3a343a5fac | ||
|
|
c29399433f | ||
|
|
6ab45815c4 | ||
|
|
00a5e6d65c | ||
|
|
2c491a7606 | ||
|
|
998479f843 | ||
|
|
190c3f08a9 | ||
|
|
2ebca7b7d6 | ||
|
|
4b5fc375f3 | ||
|
|
18fa4cfd01 | ||
|
|
8725c3c65e | ||
|
|
a1761c7901 | ||
|
|
1cfaf7712f | ||
|
|
c4860f0b1f | ||
|
|
29f14845d3 | ||
|
|
e9a8ec55c2 | ||
|
|
c7d7ec272a | ||
|
|
ee5ae28cfa | ||
|
|
9da2d792be | ||
|
|
d7591f047b | ||
|
|
233a54a056 | ||
|
|
7c77f05683 | ||
|
|
749e8c6d6a | ||
|
|
2a3f9436f1 | ||
|
|
b8eb28d141 | ||
|
|
5d8dc32adf | ||
|
|
04307c7488 | ||
|
|
89fc3a24d3 | ||
|
|
4d7b8d82c8 | ||
|
|
818be8e5ed | ||
|
|
30b690b300 | ||
|
|
02df65d643 | ||
|
|
a76c42d522 | ||
|
|
d6e49796f8 | ||
|
|
532053ee97 | ||
|
|
67693b9a75 | ||
|
|
8599942486 | ||
|
|
87f71d19e7 | ||
|
|
6c7fc6fd0b | ||
|
|
2f6507d52b | ||
|
|
8bc38f4996 | ||
|
|
c71d804f74 | ||
|
|
915b3fa55a | ||
|
|
36b14526c9 | ||
|
|
7294115c2f | ||
|
|
fe52953331 | ||
|
|
f1f80784d1 | ||
|
|
3d164fe82d | ||
|
|
05deead9b6 | ||
|
|
96a307dbb2 | ||
|
|
f009086b2e | ||
|
|
e8b32a28da | ||
|
|
96d0131cd9 | ||
|
|
b1b77ef2a8 | ||
|
|
7b79649b54 | ||
|
|
b094ed4e7e | ||
|
|
04f37e95a4 | ||
|
|
b00e03d7d9 | ||
|
|
323c1c1a4b | ||
|
|
9948e5839f | ||
|
|
5c342f6280 | ||
|
|
73e420999e | ||
|
|
c48d7170a9 | ||
|
|
392f0f809f | ||
|
|
3a85f7a3c4 | ||
|
|
6f2b3f6b4c | ||
|
|
0043bf9421 | ||
|
|
d7a48ed159 | ||
|
|
c048a332c6 | ||
|
|
6cfa9724d8 | ||
|
|
43f649be57 | ||
|
|
4b2f330d96 | ||
|
|
e3aa2cf5a1 | ||
|
|
8b71d4d613 | ||
|
|
cc3de84492 | ||
|
|
d0d4a06069 | ||
|
|
4ce094f6ab | ||
|
|
3e7b51f950 | ||
|
|
ac63a5a1f9 | ||
|
|
ffc5b903c8 | ||
|
|
ddb959e38a | ||
|
|
e2caeb0080 | ||
|
|
b795e3e92a | ||
|
|
121638e4ce | ||
|
|
669bea1cec | ||
|
|
5ad18693ec | ||
|
|
d5e04dc38a | ||
|
|
907ddce3c5 | ||
|
|
edcd505a3d | ||
|
|
4176a6f6f5 | ||
|
|
42ccf223af | ||
|
|
5446c1d17f | ||
|
|
8d523a8170 | ||
|
|
635d156771 | ||
|
|
33173501ae | ||
|
|
016a4689f8 | ||
|
|
71dd75945f | ||
|
|
b6055bf93e | ||
|
|
d18141619c | ||
|
|
6ea0a2f929 | ||
|
|
ac2402075e | ||
|
|
6a5c866193 | ||
|
|
541e870b0f | ||
|
|
bcb5adbc29 | ||
|
|
416410dae6 | ||
|
|
453d25b290 | ||
|
|
bda74950bc | ||
|
|
0d3e9d2781 | ||
|
|
2a4c40199e | ||
|
|
96745ede0a | ||
|
|
35b12e4420 | ||
|
|
cb082880ad | ||
|
|
98adc799a1 | ||
|
|
4c1d4e9825 | ||
|
|
8e247c7f43 | ||
|
|
7210aa5ed0 | ||
|
|
2c8c9d42d6 | ||
|
|
ec26af3253 | ||
|
|
75d1ce2f41 | ||
|
|
fabc3fbb7c | ||
|
|
172af6489b | ||
|
|
48c0b16c89 | ||
|
|
a97387a50b | ||
|
|
f769afd1e0 | ||
|
|
d65c589166 | ||
|
|
185a3a8210 | ||
|
|
35a4ef87f6 | ||
|
|
d8c6f9a004 | ||
|
|
00473ce1b2 | ||
|
|
78e539204e | ||
|
|
709c5ff6b2 | ||
|
|
2fd6b384b4 | ||
|
|
df49a401b0 | ||
|
|
f598155c64 | ||
|
|
4686f6b7ea | ||
|
|
3ecfd64952 | ||
|
|
b472adccf1 | ||
|
|
7738e2366d | ||
|
|
bd71665232 | ||
|
|
f5cfcc2862 | ||
|
|
2c7fbf30d7 | ||
|
|
9f4aa5ee5d | ||
|
|
5ee978dcd5 | ||
|
|
28b71e7c85 | ||
|
|
f1aa00951b | ||
|
|
269a8977ce | ||
|
|
b865cb0258 | ||
|
|
64000b4c8f | ||
|
|
3a42777a7c | ||
|
|
074baf4bf2 | ||
|
|
8913eed603 | ||
|
|
e4781703d5 | ||
|
|
20461f1622 | ||
|
|
fe38c321e4 | ||
|
|
142426d62b | ||
|
|
152bbc9386 | ||
|
|
7f3ff8ce38 | ||
|
|
27a8bdebca | ||
|
|
0fd14170a8 | ||
|
|
b0b3cf998e | ||
|
|
321c803d78 | ||
|
|
b20a55e8b0 | ||
|
|
2362523726 | ||
|
|
10f444f25d | ||
|
|
65024b0e6a | ||
|
|
02e2bc3c73 | ||
|
|
b284a8b850 | ||
|
|
ba775bf890 | ||
|
|
0d122e781c | ||
|
|
9e3d7e4e50 | ||
|
|
e0f7b4e115 | ||
|
|
056ba1802e | ||
|
|
f6b88b9053 | ||
|
|
bba9b353c2 | ||
|
|
b859317915 | ||
|
|
3ff5d5d91d | ||
|
|
eb9b08789c | ||
|
|
ca136d78a7 | ||
|
|
bc55bed795 | ||
|
|
a21ba65a2c | ||
|
|
312d79454e | ||
|
|
33f24ec557 | ||
|
|
633b3d3599 | ||
|
|
44fccbdda4 | ||
|
|
b6c8dde7b9 | ||
|
|
477d979347 | ||
|
|
a987aa9e8d | ||
|
|
7fe43cec6e | ||
|
|
b08abb8d03 | ||
|
|
b210ab4def | ||
|
|
fefeb5a099 | ||
|
|
4738a0fdf5 | ||
|
|
0ed60f93ba | ||
|
|
50f3adf0f8 | ||
|
|
6432f9bb87 | ||
|
|
baa9a093b6 | ||
|
|
58aec3decf | ||
|
|
5d666faf5e | ||
|
|
8468d7dae7 | ||
|
|
86fd9f9082 | ||
|
|
bdf9f24f2a | ||
|
|
77ceebb335 | ||
|
|
e8a5c1f737 | ||
|
|
b206b16054 | ||
|
|
7316669cd4 | ||
|
|
becc03d390 | ||
|
|
35820fc99b | ||
|
|
8a1242f75b | ||
|
|
d4b372b1bb | ||
|
|
7fd9c3f88c | ||
|
|
a9ce35135e | ||
|
|
efd139aef8 | ||
|
|
378f056033 | ||
|
|
f4f3342857 | ||
|
|
70a9beb912 | ||
|
|
12530f115d | ||
|
|
253c4105ed | ||
|
|
cf31311c3a | ||
|
|
3d52f3906b | ||
|
|
e154a220b6 | ||
|
|
da8f2be156 | ||
|
|
bc864771df | ||
|
|
b38487532d | ||
|
|
7985893a76 | ||
|
|
58ae6a1551 | ||
|
|
9320db9f2a | ||
|
|
4d39f8099f | ||
|
|
41a45b68ea | ||
|
|
8374278a07 | ||
|
|
78b861f34a | ||
|
|
7710b1be46 | ||
|
|
0e55efbd99 | ||
|
|
0d4c343759 | ||
|
|
9636c8c66c | ||
|
|
784bf53e88 | ||
|
|
cdfec4f31d | ||
|
|
3567aac515 | ||
|
|
00ea8a80fd | ||
|
|
a95116f793 | ||
|
|
b8a100e427 | ||
|
|
0210c88374 | ||
|
|
baca4c2de6 | ||
|
|
e4766b4516 | ||
|
|
f00da4f788 | ||
|
|
e327241a30 | ||
|
|
a569d4f0be | ||
|
|
46250b4c10 | ||
|
|
e235661479 | ||
|
|
fdc0579931 | ||
|
|
d4faecd79d | ||
|
|
f449749f24 | ||
|
|
8c2d8c03b4 | ||
|
|
373e359b49 | ||
|
|
7afd948737 | ||
|
|
473bbfcdbd | ||
|
|
05f4acee5b | ||
|
|
a4e779c44f | ||
|
|
271f8bc30e | ||
|
|
9e30a4e6df | ||
|
|
3df1aa2f98 | ||
|
|
afc44289fc | ||
|
|
3bf59982e5 | ||
|
|
cce40c38b8 | ||
|
|
1863d04edc | ||
|
|
06c42d5c18 | ||
|
|
8dae508b4f | ||
|
|
b4f0517f0c | ||
|
|
5e10537608 | ||
|
|
4962ac2a1b | ||
|
|
1956e83954 | ||
|
|
50ccc8736f | ||
|
|
6a5c50e3f3 | ||
|
|
49aac8740d | ||
|
|
c06df65331 | ||
|
|
4e9e640e5b | ||
|
|
b76a53a779 | ||
|
|
4e958e92c1 | ||
|
|
188ec977a5 | ||
|
|
417088e91a | ||
|
|
16d217a21f | ||
|
|
6a2e2960ef | ||
|
|
606beade27 | ||
|
|
71a9310f0b | ||
|
|
5c49a7c6b5 | ||
|
|
abdc966a19 | ||
|
|
374543f040 | ||
|
|
089268b87d | ||
|
|
74b2b30669 | ||
|
|
91699ba7d3 | ||
|
|
4afe9244e8 | ||
|
|
ed9857c416 | ||
|
|
cd22f602a4 | ||
|
|
17d211a3d3 | ||
|
|
20299563ee | ||
|
|
5600d020a0 | ||
|
|
37f4bbc1a2 | ||
|
|
b13b7f08b0 | ||
|
|
7ebfbc4a05 | ||
|
|
e402988611 | ||
|
|
88be276ec1 | ||
|
|
6f1fedb08d | ||
|
|
0bd014cfe2 | ||
|
|
209c672b0b | ||
|
|
49cda0a472 | ||
|
|
787d8ce94e | ||
|
|
89f1e69d88 | ||
|
|
fff0c5985d | ||
|
|
a047c065b7 | ||
|
|
bc735d02cf | ||
|
|
f64f6effc0 | ||
|
|
a620231929 | ||
|
|
df818a7045 | ||
|
|
bee79468e0 | ||
|
|
f8ad0281aa | ||
|
|
b9cb0ae74c | ||
|
|
5879868561 | ||
|
|
c5fe678c9e | ||
|
|
dbe8c214e4 | ||
|
|
fbe141b42b | ||
|
|
a68a972602 | ||
|
|
23edc185a0 | ||
|
|
203dcecafe | ||
|
|
bbbc28d2ff | ||
|
|
649f0b86a3 | ||
|
|
31e92ddc06 | ||
|
|
9ae5b69fd8 | ||
|
|
3bd3778610 | ||
|
|
a8d3ac06e6 | ||
|
|
c0a5998c19 | ||
|
|
5dad5076bc | ||
|
|
317c59ed73 | ||
|
|
66c9b61d72 | ||
|
|
8036e174fb | ||
|
|
b064b25721 | ||
|
|
8d1d9f0cf6 | ||
|
|
1c196d935c | ||
|
|
a878883eeb | ||
|
|
1b3c96603c | ||
|
|
e468ef7595 | ||
|
|
fae61e699f | ||
|
|
7b6854823d | ||
|
|
f84126fb3e | ||
|
|
395e58d6bf | ||
|
|
75401bda4c | ||
|
|
8530aa059a | ||
|
|
bd7fd4cf8c | ||
|
|
61ea4c9a31 | ||
|
|
afec48ebde | ||
|
|
9ef1741056 | ||
|
|
1e8ef316ac | ||
|
|
aafb5cb74e | ||
|
|
d0e49675e5 | ||
|
|
dde0a3451a | ||
|
|
3187864f9b | ||
|
|
66747ac1e6 | ||
|
|
d867d98a50 |
@@ -0,0 +1,16 @@
|
|||||||
|
# Copyright Contributors to the Open Shading Language project.
|
||||||
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||||
|
|
||||||
|
# Ignore skills that might be installed locally by a developer, to prevent
|
||||||
|
# cluttering the output of `git status` and prevent people from accidentally
|
||||||
|
# checking in locally installed skills.
|
||||||
|
skills/*
|
||||||
|
|
||||||
|
# But don't ignore the ones that belong to this project and are checked in. As
|
||||||
|
# we add skills that we intend to commit and make available to all project
|
||||||
|
# developers, they must be individually added here if they don't start with
|
||||||
|
# "osl-".
|
||||||
|
!skills/osl-*/
|
||||||
|
!skills/prepare-patch-release/
|
||||||
|
!skills/release-notes-update/
|
||||||
@@ -0,0 +1,313 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# .agents/setup-agent — Set up AI coding tool integration for this repository.
|
||||||
|
#
|
||||||
|
# Creates the tool-specific symlinks and config files needed to use the shared
|
||||||
|
# resources in AGENTS.md and .agents/ with your preferred AI coding assistant.
|
||||||
|
# Run "setup-agent <tool>" once after cloning; re-running is always safe.
|
||||||
|
#
|
||||||
|
# The canonical project instructions live in AGENTS.md (root) and skills live
|
||||||
|
# in .agents/skills/<name>/SKILL.md. Everything tool-specific is either a
|
||||||
|
# symlink into those locations, or a thin wrapper that references them.
|
||||||
|
# Tool-specific directories (.claude/, .cursor/, etc.) are git-ignored so that
|
||||||
|
# each developer runs this script for the tool they actually use.
|
||||||
|
#
|
||||||
|
# ─────────────────────────────────────────────────────────────────────────────
|
||||||
|
# TOOL STRATEGIES (update this section when tool conventions change)
|
||||||
|
# ─────────────────────────────────────────────────────────────────────────────
|
||||||
|
#
|
||||||
|
# CLAUDE CODE
|
||||||
|
# Reads: .claude/CLAUDE.md (project) or CLAUDE.md (root) — NOT AGENTS.md natively.
|
||||||
|
# If Anthropic eventually adds native AGENTS.md support, the
|
||||||
|
# .claude/CLAUDE.md wrapper can be retired.
|
||||||
|
# Skills: .claude/skills/ (each subdirectory is a skill)
|
||||||
|
# Setup: Write .claude/CLAUDE.md containing "@AGENTS.md" (Claude's include
|
||||||
|
# syntax), symlink .claude/skills -> ../.agents/skills.
|
||||||
|
# Docs: https://docs.anthropic.com/en/docs/claude-code/memory
|
||||||
|
# https://docs.anthropic.com/en/docs/claude-code/skills
|
||||||
|
#
|
||||||
|
# OPENAI CODEX
|
||||||
|
# Reads: AGENTS.md natively — no wrapper needed.
|
||||||
|
# Skills: .agents/skills/ natively, and also .codex/skills/ as a fallback.
|
||||||
|
# Setup: Symlink .codex/skills -> ../.agents/skills so either path works.
|
||||||
|
# Docs: https://developers.openai.com/codex/guides/agents-md
|
||||||
|
# https://developers.openai.com/codex/skills
|
||||||
|
#
|
||||||
|
# CURSOR
|
||||||
|
# Reads: .cursor/rules/*.mdc files — does NOT read AGENTS.md natively.
|
||||||
|
# If Cursor adds native AGENTS.md support, the rules symlink can be
|
||||||
|
# retired.
|
||||||
|
# Skills: Cursor uses a different slash-command mechanism; .agents/skills/
|
||||||
|
# are not directly usable today, but the convention may change.
|
||||||
|
# Setup: Symlink .cursor/rules/project.mdc -> ../../AGENTS.md so Cursor
|
||||||
|
# picks up our instructions as a project rule.
|
||||||
|
# Docs: https://docs.cursor.com/context/rules-for-ai
|
||||||
|
# https://docs.cursor.com/cmdk/overview
|
||||||
|
#
|
||||||
|
# OPENCODE
|
||||||
|
# Reads: AGENTS.md natively — no wrapper needed.
|
||||||
|
# Skills: Documented to read .agents/skills/ natively, but in practice also
|
||||||
|
# requires .opencode/commands/<name>.md symlinks (as of 2025-05).
|
||||||
|
# Remove the per-command symlinks once opencode reliably finds
|
||||||
|
# .agents/skills/ on its own.
|
||||||
|
# Setup: Symlink .opencode/skills -> ../.agents/skills (future-proof),
|
||||||
|
# plus individual .opencode/commands/<name>.md -> skill SKILL.md
|
||||||
|
# files (current workaround).
|
||||||
|
# Docs: https://opencode.ai/docs/configuration
|
||||||
|
# https://opencode.ai/docs/skills
|
||||||
|
#
|
||||||
|
# GITHUB COPILOT
|
||||||
|
# Reads: AGENTS.md natively (VS Code Copilot ≥ 1.99 / GitHub Copilot Chat).
|
||||||
|
# Also reads .github/copilot-instructions.md as a fallback for older
|
||||||
|
# clients or non-VS Code surfaces.
|
||||||
|
# Skills: .agents/skills/ natively supported.
|
||||||
|
# Setup: Symlink .github/copilot-instructions.md -> ../AGENTS.md so older
|
||||||
|
# clients also receive our instructions. Remove once all Copilot
|
||||||
|
# surfaces reliably pick up AGENTS.md directly.
|
||||||
|
# Docs: https://code.visualstudio.com/docs/copilot/customization/custom-instructions
|
||||||
|
# https://docs.github.com/en/copilot/concepts/about-prompting-copilot
|
||||||
|
# https://docs.github.com/en/copilot/concepts/agents/about-agent-skills
|
||||||
|
# ─────────────────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||||
|
SKILLS_DIR=".agents/skills"
|
||||||
|
SUPPORTED_TOOLS="claude codex cursor opencode copilot"
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
cat <<EOF
|
||||||
|
Usage: .agents/setup-agent <tool|all|clear|list> [tool...]
|
||||||
|
|
||||||
|
Commands:
|
||||||
|
<tool> [...] Set up one or more tools
|
||||||
|
all Set up all supported tools
|
||||||
|
clear Remove all tool-specific setup created by this script
|
||||||
|
clear <tool> Remove setup for one specific tool
|
||||||
|
list List supported tools
|
||||||
|
|
||||||
|
Supported tools: $SUPPORTED_TOOLS
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
.agents/setup-agent claude
|
||||||
|
.agents/setup-agent claude cursor
|
||||||
|
.agents/setup-agent all
|
||||||
|
.agents/setup-agent clear
|
||||||
|
.agents/setup-agent clear opencode
|
||||||
|
EOF
|
||||||
|
}
|
||||||
|
|
||||||
|
rel() { echo "${1#"$REPO_ROOT"/}"; }
|
||||||
|
|
||||||
|
# Create a symlink only if the path doesn't already exist.
|
||||||
|
# Silent if the link already points to the correct target.
|
||||||
|
safe_symlink() {
|
||||||
|
local link="$1" target="$2"
|
||||||
|
if [ -L "$link" ] && [ "$(readlink "$link")" = "$target" ]; then
|
||||||
|
return 0
|
||||||
|
elif [ -e "$link" ] || [ -L "$link" ]; then
|
||||||
|
echo " SKIP (already exists): $(rel "$link")"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
mkdir -p "$(dirname "$link")"
|
||||||
|
ln -s "$target" "$link"
|
||||||
|
echo " LINK: $(rel "$link") -> $target"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Write a file only if the path doesn't already exist.
|
||||||
|
safe_write() {
|
||||||
|
local file="$1"
|
||||||
|
shift
|
||||||
|
local content="$*"
|
||||||
|
if [ -e "$file" ]; then
|
||||||
|
echo " SKIP (already exists): $(rel "$file")"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
mkdir -p "$(dirname "$file")"
|
||||||
|
printf '%s\n' "$content" > "$file"
|
||||||
|
echo " FILE: $(rel "$file")"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Remove a symlink only if it still points to the expected target.
|
||||||
|
safe_remove_symlink() {
|
||||||
|
local link="$1" expected_target="$2"
|
||||||
|
[ ! -L "$link" ] && return 0
|
||||||
|
if [ "$(readlink "$link")" = "$expected_target" ]; then
|
||||||
|
rm "$link"
|
||||||
|
echo " REMOVED: $(rel "$link")"
|
||||||
|
else
|
||||||
|
echo " SKIP (modified, not removing): $(rel "$link")"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Remove a file only if its content still matches what we wrote.
|
||||||
|
safe_remove_file() {
|
||||||
|
local file="$1"
|
||||||
|
shift
|
||||||
|
local expected="$*"
|
||||||
|
[ ! -f "$file" ] || [ -L "$file" ] && return 0
|
||||||
|
if [ "$(cat "$file")" = "$expected" ]; then
|
||||||
|
rm "$file"
|
||||||
|
echo " REMOVED: $(rel "$file")"
|
||||||
|
else
|
||||||
|
echo " SKIP (modified, not removing): $(rel "$file")"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
try_rmdir() { rmdir "$1" 2>/dev/null && echo " RMDIR: $(rel "$1")" || true; }
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# Common (tool-agnostic project setup)
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
setup_common() {
|
||||||
|
echo "Setting up common project infrastructure..."
|
||||||
|
# specs/ at the project root is a symlink into docs/dev/specs/ so that
|
||||||
|
# speckit bash scripts find the directory where they expect it, while the
|
||||||
|
# actual specs are committed under docs/dev/specs/ and are not cluttered
|
||||||
|
# at the project root for developers who don't use agents.
|
||||||
|
safe_symlink "$REPO_ROOT/specs" "docs/dev/specs"
|
||||||
|
}
|
||||||
|
clear_common() {
|
||||||
|
echo "Removing common project infrastructure..."
|
||||||
|
safe_remove_symlink "$REPO_ROOT/specs" "docs/dev/specs"
|
||||||
|
}
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# Claude Code (.claude/)
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
setup_claude() {
|
||||||
|
echo "Setting up Claude Code..."
|
||||||
|
safe_write "$REPO_ROOT/.claude/CLAUDE.md" "@AGENTS.md"
|
||||||
|
safe_symlink "$REPO_ROOT/.claude/skills" "../.agents/skills"
|
||||||
|
safe_write "$REPO_ROOT/.claude/.gitignore" "settings.local.json"
|
||||||
|
}
|
||||||
|
clear_claude() {
|
||||||
|
echo "Removing Claude Code setup..."
|
||||||
|
safe_remove_file "$REPO_ROOT/.claude/CLAUDE.md" "@AGENTS.md"
|
||||||
|
safe_remove_symlink "$REPO_ROOT/.claude/skills" "../.agents/skills"
|
||||||
|
safe_remove_file "$REPO_ROOT/.claude/.gitignore" "settings.local.json"
|
||||||
|
try_rmdir "$REPO_ROOT/.claude"
|
||||||
|
}
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# OpenAI Codex (.codex/)
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
setup_codex() {
|
||||||
|
echo "Setting up OpenAI Codex..."
|
||||||
|
safe_symlink "$REPO_ROOT/.codex/skills" "../.agents/skills"
|
||||||
|
safe_write "$REPO_ROOT/.codex/.gitignore" "*.log"
|
||||||
|
}
|
||||||
|
clear_codex() {
|
||||||
|
echo "Removing OpenAI Codex setup..."
|
||||||
|
safe_remove_symlink "$REPO_ROOT/.codex/skills" "../.agents/skills"
|
||||||
|
safe_remove_file "$REPO_ROOT/.codex/.gitignore" "*.log"
|
||||||
|
try_rmdir "$REPO_ROOT/.codex"
|
||||||
|
}
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# Cursor (.cursor/)
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
setup_cursor() {
|
||||||
|
echo "Setting up Cursor..."
|
||||||
|
safe_symlink "$REPO_ROOT/.cursor/rules/project.mdc" "../../AGENTS.md"
|
||||||
|
safe_write "$REPO_ROOT/.cursor/.gitignore" "$(printf 'composer/\nchat/')"
|
||||||
|
}
|
||||||
|
clear_cursor() {
|
||||||
|
echo "Removing Cursor setup..."
|
||||||
|
safe_remove_symlink "$REPO_ROOT/.cursor/rules/project.mdc" "../../AGENTS.md"
|
||||||
|
safe_remove_file "$REPO_ROOT/.cursor/.gitignore" "$(printf 'composer/\nchat/')"
|
||||||
|
try_rmdir "$REPO_ROOT/.cursor/rules"
|
||||||
|
try_rmdir "$REPO_ROOT/.cursor"
|
||||||
|
}
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# Opencode (.opencode/)
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
OPENCODE_GITIGNORE="$(printf 'node_modules\npackage.json\npackage-lock.json\nbun.lock')"
|
||||||
|
|
||||||
|
setup_opencode() {
|
||||||
|
echo "Setting up Opencode..."
|
||||||
|
safe_symlink "$REPO_ROOT/.opencode/skills" "../.agents/skills"
|
||||||
|
safe_write "$REPO_ROOT/.opencode/.gitignore" "$OPENCODE_GITIGNORE"
|
||||||
|
# Individual command links (needed in practice despite docs implying otherwise)
|
||||||
|
for skill_dir in "$REPO_ROOT/$SKILLS_DIR"/*/; do
|
||||||
|
[ -d "$skill_dir" ] || continue
|
||||||
|
local skill_name
|
||||||
|
skill_name="$(basename "$skill_dir")"
|
||||||
|
safe_symlink "$REPO_ROOT/.opencode/commands/${skill_name}.md" \
|
||||||
|
"../../$SKILLS_DIR/${skill_name}/SKILL.md"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
clear_opencode() {
|
||||||
|
echo "Removing Opencode setup..."
|
||||||
|
safe_remove_symlink "$REPO_ROOT/.opencode/skills" "../.agents/skills"
|
||||||
|
safe_remove_file "$REPO_ROOT/.opencode/.gitignore" "$OPENCODE_GITIGNORE"
|
||||||
|
for skill_dir in "$REPO_ROOT/$SKILLS_DIR"/*/; do
|
||||||
|
[ -d "$skill_dir" ] || continue
|
||||||
|
local skill_name
|
||||||
|
skill_name="$(basename "$skill_dir")"
|
||||||
|
safe_remove_symlink "$REPO_ROOT/.opencode/commands/${skill_name}.md" \
|
||||||
|
"../../$SKILLS_DIR/${skill_name}/SKILL.md"
|
||||||
|
done
|
||||||
|
try_rmdir "$REPO_ROOT/.opencode/commands"
|
||||||
|
try_rmdir "$REPO_ROOT/.opencode"
|
||||||
|
}
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# GitHub Copilot (.github/copilot-instructions.md)
|
||||||
|
# Copilot natively reads AGENTS.md, but also checks copilot-instructions.md.
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
setup_copilot() {
|
||||||
|
echo "Setting up GitHub Copilot..."
|
||||||
|
safe_symlink "$REPO_ROOT/.github/copilot-instructions.md" "../AGENTS.md"
|
||||||
|
}
|
||||||
|
clear_copilot() {
|
||||||
|
echo "Removing GitHub Copilot setup..."
|
||||||
|
safe_remove_symlink "$REPO_ROOT/.github/copilot-instructions.md" "../AGENTS.md"
|
||||||
|
}
|
||||||
|
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
# Dispatch
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
run_tool() {
|
||||||
|
local action="$1" tool="$2"
|
||||||
|
case "$tool" in
|
||||||
|
claude) "${action}_claude" ;;
|
||||||
|
codex) "${action}_codex" ;;
|
||||||
|
cursor) "${action}_cursor" ;;
|
||||||
|
opencode) "${action}_opencode" ;;
|
||||||
|
copilot) "${action}_copilot" ;;
|
||||||
|
*)
|
||||||
|
echo "Unknown tool: $tool (supported: $SUPPORTED_TOOLS)" >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
[ $# -eq 0 ] && { usage; exit 0; }
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
all)
|
||||||
|
setup_common
|
||||||
|
for t in $SUPPORTED_TOOLS; do run_tool setup "$t"; done
|
||||||
|
;;
|
||||||
|
clear)
|
||||||
|
shift
|
||||||
|
if [ $# -eq 0 ]; then
|
||||||
|
for t in $SUPPORTED_TOOLS; do run_tool clear "$t"; done
|
||||||
|
clear_common
|
||||||
|
else
|
||||||
|
for t in "$@"; do run_tool clear "$t"; done
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
list)
|
||||||
|
echo "Supported tools: $SUPPORTED_TOOLS"
|
||||||
|
;;
|
||||||
|
-h|--help|help)
|
||||||
|
usage
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
setup_common
|
||||||
|
for t in "$@"; do run_tool setup "$t"; done
|
||||||
|
;;
|
||||||
|
esac
|
||||||
@@ -0,0 +1,103 @@
|
|||||||
|
---
|
||||||
|
name: prepare-patch-release
|
||||||
|
description: Do all the tasks needed for a patch release of the project.argument-hint: [new-version]
|
||||||
|
---
|
||||||
|
|
||||||
|
Do all the tasks needed for a patch release of the project. These patch
|
||||||
|
releases generally happen on the first day of every month.
|
||||||
|
|
||||||
|
Arguments: `$ARGUMENTS`
|
||||||
|
- First argument (optional): the version of the upcoming release we are
|
||||||
|
preparing. If omitted, find the most recent tag on this branch, and the
|
||||||
|
new version will update the third portion of the version. It might be
|
||||||
|
either a version number (like `3.1.4.0`) or a tag (like `v3.1.4.0`).
|
||||||
|
|
||||||
|
Hint: The numeric "version" is a four-part numeric deignation with the pattern
|
||||||
|
`MAJOR.MINOR.PATCH.TWEAK`. The "version tag" is usually the numeric version
|
||||||
|
with a "v" prepended, for example, `v3.1.4.0`.
|
||||||
|
|
||||||
|
## Steps and Checklist
|
||||||
|
|
||||||
|
- [ ] Determine the version of the new release.
|
||||||
|
- [ ] Update the main @CMakeLists.txt.
|
||||||
|
- [ ] Use the "release-notes-update" skill to update @CHANGES.md.
|
||||||
|
- [ ] Review the release notes to ensure that the changes do not deprecate any
|
||||||
|
API calls or break API or ABI backward-compatibility, or remove support
|
||||||
|
for any dependency or toolchain versions. If you think these rules are
|
||||||
|
being violated, ask for confirmation.
|
||||||
|
- [ ] Review @README.md for changes.
|
||||||
|
- [ ] Review @INSTALL.md for changes.
|
||||||
|
- [ ] Review @CREDITS.md for changes.
|
||||||
|
- [ ] Review @SECURITY.md for changes.
|
||||||
|
|
||||||
|
## Steps to determine the versions of the last and new releases.
|
||||||
|
|
||||||
|
1. **Determine the previous tag** if not provided by looking at the
|
||||||
|
most recent git tag in the current branch, and deducing the 4-part
|
||||||
|
version number from that.
|
||||||
|
2. The assumed new version for a patch release has the same major and minor
|
||||||
|
numbers, the patch number is incremented by one since the last tag, and the
|
||||||
|
tweak number is "0".
|
||||||
|
3. If no optional version was present in the arguments, use the assumed new
|
||||||
|
version.
|
||||||
|
4. If a version was supplied in the arguments, double check that it differs
|
||||||
|
from the last tag as explained above. If it does not, ask for verification
|
||||||
|
that the version requested is correct before proceeding.
|
||||||
|
|
||||||
|
## Steps to update CMakeLists.txt
|
||||||
|
|
||||||
|
1. In the main @CMakeLists.txt, alter the version to that of the new release,
|
||||||
|
if it isn't already the same.
|
||||||
|
2. For a patch release, ensure that `${PROJECT_NAME}_SUPPORTED_RELEASE` should
|
||||||
|
be set to ON. In main (not yet a supported release) it shold be OFF. If you
|
||||||
|
find these to not be as expected, ask for confirmation of whether to fix.
|
||||||
|
3. For a patch release, `PROJECT_VERSEION_RELEASE_TYPE` should be set to empty
|
||||||
|
(""). In main, it will typically be "dev", "beta", or other designations.
|
||||||
|
If you find these to not be as expected, ask for confirmation of whether to
|
||||||
|
fix.
|
||||||
|
|
||||||
|
## Reviewing README.md
|
||||||
|
|
||||||
|
If this release added support for any new image file formats, be sure that
|
||||||
|
README.md mentions them in its list of image formats supported.
|
||||||
|
|
||||||
|
## Reviewing INSTALL.md
|
||||||
|
|
||||||
|
If any of the new commits (as described in the release notes for this version)
|
||||||
|
appear to add dependencies, or add support for new versions of dependencies,
|
||||||
|
be sure that INSTALL.md is updated to include that dependency (if not already
|
||||||
|
listed among the required and optional dependencies), and reflects the latest
|
||||||
|
version that we claim to support.
|
||||||
|
|
||||||
|
Double check @externalpackages.cmake and ensure that any minimum required
|
||||||
|
versions of dependencies that cmake will enforce match the oldest versions
|
||||||
|
of those dependencies as documentd in INSTALL.md.
|
||||||
|
|
||||||
|
## Reviewing CREDITS.md
|
||||||
|
|
||||||
|
The @CREDITS.md file lists all known contributors to the project, sorted alpha
|
||||||
|
by first name. In cases where an author's actual name is unknown, we use the
|
||||||
|
GitHub userid.
|
||||||
|
|
||||||
|
Ensure that any authors referenced in the new release notes for the version we
|
||||||
|
are releasing are inserted in the credit list, if they are not already
|
||||||
|
present. You don't need to check older versions, we presume those have already
|
||||||
|
been included.
|
||||||
|
|
||||||
|
## Reviewing SECURITY.md
|
||||||
|
|
||||||
|
The @SECURITY.md file lists which versions are currently supported at what
|
||||||
|
levels, and lists all previously-fixed SVE's or security advisories. Be sure
|
||||||
|
to check this file in older branches (the last two releases, say), and if you
|
||||||
|
are preparing a patch release, also check in main and more recent (higher
|
||||||
|
numbered) releases for more recently modified SECURITY.md, and be sure that
|
||||||
|
this branch gets amended with any information that seems to have been updated
|
||||||
|
more recently in those other branches. Check whichever is newer of the local
|
||||||
|
and remote copy of that branch, since the local one may have had release notes
|
||||||
|
or its version in CMakeLists.txt updated, but not yet pushed to GitHub.
|
||||||
|
|
||||||
|
|
||||||
|
## Reference
|
||||||
|
|
||||||
|
- Full release procedures: `docs/dev/RELEASING.md`
|
||||||
|
- Steps for updating release notes: `release-notes-update/SKILL.md`
|
||||||
@@ -0,0 +1,217 @@
|
|||||||
|
---
|
||||||
|
name: release-notes-update
|
||||||
|
description: Generate or update release notes for a patch, minor, or major release, or just to update main. Run git-cliff, organize and edit the output per project conventions, and insert into CHANGES.md.
|
||||||
|
argument-hint: [patch|minor|major|main] [prev-tag]
|
||||||
|
---
|
||||||
|
|
||||||
|
Generate release notes for an OSL release.
|
||||||
|
|
||||||
|
Arguments: `$ARGUMENTS`
|
||||||
|
- First argument (optional): release type — `patch` (default), `minor`, `major`, or `main`.
|
||||||
|
- Second argument (optional): previous release tag (e.g. `v3.1.2.0`). If omitted, find the most recent tag automatically. If the release type is `main`, instead of a tag, look for the last commit at which the CHANGES.md file was updated.
|
||||||
|
|
||||||
|
## Steps
|
||||||
|
|
||||||
|
1. **Determine the previous tag** if not provided:
|
||||||
|
```
|
||||||
|
git describe --tags --abbrev=0
|
||||||
|
```
|
||||||
|
or look at recent tags: `git tag --sort=-version:refname | head -10`.
|
||||||
|
However, if the "release type" is `main`, instead of a tag, just find
|
||||||
|
the commit at which CHANGES.md was last updated.
|
||||||
|
|
||||||
|
2. **Run git-cliff** to get raw commit data:
|
||||||
|
```
|
||||||
|
git cliff -c src/doc/cliff.toml <prev-tag>..HEAD > /tmp/cliff-out.md
|
||||||
|
```
|
||||||
|
Read `/tmp/cliff-out.md` to see the raw output.
|
||||||
|
|
||||||
|
3. **Read CHANGES.md** to see the current top of the file and understand where to insert.
|
||||||
|
|
||||||
|
4. **Format the release notes** according to the release type:
|
||||||
|
|
||||||
|
### For patch releases:
|
||||||
|
|
||||||
|
Follow the skeleton in `docs/dev/Changes-skeleton-patch.md`:
|
||||||
|
|
||||||
|
```
|
||||||
|
Release X.Y.Z.W (Month DD, YYYY) -- compared to X.Y.Z.W-1
|
||||||
|
---------------------------------------------------------
|
||||||
|
- *category*: Description. [#NNNN](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/NNNN) (by author)
|
||||||
|
```
|
||||||
|
|
||||||
|
Rules:
|
||||||
|
- **Remove** the section headings git-cliff generates; patch notes are a flat
|
||||||
|
list.
|
||||||
|
- **Add conventional commit prefixes** to any "uncategorized" entries (those
|
||||||
|
lacking a `feat:`, `fix:`, etc. prefix).
|
||||||
|
- **Reorder** entries logically: feature enhancements first, then bug fixes,
|
||||||
|
then build/CI fixes, then internal changes, then test improvements, then
|
||||||
|
docs/admin.
|
||||||
|
- **Omit** entries that are purely internal and too minor to matter to users.
|
||||||
|
Ask for confirmation about entries you propose to omit.
|
||||||
|
- Prefer to use author's actual name if known. If the name cannot be found,
|
||||||
|
the GitHub userid can be used instead.
|
||||||
|
- Omit the author if it is the project leader, Larry Gritz, unless he is not
|
||||||
|
the dominant author (at least 75% of commits) in this release.
|
||||||
|
- Keep entries to one line each. Be terse but informative.
|
||||||
|
- Use the format `*subsystem*:` for the category prefix (e.g., back end target
|
||||||
|
such as `*optix*:` or `*batch*:`, utility like `*testrender*:` or
|
||||||
|
`*osltoy*:`, class or API category like `*ShadingSystem*:`, or topic
|
||||||
|
category such as `*build*:`, `*ci*:`, `*docs*:`).
|
||||||
|
- We aim to make patch releases on the first day of each month. If we are
|
||||||
|
within a few days of a month end, list the date as the beginning of the
|
||||||
|
upcoming month. Ask for confirmation that this is the planned release date.
|
||||||
|
|
||||||
|
|
||||||
|
### For minor or major releases:
|
||||||
|
|
||||||
|
Follow the skeleton in `docs/dev/Changes-skeleton-major.md`. Sections:
|
||||||
|
|
||||||
|
```
|
||||||
|
Release X.Y.0.0 (Month, YYYY) -- compared to X.Y-1
|
||||||
|
--------------------------------------------------
|
||||||
|
|
||||||
|
### New minimum dependencies, toolchain, and compatibility changes:
|
||||||
|
### ✏️ OSL Language, standard library, and oslc compiler (for shader writers):
|
||||||
|
### ⛰️ API changes and new ShadingSystem features (for renderer writers):
|
||||||
|
### ☀️ testshade/testrender/osltoy improvements
|
||||||
|
### 🐛/🔧 Internals: fixes, improvements, and developer concerns
|
||||||
|
### 🏗 Build/test/CI and platform ports
|
||||||
|
* CMake build system and scripts:
|
||||||
|
* Dependency and platform support:
|
||||||
|
* Testing and Continuous integration (CI) systems:
|
||||||
|
### 📚 Notable documentation changes:
|
||||||
|
### 🏢 Project Administration
|
||||||
|
### 🤝 Contributors
|
||||||
|
```
|
||||||
|
|
||||||
|
Note that the section outline may already be present, in which case you
|
||||||
|
only need to fit items into the existing category outline.
|
||||||
|
|
||||||
|
Rules:
|
||||||
|
- Group commits into sections; within each section, cluster related items together.
|
||||||
|
- When needed, expand terse one-liners into enough prose that users understand what changed and why it matters.
|
||||||
|
- For `feat:` commits, make sure the feature is explained sufficiently — don't just copy the commit subject.
|
||||||
|
- For `api:` or `api!:` commits, clearly call out what changed in the public API.
|
||||||
|
- Include PR links and author attribution for every entry.
|
||||||
|
- The notes should "tell the story" of the release, not just be a dump of commit subjects.
|
||||||
|
- We aim to make major/minor releases approximately in October 1 of each year. If the anticipted release date is already in the file, don't change it. If it is not present, ask for confirmation of the planned release date.
|
||||||
|
|
||||||
|
### For updating release notes in main:
|
||||||
|
|
||||||
|
Rules:
|
||||||
|
- Generally, follow the rules for "major/minor releases", except as noted in other items below.
|
||||||
|
- Don't apply a new skeleton of category listings unless they are not present for the upcoming release.
|
||||||
|
|
||||||
|
5. **Insert the formatted notes** into `CHANGES.md` in the appropriate place (as detailed below). Leave the existing content intact.
|
||||||
|
- When updating `main` or preparing a `major` or `minor` release, insert the updates in the top section for the upcoming major/minor release. Insert a new set of category sections only if it's not already present.
|
||||||
|
- When doing a `patch` release, insert the changes immediately above the last patch release of that branch, so that CHANGES.md lists releases in descending numerical (version) order.
|
||||||
|
- When porting a set of release notes from a release branch into main, or from an older (obsolete) release branch to the current release branch, insert it into the right place to maintain overall descending order.
|
||||||
|
|
||||||
|
6. **Double check that the notes are adequately descriptive.** (See more
|
||||||
|
detailed description of this step below.)
|
||||||
|
|
||||||
|
7. **Forward-port release notes from release branches if needed**
|
||||||
|
|
||||||
|
8. **Show a summary** of what was inserted and ask the user to review before finalizing.
|
||||||
|
|
||||||
|
## Forward-porting release notes
|
||||||
|
|
||||||
|
Release notes may have been generated independently in main, and release
|
||||||
|
branches. When updating one branch, we ensure that any changes from older
|
||||||
|
branches have been incorporated.
|
||||||
|
|
||||||
|
- When preparing `patch` release notes, check the CHANGES.md file in the
|
||||||
|
"dev-X.(Y-1)" branch for the previous minor release family to identify any
|
||||||
|
X.(Y-1).Z patch release notes that are not reflected in the current release
|
||||||
|
notes that we are updating.
|
||||||
|
- When updating `main` or doing a `major` or `minor` release, check the
|
||||||
|
CHANGES.md file in both the "dev-X.(Y-1)" and "dev-X.(Y-2)" branches.
|
||||||
|
Check whichever is newer of the local and remote copy of that branch, since
|
||||||
|
the local one may have had release notes or its version in CMakeLists.txt
|
||||||
|
updated, but not yet pushed to GitHub.
|
||||||
|
- If any patch releases are present in the older dev branches checked, insert
|
||||||
|
the release notes for those patch releases into the right positions in the
|
||||||
|
current release notes that we are updating.
|
||||||
|
- If a change is forward-ported in this manner and the same PR is an update in
|
||||||
|
the current set of changes we are updating as our main task, document that
|
||||||
|
in the current set of notes using the following convention: in the line of
|
||||||
|
the notes, the explanation of the version where it appears should reflect
|
||||||
|
the first version of all branches where it appeared, for example, `(3.2.0.0,
|
||||||
|
3.1.3.0, 3.0.8.0)` to indicate that the patch was added to each of those
|
||||||
|
versions. The versions should be listed in descending order.
|
||||||
|
|
||||||
|
## Useful abbreviations for category labels
|
||||||
|
|
||||||
|
| Abbrev | Meaning |
|
||||||
|
|--------|---------|
|
||||||
|
| build | CMake/build system |
|
||||||
|
| deps | Changes to accommodate dependency or toolchain changes |
|
||||||
|
| ci | CI/GitHub Actions |
|
||||||
|
| docs | documentation |
|
||||||
|
| int | internal/refactor |
|
||||||
|
| test | testsuite or unit tests |
|
||||||
|
| HEADER.h | Developer utilities in a public header file |
|
||||||
|
|
||||||
|
## Combining PRs into single entries
|
||||||
|
|
||||||
|
To be more concise and easier to read, within a release's notes, related
|
||||||
|
PRs/commits can be combined into a single bullet-point line, which would look
|
||||||
|
like
|
||||||
|
```
|
||||||
|
- *category*: Combined Description. [#NNNN1](URL) (by author1) [#NNNN2](URL2) (by author2) [#NNNN2](URL2) (by author2)
|
||||||
|
|
||||||
|
```
|
||||||
|
if fully combined, or if explained one by one,
|
||||||
|
```
|
||||||
|
- *category*: Description 1 [#NNNN1](URL) (by author1), amendment 2, [#NNNN2](URL2) (by author2), amendment 3, [#NNNN3](URL3) (by author3)
|
||||||
|
```
|
||||||
|
Choose the fully combined or explained one by one based on which is more clear
|
||||||
|
to the reader.
|
||||||
|
|
||||||
|
If the authors are all the same, only have the author designation at the end.
|
||||||
|
|
||||||
|
Here are the cases where it's ok to combine commits in this way:
|
||||||
|
- If it is clear that multiple PRs are part of the same feature or fix,
|
||||||
|
consisting of an initial commit, and subsequent smaller changes or
|
||||||
|
continuations of the same topic.
|
||||||
|
- An initial commit, and a subsequent commit that is obviously a fix to a bug
|
||||||
|
in the initial commit.
|
||||||
|
- "CI" changes that all only add new cases to the test matrix.
|
||||||
|
- "CI" changes that all only fix spontaneous breakages in the GitHub runners.
|
||||||
|
- "Build" changes that are all just minor updates to versions of dependencies
|
||||||
|
that we support or test against.
|
||||||
|
|
||||||
|
Some more examples of combined commit messages:
|
||||||
|
|
||||||
|
```
|
||||||
|
- feat: Add GPS metadata functionality for TIFF [PR1](PR URL 1) [PR2](PR URL 2) [PR3](PR URL 3) (by author).
|
||||||
|
- ci: New CI variants for MSVS 2026 [PR1](PR URL 1) (by author1), VFX Platform 2027 [PR2](PR URL 2) (by author2).
|
||||||
|
- ci: Various fixes for unexpected changes to GitHub Actions runners [PR1](PR URL 1), [PR2](PR URL 2) (by author)
|
||||||
|
- build: Added support for gcc 15 [PR1](PR URL 1) (by author1), OpenEXR 3.5.1 [PR2](PR URL 2) (by author2), libtiff 4.8 [PR3](PR URL 3) (by author3).
|
||||||
|
```
|
||||||
|
|
||||||
|
Always ask for confirmation before combining commits in this manner. Confirm
|
||||||
|
separately for each proposed combination of a group of multiple original
|
||||||
|
commits into a single commit. Give the user the opportunity to revise the
|
||||||
|
combined description or request other changes for the grouping.
|
||||||
|
|
||||||
|
## Double check that the notes are adequately descriptive
|
||||||
|
|
||||||
|
For newly added items for this release, read the short descriptions provided
|
||||||
|
by git-cliff, double check them against the full commit messages to be sure
|
||||||
|
the one-line summary is adequate. If the summary is misleading, too brief and
|
||||||
|
leaving out the fact that an important thing was changed, or not adequately
|
||||||
|
capturing the scope of changes, feel free to propose an alternate wording that
|
||||||
|
will make it more clear to readers what changed as a result of the PR. Ask for
|
||||||
|
confirmation on these and explain why you felt the one-line description wasn't
|
||||||
|
enough.
|
||||||
|
|
||||||
|
## Reference
|
||||||
|
|
||||||
|
Full release procedures: `docs/dev/RELEASING.md`
|
||||||
|
Patch skeleton: `docs/dev/Changes-skeleton-patch.md`
|
||||||
|
Major skeleton: `docs/dev/Changes-skeleton-major.md`
|
||||||
|
Example good patch notes: https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/releases/tag/v1.15.2.0
|
||||||
|
Example good major/minor notes: https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/releases/tag/v1.15.0.0
|
||||||
@@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
Language: Cpp
|
Language: Cpp
|
||||||
BasedOnStyle: WebKit
|
BasedOnStyle: WebKit
|
||||||
SpaceBeforeParens: ControlStatements
|
|
||||||
|
|
||||||
AccessModifierOffset: -4
|
AccessModifierOffset: -4
|
||||||
AlignAfterOpenBracket: Align
|
AlignAfterOpenBracket: Align
|
||||||
|
|||||||
@@ -43,3 +43,6 @@ c1045f2c2845a98e661c7181932a031eb3c76063
|
|||||||
# clang-format: the very last piece of the puzzle (#1555)
|
# clang-format: the very last piece of the puzzle (#1555)
|
||||||
4ee62cd2ef05543f818f4d95a19efc1d684a7381
|
4ee62cd2ef05543f818f4d95a19efc1d684a7381
|
||||||
5be7c6bd4e7bd2e560cb6be8c06f11985384a87a
|
5be7c6bd4e7bd2e560cb6be8c06f11985384a87a
|
||||||
|
|
||||||
|
# Raise CI formatting standard to clang-format 17
|
||||||
|
a9ce35135e6c022d538a4a184fee1b5ce908aed8
|
||||||
|
|||||||
@@ -1,40 +0,0 @@
|
|||||||
<!--
|
|
||||||
Please ask questions ("how do I...?" "why doesn't this work?") on the [osl-dev mail list](https://lists.aswf.io/g/osl-dev), not by filing issues.
|
|
||||||
|
|
||||||
Make concrete suggestions for fixing the code ("here is a patch") by filing
|
|
||||||
a pull request, not an issue.
|
|
||||||
-->
|
|
||||||
|
|
||||||
### Problem
|
|
||||||
|
|
||||||
<!-- Describe the problem or suggestion here.] -->
|
|
||||||
|
|
||||||
**Expected behavior:** <!-- What you expected to happen -->
|
|
||||||
|
|
||||||
**Actual behavior:** <!-- What actually happened -->
|
|
||||||
|
|
||||||
<!-- If your problem is a broken build, please create a -->
|
|
||||||
<!-- [gist](https://gist.github.com) that contains the _full_ verbose -->
|
|
||||||
<!-- build log, which you can create like this: -->
|
|
||||||
<!-- ```make clean ; make VERBOSE=1 > build.log``` -->
|
|
||||||
|
|
||||||
<!-- If you are reporting a problem about a release branch, have you -->
|
|
||||||
<!-- already tried the current head of `master` to see if the problem -->
|
|
||||||
<!-- has been fixed? -->
|
|
||||||
|
|
||||||
|
|
||||||
### Steps to Reproduce
|
|
||||||
|
|
||||||
1. [First Step]
|
|
||||||
2. [Second Step]
|
|
||||||
3. [and so on...]
|
|
||||||
|
|
||||||
|
|
||||||
### Versions
|
|
||||||
|
|
||||||
* OSL branch/version:
|
|
||||||
* OS:
|
|
||||||
* C++ compiler:
|
|
||||||
* LLVM version:
|
|
||||||
* OIIO version:
|
|
||||||
|
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
---
|
||||||
|
name: Bug report
|
||||||
|
about: I think I have identified a legit bug and can describe it.
|
||||||
|
title: "[BUG]"
|
||||||
|
labels: ''
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Note: The prompts below are just to help you formulate a good and actionable
|
||||||
|
request. Feel free to deviate from this format or to delete this text and
|
||||||
|
write free-form if you prefer.
|
||||||
|
|
||||||
|
**Describe the bug**
|
||||||
|
|
||||||
|
A clear and concise description of what the bug is. What happened, and
|
||||||
|
what did you expect to happen instead.
|
||||||
|
|
||||||
|
|
||||||
|
**OSL version and dependencies**
|
||||||
|
|
||||||
|
* OSL branch/version:
|
||||||
|
* OS:
|
||||||
|
* C++ compiler:
|
||||||
|
* LLVM version:
|
||||||
|
* OIIO version:
|
||||||
|
|
||||||
|
|
||||||
|
**To Reproduce**
|
||||||
|
|
||||||
|
Steps to reproduce the behavior:
|
||||||
|
1. Do this...
|
||||||
|
2. Then this...
|
||||||
|
3. Then THIS happens (reproduce the exact error message if you can)
|
||||||
|
4. Whereas I expected this other specific thing to happen instead.
|
||||||
|
|
||||||
|
|
||||||
|
**Evidence**
|
||||||
|
|
||||||
|
- Error messages (paste them here exactly)
|
||||||
|
- Example shader code (if applicable)
|
||||||
|
|
||||||
|
|
||||||
|
**IF YOU ALREADY HAVE A CODE FIX:** There is no need to file a separate issue,
|
||||||
|
please just go straight to making a [pull request](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pulls).
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
---
|
||||||
|
name: Build problems
|
||||||
|
about: I'm having trouble building OSL. Help!
|
||||||
|
title: "[BUILD]"
|
||||||
|
labels: ''
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**PLEASE DO NOT REPORT BUILD TROUBLES AS GITHUB "ISSUES" UNLESS YOU ARE RALLY SURE IT'S A BUG**
|
||||||
|
|
||||||
|
The best way to get help with your build problems is to ask a question on the
|
||||||
|
[osl-dev developer mail list](https://lists.aswf.io/g/osl-dev). For quick
|
||||||
|
questions, you could also try the [ASWF Slack](https://slack.aswf.io)
|
||||||
|
`#openshadinglanguage` channel.
|
||||||
|
|
||||||
|
When you email about this, please attach one or both of the following:
|
||||||
|
1. The full verbose build log, which you can create like this:
|
||||||
|
```make clean ; make VERBOSE=1 > build.log```
|
||||||
|
2. The `CMakeCache.txt` file from your build directory.
|
||||||
|
|
||||||
|
If you are pretty sure that you have identified a **BUG** or other actual
|
||||||
|
problem with the OSL build scripts and you can describe how to reproduce it,
|
||||||
|
please file a [bug report issue](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/issues/new?template=bug_report.md).
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
---
|
||||||
|
name: Feature request
|
||||||
|
about: I have a concrete idea about how to improve OSL.
|
||||||
|
title: "[FEATURE REQUEST]"
|
||||||
|
labels: ''
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Note: The prompts below are just to help you formulate a good and actionable
|
||||||
|
request. Feel free to deviate from this format or to delete this text and
|
||||||
|
write free-form if you prefer.
|
||||||
|
|
||||||
|
**Is your feature request related to a problem? Please describe.**
|
||||||
|
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||||
|
|
||||||
|
**Describe the solution you'd like**
|
||||||
|
|
||||||
|
A clear and concise description of what you want to happen.
|
||||||
|
|
||||||
|
**Describe alternatives you've considered**
|
||||||
|
A clear and concise description of any alternative solutions or features you've considered.
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context about the feature request here.
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
---
|
||||||
|
name: Question
|
||||||
|
about: How do I... I need help with...
|
||||||
|
title: "[HELP]"
|
||||||
|
labels: ''
|
||||||
|
assignees: ''
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**PLEASE DO NOT ASK USAGE QUESTIONS USING GITHUB "ISSUES"**
|
||||||
|
|
||||||
|
If you are pretty sure that you have identified a **BUG** in OSL, please file
|
||||||
|
a [bug report issue](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/issues/new?template=bug_report.md).
|
||||||
|
|
||||||
|
But if you are just asking a question:
|
||||||
|
* How do I...?
|
||||||
|
* I need help with...
|
||||||
|
* Am I doing something wrong?
|
||||||
|
* I can't build OSL
|
||||||
|
|
||||||
|
For anything of this nature, the best way to get help using OSL is to ask a
|
||||||
|
question on the [osl-dev developer mail list](https://lists.aswf.io/g/osl-dev).
|
||||||
|
For quick questions, you could also try the [ASWF Slack](https://slack.aswf.io) `#openshadinglanguage` channel.
|
||||||
|
|
||||||
|
Please check the [documentation](https://docs.openshadinglanguage.org) first;
|
||||||
|
you may find the answer more quickly than you can get your question answered
|
||||||
|
on the mail list.
|
||||||
|
|
||||||
@@ -1,22 +1,46 @@
|
|||||||
|
|
||||||
## Description
|
|
||||||
|
|
||||||
|
------ :scissors: -------------------------------------------------------------------
|
||||||
|
|
||||||
|
YOU MAY DELETE ALL OF THIS IF YOU ALREADY HAVE A DESCRIPTIVE COMMIT MESSAGE!
|
||||||
|
|
||||||
|
This is just a template and set of reminders about what constitutes a good PR.
|
||||||
|
But please look over the checklist at the bottom.
|
||||||
|
|
||||||
|
If THIS TEXT is still in your PR description, we'll know you didn't read the
|
||||||
|
instructions!
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Description
|
||||||
|
|
||||||
<!-- Please provide a description of what this PR is meant to fix, and -->
|
<!-- Please provide a description of what this PR is meant to fix, and -->
|
||||||
<!-- how it works (if it's not going to be very clear from the code). -->
|
<!-- how it works (if it's not going to be very clear from the code). -->
|
||||||
|
|
||||||
## Tests
|
### Tests
|
||||||
|
|
||||||
<!-- Did you / should you add a testsuite case (new test, or add to an -->
|
<!-- Did you / should you add a testsuite case (new test, or add to an -->
|
||||||
<!-- existing test) to verify that this works? -->
|
<!-- existing test) to verify that this works? -->
|
||||||
|
|
||||||
|
|
||||||
## Checklist:
|
### Checklist:
|
||||||
|
|
||||||
<!-- Put an 'x' in the boxes as you complete the checklist items -->
|
<!-- Put an 'x' in the boxes as you complete the checklist items -->
|
||||||
|
|
||||||
- [ ] I have read the [contribution guidelines](../CONTRIBUTING.md).
|
- [ ] **I have read the guidelines** on [contributions](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/blob/main/CONTRIBUTING.md) and [code review procedures](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/blob/main/docs/dev/CodeReview.md).
|
||||||
- [ ] I have previously submitted a [Contributor License Agreement](http://opensource.imageworks.com/cla/).
|
- [ ] **I have read the [Policy on AI Coding Assistants](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/blob/main/docs/dev/AI_Policy.md)**
|
||||||
- [ ] I have updated the documentation, if applicable.
|
and if I used AI coding assistants, I have an `Assisted-by: TOOL / MODEL`
|
||||||
- [ ] I have ensured that the change is tested somewhere in the testsuite (adding new test cases if necessary).
|
line in the pull request description above.
|
||||||
- [ ] My code follows the prevailing code style of this project.
|
- [ ] **I have updated the documentation** if my PR adds features or changes
|
||||||
|
behavior.
|
||||||
|
- [ ] **I am sure that this PR's changes are tested in the testsuite**.
|
||||||
|
- [ ] **I have run and passed the testsuite in CI** *before* submitting the
|
||||||
|
PR, by pushing the changes to my fork and seeing that the automated CI
|
||||||
|
passed there. (Exceptions: If most tests pass and you can't figure out why
|
||||||
|
the remaining ones fail, it's ok to submit the PR and ask for help. Or if
|
||||||
|
any failures seem entirely unrelated to your change; sometimes things break
|
||||||
|
on the GitHub runners.)
|
||||||
|
- [ ] **My code follows the prevailing code style of this project** and I
|
||||||
|
fixed any problems reported by the clang-format CI test.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright 2008-present Contributors to the Open Shading Language project.
|
# Copyright Contributors to the Open Shading Language project.
|
||||||
# SPDX-License-Identifier: BSD-3-Clause
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||||
|
|
||||||
@@ -13,24 +13,48 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
- dev-1.14
|
||||||
|
- dev-1.15
|
||||||
- '*analysis*'
|
- '*analysis*'
|
||||||
|
- '*sonar*'
|
||||||
|
paths:
|
||||||
|
- '**'
|
||||||
|
- '!**.md'
|
||||||
|
- '!**.rst'
|
||||||
|
- '!**/ci.yml'
|
||||||
|
- '!**/docs.yml'
|
||||||
|
- '!**/scorecard.yml'
|
||||||
|
- '!**/wheel.yml'
|
||||||
|
- '!**.properties'
|
||||||
|
- '!docs/**'
|
||||||
|
# Run analysis on PRs only if the branch name indicates that the purpose of
|
||||||
|
# the PR is related to the Sonar analysis. We don't run on every PR because
|
||||||
|
# the analysis run is very expensive and just isn't usually necessary.
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- '*analysis*'
|
||||||
|
- '*sonar*'
|
||||||
# Allow manual kicking off of the workflow from github.com
|
# Allow manual kicking off of the workflow from github.com
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
permissions: read-all
|
permissions: read-all
|
||||||
|
|
||||||
|
# Allow subsequent pushes to the same PR or REF to cancel any previous jobs.
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
aswf:
|
aswf:
|
||||||
name: "SonarCloud Analysis"
|
name: "SonarCloud Analysis"
|
||||||
if: |
|
if: github.event.repository.fork == false
|
||||||
github.repository == 'AcademySoftwareFoundation/OpenShadingLanguage'
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- desc: sonary gcc9/C++14 llvm13 py3.9 boost1.76 exr3.1 oiio2.3 avx2
|
- desc: sonar gcc9/C++14 llvm13 py3.9 exr3.1 oiio2.3 avx2
|
||||||
nametag: static-analysis-sonar
|
nametag: static-analysis-sonar
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
vfxyear: 2022
|
vfxyear: 2022
|
||||||
@@ -40,7 +64,7 @@ jobs:
|
|||||||
python_ver: 3.9
|
python_ver: 3.9
|
||||||
pybind11_ver: v2.9.0
|
pybind11_ver: v2.9.0
|
||||||
simd: avx2,f16c
|
simd: avx2,f16c
|
||||||
batched: b8_AVX2
|
batched: b8_AVX2,b16_AVX512
|
||||||
coverage: 1
|
coverage: 1
|
||||||
# skip_tests: 1
|
# skip_tests: 1
|
||||||
sonar: 1
|
sonar: 1
|
||||||
@@ -88,7 +112,7 @@ jobs:
|
|||||||
run: echo "::set-output name=date::`date -u +'%Y-%m-%dT%H:%M:%SZ'`"
|
run: echo "::set-output name=date::`date -u +'%Y-%m-%dT%H:%M:%SZ'`"
|
||||||
- name: ccache
|
- name: ccache
|
||||||
id: ccache
|
id: ccache
|
||||||
uses: actions/cache@c3f1317a9e7b1ef106c153ac8c0f00fed3ddbc0d # v3.0.4
|
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
|
||||||
with:
|
with:
|
||||||
path: /tmp/ccache
|
path: /tmp/ccache
|
||||||
key: ${{github.job}}-${{matrix.nametag}}-${{steps.ccache_cache_keys.outputs.date}}
|
key: ${{github.job}}-${{matrix.nametag}}-${{steps.ccache_cache_keys.outputs.date}}
|
||||||
|
|||||||
@@ -0,0 +1,332 @@
|
|||||||
|
# Copyright Contributors to the Open Shading Language project.
|
||||||
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||||
|
|
||||||
|
##########################################################################
|
||||||
|
# Common steps for all CI workflows
|
||||||
|
##########################################################################
|
||||||
|
|
||||||
|
name: CI Steps
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
# This inputs receive values via the "with:" section in ci_workflow.yml
|
||||||
|
inputs:
|
||||||
|
disable:
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
build:
|
||||||
|
type: string
|
||||||
|
runner:
|
||||||
|
type: string
|
||||||
|
container:
|
||||||
|
type: string
|
||||||
|
container_volumes:
|
||||||
|
type: string
|
||||||
|
default: '[]'
|
||||||
|
cc_compiler:
|
||||||
|
type: string
|
||||||
|
cxx_compiler:
|
||||||
|
type: string
|
||||||
|
cxx_std:
|
||||||
|
type: string
|
||||||
|
batched:
|
||||||
|
type: string
|
||||||
|
build_type:
|
||||||
|
type: string
|
||||||
|
depcmds:
|
||||||
|
type: string
|
||||||
|
extra_artifacts:
|
||||||
|
type: string
|
||||||
|
fmt_ver:
|
||||||
|
type: string
|
||||||
|
fmt_commit:
|
||||||
|
type: string
|
||||||
|
gcc_action_ver:
|
||||||
|
type: string
|
||||||
|
llvm_action_ver:
|
||||||
|
type: string
|
||||||
|
opencolorio_ver:
|
||||||
|
type: string
|
||||||
|
openexr_ver:
|
||||||
|
type: string
|
||||||
|
openimageio_ver:
|
||||||
|
type: string
|
||||||
|
pybind11_ver:
|
||||||
|
type: string
|
||||||
|
python_action_ver:
|
||||||
|
type: string
|
||||||
|
python_ver:
|
||||||
|
type: string
|
||||||
|
setenvs:
|
||||||
|
type: string
|
||||||
|
simd:
|
||||||
|
type: string
|
||||||
|
skip_build:
|
||||||
|
type: string
|
||||||
|
skip_tests:
|
||||||
|
type: string
|
||||||
|
abi_check:
|
||||||
|
type: string
|
||||||
|
benchmark:
|
||||||
|
type: string
|
||||||
|
build_docs:
|
||||||
|
type: string
|
||||||
|
clang_format:
|
||||||
|
type: string
|
||||||
|
generator:
|
||||||
|
type: string
|
||||||
|
ctest_args:
|
||||||
|
type: string
|
||||||
|
ctest_test_timeout:
|
||||||
|
type: string
|
||||||
|
coverage:
|
||||||
|
type: string
|
||||||
|
sonar:
|
||||||
|
type: string
|
||||||
|
old_node:
|
||||||
|
type: string
|
||||||
|
default: 0
|
||||||
|
nametag:
|
||||||
|
type: string
|
||||||
|
required_deps:
|
||||||
|
type: string
|
||||||
|
optional_deps:
|
||||||
|
type: string
|
||||||
|
build_local_deps:
|
||||||
|
type: string
|
||||||
|
secrets:
|
||||||
|
PASSED_GITHUB_TOKEN:
|
||||||
|
required: false
|
||||||
|
PASSED_SONAR_TOKEN:
|
||||||
|
required: false
|
||||||
|
|
||||||
|
permissions: read-all
|
||||||
|
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
steps:
|
||||||
|
name: "${{inputs.cxx_compiler}} c++${{inputs.cxx_std}} py${{inputs.python_ver}}"
|
||||||
|
if: ${{ !inputs.disable }}
|
||||||
|
runs-on: ${{ inputs.runner }}
|
||||||
|
container:
|
||||||
|
image: ${{ inputs.container }}
|
||||||
|
volumes: ${{ fromJson( inputs.container_volumes ) }}
|
||||||
|
options: -v /:/host/root ${{ (contains(inputs.runner, 'gpu') && '-e NVIDIA_DRIVER_CAPABILITIES=compute,graphics,utility --gpus all') || '-e A=x' }}
|
||||||
|
# Extra options:
|
||||||
|
# - Ensure the GPU runners have OptiX is visible in the container.
|
||||||
|
# - Mount the native filesystem under /host/root
|
||||||
|
env:
|
||||||
|
CXX: ${{inputs.cxx_compiler}}
|
||||||
|
CC: ${{inputs.cc_compiler}}
|
||||||
|
CMAKE_BUILD_TYPE: ${{inputs.build_type}}
|
||||||
|
CMAKE_CXX_STANDARD: ${{inputs.cxx_std}}
|
||||||
|
CMAKE_GENERATOR: ${{inputs.generator}}
|
||||||
|
CTEST_ARGS: ${{inputs.ctest_args}}
|
||||||
|
CTEST_TEST_TIMEOUT: ${{inputs.ctest_test_timeout}}
|
||||||
|
USE_SIMD: ${{inputs.simd}}
|
||||||
|
FMT_VERSION: ${{inputs.fmt_ver}}
|
||||||
|
fmt_BUILD_VERSION: ${{inputs.fmt_ver}}
|
||||||
|
fmt_GIT_COMMIT: ${{inputs.fmt_commit}}
|
||||||
|
OPENCOLORIO_VERSION: ${{inputs.opencolorio_ver}}
|
||||||
|
OPENEXR_VERSION: ${{inputs.openexr_ver}}
|
||||||
|
OPENIMAGEIO_VERSION: ${{inputs.openimageio_ver}}
|
||||||
|
PYBIND11_VERSION: ${{inputs.pybind11_ver}}
|
||||||
|
PYTHON_VERSION: ${{inputs.python_ver}}
|
||||||
|
USE_BATCHED: ${{inputs.batched}}
|
||||||
|
ABI_CHECK: ${{inputs.abi_check}}
|
||||||
|
ACTIONS_RUNNER_FORCE_ACTIONS_NODE_VERSION: node16
|
||||||
|
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
|
||||||
|
# For CI, sometimes we want to require all dependencies to be present,
|
||||||
|
# except for a select few listed explicitly. This ensures that we don't
|
||||||
|
# accidentally have a situation in which we think we are building
|
||||||
|
# against and testing an optional dependency, but in fact are not.
|
||||||
|
OSL_REQUIRED_DEPS: ${{inputs.required_deps}}
|
||||||
|
OSL_OPTIONAL_DEPS: ${{inputs.optional_deps}}
|
||||||
|
OSL_BUILD_LOCAL_DEPS: ${{inputs.build_local_deps}}
|
||||||
|
SETENVS: ${{inputs.setenvs}}
|
||||||
|
DEPCMDS: ${{inputs.depcmds}}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
# Install nodejs 20 with glibc 2.17, to work around the face that the
|
||||||
|
# GHA runners are insisting on a node version that is too new for the
|
||||||
|
# glibc in the ASWF containers prior to 2023.
|
||||||
|
- name: install nodejs20glibc2.17
|
||||||
|
if: inputs.old_node == '1'
|
||||||
|
run: |
|
||||||
|
curl --silent https://unofficial-builds.nodejs.org/download/release/v20.18.1/node-v20.18.1-linux-x64-glibc-217.tar.xz | tar -xJ --strip-components 1 -C /node20217 -f -
|
||||||
|
- name: Checkout repo
|
||||||
|
if: inputs.old_node != '1'
|
||||||
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
|
- name: Checkout repo-OLD
|
||||||
|
if: inputs.old_node == '1'
|
||||||
|
# Must use an old checkout action for old containers
|
||||||
|
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
|
||||||
|
- name: Install LLVM and Clang
|
||||||
|
if: inputs.llvm_action_ver != ''
|
||||||
|
uses: KyleMayes/install-llvm-action@ebc0426251bc40c7cd31162802432c68818ab8f0 # v2.0.9
|
||||||
|
with:
|
||||||
|
version: ${{ inputs.llvm_action_ver }}
|
||||||
|
- name: Build setup
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
eval "$SETENVS"
|
||||||
|
src/build-scripts/ci-startup.bash
|
||||||
|
- name: Prepare ccache timestamp
|
||||||
|
id: ccache_cache_keys
|
||||||
|
shell: bash
|
||||||
|
run: echo "date=`date -u +'%Y-%m-%dT%H:%M:%SZ'`" >> $GITHUB_OUTPUT
|
||||||
|
- name: ccache-restore
|
||||||
|
if: inputs.old_node != '1'
|
||||||
|
id: ccache-restore
|
||||||
|
uses: actions/cache/restore@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
|
||||||
|
with:
|
||||||
|
path: ${{ env.CCACHE_DIR }}
|
||||||
|
key: ${{inputs.nametag}}-${{steps.ccache_cache_keys.outputs.date}}
|
||||||
|
restore-keys: ${{inputs.nametag}}
|
||||||
|
- name: ccache-restore-OLD
|
||||||
|
if: inputs.old_node == '1'
|
||||||
|
id: ccache-restore-old
|
||||||
|
# Must use an old cache restore action for old containers
|
||||||
|
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
|
||||||
|
with:
|
||||||
|
path: ${{ env.CCACHE_DIR }}
|
||||||
|
# path: ./ccache
|
||||||
|
key: ${{inputs.nametag}}-${{steps.ccache_cache_keys.outputs.date}}
|
||||||
|
restore-keys: ${{inputs.nametag}}
|
||||||
|
- name: Install gcc
|
||||||
|
if: inputs.gcc_action_ver != ''
|
||||||
|
run: |
|
||||||
|
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
|
||||||
|
sudo apt-get update -y
|
||||||
|
sudo apt-get install -y g++-${{inputs.gcc_action_ver}}
|
||||||
|
- name: Install python
|
||||||
|
if: inputs.python_action_ver != ''
|
||||||
|
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
||||||
|
with:
|
||||||
|
python-version: ${{ inputs.python_action_ver }}
|
||||||
|
- name: Dependencies
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
eval "$DEPCMDS"
|
||||||
|
if [[ "$RUNNER_OS" == "Linux" ]]; then
|
||||||
|
src/build-scripts/gh-installdeps.bash
|
||||||
|
elif [[ "$RUNNER_OS" == "macOS" ]]; then
|
||||||
|
src/build-scripts/install_homebrew_deps.bash
|
||||||
|
if [[ "$OPENIMAGEIO_VERSION" != "" ]] ; then \
|
||||||
|
OPENIMAGEIO_CMAKE_FLAGS="-DOIIO_BUILD_TESTS=0 -DUSE_OPENGL=0 -DCMAKE_UNITY_BUILD=ON" ; \
|
||||||
|
source src/build-scripts/build_openimageio.bash ; \
|
||||||
|
else \
|
||||||
|
brew install --display-times -q openimageio ; \
|
||||||
|
PYTHONPATH=$PYTHONPATH:/usr/local/lib/python${PYTHON_VERSION}/site-packages ; \
|
||||||
|
fi
|
||||||
|
src/build-scripts/save-env.bash
|
||||||
|
elif [[ "$RUNNER_OS" == "Windows" ]]; then
|
||||||
|
src/build-scripts/gh-win-installdeps.bash
|
||||||
|
fi
|
||||||
|
- name: Install sonar-scanner and build-wrapper
|
||||||
|
if: inputs.sonar == '1'
|
||||||
|
uses: sonarsource/sonarqube-scan-action@a31c9398be7ace6bbfaf30c0bd5d415f843d45e9 # v7.0.0
|
||||||
|
- name: Build
|
||||||
|
if: inputs.skip_build != '1'
|
||||||
|
shell: bash
|
||||||
|
run: src/build-scripts/ci-build.bash
|
||||||
|
- name: Check out ABI standard
|
||||||
|
if: inputs.abi_check != ''
|
||||||
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
|
with:
|
||||||
|
ref: ${{inputs.abi_check}}
|
||||||
|
path: abi_standard
|
||||||
|
- name: Build ABI standard
|
||||||
|
if: inputs.abi_check != ''
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
mkdir -p abi_standard/build
|
||||||
|
pushd abi_standard
|
||||||
|
src/build-scripts/ci-build.bash
|
||||||
|
popd
|
||||||
|
- name: ccache-save
|
||||||
|
if: inputs.old_node != '1'
|
||||||
|
id: ccache-save
|
||||||
|
uses: actions/cache/save@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
|
||||||
|
with:
|
||||||
|
path: ${{ env.CCACHE_DIR }}
|
||||||
|
key: ${{inputs.nametag}}-${{steps.ccache_cache_keys.outputs.date}}
|
||||||
|
- name: ccache-save-OLD
|
||||||
|
if: inputs.old_node == '1'
|
||||||
|
id: ccache-save-old
|
||||||
|
# Must use an old cache action for old containers
|
||||||
|
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
|
||||||
|
with:
|
||||||
|
path: ${{ env.CCACHE_DIR }}
|
||||||
|
key: ${{inputs.nametag}}-${{steps.ccache_cache_keys.outputs.date}}
|
||||||
|
- name: Testsuite
|
||||||
|
if: inputs.skip_tests != '1'
|
||||||
|
shell: bash
|
||||||
|
run: src/build-scripts/ci-test.bash
|
||||||
|
- name: Benchmarks
|
||||||
|
if: inputs.benchmark == '1'
|
||||||
|
shell: bash
|
||||||
|
run: src/build-scripts/ci-benchmark.bash
|
||||||
|
- name: clang-format
|
||||||
|
if: inputs.clang_format == '1'
|
||||||
|
shell: bash
|
||||||
|
run: src/build-scripts/run-clang-format.bash
|
||||||
|
- name: Code coverage
|
||||||
|
if: inputs.coverage == '1'
|
||||||
|
run: src/build-scripts/ci-coverage.bash
|
||||||
|
- name: Sonar-scanner
|
||||||
|
if: inputs.sonar == 1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||||
|
run: |
|
||||||
|
which sonar-scanner
|
||||||
|
ls -l /__w/OpenShadingLanguage/OpenShadingLanguage/bw_output
|
||||||
|
echo "BUILD_OUTPUT_DIR is ${BUILD_WRAPPER_OUT_DIR}"
|
||||||
|
find . -name "*.gcov" -print
|
||||||
|
# sonar-scanner --define sonar.cfamily.build-wrapper-output="${BUILD_WRAPPER_OUT_DIR}"
|
||||||
|
time sonar-scanner --define sonar.host.url="${SONAR_SERVER_URL}" --define sonar.cfamily.build-wrapper-output="$BUILD_WRAPPER_OUT_DIR" --define sonar.cfamily.gcov.reportsPath="_coverage" --define sonar.cfamily.threads="$PARALLEL"
|
||||||
|
# Consult https://docs.sonarcloud.io/advanced-setup/ci-based-analysis/sonarscanner-cli/ for more information and options
|
||||||
|
- name: Check ABI
|
||||||
|
if: inputs.abi_check != ''
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
src/build-scripts/ci-abicheck.bash ./build abi_standard/build \
|
||||||
|
liboslexec liboslcomp liboslquery liboslnoise
|
||||||
|
- name: Build Docs
|
||||||
|
if: inputs.build_docs == '1'
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
cd src/doc
|
||||||
|
time make doxygen
|
||||||
|
time make sphinx
|
||||||
|
- name: Upload testsuite debugging artifacts
|
||||||
|
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
||||||
|
if: ${{ inputs.old_node != '1' && (failure() || inputs.build_docs == '1' || inputs.benchmark == '1' || inputs.abi_check != '') }}
|
||||||
|
with:
|
||||||
|
name: osl-${{github.job}}-${{inputs.nametag}}
|
||||||
|
path: |
|
||||||
|
build/cmake-save
|
||||||
|
build/compat_reports
|
||||||
|
build/sphinx
|
||||||
|
build/benchmarks
|
||||||
|
build/*.cmake
|
||||||
|
build/CMake*
|
||||||
|
build/testsuite/*/*.*
|
||||||
|
${{ inputs.extra_artifacts }}
|
||||||
|
- name: Upload testsuite debugging artifacts-OLD
|
||||||
|
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
|
||||||
|
if: ${{ inputs.old_node == '1' && (failure() || inputs.build_docs == '1' || inputs.benchmark == '1' || inputs.abi_check != '') }}
|
||||||
|
with:
|
||||||
|
name: osl-${{github.job}}-${{inputs.nametag}}
|
||||||
|
path: |
|
||||||
|
build/cmake-save
|
||||||
|
build/compat_reports
|
||||||
|
build/sphinx
|
||||||
|
build/benchmarks
|
||||||
|
build/*.cmake
|
||||||
|
build/CMake*
|
||||||
|
build/testsuite/*/*.*
|
||||||
|
${{ inputs.extra_artifacts }}
|
||||||
@@ -10,163 +10,217 @@ name: CI
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
# Skip jobs when only documentation files are changed
|
# Skip jobs when only documentation files are changed
|
||||||
paths-ignore:
|
paths:
|
||||||
- '**.md'
|
- '**'
|
||||||
- '**.rst'
|
- '!**.md'
|
||||||
- '**.tex'
|
- '!**.rst'
|
||||||
|
- '!**.tex'
|
||||||
|
- '!**/analysis.yml'
|
||||||
|
- '!**/docs.yml'
|
||||||
|
- '!**.properties'
|
||||||
|
- '!docs/**'
|
||||||
pull_request:
|
pull_request:
|
||||||
paths-ignore:
|
paths:
|
||||||
- '**.md'
|
- '**'
|
||||||
- '**.rst'
|
- '!**.md'
|
||||||
- '**.tex'
|
- '!**.rst'
|
||||||
|
- '!**.tex'
|
||||||
|
- '!docs/**'
|
||||||
schedule:
|
schedule:
|
||||||
# Full nightly build
|
# Full nightly build, for the main project repo (not for forks)
|
||||||
- cron: "0 6 * * *"
|
- cron: "0 6 * * *"
|
||||||
|
workflow_dispatch:
|
||||||
|
# This allows manual triggering of the workflow from the web
|
||||||
|
|
||||||
permissions: read-all
|
permissions: read-all
|
||||||
|
|
||||||
|
# Allow subsequent pushes to the same PR or REF to cancel any previous jobs.
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
aswf:
|
aswf-old:
|
||||||
name: "VFX${{matrix.vfxyear}} ${{matrix.desc}}"
|
if: ${{ (github.event.repository.fork == false || github.event_name != 'schedule') && ! contains(github.ref, 'windows-only') && ! contains(github.ref, 'macos-only') && ! contains(github.ref, 'optix-only') }}
|
||||||
|
name: "(old) ${{matrix.desc}}"
|
||||||
|
uses: ./.github/workflows/build-steps.yml
|
||||||
|
with:
|
||||||
|
nametag: ${{ matrix.nametag || 'unnamed!' }}
|
||||||
|
disable: ${{ matrix.disable || false }}
|
||||||
|
runner: ${{ matrix.runner || 'ubuntu-latest' }}
|
||||||
|
container: ${{ matrix.container }}
|
||||||
|
container_volumes: '["/node20217:/node20217:rw,rshared", "/node20217:/__e/node20:ro,rshared]"]'
|
||||||
|
cc_compiler: ${{ matrix.cc_compiler || 'gcc' }}
|
||||||
|
cxx_compiler: ${{ matrix.cxx_compiler || 'g++' }}
|
||||||
|
cxx_std: ${{ matrix.cxx_std || '17' }}
|
||||||
|
build_type: ${{ matrix.build_type || 'Release' }}
|
||||||
|
depcmds: ${{ matrix.depcmds }}
|
||||||
|
extra_artifacts: ${{ matrix.extra_artifacts }}
|
||||||
|
fmt_ver: ${{ matrix.fmt_ver }}
|
||||||
|
fmt_commit: ${{ matrix.fmt_commit }}
|
||||||
|
opencolorio_ver: ${{ matrix.opencolorio_ver }}
|
||||||
|
openexr_ver: ${{ matrix.openexr_ver }}
|
||||||
|
openimageio_ver: ${{ matrix.openimageio_ver }}
|
||||||
|
pybind11_ver: ${{ matrix.pybind11_ver }}
|
||||||
|
python_ver: ${{ matrix.python_ver }}
|
||||||
|
setenvs: ${{ matrix.setenvs }}
|
||||||
|
simd: ${{ matrix.simd }}
|
||||||
|
batched: ${{ matrix.batched }}
|
||||||
|
skip_build: ${{ matrix.skip_build }}
|
||||||
|
skip_tests: ${{ matrix.skip_tests }}
|
||||||
|
abi_check: ${{ matrix.abi_check }}
|
||||||
|
build_docs: ${{ matrix.build_docs }}
|
||||||
|
generator: ${{ matrix.generator }}
|
||||||
|
ctest_args: ${{ matrix.ctest_args }}
|
||||||
|
ctest_test_timeout: ${{ matrix.ctest_test_timeout || '800' }}
|
||||||
|
coverage: ${{ matrix.coverage || 0 }}
|
||||||
|
sonar: ${{ matrix.sonar || 0 }}
|
||||||
|
old_node: ${{ matrix.old_node || 0 }}
|
||||||
|
llvm_action_ver: ${{ matrix.llvm_action_ver }}
|
||||||
|
clang_format: ${{ matrix.clang_format }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- desc: gcc6/C++14 llvm9 py2.7 boost1.66 exr2.3 oiio2.2 sse2
|
- desc: VP2022 gcc9/C++17 llvm14 py3.9 exr3.1 oiio3.0 sse2 batch-b4sse2
|
||||||
nametag: linux-vfx2019
|
|
||||||
os: ubuntu-latest
|
|
||||||
vfxyear: 2019
|
|
||||||
vfxsuffix: -clang9
|
|
||||||
cxx_std: 14
|
|
||||||
openimageio_ver: v2.3.17.0
|
|
||||||
python_ver: 2.7
|
|
||||||
pybind11_ver: v2.4.2
|
|
||||||
- desc: clang9/C++14 llvm9 oiio-release boost1.66 avx2 exr2.3 py2.7
|
|
||||||
nametag: linux-clang9-llvm9
|
|
||||||
os: ubuntu-18.04
|
|
||||||
vfxyear: 2019
|
|
||||||
vfxsuffix: -clang9
|
|
||||||
cc_compiler: clang
|
|
||||||
cxx_compiler: clang++
|
|
||||||
cxx_std: 14
|
|
||||||
openimageio_ver: release
|
|
||||||
python_ver: 2.7
|
|
||||||
# pybind11_ver: v2.9.0
|
|
||||||
simd: avx
|
|
||||||
- desc: GPU Cuda10 gcc6/C++14 llvm10 py2.7 boost-1.70 exr-2.3 OIIO-master avx2
|
|
||||||
nametag: linux-optix7-2019
|
|
||||||
os: ubuntu-latest
|
|
||||||
vfxyear: 2019
|
|
||||||
vfxsuffix: -clang10
|
|
||||||
cxx_std: 14
|
|
||||||
openimageio_ver: master
|
|
||||||
python_ver: 2.7
|
|
||||||
# pybind11_ver: v2.9.0
|
|
||||||
simd: avx2,f16c
|
|
||||||
skip_tests: 1
|
|
||||||
setenvs: export OSL_CMAKE_FLAGS="-DUSE_OPTIX=1" OPTIX_VERSION=7.0
|
|
||||||
- desc: gcc6/C++14 llvm10 py3.7 boost1.70 exr2.4 oiio2.2 sse4
|
|
||||||
nametag: linux-vfx2020
|
|
||||||
os: ubuntu-latest
|
|
||||||
vfxyear: 2020
|
|
||||||
cxx_std: 14
|
|
||||||
openimageio_ver: v2.3.17.0
|
|
||||||
python_ver: 3.7
|
|
||||||
pybind11_ver: v2.5.0
|
|
||||||
simd: sse4.2
|
|
||||||
setenvs: export CONAN_LLVM_VERSION=10.0.1
|
|
||||||
- desc: gcc9/C++17 llvm11 py3.7 boost1.73 exr2.5 oiio2.2 avx2 batch-b8avx2
|
|
||||||
nametag: linux-vfx2021
|
|
||||||
os: ubuntu-latest
|
|
||||||
vfxyear: 2021
|
|
||||||
vfxsuffix: -clang11
|
|
||||||
cxx_std: 17
|
|
||||||
openimageio_ver: dev-2.3
|
|
||||||
python_ver: 3.7
|
|
||||||
pybind11_ver: v2.7.0
|
|
||||||
simd: avx2,f16c
|
|
||||||
batched: b8_AVX2_noFMA
|
|
||||||
- desc: gcc9/C++17 llvm13 py3.9 boost1.76 exr3.1 oiio2.3 avx2
|
|
||||||
nametag: linux-vfx2022
|
nametag: linux-vfx2022
|
||||||
os: ubuntu-latest
|
runner: ubuntu-latest
|
||||||
|
container: aswf/ci-osl:2022-clang14
|
||||||
vfxyear: 2022
|
vfxyear: 2022
|
||||||
vfxsuffix: -clang13
|
old_node: 1
|
||||||
cxx_std: 17
|
cxx_std: 17
|
||||||
openimageio_ver: release
|
opencolorio_ver: v2.2.0
|
||||||
|
openimageio_ver: dev-3.0
|
||||||
python_ver: 3.9
|
python_ver: 3.9
|
||||||
pybind11_ver: v2.9.0
|
pybind11_ver: v2.9.0
|
||||||
|
simd: sse2
|
||||||
|
- desc: VP2022 clang14/C++17 llvm14 oiio-3.0 py3.9 avx2 batch-avx512
|
||||||
|
nametag: linux-vfx2022-clang-llvm14-batch
|
||||||
|
runner: ubuntu-latest
|
||||||
|
container: aswf/ci-osl:2022-clang14
|
||||||
|
vfxyear: 2022
|
||||||
|
old_node: 1
|
||||||
|
cxx_std: 17
|
||||||
|
opencolorio_ver: v2.2.1
|
||||||
|
openimageio_ver: v3.0.11.0
|
||||||
|
python_ver: 3.9
|
||||||
|
pybind11_ver: v2.9.0
|
||||||
|
simd: avx2,f16c
|
||||||
|
batched: b4_SSE2,b8_AVX2,b8_AVX512,b16_AVX512
|
||||||
|
setenvs: USE_OPENVDB=0
|
||||||
|
- desc: VP2022 oldest everything gcc9/C++17 llvm14 py3.9 oiio3.0 no-simd
|
||||||
|
nametag: linux-oldest
|
||||||
|
runner: ubuntu-latest
|
||||||
|
container: aswf/ci-osl:2022-clang14
|
||||||
|
vfxyear: 2022
|
||||||
|
old_node: 1
|
||||||
|
cxx_std: 17
|
||||||
|
openexr_ver: v3.1.0
|
||||||
|
openimageio_ver: v3.0.0.3
|
||||||
|
python_ver: 3.9
|
||||||
|
pybind11_ver: v2.7.0
|
||||||
|
# simd: 0
|
||||||
|
setenvs: export PUGIXML_VERSION=v1.8
|
||||||
|
CMAKE_VERSION=3.19.0
|
||||||
|
ENABLE_OPENVDB=0
|
||||||
|
|
||||||
|
|
||||||
|
linux:
|
||||||
|
if: ${{ (github.event.repository.fork == false || github.event_name != 'schedule') && ! contains(github.ref, 'windows-only') && ! contains(github.ref, 'macos-only') && ! contains(github.ref, 'optix-only') }}
|
||||||
|
name: "${{matrix.desc}}"
|
||||||
|
uses: ./.github/workflows/build-steps.yml
|
||||||
|
with:
|
||||||
|
nametag: ${{ matrix.nametag || 'unnamed!' }}
|
||||||
|
disable: ${{ matrix.disable || false }}
|
||||||
|
runner: ${{ matrix.runner || 'ubuntu-latest' }}
|
||||||
|
container: ${{ matrix.container }}
|
||||||
|
cc_compiler: ${{ matrix.cc_compiler || 'gcc' }}
|
||||||
|
cxx_compiler: ${{ matrix.cxx_compiler || 'g++' }}
|
||||||
|
cxx_std: ${{ matrix.cxx_std || '17' }}
|
||||||
|
build_type: ${{ matrix.build_type || 'Release' }}
|
||||||
|
depcmds: ${{ matrix.depcmds }}
|
||||||
|
extra_artifacts: ${{ matrix.extra_artifacts }}
|
||||||
|
fmt_ver: ${{ matrix.fmt_ver }}
|
||||||
|
fmt_commit: ${{ matrix.fmt_commit }}
|
||||||
|
opencolorio_ver: ${{ matrix.opencolorio_ver }}
|
||||||
|
openexr_ver: ${{ matrix.openexr_ver }}
|
||||||
|
openimageio_ver: ${{ matrix.openimageio_ver }}
|
||||||
|
pybind11_ver: ${{ matrix.pybind11_ver }}
|
||||||
|
python_ver: ${{ matrix.python_ver }}
|
||||||
|
setenvs: ${{ matrix.setenvs }}
|
||||||
|
simd: ${{ matrix.simd }}
|
||||||
|
batched: ${{ matrix.batched }}
|
||||||
|
skip_build: ${{ matrix.skip_build }}
|
||||||
|
skip_tests: ${{ matrix.skip_tests }}
|
||||||
|
abi_check: ${{ matrix.abi_check }}
|
||||||
|
build_docs: ${{ matrix.build_docs }}
|
||||||
|
generator: ${{ matrix.generator }}
|
||||||
|
ctest_args: ${{ matrix.ctest_args }}
|
||||||
|
ctest_test_timeout: ${{ matrix.ctest_test_timeout || '800' }}
|
||||||
|
coverage: ${{ matrix.coverage || 0 }}
|
||||||
|
sonar: ${{ matrix.sonar || 0 }}
|
||||||
|
llvm_action_ver: ${{ matrix.llvm_action_ver }}
|
||||||
|
clang_format: ${{ matrix.clang_format }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- desc: VP2023 gcc11/C++17 llvm15 py3.10 oiio-3.0 avx2
|
||||||
|
nametag: linux-vfx2023
|
||||||
|
runner: ubuntu-latest
|
||||||
|
container: aswf/ci-osl:2023-clang15.2
|
||||||
|
cxx_std: 17
|
||||||
|
openimageio_ver: v3.0.11.0
|
||||||
|
python_ver: "3.10"
|
||||||
|
pybind11_ver: v2.9.0
|
||||||
simd: avx2,f16c
|
simd: avx2,f16c
|
||||||
batched: b8_AVX2
|
batched: b8_AVX2
|
||||||
- desc: clang12/C++17 llvm12 oiio-master boost1.73 exr3.1 py3.9 avx2 batch-avx512
|
- desc: VP2024 gcc11/C++17 llvm17 py3.11 oiio-3.0 avx2
|
||||||
nametag: linux-clang12-llvm12-batch
|
nametag: linux-vfx2024
|
||||||
os: ubuntu-latest
|
runner: ubuntu-latest
|
||||||
vfxyear: 2022
|
container: aswf/ci-osl:2024-clang17
|
||||||
vfxsuffix: -clang12
|
|
||||||
cxx_std: 17
|
cxx_std: 17
|
||||||
openimageio_ver: master
|
openimageio_ver: v3.0.11.0
|
||||||
python_ver: 3.9
|
python_ver: "3.11"
|
||||||
pybind11_ver: v2.6.2
|
pybind11_ver: v2.11.1
|
||||||
simd: avx2,f16c
|
simd: avx2,f16c
|
||||||
batched: b8_AVX2,b8_AVX512,b16_AVX512
|
batched: b8_AVX2
|
||||||
setenvs: USE_OPENVDB=0
|
setenvs: export REMOVE_INSTALLED_OPENIMAGEIO=1
|
||||||
- desc: icc/C++17 llvm13 py3.9 boost1.76 exr3.1 oiio-master avx2
|
- desc: VP2025 gcc11/C++17 llvm18 py3.11 oiio-3.0 avx2
|
||||||
nametag: linux-icc
|
nametag: linux-vfx2025
|
||||||
os: ubuntu-latest
|
runner: ubuntu-latest
|
||||||
vfxyear: 2022
|
container: aswf/ci-osl:2025-clang18
|
||||||
vfxsuffix: -clang13
|
|
||||||
cc_compiler: icc
|
|
||||||
cxx_compiler: icpc
|
|
||||||
cxx_std: 17
|
cxx_std: 17
|
||||||
fmt_ver: 7.1.3
|
python_ver: "3.11"
|
||||||
openimageio_ver: master
|
|
||||||
python_ver: 3.9
|
|
||||||
pybind11_ver: v2.9.0
|
|
||||||
# simd: avx2,f16c
|
|
||||||
batched: b8_AVX2_noFMA
|
|
||||||
setenvs: export OSL_CMAKE_FLAGS="-DSTOP_ON_WARNING=OFF -DEXTRA_CPP_ARGS=-fp-model=consistent"
|
|
||||||
OPENIMAGEIO_CMAKE_FLAGS=-DBUILD_FMT_VERSION=7.1.3
|
|
||||||
USE_OPENVDB=0
|
|
||||||
- desc: icx/C++17 llvm13 py3.9 boost1.76 exr3.1 oiio2.3 avx2
|
|
||||||
nametag: linux-icx
|
|
||||||
os: ubuntu-latest
|
|
||||||
vfxyear: 2022
|
|
||||||
vfxsuffix: -clang13
|
|
||||||
cc_compiler: icx
|
|
||||||
cxx_compiler: icpx
|
|
||||||
cxx_std: 17
|
|
||||||
fmt_ver: 7.1.3
|
|
||||||
openimageio_ver: master
|
|
||||||
python_ver: 3.9
|
|
||||||
pybind11_ver: v2.9.0
|
|
||||||
simd: avx2,f16c
|
simd: avx2,f16c
|
||||||
batched: b8_AVX2_noFMA
|
batched: b8_AVX2
|
||||||
setenvs: export OSL_CMAKE_FLAGS="-DSTOP_ON_WARNING=OFF" USE_OPENVDB=0
|
setenvs: export CTEST_EXCLUSIONS="broken|python-oslquery"
|
||||||
- desc: oldest everything gcc6/C++14 llvm9 py2.7 boost1.66 oiio2.2 no-simd exr2.3
|
# ^^ exclude python-oslquery test until the ASWF container properly
|
||||||
nametag: linux-oldest
|
# includes OIIO's python bindings, then we can remove that.
|
||||||
os: ubuntu-latest
|
- desc: VP2026 gcc14/C++20 llvm20 py3.13 oiio-3.1 avx2
|
||||||
vfxyear: 2019
|
nametag: linux-vfx2026
|
||||||
vfxsuffix: -clang9
|
runner: ubuntu-latest
|
||||||
cxx_std: 14
|
container: aswf/ci-osl:2026-clang20
|
||||||
openimageio_ver: v2.3.17.0
|
cxx_std: 20
|
||||||
python_ver: 2.7
|
python_ver: "3.13"
|
||||||
pybind11_ver: v2.6.2
|
simd: avx2,f16c
|
||||||
simd: 0
|
batched: b8_AVX2
|
||||||
setenvs: export PUGIXML_VERSION=v1.8
|
setenvs: export CTEST_EXCLUSIONS="broken|python-oslquery"
|
||||||
|
# ^^ exclude python-oslquery test until the ASWF container properly
|
||||||
# Address and leak sanitizers
|
# includes OIIO's python bindings, then we can remove that.
|
||||||
|
# Address and leak sanitizers (debug build)
|
||||||
- desc: sanitizers
|
- desc: sanitizers
|
||||||
nametag: sanitizer
|
nametag: sanitizer
|
||||||
os: ubuntu-latest
|
runner: ubuntu-latest
|
||||||
vfxyear: 2022
|
container: aswf/ci-osl:2024-clang17
|
||||||
vfxsuffix: -clang13
|
|
||||||
cc_compiler: clang
|
cc_compiler: clang
|
||||||
cxx_compiler: clang++
|
cxx_compiler: clang++
|
||||||
cxx_std: 17
|
cxx_std: 17
|
||||||
openimageio_ver: master
|
openimageio_ver: main
|
||||||
python_ver: 3.9
|
python_ver: "3.11"
|
||||||
pybind11_ver: v2.9.0
|
pybind11_ver: v2.11.1
|
||||||
simd: avx2,f16c
|
simd: avx2,f16c
|
||||||
batched: b8_AVX2
|
batched: b8_AVX2
|
||||||
setenvs: export OSL_CMAKE_FLAGS="-DSANITIZE=address -DOSL_TEST_BIG_TIMEOUT=1200"
|
setenvs: export OSL_CMAKE_FLAGS="-DSANITIZE=address -DOSL_TEST_BIG_TIMEOUT=1200"
|
||||||
@@ -176,6 +230,7 @@ jobs:
|
|||||||
OSL_OPTIONS=llvm_debugging_symbols=1
|
OSL_OPTIONS=llvm_debugging_symbols=1
|
||||||
TESTRENDER_AA=1
|
TESTRENDER_AA=1
|
||||||
OSL_TESTSUITE_SKIP_DIFF=1
|
OSL_TESTSUITE_SKIP_DIFF=1
|
||||||
|
REMOVE_INSTALLED_OPENIMAGEIO=1
|
||||||
# Sanitizer notes:
|
# Sanitizer notes:
|
||||||
# - There are a handful of tests we disable entirely with
|
# - There are a handful of tests we disable entirely with
|
||||||
# CTEST_EXCLUSIONS because they are irrelevant or just cannot be
|
# CTEST_EXCLUSIONS because they are irrelevant or just cannot be
|
||||||
@@ -196,6 +251,142 @@ jobs:
|
|||||||
# texture system adequately and is able to ignore the benign
|
# texture system adequately and is able to ignore the benign
|
||||||
# "leaks."
|
# "leaks."
|
||||||
|
|
||||||
|
# Test ABI stability. `abi_check` is the version or commit that we
|
||||||
|
# believe is the current standard against which we don't want to
|
||||||
|
# break the ABI. Basically, we will build that version as well as
|
||||||
|
# the current one, and compare the resulting libraries.
|
||||||
|
- desc: abi check
|
||||||
|
nametag: linux-abi
|
||||||
|
runner: ubuntu-latest
|
||||||
|
container: aswf/ci-osl:2025-clang18
|
||||||
|
cc_compiler: gcc
|
||||||
|
cxx_compiler: g++
|
||||||
|
cxx_std: 17
|
||||||
|
openimageio_ver: release
|
||||||
|
python_ver: "3.11"
|
||||||
|
simd: "avx2,f16c"
|
||||||
|
batched: b8_AVX2
|
||||||
|
fmt_ver: 10.1.1
|
||||||
|
pybind11_ver: v2.10.0
|
||||||
|
skip_tests: 1
|
||||||
|
abi_check: 6ab45815c49e6f4793769c29ba64b8ef0880adaf
|
||||||
|
setenvs: export OSL_CMAKE_FLAGS="-DOSL_BUILD_TESTS=0 -DBUILD_TESTING=OFF -DUSE_QT=0"
|
||||||
|
OPENIMAGEIO_CMAKE_FLAGS="-DUSE_PYTHON=0"
|
||||||
|
CMAKE_BUILD_TYPE=RelWithDebInfo
|
||||||
|
OpenImageIO_DEPENDENCY_BUILD_ALLOW_UNVERIFIED_TAGS=ON
|
||||||
|
|
||||||
|
- desc: icx/C++17 llvm14 py3.10 oiio-3.0 avx2
|
||||||
|
nametag: linux-icx
|
||||||
|
runner: ubuntu-latest
|
||||||
|
# If we ever need the big runner:
|
||||||
|
# runner: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-22.04-8c-32g-300h') || 'ubuntu-latest' }}
|
||||||
|
# disable: ${{ github.repository_owner != 'AcademySoftwareFoundation' }}
|
||||||
|
container: aswf/ci-osl:2023-clang15.2
|
||||||
|
cc_compiler: icx
|
||||||
|
cxx_compiler: icpx
|
||||||
|
cxx_std: 17
|
||||||
|
fmt_ver: 7.1.3
|
||||||
|
opencolorio_ver: v2.3.2
|
||||||
|
openimageio_ver: v3.0.15.0
|
||||||
|
python_ver: "3.10"
|
||||||
|
pybind11_ver: v2.10.0
|
||||||
|
simd: avx2,f16c
|
||||||
|
batched: b8_AVX2_noFMA
|
||||||
|
setenvs: export OSL_CMAKE_FLAGS="-DSTOP_ON_WARNING=OFF"
|
||||||
|
USE_OPENVDB=0
|
||||||
|
OPENCOLORIO_CMAKE_FLAGS="-DCMAKE_CXX_COMPILER=g++"
|
||||||
|
|
||||||
|
- desc: Debug gcc9/C++17 llvm14 py3.10 oiio3.0 exr3.1 sse4
|
||||||
|
nametag: linux-debug-gcc9-llvm14
|
||||||
|
runner: ubuntu-22.04
|
||||||
|
cxx_compiler: g++-9
|
||||||
|
cxx_std: 17
|
||||||
|
openexr_ver: v3.1.11
|
||||||
|
openimageio_ver: v3.0.0.3
|
||||||
|
pybind11_ver: v2.7.0
|
||||||
|
python_ver: "3.10"
|
||||||
|
simd: sse4.2
|
||||||
|
setenvs: export CMAKE_BUILD_TYPE=Debug
|
||||||
|
LLVM_VERSION=14.0.0 LLVM_DISTRO_NAME=ubuntu-18.04
|
||||||
|
PUGIXML_VERSION=v1.9
|
||||||
|
CTEST_TEST_TIMEOUT=1800
|
||||||
|
OSL_CMAKE_FLAGS="-DOSL_TEST_BIG_TIMEOUT=1200"
|
||||||
|
- desc: latest releases gcc13/C++17 llvm20 oiio-rel exr3.4 py3.12 avx2 batch-b16avx512
|
||||||
|
nametag: linux-latest-releases
|
||||||
|
runner: ubuntu-24.04
|
||||||
|
cc_compiler: gcc-14
|
||||||
|
cxx_compiler: g++-14
|
||||||
|
cxx_std: 17
|
||||||
|
fmt_ver: 12.1.0
|
||||||
|
opencolorio_ver: v2.5.0
|
||||||
|
openexr_ver: v3.4.2
|
||||||
|
openimageio_ver: release
|
||||||
|
pybind11_ver: v3.0.1
|
||||||
|
python_ver: "3.12"
|
||||||
|
llvm_action_ver: "18.1.7"
|
||||||
|
simd: avx2,f16c
|
||||||
|
batched: b8_AVX2,b8_AVX512,b16_AVX512
|
||||||
|
setenvs: export LIBTIFF_VERSION=v4.7.1
|
||||||
|
PTEX_VERSION=v2.4.3
|
||||||
|
PUGIXML_VERSION=v1.15
|
||||||
|
FREETYPE_VERSION=VER-2-14-3
|
||||||
|
- desc: latest releases clang18/C++17 llvm18 oiio-rel exr3.4 py3.12 avx2 batch-b16avx512
|
||||||
|
nametag: linux-latest-releases
|
||||||
|
runner: ubuntu-24.04
|
||||||
|
cc_compiler: clang
|
||||||
|
cxx_compiler: clang++
|
||||||
|
cxx_std: 17
|
||||||
|
fmt_ver: 12.1.0
|
||||||
|
opencolorio_ver: v2.5.0
|
||||||
|
openexr_ver: v3.4.2
|
||||||
|
openimageio_ver: release
|
||||||
|
pybind11_ver: v3.0.1
|
||||||
|
python_ver: "3.12"
|
||||||
|
llvm_action_ver: "18.1.7"
|
||||||
|
simd: avx2,f16c
|
||||||
|
batched: b8_AVX2,b8_AVX512,b16_AVX512
|
||||||
|
setenvs: export LIBTIFF_VERSION=v4.7.1
|
||||||
|
PTEX_VERSION=v2.4.3
|
||||||
|
PUGIXML_VERSION=v1.15
|
||||||
|
FREETYPE_VERSION=VER-2-14-3
|
||||||
|
- desc: bleeding edge gcc14/C++17 llvm17 oiio/ocio/exr/pybind-main py3.12 avx2 batch-b16avx512
|
||||||
|
nametag: linux-bleeding-edge
|
||||||
|
runner: ubuntu-24.04
|
||||||
|
cc_compiler: gcc-14
|
||||||
|
cxx_compiler: g++-14
|
||||||
|
cxx_std: 20
|
||||||
|
fmt_ver: main
|
||||||
|
opencolorio_ver: main
|
||||||
|
openexr_ver: main
|
||||||
|
openimageio_ver: main
|
||||||
|
# pybind11_ver: v3.0.1
|
||||||
|
pybind11_ver: master
|
||||||
|
python_ver: "3.12"
|
||||||
|
llvm_action_ver: "18.1.7"
|
||||||
|
simd: avx2,f16c
|
||||||
|
batched: b8_AVX2,b8_AVX512,b16_AVX512
|
||||||
|
setenvs: export PUGIXML_VERSION=master
|
||||||
|
PTEX_VERSION=v2.4.3
|
||||||
|
PUGIXML_VERSION=v1.15
|
||||||
|
FREETYPE_VERSION=VER-2-14-3
|
||||||
|
OpenImageIO_DEPENDENCY_BUILD_ALLOW_UNVERIFIED_TAGS=ON
|
||||||
|
- desc: clang14/C++17 llvm14 py3.10 avx2 batch-b16avx512
|
||||||
|
nametag: linux-clang14
|
||||||
|
runner: ubuntu-22.04
|
||||||
|
cxx_compiler: clang++
|
||||||
|
cc_compiler: clang
|
||||||
|
cxx_std: 17
|
||||||
|
fmt_ver: 12.1.0
|
||||||
|
opencolorio_ver: v2.5.0
|
||||||
|
openexr_ver: v3.4.2
|
||||||
|
openimageio_ver: release
|
||||||
|
pybind11_ver: v3.0.1
|
||||||
|
python_ver: "3.10"
|
||||||
|
simd: avx2,f16c
|
||||||
|
batched: b8_AVX2,b8_AVX512,b16_AVX512
|
||||||
|
setenvs: export LLVM_VERSION=14.0.0
|
||||||
|
LLVM_DISTRO_NAME=ubuntu-18.04
|
||||||
|
PUGIXML_VERSION=v1.15
|
||||||
# Test formatting. This test entry doesn't do a full build, it
|
# Test formatting. This test entry doesn't do a full build, it
|
||||||
# just runs clang-format on everything, and passes if nothing is
|
# just runs clang-format on everything, and passes if nothing is
|
||||||
# misformatted. Upon failure, the build artifact will be the full
|
# misformatted. Upon failure, the build artifact will be the full
|
||||||
@@ -203,288 +394,219 @@ jobs:
|
|||||||
# the console output).
|
# the console output).
|
||||||
- desc: "clang-format"
|
- desc: "clang-format"
|
||||||
nametag: clang-format
|
nametag: clang-format
|
||||||
os: ubuntu-latest
|
runner: ubuntu-24.04
|
||||||
vfxyear: 2022
|
|
||||||
vfxsuffix: -clang14
|
|
||||||
cxx_std: 17
|
cxx_std: 17
|
||||||
openimageio_ver: release
|
extra_artifacts: "src/*.*"
|
||||||
python_ver: 3.9
|
|
||||||
simd: avx2,f16c
|
|
||||||
batched: b8_AVX2
|
|
||||||
skip_tests: 1
|
|
||||||
setenvs: export BUILDTARGET=clang-format
|
|
||||||
OPENIMAGEIO_CMAKE_FLAGS=-DUSE_PYTHON=0
|
|
||||||
|
|
||||||
runs-on: ${{matrix.os}}
|
|
||||||
container:
|
|
||||||
image: aswftesting/ci-osl:${{matrix.vfxyear}}${{matrix.vfxsuffix}}
|
|
||||||
env:
|
|
||||||
CXX: ${{matrix.cxx_compiler}}
|
|
||||||
CC: ${{matrix.cc_compiler}}
|
|
||||||
CMAKE_CXX_STANDARD: ${{matrix.cxx_std}}
|
|
||||||
FMT_VERSION: ${{matrix.fmt_ver}}
|
|
||||||
OPENEXR_VERSION: ${{matrix.openexr_ver}}
|
|
||||||
OPENIMAGEIO_VERSION: ${{matrix.openimageio_ver}}
|
|
||||||
PYBIND11_VERSION: ${{matrix.pybind11_ver}}
|
|
||||||
PYTHON_VERSION: ${{matrix.python_ver}}
|
|
||||||
USE_BATCHED: ${{matrix.batched}}
|
|
||||||
USE_SIMD: ${{matrix.simd}}
|
|
||||||
steps:
|
|
||||||
# We would like to use harden-runner, but it flags too many false
|
|
||||||
# positives, every time we download a dependency. We should use it only
|
|
||||||
# on CI runs where we are producing artifacts that users might rely on.
|
|
||||||
# - name: Harden Runner
|
|
||||||
# uses: step-security/harden-runner@248ae51c2e8cc9622ecf50685c8bf7150c6e8813 # v1.4.3
|
|
||||||
# with:
|
|
||||||
# egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
|
|
||||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
|
|
||||||
- name: Prepare ccache timestamp
|
|
||||||
id: ccache_cache_keys
|
|
||||||
run: echo "::set-output name=date::`date -u +'%Y-%m-%dT%H:%M:%SZ'`"
|
|
||||||
- name: ccache
|
|
||||||
id: ccache
|
|
||||||
uses: actions/cache@c3f1317a9e7b1ef106c153ac8c0f00fed3ddbc0d # v3.0.4
|
|
||||||
with:
|
|
||||||
path: /tmp/ccache
|
|
||||||
key: ${{github.job}}-${{matrix.nametag}}-${{steps.ccache_cache_keys.outputs.date}}
|
|
||||||
restore-keys: ${{github.job}}-${{matrix.nametag}}-
|
|
||||||
- name: Build setup
|
|
||||||
run: |
|
|
||||||
${{matrix.setenvs}}
|
|
||||||
src/build-scripts/ci-startup.bash
|
|
||||||
- name: Remove existing OIIO
|
|
||||||
if: matrix.openimageio_ver != ''
|
|
||||||
run: |
|
|
||||||
sudo rm -rf /usr/local/include/OpenImageIO
|
|
||||||
sudo rm -rf /usr/local/lib*/cmake/OpenImageIO
|
|
||||||
sudo rm -rf /usr/local/lib*/libOpenImageIO*
|
|
||||||
sudo rm -rf /usr/local/lib*/python3.9/site-packages/OpenImageIO*
|
|
||||||
- name: Dependencies
|
|
||||||
run: |
|
|
||||||
${{matrix.depcmds}}
|
|
||||||
src/build-scripts/gh-installdeps.bash
|
|
||||||
- name: Build
|
|
||||||
run: |
|
|
||||||
src/build-scripts/ci-build.bash
|
|
||||||
- name: Testsuite
|
|
||||||
if: matrix.skip_tests != '1'
|
|
||||||
run: src/build-scripts/ci-test.bash
|
|
||||||
- uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0
|
|
||||||
if: failure()
|
|
||||||
with:
|
|
||||||
name: osl-${{github.job}}-${{matrix.nametag}}
|
|
||||||
path: |
|
|
||||||
build/*.cmake
|
|
||||||
build/CMake*
|
|
||||||
build/testsuite/*/*.*
|
|
||||||
|
|
||||||
|
|
||||||
ubuntu:
|
|
||||||
name: "Ubuntu ${{matrix.desc}}"
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- desc: Debug gcc7/C++14 llvm9 py2.7 oiio2.3 exr2.4 sse4 boost1.65 exr2.4
|
|
||||||
nametag: linux-debug-gcc7-llvm9
|
|
||||||
os: ubuntu-18.04
|
|
||||||
cxx_compiler: g++-7
|
|
||||||
cxx_std: 14
|
|
||||||
openexr_ver: v2.4.3
|
|
||||||
openimageio_ver: dev-2.3
|
|
||||||
pybind11_ver: v2.6.2
|
|
||||||
python_ver: 2.7
|
|
||||||
simd: sse4.2
|
|
||||||
setenvs: export CMAKE_BUILD_TYPE=Debug
|
|
||||||
LLVM_VERSION=9.0.0
|
|
||||||
PUGIXML_VERSION=v1.9
|
|
||||||
CTEST_TEST_TIMEOUT=240
|
|
||||||
- desc: gcc10/C++17 llvm10 oiio-release boost1.65 exr2.5 avx2
|
|
||||||
nametag: linux-2021ish-gcc10-llvm10
|
|
||||||
os: ubuntu-18.04
|
|
||||||
cxx_compiler: g++-10
|
|
||||||
cxx_std: 17
|
|
||||||
fmt_ver: 7.0.1
|
|
||||||
openexr_ver: v2.5.6
|
|
||||||
openimageio_ver: release
|
|
||||||
pybind11_ver: v2.8.1
|
|
||||||
# python_ver: 2.7 FIXME
|
|
||||||
simd: avx2,f16c
|
|
||||||
setenvs: export LLVM_VERSION=10.0.0
|
|
||||||
OPENIMAGEIO_CMAKE_FLAGS="-DBUILD_FMT_VERSION=7.0.1"
|
|
||||||
PUGIXML_VERSION=v1.10
|
|
||||||
- desc: latest releases gcc11/C++17 llvm13 boost1.71 exr3.1 py3.9 avx2 batch-b16avx512
|
|
||||||
nametag: linux-latest-releases
|
|
||||||
os: ubuntu-20.04
|
|
||||||
cxx_compiler: g++-11
|
|
||||||
cxx_std: 17
|
|
||||||
fmt_ver: 9.1.0
|
|
||||||
openexr_ver: v3.1.5
|
|
||||||
openimageio_ver: master
|
|
||||||
pybind11_ver: v2.10.0
|
|
||||||
python_ver: 3.9
|
|
||||||
simd: avx2,f16c
|
|
||||||
batched: b8_AVX2,b8_AVX512,b16_AVX512
|
|
||||||
setenvs: export LLVM_VERSION=13.0.0
|
|
||||||
LLVM_DISTRO_NAME=ubuntu-20.04
|
|
||||||
OPENCOLORIO_VERSION=v2.1.2
|
|
||||||
PUGIXML_VERSION=v1.11.4
|
|
||||||
- desc: bleeding edge gcc12/C++17 llvm14 oiio/ocio/exr/pybind-master boost1.71 py3.10 avx2 batch-b16avx512
|
|
||||||
nametag: linux-bleeding-edge
|
|
||||||
os: ubuntu-22.04
|
|
||||||
cxx_compiler: g++-12
|
|
||||||
cxx_std: 17
|
|
||||||
fmt_ver: master
|
|
||||||
openexr_ver: main
|
|
||||||
openimageio_ver: master
|
|
||||||
pybind11_ver: master
|
|
||||||
python_ver: "3.10"
|
python_ver: "3.10"
|
||||||
simd: avx2,f16c
|
pybind11_ver: "0"
|
||||||
batched: b8_AVX2,b8_AVX512,b16_AVX512
|
skip_build: 1
|
||||||
setenvs: export LLVM_VERSION=14.0.0
|
skip_tests: 1
|
||||||
LLVM_DISTRO_NAME=ubuntu-18.04
|
clang_format: 1
|
||||||
OPENCOLORIO_VERSION=main
|
setenvs: export OPENIMAGEIO_CMAKE_FLAGS=-DUSE_PYTHON=0
|
||||||
PUGIXML_VERSION=master
|
USE_PYTHON=0 QT_VERSION=0 PUGIXML_VERSION=0
|
||||||
- desc: clang14/C++17 llvm14 boost1.71 exr3.1 py3.8 avx2 batch-b16avx512
|
SKIP_APT_GET_UPDATE=0
|
||||||
nametag: linux-latest-releases-clang
|
SKIP_SYSTEM_DEPS_INSTALL=1
|
||||||
os: ubuntu-20.04
|
EXTRA_DEP_PACKAGES="clang-format-17"
|
||||||
cxx_compiler: clang++
|
CLANG_FORMAT_EXE=clang-format-17
|
||||||
cc_compiler: clang
|
|
||||||
cxx_std: 17
|
|
||||||
fmt_ver: 8.1.1
|
|
||||||
openexr_ver: v3.1.5
|
|
||||||
openimageio_ver: master
|
|
||||||
pybind11_ver: v2.9.2
|
|
||||||
python_ver: 3.8
|
|
||||||
simd: avx2,f16c
|
|
||||||
batched: b8_AVX2,b8_AVX512,b16_AVX512
|
|
||||||
setenvs: export LLVM_VERSION=14.0.0
|
|
||||||
LLVM_DISTRO_NAME=ubuntu-18.04
|
|
||||||
OPENCOLORIO_VERSION=v2.1.2
|
|
||||||
PUGIXML_VERSION=v1.11.4
|
|
||||||
|
|
||||||
runs-on: ${{matrix.os}}
|
|
||||||
env:
|
|
||||||
CXX: ${{matrix.cxx_compiler}}
|
|
||||||
CC: ${{matrix.cc_compiler}}
|
|
||||||
CMAKE_CXX_STANDARD: ${{matrix.cxx_std}}
|
|
||||||
FMT_VERSION: ${{matrix.fmt_ver}}
|
|
||||||
OPENEXR_VERSION: ${{matrix.openexr_ver}}
|
|
||||||
OPENIMAGEIO_VERSION: ${{matrix.openimageio_ver}}
|
|
||||||
PYBIND11_VERSION: ${{matrix.pybind11_ver}}
|
|
||||||
PYTHON_VERSION: ${{matrix.python_ver}}
|
|
||||||
USE_BATCHED: ${{matrix.batched}}
|
|
||||||
USE_SIMD: ${{matrix.simd}}
|
|
||||||
steps:
|
|
||||||
# We would like to use harden-runner, but it flags too many false
|
|
||||||
# positives, every time we download a dependency. We should use it only
|
|
||||||
# on CI runs where we are producing artifacts that users might rely on.
|
|
||||||
# - name: Harden Runner
|
|
||||||
# uses: step-security/harden-runner@248ae51c2e8cc9622ecf50685c8bf7150c6e8813 # v1.4.3
|
|
||||||
# with:
|
|
||||||
# egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
|
|
||||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
|
|
||||||
- name: Prepare ccache timestamp
|
|
||||||
id: ccache_cache_keys
|
|
||||||
run: echo "::set-output name=date::`date -u +'%Y-%m-%dT%H:%M:%SZ'`"
|
|
||||||
- name: ccache
|
|
||||||
id: ccache
|
|
||||||
uses: actions/cache@c3f1317a9e7b1ef106c153ac8c0f00fed3ddbc0d # v3.0.4
|
|
||||||
with:
|
|
||||||
path: /tmp/ccache
|
|
||||||
key: ${{github.job}}-${{matrix.nametag}}-${{steps.ccache_cache_keys.outputs.date}}
|
|
||||||
restore-keys: ${{github.job}}-${{matrix.nametag}}-
|
|
||||||
- name: Build setup
|
|
||||||
run: |
|
|
||||||
${{matrix.setenvs}}
|
|
||||||
src/build-scripts/ci-startup.bash
|
|
||||||
- name: Dependencies
|
|
||||||
run: |
|
|
||||||
${{matrix.depcmds}}
|
|
||||||
src/build-scripts/gh-installdeps.bash
|
|
||||||
- name: Build
|
|
||||||
run: src/build-scripts/ci-build.bash
|
|
||||||
- name: Testsuite
|
|
||||||
if: matrix.skip_tests != '1'
|
|
||||||
run: src/build-scripts/ci-test.bash
|
|
||||||
- uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0
|
|
||||||
if: failure()
|
|
||||||
with:
|
|
||||||
name: osl-${{github.job}}-${{matrix.nametag}}
|
|
||||||
path: |
|
|
||||||
build/*.cmake
|
|
||||||
build/CMake*
|
|
||||||
build/testsuite/*/*.*
|
|
||||||
|
|
||||||
|
|
||||||
macos:
|
macos:
|
||||||
name: "${{matrix.os}} appleclang${{matrix.aclang}}/C++${{matrix.cxx_std}} py${{matrix.python_ver}} ${{matrix.desc}}"
|
if: ${{ (github.event.repository.fork == false || github.event_name != 'schedule') && ! contains(github.ref, 'windows-only') && ! contains(github.ref, 'linux-only') && ! contains(github.ref, 'optix-only') }}
|
||||||
|
name: "${{matrix.desc}}"
|
||||||
|
uses: ./.github/workflows/build-steps.yml
|
||||||
|
with:
|
||||||
|
nametag: ${{ matrix.nametag || 'unnamed!' }}
|
||||||
|
runner: ${{ matrix.runner }}
|
||||||
|
container: ${{ matrix.container }}
|
||||||
|
cc_compiler: ${{ matrix.cc_compiler || 'clang' }}
|
||||||
|
cxx_compiler: ${{ matrix.cxx_compiler || 'clang++' }}
|
||||||
|
cxx_std: ${{ matrix.cxx_std || '17' }}
|
||||||
|
batched: ${{ matrix.batched }}
|
||||||
|
build_type: ${{ matrix.build_type || 'Release' }}
|
||||||
|
depcmds: ${{ matrix.depcmds }}
|
||||||
|
extra_artifacts: ${{ matrix.extra_artifacts }}
|
||||||
|
fmt_ver: ${{ matrix.fmt_ver }}
|
||||||
|
fmt_commit: ${{ matrix.fmt_commit }}
|
||||||
|
opencolorio_ver: ${{ matrix.opencolorio_ver }}
|
||||||
|
openexr_ver: ${{ matrix.openexr_ver }}
|
||||||
|
openimageio_ver: ${{ matrix.openimageio_ver }}
|
||||||
|
pybind11_ver: ${{ matrix.pybind11_ver }}
|
||||||
|
python_ver: ${{ matrix.python_ver }}
|
||||||
|
setenvs: ${{ matrix.setenvs }}
|
||||||
|
simd: ${{ matrix.simd }}
|
||||||
|
skip_build: ${{ matrix.skip_build }}
|
||||||
|
skip_tests: ${{ matrix.skip_tests }}
|
||||||
|
abi_check: ${{ matrix.abi_check }}
|
||||||
|
build_docs: ${{ matrix.build_docs }}
|
||||||
|
generator: ${{ matrix.generator }}
|
||||||
|
ctest_args: ${{ matrix.ctest_args }}
|
||||||
|
ctest_test_timeout: ${{ matrix.ctest_test_timeout || '800' }}
|
||||||
|
coverage: ${{ matrix.coverage || 0 }}
|
||||||
|
sonar: ${{ matrix.sonar || 0 }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- desc: MacOS-11
|
- desc: MacOS-15-Intel aclang17/C++17/py3.13 llvm18 oiio-release
|
||||||
os: macos-11
|
runner: macos-15-intel
|
||||||
nametag: macos11-py39
|
nametag: macos15
|
||||||
cc_compiler: /usr/local/opt/llvm@14/bin/clang
|
cc_compiler: /usr/bin/clang
|
||||||
cxx_compiler: /usr/local/opt/llvm@14/bin/clang++
|
cxx_compiler: /usr/bin/clang++
|
||||||
cxx_std: 17
|
cxx_std: 17
|
||||||
python_ver: "3.10"
|
openimageio_ver: dev-3.0
|
||||||
aclang: 13
|
python_ver: "3.13"
|
||||||
setenvs: export LLVMBREWVER="@14" DO_BREW_UPDATE=1
|
ctest_test_timeout: 120
|
||||||
- desc: MacOS-12
|
setenvs: export HOMEBREW_PREFIX=/usr/local
|
||||||
os: macos-12
|
LLVMBREWVER="@18"
|
||||||
nametag: macos11-p310
|
INSTALL_OPENVDB=0 INSTALL_QT=0
|
||||||
cc_compiler: /usr/local/opt/llvm@15/bin/clang
|
- desc: MacOS-14-ARM llvm19 oiio-release
|
||||||
cxx_compiler: /usr/local/opt/llvm@15/bin/clang++
|
runner: macos-14
|
||||||
|
nametag: macos14-arm
|
||||||
|
cc_compiler: /usr/bin/clang
|
||||||
|
cxx_compiler: /usr/bin/clang++
|
||||||
cxx_std: 17
|
cxx_std: 17
|
||||||
python_ver: "3.10"
|
openimageio_ver: main
|
||||||
aclang: 13
|
python_ver: "3.13"
|
||||||
setenvs: export LLVMBREWVER="@15" DO_BREW_UPDATE=1
|
setenvs: export LLVMBREWVER="@19"
|
||||||
runs-on: ${{matrix.os}}
|
- desc: MacOS-15-ARM aclang16/C++17/py3.13 llvm21 oiio-main
|
||||||
env:
|
runner: macos-15
|
||||||
CXX: ${{matrix.cxx_compiler}}
|
nametag: macos15-arm
|
||||||
CC: ${{matrix.cc_compiler}}
|
cc_compiler: /usr/bin/clang
|
||||||
CMAKE_CXX_STANDARD: ${{matrix.cxx_std}}
|
cxx_compiler: /usr/bin/clang++
|
||||||
PYTHON_VERSION: ${{matrix.python_ver}}
|
cxx_std: 17
|
||||||
OPENIMAGEIO_VERSION: ${{matrix.openimageio_ver}}
|
python_ver: "3.13"
|
||||||
steps:
|
openimageio_ver: main
|
||||||
- uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
|
- desc: MacOS-26-ARM aclang16/C++17/py3.14 llvm21 oiio-main
|
||||||
- name: Prepare ccache timestamp
|
runner: macos-26
|
||||||
id: ccache_cache_keys
|
nametag: macos26-arm
|
||||||
run: echo "::set-output name=date::`date -u +'%Y-%m-%dT%H:%M:%SZ'`"
|
cc_compiler: /usr/bin/clang
|
||||||
- name: ccache
|
cxx_compiler: /usr/bin/clang++
|
||||||
id: ccache
|
cxx_std: 17
|
||||||
uses: actions/cache@c3f1317a9e7b1ef106c153ac8c0f00fed3ddbc0d # v3.0.4
|
python_ver: "3.14"
|
||||||
with:
|
openimageio_ver: main
|
||||||
path: /Users/runner/.ccache
|
|
||||||
key: ${{github.job}}-${{matrix.nametag}}-${{steps.ccache_cache_keys.outputs.date}}
|
|
||||||
restore-keys: ${{github.job}}-${{matrix.nametag}}-
|
windows:
|
||||||
- name: Build setup
|
if: ${{ (github.event.repository.fork == false || github.event_name != 'schedule') && ! contains(github.ref, 'linux-only') && ! contains(github.ref, 'macos-only') && ! contains(github.ref, 'optix-only') }}
|
||||||
run: |
|
name: "${{matrix.desc}}"
|
||||||
${{matrix.setenvs}}
|
uses: ./.github/workflows/build-steps.yml
|
||||||
src/build-scripts/ci-startup.bash
|
with:
|
||||||
- name: Dependencies
|
nametag: ${{ matrix.nametag || 'unnamed!' }}
|
||||||
run: |
|
runner: ${{ matrix.runner }}
|
||||||
source src/build-scripts/install_homebrew_deps.bash
|
container: ${{ matrix.container }}
|
||||||
if [[ "$OPENIMAGEIO_VERSION" != "" ]] ; then \
|
cc_compiler: ${{ matrix.cc_compiler }}
|
||||||
OPENIMAGEIO_CMAKE_FLAGS="-DOIIO_BUILD_TESTS=0 -DUSE_OPENGL=0" ; \
|
cxx_compiler: ${{ matrix.cxx_compiler }}
|
||||||
source src/build-scripts/build_openimageio.bash ; \
|
cxx_std: ${{ matrix.cxx_std || '17' }}
|
||||||
else \
|
batched: ${{ matrix.batched }}
|
||||||
brew install --display-times -q openimageio ; \
|
build_type: ${{ matrix.build_type || 'Release' }}
|
||||||
PYTHONPATH=$PYTHONPATH:/usr/local/python${PYTHON_VERSION}/site-packages ; \
|
depcmds: ${{ matrix.depcmds }}
|
||||||
fi
|
extra_artifacts: ${{ matrix.extra_artifacts }}
|
||||||
src/build-scripts/save-env.bash
|
fmt_ver: ${{ matrix.fmt_ver }}
|
||||||
- name: Build
|
fmt_commit: ${{ matrix.fmt_commit }}
|
||||||
run: |
|
llvm_action_ver: ${{ matrix.llvm_action_ver }}
|
||||||
src/build-scripts/ci-build.bash
|
opencolorio_ver: ${{ matrix.opencolorio_ver }}
|
||||||
- name: Testsuite
|
openexr_ver: ${{ matrix.openexr_ver }}
|
||||||
run: src/build-scripts/ci-test.bash
|
openimageio_ver: ${{ matrix.openimageio_ver }}
|
||||||
- uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0
|
pybind11_ver: ${{ matrix.pybind11_ver }}
|
||||||
if: failure()
|
python_ver: ${{ matrix.python_ver }}
|
||||||
with:
|
setenvs: ${{ matrix.setenvs }}
|
||||||
name: osl-${{github.job}}-${{matrix.nametag}}
|
simd: ${{ matrix.simd }}
|
||||||
path: |
|
skip_build: ${{ matrix.skip_build }}
|
||||||
build/*.cmake
|
skip_tests: ${{ matrix.skip_tests }}
|
||||||
build/CMake*
|
abi_check: ${{ matrix.abi_check }}
|
||||||
build/testsuite/*/*.*
|
build_docs: ${{ matrix.build_docs }}
|
||||||
|
generator: ${{ matrix.generator }}
|
||||||
|
ctest_args: ${{ matrix.ctest_args }}
|
||||||
|
ctest_test_timeout: ${{ matrix.ctest_test_timeout || '800' }}
|
||||||
|
coverage: ${{ matrix.coverage || 0 }}
|
||||||
|
sonar: ${{ matrix.sonar || 0 }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
#
|
||||||
|
# Windows 2022 / MSVS 17 case is below. It's not working yet,
|
||||||
|
# work in progress.
|
||||||
|
#
|
||||||
|
- desc: Windows-2022 VS2022 llvm20 oiio3.1
|
||||||
|
runner: windows-2022
|
||||||
|
nametag: windows-2022
|
||||||
|
generator: "Visual Studio 17 2022"
|
||||||
|
python_ver: "3.12"
|
||||||
|
opencolorio_ver: v2.3.2
|
||||||
|
openexr_ver: v3.3.2
|
||||||
|
openimageio_ver: release
|
||||||
|
skip_tests: 1
|
||||||
|
setenvs: export OSL_CMAKE_FLAGS="-DUSE_LLVM_BTCODE=ON"
|
||||||
|
PUGIXML_VERSION=v1.14
|
||||||
|
OpenImageIO_BUILD_MISSING_DEPS="Freetype;TIFF;libdeflate;libjpeg-turbo"
|
||||||
|
LLVM_GOOGLE_DRIVE_ID="1uy7PNVlTQ-H56unXGOS6siRWtNcdS1J7"
|
||||||
|
- desc: Windows-2025 VS2026
|
||||||
|
runner: windows-2025-vs2026
|
||||||
|
nametag: windows-2025-vs2026
|
||||||
|
generator: "Visual Studio 18 2026"
|
||||||
|
python_ver: "3.12"
|
||||||
|
opencolorio_ver: v2.5.1
|
||||||
|
openexr_ver: v3.4.5
|
||||||
|
openimageio_ver: release
|
||||||
|
skip_tests: 1
|
||||||
|
setenvs: export OSL_CMAKE_FLAGS="-DUSE_LLVM_BTCODE=ON"
|
||||||
|
PUGIXML_VERSION=v1.14
|
||||||
|
OpenImageIO_BUILD_MISSING_DEPS="Freetype;TIFF;libdeflate;libjpeg-turbo"
|
||||||
|
LLVM_GOOGLE_DRIVE_ID="1uy7PNVlTQ-H56unXGOS6siRWtNcdS1J7"
|
||||||
|
|
||||||
|
|
||||||
|
optix-gpu:
|
||||||
|
if: ${{ (github.event.repository.fork == false || github.event_name != 'schedule') && ! contains(github.ref, 'windows-only') && ! contains(github.ref, 'macos-only') }}
|
||||||
|
name: "${{matrix.desc}}"
|
||||||
|
uses: ./.github/workflows/build-steps.yml
|
||||||
|
with:
|
||||||
|
nametag: ${{ matrix.nametag || 'unnamed!' }}
|
||||||
|
runner: ${{ matrix.runner || 'ubuntu-latest' }}
|
||||||
|
container: ${{ matrix.container }}
|
||||||
|
cc_compiler: ${{ matrix.cc_compiler || 'gcc' }}
|
||||||
|
cxx_compiler: ${{ matrix.cxx_compiler || 'g++' }}
|
||||||
|
cxx_std: ${{ matrix.cxx_std || '17' }}
|
||||||
|
build_type: ${{ matrix.build_type || 'Release' }}
|
||||||
|
depcmds: ${{ matrix.depcmds }}
|
||||||
|
extra_artifacts: ${{ matrix.extra_artifacts }}
|
||||||
|
fmt_ver: ${{ matrix.fmt_ver }}
|
||||||
|
fmt_commit: ${{ matrix.fmt_commit }}
|
||||||
|
opencolorio_ver: ${{ matrix.opencolorio_ver }}
|
||||||
|
openexr_ver: ${{ matrix.openexr_ver }}
|
||||||
|
openimageio_ver: ${{ matrix.openimageio_ver }}
|
||||||
|
pybind11_ver: ${{ matrix.pybind11_ver }}
|
||||||
|
python_ver: ${{ matrix.python_ver }}
|
||||||
|
setenvs: ${{ matrix.setenvs }}
|
||||||
|
simd: ${{ matrix.simd }}
|
||||||
|
batched: ${{ matrix.batched }}
|
||||||
|
skip_build: ${{ matrix.skip_build }}
|
||||||
|
skip_tests: ${{ matrix.skip_tests }}
|
||||||
|
abi_check: ${{ matrix.abi_check }}
|
||||||
|
build_docs: ${{ matrix.build_docs }}
|
||||||
|
generator: ${{ matrix.generator }}
|
||||||
|
ctest_args: ${{ matrix.ctest_args }}
|
||||||
|
ctest_test_timeout: ${{ matrix.ctest_test_timeout || '800' }}
|
||||||
|
coverage: ${{ matrix.coverage || 0 }}
|
||||||
|
sonar: ${{ matrix.sonar || 0 }}
|
||||||
|
llvm_action_ver: ${{ matrix.llvm_action_ver }}
|
||||||
|
clang_format: ${{ matrix.clang_format }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- desc: OptiX ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'GPU') || 'build only' }} VP2025 gcc11/C++17 llvm18 py3.11 oiio-rel avx2
|
||||||
|
# ^^ This will run on GPU when on the ASWF account, but is a
|
||||||
|
# "build only" test on user accounts. Similar conditionals below
|
||||||
|
# select the right runner type and whether tests are run.
|
||||||
|
nametag: linux-optix-vfx2025
|
||||||
|
runner: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-20.04-gpu-t4-4c-16g-176h') || 'ubuntu-latest' }}
|
||||||
|
container: aswf/ci-osl:2025-clang18
|
||||||
|
cxx_std: 17
|
||||||
|
python_ver: "3.11"
|
||||||
|
pybind11_ver: v2.11.1
|
||||||
|
simd: avx2,f16c
|
||||||
|
skip_tests: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && '0') || '1' }}
|
||||||
|
setenvs: export OSL_CMAKE_FLAGS="-DOSL_USE_OPTIX=1"
|
||||||
|
OPTIX_VERSION=8.0.0
|
||||||
|
CTEST_EXCLUSIONS="broken|render-microfacet|example-cuda|python-oslquery"
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
# Copyright Contributors to the Open Shading Language project.
|
||||||
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
# https://github.com/AcademySoftwareFoundation/OpenshadingLanguage
|
||||||
|
|
||||||
|
|
||||||
|
name: Publish Release Notice to ASWF Slack
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types:
|
||||||
|
- published
|
||||||
|
# published should cover both 'released' and 'prereleased'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
publish:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 5
|
||||||
|
steps:
|
||||||
|
- name: Notify Slack
|
||||||
|
id: slack
|
||||||
|
with:
|
||||||
|
project_name: "Open Shading Language"
|
||||||
|
slack_bot_token: ${{ secrets.SLACK_BOT_TOKEN }}
|
||||||
|
slack_channel: "#release-announcements"
|
||||||
|
project_logo: "https://artwork.aswf.io/projects/open-shading-language/icon/color/open-shading-language-icon-color.png"
|
||||||
|
uses: jmertic/slack-release-notifier@main
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
# Copyright (c) Contributors to the Open Shading Language Project.
|
||||||
|
|
||||||
|
#
|
||||||
|
# Releases are signed via https://github.com/sigstore/sigstore-python.
|
||||||
|
# See https://docs.sigstore.dev for information about sigstore.
|
||||||
|
#
|
||||||
|
# This action creates a .tar.gz of the complete OSL source tree at
|
||||||
|
# the given release tag, signs it via sigstore, and uploads the
|
||||||
|
# .tar.gz and the associated .tar.gz.sigstore credential bundle.
|
||||||
|
#
|
||||||
|
# To verify a downloaded release at a given tag:
|
||||||
|
#
|
||||||
|
# % pip install sigstore
|
||||||
|
# % sigstore verify github --cert-identity https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/.github/workflows/release-sign.yml@refs/tags/<tag> OSL-<tag>.tar.gz
|
||||||
|
#
|
||||||
|
|
||||||
|
name: Sign Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
name: Sign & upload release artifacts
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
env:
|
||||||
|
TAG: ${{ github.ref_name }}
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
id-token: write
|
||||||
|
repository-projects: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- name: Set Prefix
|
||||||
|
# The tag name begins with a 'v', e.g. "v1.14.3", but the prefix
|
||||||
|
# should omit the 'v', so the tarball "OSL-1.14.3.tar.gz"
|
||||||
|
# extracts files into "OSL-v1.14.3/...". This matches
|
||||||
|
# the GitHub release page autogenerated artifact conventions.
|
||||||
|
run: |
|
||||||
|
echo OSL_PREFIX=OSL-${TAG//v}/ >> $GITHUB_ENV
|
||||||
|
echo OSL_TARBALL=OSL-${TAG//v}.tar.gz >> $GITHUB_ENV
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||||
|
|
||||||
|
- name: Create archive
|
||||||
|
run: git archive --format=tar.gz -o ${OSL_TARBALL} --prefix ${OSL_PREFIX} ${TAG}
|
||||||
|
|
||||||
|
- name: Sign archive with Sigstore
|
||||||
|
uses: sigstore/gh-action-sigstore-python@f514d46b907ebcd5bedc05145c03b69c1edd8b46 # v3.0.0
|
||||||
|
with:
|
||||||
|
inputs: ${{ env.OSL_TARBALL }}
|
||||||
|
upload-signing-artifacts: false
|
||||||
|
release-signing-artifacts: false
|
||||||
|
|
||||||
|
- name: Upload release archive
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
run: gh release upload ${TAG} ${OSL_TARBALL} ${OSL_TARBALL}.sigstore.json
|
||||||
@@ -1,3 +1,7 @@
|
|||||||
|
# Copyright Contributors to the Open Shading Language project.
|
||||||
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||||
|
|
||||||
name: Scorecards supply-chain security
|
name: Scorecards supply-chain security
|
||||||
on:
|
on:
|
||||||
# Only the default branch is supported.
|
# Only the default branch is supported.
|
||||||
@@ -6,22 +10,30 @@ on:
|
|||||||
- cron: '44 20 * * 6'
|
- cron: '44 20 * * 6'
|
||||||
push:
|
push:
|
||||||
branches: [ "main", "scorecard" ]
|
branches: [ "main", "scorecard" ]
|
||||||
|
paths-ignore:
|
||||||
|
- '**.md'
|
||||||
|
- '**.rst'
|
||||||
|
- '**.tex'
|
||||||
|
|
||||||
# Declare default permissions as read only.
|
# Declare default permissions as read only.
|
||||||
permissions: read-all
|
permissions: read-all
|
||||||
|
|
||||||
|
# Allow subsequent pushes to the same PR or REF to cancel any previous jobs.
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
analysis:
|
analysis:
|
||||||
name: Scorecards analysis
|
name: Scorecards analysis
|
||||||
|
if: github.event.repository.fork == false
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
# Needed to upload the results to code-scanning dashboard.
|
# Needed to upload the results to code-scanning dashboard.
|
||||||
security-events: write
|
security-events: write
|
||||||
# Used to receive a badge. (Upcoming feature)
|
# Used to receive a badge. (Upcoming feature)
|
||||||
id-token: write
|
id-token: write
|
||||||
# Needs for private repositories.
|
|
||||||
contents: read
|
|
||||||
actions: read
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: "Checkout code"
|
- name: "Checkout code"
|
||||||
|
|||||||
@@ -10,4 +10,12 @@ build
|
|||||||
*.log
|
*.log
|
||||||
.vscode
|
.vscode
|
||||||
.envrc
|
.envrc
|
||||||
|
.DS_Store
|
||||||
|
|
||||||
|
# AI coding tool directories — generated locally by .agents/setup-agent
|
||||||
|
.claude/
|
||||||
|
.codex/
|
||||||
|
.cursor/
|
||||||
|
.opencode/
|
||||||
|
.github/copilot-instructions.md
|
||||||
|
/specs
|
||||||
|
|||||||
@@ -0,0 +1,47 @@
|
|||||||
|
# This file establishes email equivalences so we can resolve what look like
|
||||||
|
# multiple authors, but actually are the same author who has used multiple
|
||||||
|
# emails over the course of their involvement with the project.
|
||||||
|
#
|
||||||
|
# The format is any of the following:
|
||||||
|
# <CANONICAL-EMAIL> <alternate-email>
|
||||||
|
# CANONICAL-NAME <CANONICAL-EMAIL> <alternate-email>
|
||||||
|
# CANONICAL-NAME <CANONICAL-EMAIL> alternate-name <alternate-email>
|
||||||
|
#
|
||||||
|
# You can check for duplicates with this command:
|
||||||
|
# git shortlog -sne --all
|
||||||
|
# That command (and others) will use this file to collapse the duplicates.
|
||||||
|
#
|
||||||
|
# If you see any duplicates we don't account for here, or if you look at your
|
||||||
|
# own entry here and want a different name or email to be your canonical one
|
||||||
|
# (we may not have guessed correctly and matched your preferences), please
|
||||||
|
# file a PR with the edits to this file.
|
||||||
|
|
||||||
|
Adam Martinez <amartinez.cg@gmail.com> amartinez-cg <amartinez.cg@gmail.com>
|
||||||
|
Alejandro Conty <aconty@imageworks.com> aconty <aconty@gmail.com>
|
||||||
|
Alejandro Conty <aconty@imageworks.com> Alejandro Conty <aconty@gmail.com>
|
||||||
|
Alex M. Wells <alex.m.wells@intel.com> <alex.m.wells@intel.com>
|
||||||
|
Alex M. Wells <alex.m.wells@intel.com> <AlexMWells@users.noreply.github.com>
|
||||||
|
Alex M. Wells <alex.m.wells@intel.com> <awells-np@argon.sea.pixar.com>
|
||||||
|
Alexis Oblet <alob@mikrosimage.eu> Alexis Oblet <aoblet@users.noreply.github.com>
|
||||||
|
Brecht Van Lommel <brecht@blender.org> <brecht@solidangle.com>
|
||||||
|
Brecht Van Lommel <brecht@blender.org> Brecht Van Lommel <brechtvanlommel@gmail.com>
|
||||||
|
Chris Kulla <ckulla@gmail.com> <ckulla@imageworks.com>
|
||||||
|
Chris Kulla <ckulla@gmail.com> <fpsunflower@users.noreply.github.com>
|
||||||
|
Chris Kulla <ckulla@gmail.com> Christopher Kulla <ckulla@gmail.com>
|
||||||
|
Chris Kulla <ckulla@gmail.com> fpsunflower <ckulla@gmail.com>
|
||||||
|
Clifford Stein <cstein@imageworks.com> Cliff Stein <clifford.stein@gmail.com>
|
||||||
|
Clifford Stein <cstein@imageworks.com> cmstein <cstein@imageworks.com>
|
||||||
|
Declan Russell <declan.russell@autodesk.com> Declan Russell <i7709212@bournemouth.ac.uk>
|
||||||
|
Derek Haase <derekhaase@gmail.com> Derek Haase <dhaase@imageworks.com>
|
||||||
|
Esteban Tovagliari <ramenhdr@gmail.com> est77 <ramenhdr@gmail.com>
|
||||||
|
Henri Fousse <henri.fousse@free.fr> darkhorse64 <henri.fousse@free.fr>
|
||||||
|
Larry Gritz <lg@imageworks.com> <larrygritz@gmail.com>
|
||||||
|
Larry Gritz <lg@imageworks.com> <lg@larrygritz.com>
|
||||||
|
Roman Zulak <marsupial@users.noreply.github.com> <rzulak@imageworks.com>
|
||||||
|
Roman Zulak <marsupial@users.noreply.github.com> Frederich Munch <marsupial@users.noreply.github.com>
|
||||||
|
Roman Zulak <marsupial@users.noreply.github.com> marsupial <marsupial@users.noreply.github.com>
|
||||||
|
Ronan Keryell <Ronan.Keryell@amd.com> Ronan Keryell <Ronan.Keryell@silkan.com>
|
||||||
|
Steena Monteiro <steena.monteiro@intel.com> steena.monteiro <smonteir@ortce-sklaw.jf.intel.com>
|
||||||
|
Sven-Hendrik Haase <sh@lutzhaase.com> Sven-Hendrik Haase <svenstaro@gmail.com>
|
||||||
|
Tim Grant <tgrant@nvidia.com> Tim Grant <87798327+tgrant-nv@users.noreply.github.com>
|
||||||
|
Tim Grant <tgrant@nvidia.com> timgrant <timgrant@users.noreply.github.com>
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
# .readthedocs.yml
|
||||||
|
# Read the Docs configuration file
|
||||||
|
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
|
||||||
|
|
||||||
|
# Required
|
||||||
|
version: 2
|
||||||
|
|
||||||
|
# Set the OS, Python version and other tools you might need
|
||||||
|
build:
|
||||||
|
os: ubuntu-22.04
|
||||||
|
tools:
|
||||||
|
python: "3.11"
|
||||||
|
|
||||||
|
|
||||||
|
# Build documentation with Sphinx
|
||||||
|
sphinx:
|
||||||
|
configuration: src/doc/conf.py
|
||||||
|
|
||||||
|
|
||||||
|
# Optionally build your docs in additional formats such as PDF and ePub
|
||||||
|
formats:
|
||||||
|
- pdf
|
||||||
|
- htmlzip
|
||||||
|
|
||||||
|
|
||||||
|
# Optionally set the version of Python and requirements required to build your docs
|
||||||
|
python:
|
||||||
|
install:
|
||||||
|
- requirements: src/doc/requirements.txt
|
||||||
@@ -0,0 +1,199 @@
|
|||||||
|
# OSL Agent Guide
|
||||||
|
|
||||||
|
This file provides guidance to coding assistants when working with code in
|
||||||
|
this repository.
|
||||||
|
|
||||||
|
## Project Overview
|
||||||
|
|
||||||
|
Open Shading Language (OSL) is a production shading language for VFX/animation
|
||||||
|
renderers, maintained by the Academy Software Foundation. It compiles `.osl`
|
||||||
|
shader source to `.oso` bytecode, then JIT-compiles via LLVM to native code at
|
||||||
|
render time. C++17 codebase.
|
||||||
|
|
||||||
|
|
||||||
|
## Repo map
|
||||||
|
|
||||||
|
**Core libraries**
|
||||||
|
|
||||||
|
- `src/liboslcomp/` — Shader compiler. Flex/Bison lexer+parser → AST → `.oso`
|
||||||
|
bytecode. Entry point: `oslcomp.h`
|
||||||
|
- `src/liboslexec/` — Shader execution engine. Loads `.oso`, optimizes shader
|
||||||
|
groups, JIT-compiles to native via LLVM. Key files: `backendllvm.cpp`,
|
||||||
|
`llvm_gen.cpp`, `llvm_ops.cpp`, `instance.cpp`. Contains `wide/`
|
||||||
|
subdirectory for SIMD batched execution (SSE2/AVX/AVX-512)
|
||||||
|
- `src/liboslquery/` — Query compiled shader metadata and parameters
|
||||||
|
- `src/liboslnoise/` — Noise function implementations
|
||||||
|
- `src/libbsdl/` — BSDF/closure library
|
||||||
|
|
||||||
|
**Command line tools**
|
||||||
|
|
||||||
|
- `src/oslc/` — Compiler CLI (`oslc`)
|
||||||
|
- `src/oslinfo/` — Shader info query tool (`oslinfo`)
|
||||||
|
- `src/testshade/` — Test harness that executes shaders on rectangular arrays
|
||||||
|
of points, saves output as images.
|
||||||
|
- `src/testrender/` — Minimal path-tracing renderer demonstrating OSL
|
||||||
|
integration.
|
||||||
|
- `src/osltoy/` — Qt-based GUI shader editor (optional)
|
||||||
|
|
||||||
|
**Public APIs/headers**
|
||||||
|
|
||||||
|
Headers in `src/include/OSL/`: `oslexec.h`, `oslcomp.h`, `oslquery.h`, `rendererservices.h` (abstract interface renderers must implement).
|
||||||
|
|
||||||
|
Namespaces:
|
||||||
|
- `OSL` (outer), `OSL::pvt` (private implementation of internal-only utilities)
|
||||||
|
- Versioned inner namespace: `v{MAJOR}_{MINOR}`
|
||||||
|
|
||||||
|
|
||||||
|
## Build and verification
|
||||||
|
|
||||||
|
Common build commands via the Makefile convenience wrapper:
|
||||||
|
```bash
|
||||||
|
make # configure, build, install (Release)
|
||||||
|
make debug # debug build
|
||||||
|
make clean # wipe build dir (needed when switching branches/modes)
|
||||||
|
make clang-format # format all source files
|
||||||
|
make test # full testsuite
|
||||||
|
make test TEST=<pattern> # subset matching regex
|
||||||
|
```
|
||||||
|
|
||||||
|
Or directly with cmake:
|
||||||
|
```bash
|
||||||
|
cmake -B build -S .
|
||||||
|
cmake --build build --target install
|
||||||
|
ctest --test-dir build -R <pattern> --output-on-failure
|
||||||
|
```
|
||||||
|
|
||||||
|
By default, builds into `./build` and installs into `./dist`.
|
||||||
|
|
||||||
|
## Testsuite notes
|
||||||
|
|
||||||
|
- Test output lands in `build/testsuite/<testname>/`; references in
|
||||||
|
`testsuite/<testname>/ref/`
|
||||||
|
- Read `testsuite/TESTSUITE-README.md` before updating references or
|
||||||
|
diagnosing failures
|
||||||
|
- For platform-specific diffs, add a variant ref (e.g. `out-win.txt`) rather
|
||||||
|
than overwriting
|
||||||
|
- Be conservative loosening image diff thresholds — use the minimum needed
|
||||||
|
- Check uploaded CI artifacts before changing references when local
|
||||||
|
reproduction is unclear
|
||||||
|
|
||||||
|
## Code formatting and file conventions
|
||||||
|
|
||||||
|
- `clang-format` enforced (`.clang-format`); CI rejects non-conforming code —
|
||||||
|
run `make clang-format` before committing
|
||||||
|
- Lines ~80 cols; ASCII only in code and comments; `#pragma once` for headers
|
||||||
|
- New files: standard copyright + SPDX notice
|
||||||
|
- `CamelCase` classes, `snake_case` locals, `ALL_CAPS` macros, `m_foo` private
|
||||||
|
members
|
||||||
|
- 3 blank lines between free functions/classes; 1 between class methods; max 1
|
||||||
|
blank line inside a function body
|
||||||
|
- `//` for regular comments; `///` Doxygen for public API
|
||||||
|
- If a file has a strong local style, imitate that.
|
||||||
|
|
||||||
|
|
||||||
|
## C++ guidelines
|
||||||
|
|
||||||
|
- Error handling: prefer `bool` returns, explicit status propagation, and
|
||||||
|
`errorfmt()`-style reporting — not exceptions — consistent with the
|
||||||
|
surrounding subsystem
|
||||||
|
- Preserve API, ABI, and behavior compatibility unless the task explicitly
|
||||||
|
requires a break
|
||||||
|
- For hot paths: no hidden allocation in inner loops or parallel regions;
|
||||||
|
precompute outside hot paths
|
||||||
|
|
||||||
|
|
||||||
|
## OIIO utility types (prefer over raw C++ equivalents)
|
||||||
|
|
||||||
|
The [OpenImageIO](http://github.com/AcademySoftwareFoundation/OpenImageIO) (OIIO) project is a key dependency of OSL and the two projects are co-developed. Many utilities shared by both projects live in OpenImageIO.
|
||||||
|
|
||||||
|
Prefer C++17 `std` and Imath types except as noted below. Avoid introducing
|
||||||
|
new third-party dependencies without a strong reason. Rely liberally on these
|
||||||
|
classes and headers from OIIO:
|
||||||
|
|
||||||
|
- `OIIO::TypeDesc` - light-weight description of simple types (aliased
|
||||||
|
as `OSL::TypeDesc`)
|
||||||
|
- `OIIO::ustring` and `OIIO::ustringhash` - light-weight unique string heavily
|
||||||
|
used in OSL. (Aliased as `OSL::ustring` and `OSL::ustringhash`).
|
||||||
|
- `OIIO::string_view` — non-owning string/`char*` (like `std::string_view`).
|
||||||
|
Aliased as `OSL::string_view`.
|
||||||
|
- `OIIO::span` / `OIIO::cspan` — non-owning contiguous data (like
|
||||||
|
`std::span`); use instead of pointer+length pairs. Aliased as `OSL::span`
|
||||||
|
and `OSL::cspan`.
|
||||||
|
- `OpenImageIO/strutil.h` : string processing utilities
|
||||||
|
- `OIIO::Strutil::print()` , also aliased as `OSL::print` — string
|
||||||
|
formatting/output; **never** use `printf` or `<<` streams
|
||||||
|
- `OpenImageIO/fmath.h` — fast/safe math, avoids NaN/Inf
|
||||||
|
- `OIIO::Filesystem::*` in `OpenImageIO/filesystem.h` — file/directory
|
||||||
|
utilities
|
||||||
|
- `OpenImageIO/simd.h` — SIMD helpers
|
||||||
|
- `OpenImageIO/parallel.h` — parallel loops, etc.
|
||||||
|
- `OpenImageIO/unittest.h` — unit test macros
|
||||||
|
|
||||||
|
|
||||||
|
## Safe programming in C++
|
||||||
|
|
||||||
|
- Try to avoid passing raw pointers as function arguments.
|
||||||
|
- Use `std::unique_ptr` and `std::shared_ptr` rather than raw pointers when
|
||||||
|
ownership must be expressed.
|
||||||
|
- Prefer `OSL::string_view` when passing non-mutable strings or C-style
|
||||||
|
`char*` strings.
|
||||||
|
- Prefer `OSL::span` rather than passing raw pointers + a separate length, or
|
||||||
|
passing a raw pointer with an implied (but not explicitly passed) length.
|
||||||
|
`OSL::cspan` is a synonmym when the underlying data is const/non-mutable.
|
||||||
|
`OSL::span<std::byte>` or `OSL::cspan<std::byte>` can be used to represent
|
||||||
|
contiguous untyped data. These are our equivalent of C++ `std::span`.
|
||||||
|
- Use these guidelines always for new code, but do not churn existing code
|
||||||
|
just to "modernize" it.
|
||||||
|
|
||||||
|
## Architecture
|
||||||
|
|
||||||
|
### Compilation Pipeline
|
||||||
|
|
||||||
|
OSL source → (Flex/Bison) → AST → (liboslcomp) → `.oso` bytecode → (liboslexec) → LLVM IR → JIT native code
|
||||||
|
|
||||||
|
|
||||||
|
## Code Style
|
||||||
|
|
||||||
|
- clang-format config in `.clang-format` (WebKit-based, 80-char line limit, 4-space indent)
|
||||||
|
- Run `make clang-format` before submitting changes
|
||||||
|
|
||||||
|
## Key Dependencies
|
||||||
|
|
||||||
|
- **LLVM 14+** (JIT compilation), **OpenImageIO 2.5+** (textures, image I/O, utilities), **Imath 3.1+** (math types), **Flex/Bison** (parser generation), **pybind11** (Python bindings, optional)
|
||||||
|
|
||||||
|
## Commits and PRs
|
||||||
|
|
||||||
|
- Keep PRs narrow and easy to review.
|
||||||
|
- Prefix format: `type(subsystem): message` — subsystem is optional but helpful.
|
||||||
|
- Valid types: `fix:`, `feat:`, `perf:`, `api:`, `int:`, `build:`, `test:`,
|
||||||
|
`ci:`, `docs:`, `refactor:`, `style:`, `admin:`, `revert:`.
|
||||||
|
- Add a subsystem tag when it helps, e.g. `fix(exr):` or `perf(IBA):`.
|
||||||
|
- Write commit messages and PR descriptions that explain why the change is
|
||||||
|
needed, what behavior changes, and any non-obvious implementation choices.
|
||||||
|
|
||||||
|
## Spec-driven design
|
||||||
|
|
||||||
|
Feature specifications live in `docs/dev/specs/` (not at the project root).
|
||||||
|
When using speckit commands (`/speckit-specify`, `/speckit-plan`, etc.), always
|
||||||
|
use `docs/dev/specs/` as the base directory for all spec paths, overriding any
|
||||||
|
default of `specs/`. When creating a new spec, set `SPECIFY_FEATURE_DIRECTORY`
|
||||||
|
to `docs/dev/specs/<NNN-feature-name>` and write that path to
|
||||||
|
`.specify/feature.json`.
|
||||||
|
|
||||||
|
The speckit bash scripts expect a `specs/` directory at the project root. A
|
||||||
|
symlink satisfies this without committing speckit infrastructure to the repo.
|
||||||
|
This symlink is set up by the setup-agents script, and is not committed to
|
||||||
|
the repo. All saved specs live in `docs/dev/specs`.
|
||||||
|
|
||||||
|
## AI policy
|
||||||
|
|
||||||
|
Refer to `docs/dev/AI_Policy.md`.
|
||||||
|
|
||||||
|
See `docs/dev/AI_Policy.md`. Key rule: if AI assistance contributed materially
|
||||||
|
to a patch, the commit must include `Assisted-by: <TOOL> / <MODEL>`. The human
|
||||||
|
author is responsible for understanding, testing, and defending all changes.
|
||||||
|
|
||||||
|
## References
|
||||||
|
|
||||||
|
- `CONTRIBUTING.md` : general contribution guidelines and recap of coding
|
||||||
|
conventions.
|
||||||
@@ -1,253 +0,0 @@
|
|||||||
# Technical Charter (the "Charter") for Open Shading Language a Series of LF Projects, LLC
|
|
||||||
|
|
||||||
This charter (the "Charter") sets forth the responsibilities and procedures
|
|
||||||
for technical contribution to, and oversight of, the Open Shading Language
|
|
||||||
project, which has been established as Open Shading Language a Series of LF
|
|
||||||
Projects, LLC (the "Project"). LF Projects, LLC ("LF Projects") is a
|
|
||||||
Delaware series limited liability company. All Contributors to the Project
|
|
||||||
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
|
|
||||||
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
|
|
||||||
documentation, testing, integration and the creation of other artifacts
|
|
||||||
that aid the development, deployment, operation or adoption of the open
|
|
||||||
source software project.
|
|
||||||
|
|
||||||
### 2. Technical Steering Committee
|
|
||||||
|
|
||||||
* **a.** The Technical Steering Committee (the "TSC") will be responsible
|
|
||||||
for all technical oversight of the open source Project.
|
|
||||||
|
|
||||||
* **b.** The TSC voting members are initially the Project's Committers. At
|
|
||||||
the inception of the project, the Committers of the Project will be as
|
|
||||||
set forth within the "GOVERNANCE" file within the Project's code
|
|
||||||
repository. The TSC may choose an alternative approach for determining
|
|
||||||
the voting members of the TSC, and any such alternative approach will be
|
|
||||||
documented in the GOVERNANCE file. Any meetings of the Technical
|
|
||||||
Steering Committee are intended to be open to the public, and can be
|
|
||||||
conducted electronically, via teleconference, or in person.
|
|
||||||
|
|
||||||
* **c.** TSC projects generally will involve Contributors and Committers.
|
|
||||||
The TSC may adopt or modify roles so long as the roles are documented in
|
|
||||||
the GOVERNANCE file. Unless otherwise documented:
|
|
||||||
|
|
||||||
- **i.** Contributors include anyone in the technical community that
|
|
||||||
contributes code, documentation, or other technical artifacts to the
|
|
||||||
Project;
|
|
||||||
|
|
||||||
- **ii.** Committers are Contributors who have earned the ability to
|
|
||||||
modify ("commit") source code, documentation or other technical
|
|
||||||
artifacts in a project's repository; and
|
|
||||||
|
|
||||||
- **iii.** A Contributor may become a Committer by a majority approval
|
|
||||||
of the existing Committers or at the discretion of the TSC. A
|
|
||||||
Committer may be removed by a majority approval of the other existing
|
|
||||||
Committers, or at the discretion of the TSC.
|
|
||||||
|
|
||||||
* **d.** Participation in the Project through becoming a Contributor and
|
|
||||||
Committer is open to anyone so long as they abide by the terms of this
|
|
||||||
Charter.
|
|
||||||
|
|
||||||
* **e.** The TSC may (1) establish workflow procedures for the submission,
|
|
||||||
approval, and closure/archiving of projects, (2) set requirements for
|
|
||||||
the promotion of Contributors to Committer status, as applicable, and
|
|
||||||
(3) amend, adjust, refine and/or eliminate the roles of Contributors,
|
|
||||||
and Committers, and create new roles, and publicly document any TSC
|
|
||||||
roles, as it sees fit.
|
|
||||||
|
|
||||||
* **f.** The TSC may elect a TSC Chair, who will preside over meetings of
|
|
||||||
the TSC and will serve until his or her resignation or replacement by
|
|
||||||
the TSC. The TSC Chair, or any other TSC member so designated by the
|
|
||||||
TSC, will serve as the primary communication contact between the Project
|
|
||||||
and the Academy Software Foundation Fund of The Linux Foundation.
|
|
||||||
|
|
||||||
* **g.** Responsibilities: The TSC will be responsible for all aspects of
|
|
||||||
oversight relating to the Project, which may include:
|
|
||||||
|
|
||||||
- **i.** coordinating the technical direction of the Project;
|
|
||||||
|
|
||||||
- **ii.** approving project or system proposals (including, but not
|
|
||||||
limited to, incubation, deprecation, and changes to a sub-project's
|
|
||||||
scope);
|
|
||||||
|
|
||||||
- **iii.** organizing sub-projects and removing projects;
|
|
||||||
|
|
||||||
- **iv.** creating sub-committees or working groups to focus on
|
|
||||||
cross-project technical issues and requirements;
|
|
||||||
|
|
||||||
- **v.** appointing representatives to work with other open source or
|
|
||||||
open standards communities;
|
|
||||||
|
|
||||||
- **vi.** establishing community norms, workflows, issuing releases, and
|
|
||||||
security issue reporting policies;
|
|
||||||
|
|
||||||
- **vii.** approving and implementing policies and processes for
|
|
||||||
contributing (to be published in the CONTRIBUTING file) and
|
|
||||||
coordinating with the Series Manager to resolve matters or concerns
|
|
||||||
that may arise as set forth in Section 7 of this Charter;
|
|
||||||
|
|
||||||
- **viii.** discussions, seeking consensus, and where necessary, voting
|
|
||||||
on technical matters relating to the code base that affect multiple
|
|
||||||
projects; and
|
|
||||||
|
|
||||||
- **ix.** coordinating any marketing, events, or communications
|
|
||||||
regarding the Project with the LF Projects Manager or their designee.
|
|
||||||
|
|
||||||
### 3. TSC Voting
|
|
||||||
|
|
||||||
* **a.** While the Project aims to operate as a consensus based community,
|
|
||||||
if any TSC decision requires a vote to move the Project forward, the
|
|
||||||
voting members of the TSC will vote on a one vote per voting member
|
|
||||||
basis.
|
|
||||||
|
|
||||||
* **b.** At least fifty percent of all voting members of the TSC must be
|
|
||||||
present at a TSC meeting in order to establish a quorum. The TSC may
|
|
||||||
continue to meet if a quorum is not met, but will be prevented from
|
|
||||||
making any decisions at such meeting.
|
|
||||||
|
|
||||||
* **c.** Except as provided in Section 7.c. and 8.a, decisions by vote at
|
|
||||||
a meeting require a majority vote of those in attendance, provided
|
|
||||||
quorum is met. Decisions made by electronic vote without a meeting
|
|
||||||
require a majority vote of all voting members of the TSC.
|
|
||||||
|
|
||||||
* **d.** In the event a vote cannot be resolved by the TSC, any voting
|
|
||||||
member of the TSC may refer the matter to the Series Manager or its
|
|
||||||
designee for assistance in reaching a resolution.
|
|
||||||
|
|
||||||
### 4. Compliance with Policies
|
|
||||||
|
|
||||||
* **a.** This Charter is subject to the Series Agreement for the Project
|
|
||||||
and the Operating Agreement of LF Projects. Contributors will comply
|
|
||||||
with the policies of LF Projects as may be adopted and amended by LF
|
|
||||||
Projects, including, without limitation the policies listed at
|
|
||||||
https://lfprojects.org/policies/.
|
|
||||||
|
|
||||||
* **b.** The TSC may adopt a code of conduct ("CoC") for the Project,
|
|
||||||
which is subject to approval by the Series Manager. Contributors to the
|
|
||||||
Project will comply with the CoC or, in the event that a
|
|
||||||
Project-specific CoC has not been approved, the LF Projects Code of
|
|
||||||
Conduct listed at https://lfprojects.org/policies/.
|
|
||||||
|
|
||||||
* **c.** When amending or adopting any policy applicable to the Project,
|
|
||||||
LF Projects will publish such policy, as to be amended or adopted, on
|
|
||||||
its web site at least 30 days prior to such policy taking effect;
|
|
||||||
provided, however, that in the case of any amendment of the Trademark
|
|
||||||
Policy or Terms of Use of LF Projects, any such amendment is effective
|
|
||||||
upon publication on LF Project's web site.
|
|
||||||
|
|
||||||
* **d.** All participants must allow open participation from any
|
|
||||||
individual or organization meeting the requirements for contributing
|
|
||||||
under this Charter and any policies adopted for all participants by the
|
|
||||||
TSC, regardless of competitive interests. Put another way, the Project
|
|
||||||
community must not seek to exclude any participant based on any
|
|
||||||
criteria, requirement, or reason other than those that are reasonable
|
|
||||||
and applied on a non-discriminatory basis to all participants in the
|
|
||||||
Project community.
|
|
||||||
|
|
||||||
* **e.** The Project will operate in a transparent, open, collaborative,
|
|
||||||
and ethical manner at all times. The output of all Project discussions,
|
|
||||||
proposals, timelines, decisions, and status should be made open and
|
|
||||||
easily visible to all. Any potential violations of this requirement
|
|
||||||
should be reported immediately to the LF Projects Manager.
|
|
||||||
|
|
||||||
### 5. Community Assets
|
|
||||||
|
|
||||||
* **a.** LF Projects will hold title to all trade or service marks used by
|
|
||||||
the Project ("Project Trademarks"), whether based on common law or
|
|
||||||
registered rights. Project Trademarks will be transferred and assigned
|
|
||||||
to LF Projects to hold on behalf of the Project. Any use of any Project
|
|
||||||
Trademarks by participants in the Project will be in accordance with the
|
|
||||||
license from LF Projects and inure to the benefit of LF Projects.
|
|
||||||
|
|
||||||
* **b.** The Project shall, as permitted and in accordance with such
|
|
||||||
license from LF Projects, develop and own all Project GitHub and social
|
|
||||||
media accounts, and domain name registrations created by the Project
|
|
||||||
community.
|
|
||||||
|
|
||||||
* **c.** Under no circumstances will LF Projects be expected or required
|
|
||||||
to undertake any action on behalf of the Project that is inconsistent
|
|
||||||
with the tax-exempt status or purpose, as applicable, of LFP, Inc. or LF
|
|
||||||
Projects, LLC.
|
|
||||||
|
|
||||||
### 6. General Rules and Operations.
|
|
||||||
|
|
||||||
* **a.** The Project will:
|
|
||||||
|
|
||||||
- **i.** engage in the work of the project in a professional manner
|
|
||||||
consistent with maintaining a cohesive community, while also
|
|
||||||
maintaining the goodwill and esteem of LF Projects, LFP, Inc. and
|
|
||||||
other partner organizations in the open source software community; and
|
|
||||||
|
|
||||||
- **ii.** respect the rights of all trademark owners, including any
|
|
||||||
branding and trademark usage guidelines.
|
|
||||||
|
|
||||||
### 7. Intellectual Property Policy
|
|
||||||
|
|
||||||
* **a.** Participants acknowledge that the copyright in all new
|
|
||||||
contributions shall be retained by the copyright holder as independent
|
|
||||||
works of authorship and that no contributor or copyright holder will be
|
|
||||||
required to assign copyrights to the Project.
|
|
||||||
|
|
||||||
* **b.** Except as described in Section 7.c., all code contributions to
|
|
||||||
the Project are subject to the following:
|
|
||||||
|
|
||||||
- **i.** All new inbound code contributions to the Project must be made
|
|
||||||
using the BSD 3-Clause License (available here:
|
|
||||||
https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/blob/main/LICENSE.md)
|
|
||||||
(the "Project License").
|
|
||||||
|
|
||||||
- **ii.** All new inbound code contributions must:
|
|
||||||
|
|
||||||
o **a.** be made pursuant to a binding Project Contribution License
|
|
||||||
Agreement (the "CLA") available on the Project's web site; and
|
|
||||||
|
|
||||||
o **b.** be accompanied by a Developer Certificate of Origin
|
|
||||||
(http://developercertificate.org) sign-off in the source code system
|
|
||||||
that is submitted through a TSC-approved contribution process which
|
|
||||||
will bind the authorized contributor and, if not self-employed,
|
|
||||||
their employer to the applicable license;
|
|
||||||
|
|
||||||
- **iii.** All outbound code will be made available under the Project
|
|
||||||
License.
|
|
||||||
|
|
||||||
- **iv.** Documentation will be received and made available by the
|
|
||||||
Project under the Creative Commons Attribution 4.0 International
|
|
||||||
License (available at http://creativecommons.org/licenses/by/4.0/).
|
|
||||||
|
|
||||||
- **v.** The Project may seek to integrate and contribute back to other
|
|
||||||
open source projects ("Upstream Projects"). In such cases, the Project
|
|
||||||
will conform to all license requirements of the Upstream Projects,
|
|
||||||
including dependencies, leveraged by the Project. Upstream Project
|
|
||||||
code contributions not stored within the Project's main code
|
|
||||||
repository shall comply with the contribution process and license
|
|
||||||
terms for the applicable Upstream Project.
|
|
||||||
|
|
||||||
* **c.** If an alternative inbound or outbound license is required for
|
|
||||||
compliance with the license for a leveraged open source project or is
|
|
||||||
otherwise required to achieve the Project's mission, the Governing Board
|
|
||||||
of the Academy Software Foundation Fund of the Linux Foundation
|
|
||||||
("Governing Board"), or the Governing Board's representatives designated
|
|
||||||
for such purpose, may approve the use of an alternative license for
|
|
||||||
specific inbound or outbound contributions on an exception basis. Any
|
|
||||||
exceptions must be approved by a vote of the Governing Board and must be
|
|
||||||
limited in scope to what is required for such a purpose. To request an
|
|
||||||
exception, please describe the contribution, the alternative open source
|
|
||||||
license(s), and the justification for using an alternative open source
|
|
||||||
license for the Project.
|
|
||||||
|
|
||||||
* **d.** Contributed files should contain license information, such as
|
|
||||||
SPDX short form identifiers, indicating the open source license or
|
|
||||||
licenses pertaining to the file.
|
|
||||||
|
|
||||||
### 8. Amendments
|
|
||||||
|
|
||||||
* **a.** This charter may be amended by a two-thirds vote of the entire
|
|
||||||
TSC, subject to reasonable approval by LF Projects.
|
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 7.6 KiB |
|
After Width: | Height: | Size: 59 KiB |
|
After Width: | Height: | Size: 121 KiB |
|
After Width: | Height: | Size: 92 KiB |
@@ -5,13 +5,14 @@ This is a checklist for TSC's to review as part of the intake process. The TSC s
|
|||||||
- Existing Project Governance
|
- Existing Project Governance
|
||||||
- [X] Project License exists ( [LICENSE.md](../LICENSE.md) ) and is OSI-approved
|
- [X] Project License exists ( [LICENSE.md](../LICENSE.md) ) and is OSI-approved
|
||||||
- [X] Any third-party components/dependencies included are listed along with their licenses ( [THIRD_PARTY.md](../THIRD_PARTY.md) )
|
- [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] )
|
- [X] Governance defined, outlining community roles and how decisions are made ( [GOVERNANCE.md](../GOVERNANCE.md) )
|
||||||
- Closed by https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1137
|
- Closed by https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1137
|
||||||
- [X] Contribution Policy defined ( [CONTRIBUTING.md](../CONTRIBUTING.md) )
|
- [X] Contribution Policy defined ( [CONTRIBUTING.md](../CONTRIBUTING.md) )
|
||||||
- Closed by https://github.com/AcademySoftwareFoundation/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) )
|
- [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/AcademySoftwareFoundation/OpenShadingLanguage/pull/1137
|
- Closed by https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1137
|
||||||
- [ ] Release methodology defined ( [release.md](process/release.md) )
|
- [X] Release methodology defined ( [RELEASING.md](../docs/RELEASING.md) )
|
||||||
|
- Closed by https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1572
|
||||||
- New Project Governance
|
- New Project Governance
|
||||||
- [X] TSC members identified
|
- [X] TSC members identified
|
||||||
- [X] First TSC meeting held
|
- [X] First TSC meeting held
|
||||||
@@ -41,7 +42,7 @@ This is a checklist for TSC's to review as part of the intake process. The TSC s
|
|||||||
- [X] New project announcement 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
|
- [X] Project added to ASWF website and ASWF landscape
|
||||||
- Graduation
|
- Graduation
|
||||||
- [ ] CII Badge achieved
|
- [X] OpenSSF Best Practices Badge achieved
|
||||||
- [ ] Committer Diversity established
|
- [ ] Committer Diversity established
|
||||||
- [ ] Commit/Contribution growth during incubation
|
- [ ] Commit/Contribution growth during incubation
|
||||||
- [ ] Committers defined in the project ( [COMMITTERS.csv](COMMITTERS.csv) or [COMMITTERS.yml](COMMITTERS.yml) )
|
- [ ] Committers defined in the project ( [COMMITTERS.csv](COMMITTERS.csv) or [COMMITTERS.yml](COMMITTERS.yml) )
|
||||||
|
|||||||
@@ -1,30 +1,571 @@
|
|||||||
<!-- SPDX-License-Identifier: CC-BY-4.0 -->
|
<!-- SPDX-License-Identifier: CC-BY-4.0 -->
|
||||||
<!-- Copyright Contributors to the Open Shading Language Project. -->
|
<!-- Copyright Contributors to the Open Shading Language Project. -->
|
||||||
|
|
||||||
Release 1.13 -- ?? 2023 ?? (compared to 1.12)
|
Release 1.16 (Oct?? ??, 2026) -- compared to 1.15
|
||||||
--------------------------------------------------
|
-------------------------------------------------------------
|
||||||
Dependency and standards requirements changes:
|
|
||||||
* OptiX 6.0 support has been removed. For GPU rendering with OptiX, a minimum
|
|
||||||
of OptiX 7.0 is required.
|
|
||||||
* The minimum version OpenImageIO has been raised from 2.2 to 2.3. #1591
|
|
||||||
(1.13.0.3)
|
|
||||||
|
|
||||||
OSL Language and oslc compiler:
|
### New minimum dependencies, toolchain, and compatibility changes:
|
||||||
* Bug fix: shader params whose default values involve "init ops" could be
|
- *build*: Remove support for the deprecated Intel `icc` classic compiler [#2075](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2075)
|
||||||
incorrectly initialized if their values came from instance parameters set to
|
|
||||||
zero. #1578 (1.13.0.2)
|
|
||||||
|
|
||||||
OSL Standard library:
|
### ✏️ OSL Language, standard library, and oslc compiler (for shader writers):
|
||||||
|
|
||||||
|
### ⛰️ API changes and new ShadingSystem features (for renderer writers):
|
||||||
|
- *feat/ShadingSystem*: Add more shader group diagnostics to `compile_report`: active layer count, connection depth, texture and noise op counts [#2085](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2085) (1.16.0.0, 1.15.2.0, 1.14.9.0)
|
||||||
|
- *bsdl*: Move GeneralizedSchlick lobe from testrender into BSDL library, unifying DielectricRefl/DielectricBoth into a single `DielectricBSDF<Fresnel>` template [#2078](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2078) (by Alejandro Conty) (1.16.0.0, 1.15.2.0)
|
||||||
|
- *bsdl*: Move MaterialX sheen BSDF into BSDL as `mtx::SheenLobe`, consolidating sheen implementations from testrender and SPI into one place [#2084](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2084) (by Alejandro Conty) (1.16.0.0, 1.15.2.0)
|
||||||
|
- *bsdl*: Incorporate diffuse MaterialX BSDFs into BSDL library [#2092](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2092) (by Alejandro Conty) (1.16.0.0, 1.15.3.0)
|
||||||
|
- *bsdl*: Clamp BSDL/MTX Fresnel inputs to [0,1] and fix bootstrap Imath link [#2081](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2081) (by Alejandro Conty) (1.16.0.0, 1.15.2.0)
|
||||||
|
|
||||||
|
### ☀️ testshade/testrender/osltoy improvements
|
||||||
|
- *testrender*: Fix uv derivatives [#1978] [#2037](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2037) (by Alexey Smolenchuk)
|
||||||
|
- *osltoy*: Autodetect output color variable [#2051](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2051) (by Silvia Lopez)
|
||||||
|
- *testshade*: Route errors through renderer's own error handler; convert raw pointers to `unique_ptr` [#2082](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2082) (1.16.0.0, 1.15.2.0, 1.14.9.0)
|
||||||
|
|
||||||
|
### 🚀 SIMD batched shading mode
|
||||||
|
|
||||||
|
### 🚀 OptiX GPU rendering
|
||||||
|
|
||||||
|
### 🐛/🔧 Internals: fixes, improvements, and developer concerns
|
||||||
|
- *fix*: Make `linearstep` definitely return 1 for x > edge1 [#2064](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2064) (by Roeland Schoukens) (1.16.0.0, 1.15.2.0)
|
||||||
|
- *perf/fix*: Change default JIT FMA mode to Strict (no fused multiply-add), improving cross-platform numerical consistency [#2076](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2076) (1.16.0.0, 1.15.2.0)
|
||||||
|
|
||||||
|
### 🏗 Build/test/CI and platform ports
|
||||||
|
* CMake build system and scripts:
|
||||||
|
- *build*: Add Conda environment setup and dependency installation script [#2023](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2023) (by Alexandru Biscoveanu)
|
||||||
|
- *build*: Fix compilation with ld.lld [#2094](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2094) (by Sv. Lockal) (1.16.0.0, 1.15.3.0, 1.14.10.0)
|
||||||
|
* Dependency version support:
|
||||||
|
- *deps*: Support building with LLVM 22 / clang 22 [#2086](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2086) (1.16.0.0, 1.15.2.0, 1.14.9.0)
|
||||||
|
* Testing and Continuous integration (CI) systems:
|
||||||
|
- *ci*: Switch all containers from aswftesting to aswf [#2061](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2061)
|
||||||
|
- *ci*: Save time by not redundantly installing gif library [#2049](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2049)
|
||||||
|
- *ci*: Bump python we test on Windows runners [#2066](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2066)
|
||||||
|
- *ci*: Lock bleeding edge to pybind11 latest version [#2069](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2069)
|
||||||
|
- *ci*: Stop nightly CI workflows on user forks [#2074](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2074) (1.16.0.0, 1.15.2.0)
|
||||||
|
- *ci*: For security, replace some workflow substitutions with safer env substitutions [#2088](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2088) (1.16.0.0, 1.15.3.0, 1.14.10.0)
|
||||||
|
- *ci*: Some minor LLVM dependency improvements [#2090](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2090) (1.16.0.0, 1.15.3.0)
|
||||||
|
- *ci*: New CI platform variants: macOS 26 ARM [#2079](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2079) (1.16.0.0, 1.15.2.0), Windows 2025 with MSVS 2026 [#2093](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2093) (1.16.0.0, 1.15.3.0, 1.14.10.0)
|
||||||
|
- *ci*: Various fixes for unexpected CI runner breakages: Windows curl LLVM download [#2089](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2089), Mac homebrew installations [#2091](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2091) (1.16.0.0, 1.15.2.0, 1.14.10.0), fmt/OIIO main build [#2095](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2095), Mac compiler path [#2096](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2096), Intel compiler certificate update [#2101](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2101), OIIO dependency hash lockdown [#2102](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2102) (1.16.0.0, 1.15.3.0, 1.14.10.0)
|
||||||
|
- *testing*: Check in reference images for Mac ARM debug case [#2083](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2083) (1.16.0.0, 1.15.2.0, 1.14.10.0)
|
||||||
|
* Platform support:
|
||||||
|
|
||||||
|
### 📚 Documentation
|
||||||
|
- *docs*: Fix typo [#2077](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2077) (by Taraash) (1.16.0.0, 1.15.2.0)
|
||||||
|
|
||||||
|
### 🏢 Project Administration
|
||||||
|
- *admin*: TSC roster changes [#2065](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2065)
|
||||||
|
- *admin*: Fix link to icon used for Slack release announcements [#2070](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2070) (1.16.0.0, 1.15.2.0)
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Release 1.15.3.0 (1 Apr 2026) -- compared to 1.15.2.0
|
||||||
|
---------------------------------------------------------
|
||||||
|
- *bsdl*: Incorporate diffuse MaterialX BSDFs into BSDL library [#2092](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2092) (by Alejandro Conty)
|
||||||
|
- *build*: Fix compilation with ld.lld [#2094](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2094) (by Sv. Lockal) (1.15.3.0, 1.14.10.0)
|
||||||
|
- *ci*: Add Windows 2025 with MSVS 2026 job variant to CI [#2093](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2093) (1.15.3.0, 1.14.10.0)
|
||||||
|
- *ci*: For security, replace some workflow substitutions with safer env substitutions [#2088](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2088) (1.15.3.0, 1.14.10.0)
|
||||||
|
- *ci*: Some minor LLVM dependency improvements [#2090](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2090)
|
||||||
|
- *ci*: Various fixes for unexpected CI runner breakages: fmt/OIIO main build [#2095](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2095), Mac compiler path [#2096](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2096), Intel compiler certificate update [#2101](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2101), OIIO dependency hash lockdown [#2102](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2102) (1.15.3.0, 1.14.10.0)
|
||||||
|
|
||||||
|
|
||||||
|
Release 1.15.2.0 (Mar 10, 2026) -- compared to 1.15.1.0
|
||||||
|
-------------------------------------------------------------
|
||||||
|
- *feat*: Add more shader group diagnostics to `compile_report` (active layers, connection depth, texture and noise op counts) [#2085](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2085)
|
||||||
|
- *bsdl improvements*:
|
||||||
|
- *bsdl*: Move GeneralizedSchlick lobe from testrender into BSDL library, unifying DielectricRefl/DielectricBoth into a single `DielectricBSDF<Fresnel>` template [#2078](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2078) (by Alejandro Conty)
|
||||||
|
- *bsdl*: Move MaterialX sheen BSDF into BSDL as `mtx::SheenLobe`, consolidating sheen implementations from testrender and SPI into one place [#2084](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2084) (by Alejandro Conty)
|
||||||
|
- *bsdl*: Clamp BSDL/MTX Fresnel inputs to [0,1] and fix bootstrap Imath link [#2081](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2081) (by Alejandro Conty)
|
||||||
|
- *fix*: Make `linearstep` definitely return 1 for x > edge1 [#2064](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2064) (by Roeland Schoukens)
|
||||||
|
- *perf/fix*: Change default JIT FMA mode to Strict (no fused multiply-add), improving cross-platform numerical consistency [#2076](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2076)
|
||||||
|
- *testshade*: Route errors through renderer's own error handler; convert raw pointers to `unique_ptr` [#2082](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2082)
|
||||||
|
- *build*: Support LLVM 22 / clang 22 for building [#2086](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2086)
|
||||||
|
- *ci*: Add macOS 26 (ARM) to the CI lineup [#2079](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2079)
|
||||||
|
- *ci*: Stop nightly CI workflows on user forks [#2074](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2074)
|
||||||
|
- *ci*: Fix Windows curl LLVM download failure [#2089](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2089)
|
||||||
|
- *ci*: Fix and speed up Mac CI dependency installations via Homebrew [#2091](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2091)
|
||||||
|
- *testing*: Check in ref images for Mac ARM debug case [#2083](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2083)
|
||||||
|
- *docs*: Fix typo [#2077](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2077) (by Taraash)
|
||||||
|
- *admin*: Fix link to icon used for Slack release announcements [#2070](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2070)
|
||||||
|
|
||||||
|
|
||||||
|
Release 1.15.1.0 (Feb 1, 2026) -- compared to 1.15.0.0
|
||||||
|
-------------------------------------------------------------
|
||||||
|
- *testrender*: Fix uv derivatives for testrender [#1978] [#2037](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2037) (by Alexey Smolenchuk)
|
||||||
|
- *osltoy*: Autodetect output color variable [#2051](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2051) (by Silvia Lopez)
|
||||||
|
- *build*: Add Conda environment setup and dependency installation script [#2023](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2023) (by Alexandru Biscoveanu)
|
||||||
|
- *ci*: Bump python we test on Windows runners [#2066](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2066)
|
||||||
|
- *ci*: Lock bleeding edge to pybind11 latest version [#2069](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2069)
|
||||||
|
- *admin*: TSC roster changes [#2065](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2065)
|
||||||
|
|
||||||
|
|
||||||
|
Release 1.15 (Jan 1, 2026) -- compared to 1.14
|
||||||
|
-------------------------------------------------------------
|
||||||
|
- Beta 1: Dec 20, 2025
|
||||||
|
- Supported Release: Jan 1, 2026
|
||||||
|
|
||||||
|
### New minimum dependencies, toolchain, and compatibility changes:
|
||||||
|
* *Python*: 3.9 minimum (from 3.7) [#2017](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2017) (1.15.0.0)
|
||||||
|
* *LLVM*: Raise llvm minimum to 14.0 (from 11.0). [#2019](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2019) (1.15.0.0)
|
||||||
|
|
||||||
|
### ✏️ OSL Language, standard library, and oslc compiler (for shader writers):
|
||||||
|
* No changes to the language in this release.
|
||||||
|
|
||||||
|
### ⛰️ API changes and new ShadingSystem features (for renderer writers):
|
||||||
|
* *BSDL Library*: The internal Imageworks BSDF library has been open sourced and included with OSL as a header-only library for renderer authors. [#1986](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1986) (by Alejandro Conty) (1.15.0.0) And subsequent enhancements: [#1991](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1991) [#2000](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2000) [#2009](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2009) (all by Alejandro Conty) (1.15.0.0)
|
||||||
|
* Continued work on "rs free function" migration:
|
||||||
|
- *api*: Add rs_allocate_closure free function. [#1944](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1944) (by Curtis Black) (1.15.0.0)
|
||||||
|
|
||||||
|
### ☀️ testshade/testrender/osltoy improvements
|
||||||
|
- *testrender*: Fix uv derivatives for testrender [#1978] [#2037](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2037) (by Alexey Smolenchuk) (1.14.8.0, 1.15.0.0)
|
||||||
|
- *testrender*: Default to identity for unknown testrender xforms [#2043](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2043) (by Chris Hellmuth) (1.14.8.0, 1.15.0.0)
|
||||||
|
|
||||||
|
### 🐛/🔧 Internals: fixes, improvements, and developer concerns
|
||||||
|
- *perf*: Share Shading Context when optimizing/jitting a shader [#1952](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1952) (by Alex Wells) (1.15.0.0)
|
||||||
|
- *fix*: Check for errors in ShadingSystem::ReParameter() [#1998](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1998) (by cmstein) (1.15.0.0)
|
||||||
|
- *fix*: Pass the real number of channels to rs_texture and rs_texture3d on gpu [#2004](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2004) (1.15.0.0)
|
||||||
|
- *int*: LLVM_Util::supports_isa is not thread-safe [#2029](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2029) (by Sergey Sharybin) (1.15.0.0)
|
||||||
|
|
||||||
|
### 🏗 Build/test/CI and platform ports
|
||||||
|
* CMake build system and scripts:
|
||||||
|
- *build*: Link batched libraries with liboslexec [#1987](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1987) (by John Haddon) (1.15.0.0)
|
||||||
|
- *build*: Simplify FindOptiX.cmake a bit now that OptiX 7 is the minimum [#1988](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1988) (1.15.0.0)
|
||||||
|
- *build*: Update include directives for OpenImageIO_ROOT [#1997](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1997) (by cmstein) (1.15.0.0)
|
||||||
|
- *build*: Serialize builds in testshade [#2012](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2012) (by Jean-Francois Panisset) (1.15.0.0)
|
||||||
|
- *build*: Simplify some clauses involving old compilers [#2016](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2016) (1.15.0.0)
|
||||||
|
- *build/batch*: Batch shading compiler directives were wrong [#2015](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2015) (1.15.0.0)
|
||||||
|
- *build/windows*: Ensure 'lib' prefix is on the dynamicaly loaded batched shading libraries for windows [#2025](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2025) (by Alex Fuller) (1.15.0.0)
|
||||||
|
- *build*: Use generator expressions to find oslc and compile shaders with it [#2026](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2026) (by Alex Fuller) (1.15.0.0)
|
||||||
|
- *build*: Suppress warning for SIMD loop vectorization failure with clang [#2032](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2032) (1.15.0.0)
|
||||||
|
- *build*: Fix compiler warnings with clang 21 + C++20 [#2033](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2033) (1.15.0.0)
|
||||||
|
* Dependency version support:
|
||||||
|
- *deps*: Remove unused symbol that was removed from OIIO main [#1984](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1984) (1.15.0.0)
|
||||||
|
- *deps*: Add compatibility with LLVM 20.1 [#1993](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1993) (by Sven-Hendrik Haase) (1.15.0.0)
|
||||||
|
- *deps*: Test against pybind11 3.0 and minor fixes [#2007](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2007) (1.15.0.0)
|
||||||
|
- *deps*: Test C++20 and gcc14 + fixes needed [#2010](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2010) (1.15.0.0)
|
||||||
|
- *deps*: Use more modern span-based set_pixels with OIIO 3.1. [#2042](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2042) (1.15.0.0)
|
||||||
|
- *deps*: Add compatibility with LLVM 21 [#2030](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2030) (by Christian Heusel) [#2034](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2034) (by Alex Fuller) (1.15.0.0)
|
||||||
|
* Testing and Continuous integration (CI) systems:
|
||||||
|
- *ci*: Get OptiX headers from new improved location [#1989](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1989) (1.15.0.0)
|
||||||
|
- *ci*: Remove Windows-2019 job [#1990](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1990) (1.15.0.0)
|
||||||
|
- *ci*: GPU/OptiX full build and test [#1992](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1992) (1.15.0.0)
|
||||||
|
- *ci*: Improve CI caching scheme [#1994](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1994) (1.15.0.0)
|
||||||
|
- *ci*: Add vp2025 test [#1995](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1995) (1.15.0.0)
|
||||||
|
- *ci*: Fix Windows CI with special LLVM pre-build [#2011](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2011) (1.15.0.0)
|
||||||
|
- *tests*: Add optix ref output for new test added in PR 1991 [#1996](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1996) (1.15.0.0)
|
||||||
|
- *ci*: Add a VFX 2026 platform test [#2020](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2020) (1.15.0.0)
|
||||||
|
- *ci*: Adjust comparison threshold for render-microfacet test [#2027](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2027) (1.15.0.0)
|
||||||
|
- *ci*: Adjust test matrix for recent OIIO and OCIO releases [#2028](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2028) (1.15.0.0)
|
||||||
|
- *ci*: Drop deprecated macos-13 (intel) platform, add macos-15-intel [#2031](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2031) (1.15.0.0)
|
||||||
|
- *ci*: Unbreak optix jobs by locking down container [#2041](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2041) (1.15.0.0)
|
||||||
|
- *ci*: Bump 'latest' test dependency versions [#2038](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2038) (1.15.0.0)
|
||||||
|
- *ci*: Use bigger runner for icx job variation, needs more disk space [#2047](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2047) (1.15.0.0)
|
||||||
|
- *ci*: Fix failing render-microfacet.opt test [#2048](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2048) (1.15.0.0)
|
||||||
|
- *ci*: Fix change deprecated sonarqube action, improve run conditions [#2052](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2052) (1.15.0.0)
|
||||||
|
* Platform support:
|
||||||
|
- *build(Mac)*: Fix various MacOS problems with GitHub and CMake [#1982](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1982) (1.15.0.0)
|
||||||
|
|
||||||
|
### 🏢 Project Administration
|
||||||
|
- *admin*: Set up new issue templates [#1981](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1981) (1.15.0.0)
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
Release 1.14.10.0 (1 Apr 2026) -- compared to 1.14.9.0
|
||||||
|
---------------------------------------------------------
|
||||||
|
- *build*: Fix compilation with ld.lld [#2094](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2094) (by Sv. Lockal)
|
||||||
|
- *test*: Check in reference images for Mac ARM debug case [#2083](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2083)
|
||||||
|
- *ci*: Add Windows 2025 with MSVS 2026 job variant to CI [#2093](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2093)
|
||||||
|
- *ci*: For security, replace some workflow substitutions with safer env substitutions [#2088](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2088)
|
||||||
|
- *ci*: Various fixes for unexpected CI runner breakages: Windows curl LLVM download [#2089](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2089), Mac homebrew installations [#2091](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2091), Mac compiler path [#2096](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2096), fmt/OIIO main build [#2095](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2095), update certificates to be able to install Intel compilers [#2101](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2101)
|
||||||
|
- *ci*: Repair broken CI from OIIO locking down dependency hashes [#2102](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2102)
|
||||||
|
|
||||||
|
|
||||||
|
Release 1.14.9.0 (10 Mar 2026) -- compared to 1.14.8.0
|
||||||
|
-------------------------------------------------------------
|
||||||
|
- *feat*: Add more shader group diagnostics to `compile_report`: when `compile_report >= 1`, report number of active layers, maximum connection depth of the shader network, number of texture ops, and number of noise ops. [#2085](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2085)
|
||||||
|
- *testshade*: Use the renderer's own error handler and convert raw pointers to `unique_ptr` [#2082](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2082)
|
||||||
|
- *build*: Support LLVM 22 and clang 22 [#2086](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2086)
|
||||||
|
- *ci*: Several CI improvements (disk space, container names, nightly workflow control, Python version, gif library dedup) [#2074](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2074) [#2061](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2061) [#2055](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2055) [#2066](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2066) [#2049](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2049)
|
||||||
|
- *docs*: Fix typo [#2077](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2077)
|
||||||
|
|
||||||
|
|
||||||
|
Release 1.14.8.0 (1 Dec 2025) -- compared to 1.14.7.0
|
||||||
|
-------------------------------------------------------------
|
||||||
|
- *testrender*: Fix uv derivatives for testrender [#1978] [#2037](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2037) (by Alexey Smolenchuk)
|
||||||
|
- *testrender*: Default to identity for unknown testrender xforms [#2043](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2043) (by Chris Hellmuth)
|
||||||
|
- *fix(batch)*: Batch shading compiler directives were wrong [#2015](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2015)
|
||||||
|
- *fix*: LLVM_Util::supports_isa is not thread-safe [#2029](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2029) (by Sergey Sharybin)
|
||||||
|
- *build*: Simplify some clauses involving old compilers [#2016](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2016)
|
||||||
|
- *build(windows)*: Ensure 'lib' prefix is on the dynamically loaded batched shading libraries for windows [#2025](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2025) (by Alex Fuller)
|
||||||
|
- *build*: Use generator expressions to find oslc and compile shaders with it [#2026](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2026) (by Alex Fuller)
|
||||||
|
- *build*: Fix compiler warnings with clang 21 + C++20 [#2033](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2033)
|
||||||
|
- *build*: Suppress warning for SIMD loop vectorization failure with clang [#2032](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2032)
|
||||||
|
- *deps*: Use more modern span-based set_pixels with OIIO 3.1. [#2042](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2042)
|
||||||
|
- *deps*: Add compatibility with LLVM 21 [#2030](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2030) (by Christian Heusel) [#2034](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2034) (by Alex Fuller)
|
||||||
|
- *ci*: Add a VFX 2026 platform test [#2020](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2020)
|
||||||
|
- *ci*: Adjust comparison threshold for render-microfacet test [#2027](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2027)
|
||||||
|
- *ci*: Adjust to latest OIIO's new OCIO minimum
|
||||||
|
- *ci*: Drop deprecated macos-13 (intel) platform, add macos-15-intel [#2031](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2031)
|
||||||
|
- *ci*: Unbreak optix jobs by locking down container [#2041](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2041)
|
||||||
|
- *ci*: Bump 'latest' test dependency versions [#2038](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2038)
|
||||||
|
- *ci*: Use bigger runner for icx job variation, needs more disk space [#2047](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2047)
|
||||||
|
- *ci*: Fix failing render-microfacet.opt test [#2048](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2048)
|
||||||
|
|
||||||
|
|
||||||
|
Release 1.14.7.0 (2 Aug 2025) -- compared to 1.14.6.0
|
||||||
|
-------------------------------------------------------------
|
||||||
|
- *build*: Support for building with gcc14 and for C++20. [#2010](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2010)
|
||||||
|
- *build*: Serialize builds in testshade [#2012](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2012) (by Jean-Francois Panisset)
|
||||||
|
- *deps*: Support for pybind11 3.0 [#2007](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2007)
|
||||||
|
- *ci*: Fix Windows CI with special LLVM pre-build [#2011](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2011)
|
||||||
|
|
||||||
|
|
||||||
|
Release 1.14.6.0 (2 Jul 2025) -- compared to 1.14.5.1
|
||||||
|
-------------------------------------------------------------
|
||||||
|
- *fix*: Check for errors in ShadingSystem::ReParameter() [#1998](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1998) (by cmstein)
|
||||||
|
- *fix*: Pass the real number of channels to rs_texture and rs_texture3d on gpu [#2004](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/2004)
|
||||||
|
- *build*: Link batched libraries with liboslexec [#1987](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1987) (by John Haddon)
|
||||||
|
- *build*: Update include directives for OpenImageIO_ROOT [#1997](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1997) (by cmstein)
|
||||||
|
- *build(optix)*: Simplify FindOptiX.cmake a bit now that OptiX 7 is the minimum [#1988](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1988)
|
||||||
|
- *build(optix)*: Get OptiX headers from new improved location [#1989](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1989)
|
||||||
|
- *build*: Add compatibility with LLVM 20.1 [#1993](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1993) (by Sven-Hendrik Haase)
|
||||||
|
- *ci*: Remove Windows-2019 job [#1990](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1990)
|
||||||
|
- *ci*: GPU/OptiX full build and test [#1992](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1992)
|
||||||
|
- *ci*: Improve CI caching scheme [#1994](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1994)
|
||||||
|
- *ci*: Add vp2025 test [#1995](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1995)
|
||||||
|
|
||||||
|
|
||||||
|
Release 1.14.5.1 (3 May 2025) -- compared to 1.14.5.0
|
||||||
|
-------------------------------------------------------------
|
||||||
|
- *build*: Fix various MacOS problems with GitHub and CMake [#1982](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1982)
|
||||||
|
- *build*: Remove unused symbol that was removed from OIIO main [#1984](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1984)
|
||||||
|
|
||||||
|
|
||||||
|
Release 1.14 (6 Apr 2025) -- compared to 1.13
|
||||||
|
-------------------------------------------------------------
|
||||||
|
- v1.14.4.0-beta1 - 4 Mar 2025
|
||||||
|
- v1.14.5.0 (non-beta release) - 6 Apr 2025
|
||||||
|
|
||||||
|
### New minimum dependencies, toolchain, and compatibility changes:
|
||||||
|
* **C++**: Raise C++ standard to 17 (from 14), gcc min to 9.3 (from 6.3), clang min to 5.0 [#1847](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1847) (1.14.2.0)
|
||||||
|
* **Python**: Raise Python minimum to 3.7 (from 2.7), pybind11 to 2.7 (from 2.4) [#1855](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1855) (1.14.2.0)
|
||||||
|
* **Imath**: Raise Imath minimum to 3.1 (from 2.4) [#1853](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1853) (1.14.2.0)
|
||||||
|
* **CMake** Raise minimum to 3.19 [#1914](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1914)
|
||||||
|
* **OpenImageIO**: Raise minimum to 2.5. [#1914](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1914)
|
||||||
|
Note that it is likely that 1.14 is the last release family that will support OIIO 2.x, and beginning with next year's OSL release, OpenImageIO 3.0+ will be the new minimum.
|
||||||
|
* **LLVM**: New minimum LLVM release is 11.0. [#1914](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1914)
|
||||||
|
* **NO Boost**: Boost is no longer a dependency of OSL.
|
||||||
|
|
||||||
|
### ✏️ OSL Language, standard library, and oslc compiler (for shader writers):
|
||||||
|
- *osl*: Add optional texture(), texture3d(), and environment() argument for "colorspace". This currently is not functional (should be fixed soon), but is legal to pass. [#1966](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1966) (1.14.5.0)
|
||||||
|
- Fix bugs in vector2.h, vector4.h, color2.h, color4.h, docs [#1892](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1892) (1.14.3.0)
|
||||||
|
- Fix the subsurface_bssrdf parameters to conform to MaterialX. [#1823](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1823) (by Christopher Kulla) (1.14.1.0)
|
||||||
|
- *bsdf*: Anisotropic_vdf closure should not set IOR [#1870](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1870) (by Christopher Kulla) (1.14.3.0)
|
||||||
|
- *bsdf*: Add hair_chiang_bsdf closure definition from MaterialX [#1891](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1891) (by Christopher Kulla) (1.14.3.0)
|
||||||
|
|
||||||
|
### ☀️ testshade/testrender/osltoy improvements
|
||||||
|
- *testrender*: Implement new OpenPBR BRDFs: Oren-Nayar [#1817](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1817) (by Christopher Kulla) (1.14.1.0), sheen BRDF [#1819](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1819) (by Christopher Kulla) (1.14.1.0)
|
||||||
|
- *testrender*: Modify testrender to work with triangle meshes [#1865](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1865) (by Christopher Kulla) (1.14.3.0)
|
||||||
|
- *testrender*: Implement basic displacement shader support [#1898](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1898) (by Christopher Kulla)
|
||||||
|
- *testrender*: Full OptiX support in testrender [#1896](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1896) [#1897](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1897) (by Tim Grant) (1.14.3.0)
|
||||||
|
- *testrender*: Improvements to energy conservation between layered BSDFs [#1935](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1935) (by Jonathan Stone)
|
||||||
|
- *osltoy*: Add command line and GUI ways to adjust include search paths [#1876](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1876) (by Maxwell Iverson) (1.14.3.0)
|
||||||
|
|
||||||
|
### ⛰️ API changes and new ShadingSystem features (for renderer writers):
|
||||||
|
- The big switch to `ustringhash`: To better accommodate GPU execution, and to
|
||||||
|
make the code and techniques less divergent between CPU and GPU code paths,
|
||||||
|
we have changed the runtime representation of strings from `ustring` to
|
||||||
|
`ustringhash` -- which is still a 64 bit token, but rather than the address
|
||||||
|
of the unique characters, which may change from run to run and harm the
|
||||||
|
OptiX/CUDA PTX cache performance, it is the deterministic hash of the
|
||||||
|
characters. Thus, not just the runtime, but all of the interfaces of
|
||||||
|
RendererServices and other APIs that the renderers use to set up and
|
||||||
|
communicate with the ShadingSystem, now have been changed to expect
|
||||||
|
ustringhash instead of ustring.
|
||||||
|
[#1732](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1732) (by Steena Monteiro) (1.14.0.0)
|
||||||
|
- Add API for building interpolated getter free functions.
|
||||||
|
[#1765](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1765) (by Thibault Vergne) (1.14.0.0)
|
||||||
|
- Switch `shade_image()` to use current OIIO::paropt [#1843](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1843) (1.14.1.1)
|
||||||
|
- Free functions for texturing, point clouds, and trace [#1852](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1852) (by Curtis Black) (1.14.3.0)
|
||||||
|
- Switch to a 2-level namespace [#1922](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1922)
|
||||||
|
- Add ShadingSystem query to ask if attribute derivatives are requested. [#1932](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1932) (by Curtis Black) (and subsequent OptiX related fixes in [#1951](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1951))
|
||||||
|
- RendererServices API for renderer to cache key/value pairs. This is currently used to cache ptx generation for OptiX/GPU rendering. [#1938](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1938) [#1954](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1954) (by Chris Hellmuth)
|
||||||
|
|
||||||
|
### 🚀 SIMD batched shading mode
|
||||||
|
- Codegen bug for compref with varying index [#1776](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1776) (by Alex Wells) (1.14.1.0)
|
||||||
|
- Add support for b4_SSE2 batched mode. [#1825](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1825) (by johnfea) (1.14.2.0)
|
||||||
|
- *fix*: Assume BatchedRendererServices texture derivatives are in st space. [#1828](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1828) (by sfriedmapixar) (1.14.2.0)
|
||||||
|
|
||||||
|
### 🚀 OptiX GPU rendering
|
||||||
|
- Fix NVPTX TargetMachine leak, etc. [#1763](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1763) (by Tim Grant) (1.14.0.0)
|
||||||
|
- Fix GPU interpolated param initialization [#1791](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1791) (by Chris Hellmuth) (1.14.1.0)
|
||||||
|
- Add `lazytrace` ShadingSystem option to avoid combinatoric optixTrace
|
||||||
|
inlining: when enabled, run layers with trace ops unconditionally at the
|
||||||
|
start of shader evaluation. This costs some potential performance in cases
|
||||||
|
where the trace layer would never be evaluated, but removes all the
|
||||||
|
compilation penalties that the inlining was presenting.
|
||||||
|
[#1815](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1815) (by Chris Hellmuth) (1.14.1.0)
|
||||||
|
- Mock gpu pointcloud_search calls with empty custom attributes [#1859](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1859) (by Chris Hellmuth) (1.14.2.0)
|
||||||
|
- Fully implement and fix the OptiX path in testrender and testshade [#1896](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1896) [#1897](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1897) (by Tim Grant) (1.14.3.0)
|
||||||
|
- RendererServices API for renderer to cache key/value pairs. This is currently used to cache ptx generation for OptiX/GPU rendering. [#1938](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1938) (by Chris Hellmuth)
|
||||||
|
- Generate symbol derivatives for outputs when requested [#1916](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1916) (by Lukas Stockner)
|
||||||
|
|
||||||
|
### 🐛/🔧 Internals: fixes, improvements, and developer concerns
|
||||||
|
- Mute partio error prints [#1774](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1774) (by olegul) (1.14.1.0)
|
||||||
|
- calculatenormal needs to use the fliphandedness global [#1783](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1783) (by sfriedmapixar) (1.14.1.0)
|
||||||
|
- Print closure missing error message at compile time instead of run time. [#1781](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1781) (by sfriedmapixar) (1.14.1.0)
|
||||||
|
- Make isconnected() work with downstream renderer "connections." [#1782](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1782) (by sfriedmapixar) (1.14.1.0)
|
||||||
|
- *int*: Change OSL_CONSTEXPR14 to constexpr [#1805](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1805) (1.14.1.0)
|
||||||
|
- Remove unnecessary ustring lookup [#1824](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1824) (by Chris Hellmuth) (1.14.1.0)
|
||||||
|
- Make backfacing shadeop indicate backfacing shader-global is needed [#1827](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1827) (by sfriedmapixar) (1.14.1.0)
|
||||||
|
- Reparameter string needed to be ustringhash [#1841](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1841) (by Chris Hellmuth) (1.14.1.0)
|
||||||
|
- Some modernization of osl.imageio [#1840](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1840) (1.14.1.1)
|
||||||
|
- Typo in dual.h made invalid template DualStorage [#1871](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1871) (1.14.3.0)
|
||||||
|
- Prevent NaN from cropping up in testshade for icx (or anyone else) [#1874](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1874) (1.14.3.0)
|
||||||
|
- *testrender*: Fix GPU regression with bad destruction order [#1814](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1814) (1.14.1.0)
|
||||||
|
- *fix*: False positives when utilizing OSL's "debug_uninit" feature [#1947](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1947) (by Alex Wells) (1.14.4.0)
|
||||||
|
- *fix*: Interpolated int attributes wrong for batch shading [#1949](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1949) (by Alex Wells) (1.14.4.0)
|
||||||
|
- *int*: Proper forwarding of osofmt() for correct C++20 support [#1923](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1923) (1.14.4.0)
|
||||||
|
|
||||||
|
### 🏗 Build/test/CI and platform ports
|
||||||
|
* CMake build system and scripts:
|
||||||
|
- Add options to use static Cuda libraries (controlled by
|
||||||
|
CMake variable `CUDA_PREFER_STATIC_LIBS`) [#1772](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1772) (1.14.1.0)
|
||||||
|
- Remove a lot of old SPI build cruft [#1778](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1778) (1.14.1.0)
|
||||||
|
- Simplify oslquery library include and link needs [#1787](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1787) (1.14.1.0)
|
||||||
|
- Propagate cpp version: when building against an OIIO that needs C++17,
|
||||||
|
OSL will need to be build with C++17, too. [#1797](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1797) (1.14.1.0)
|
||||||
|
- Eliminate boost as a dependency: [#1802](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1802) (by Christopher Kulla) (1.14.1.0) [#1808](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1808) (by Christopher Kulla) (1.14.1.0)
|
||||||
|
- Default to C++17 mode (but for now, C++14 is still supported by
|
||||||
|
setting `CMAKE_CXX_STANDARD`). [#1818](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1818) (1.14.1.0)
|
||||||
|
- CMake: replace deprecated add_definitions with preferred add_compile_definitions [#1821](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1821) (1.14.2.0)
|
||||||
|
- Port set_utils and dependency_utils from oiio cmake scripts [#1845](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1845) (1.14.2.0)
|
||||||
|
- Fix testrender OptiX build [#1869](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1869) (by Tim Grant) (1.14.3.0)
|
||||||
|
- Work around Imath UB in bvh code was problematic using icx [#1882](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1882) (1.14.3.0)
|
||||||
|
- Reduce shared dependencies between liboslcomp and liboslexec [#1890](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1890) (by Christopher Kulla) (1.14.3.0)
|
||||||
|
- Add option for build profiling with clang -ftime-trace [#1909](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1909) (1.14.3.0)
|
||||||
|
- Link error on Windows due to shared symbols [#1918](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1918) (by Brecht Van Lommel)
|
||||||
|
- Unbreak osl-unittest.h for OptiX [#1926](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1926)
|
||||||
|
* Dependency and toolchain version support:
|
||||||
|
- Support for LLVM 18. [#1773](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1773) (by مهدي شينون (Mehdi Chinoune)) (1.14.1.0)
|
||||||
|
[#1803](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1803) (1.14.1.0)
|
||||||
|
- LLVM 18 compat issue - include libclangAPINotes [#1812](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1812) (1.14.1.1)
|
||||||
|
- Various fixes to deal with deprecations in the development branch and
|
||||||
|
upcoming 3.0 release of OpenImageIO:
|
||||||
|
[#1788](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1788), [#1806](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1806), [#1834](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1834), [#1838](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1838), [#1842](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1842), [#1844](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1844) [#1884](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1884)
|
||||||
|
- Use new OIIO ustringhash decode methods when available [#1792](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1792) (by Chris Hellmuth) (1.14.1.0)
|
||||||
|
- Adjust to OIIO change to IC/TS API [#1848](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1848) [#1850](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1850) (1.14.2.0)
|
||||||
|
- Various adjustments for OIIO 3.0 becoming the release [#1881](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1881) [#1885](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1885) [#1888](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1888) [#1901](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1901) (1.14.3.0)
|
||||||
|
- Fix LLVM find package picking up system-wide libraries [#1866](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1866) (by Sergey Sharybin) (1.14.3.0)
|
||||||
|
- Support for LLVM 19 [#1873](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1873) (1.14.3.0)
|
||||||
|
- Raise dependencies: cmake 3.19, OIIO 2.5, LLVM 11 [#1914](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1914)
|
||||||
|
- Adjust osltoy for Qt 6.8 [#1936](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1936)
|
||||||
|
- Fix libclang link order [#1946](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1946) (1.14.4.0)
|
||||||
|
- Support for CMake 4.0 [#1960](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1960) (1.14.5.0)
|
||||||
|
* Testing and Continuous integration (CI) systems:
|
||||||
|
- *testrender*: Fix testrender GPU regression with bad destruction order [#1814](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1814) (1.14.1.0)
|
||||||
|
- *tests*: Update ref output for OptiX execution order variance [#1816](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1816) (1.14.1.0)
|
||||||
|
- *tests*: Update ref output for render-microfacet with OptiX [#1927](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1927)
|
||||||
|
- *tests*: For CI only, trim PWD from the oslc -M output [#1924](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1924)
|
||||||
|
- *tests*: Fix shell command quoting to work the same on Unix and Windows [#1925](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1925)
|
||||||
|
- *tests*: Env variable OSL_TESTSUITE_THRESH_SCALE scales test thresholds [#1934](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1934)
|
||||||
|
- *tests*: Update some optix ref images and comparison thresholds [#1937](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1937)
|
||||||
|
- *ci*: Test against LLVM 17 [#1760](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1760) (1.14.0.0)
|
||||||
|
- *ci*: Increase timeout for slow MacOS-13 runner [#1775](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1775) (1.14.1.0)
|
||||||
|
- *ci*: Fix broken Macos-13 CI [#1780](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1780) (1.14.1.0)
|
||||||
|
- *ci*: Allow triggering CI workflow from web [#1779](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1779) (1.14.1.0)
|
||||||
|
- *ci*: Lock down to OIIO 2.5 for icc tests [#1799](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1799) (1.14.1.0)
|
||||||
|
- *ci*: Print commit hash of locally built dependencies [#1798](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1798) (1.14.1.0)
|
||||||
|
- *ci*: Suppress leak sanitizer warnings about internals of robin_hash [#1807](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1807) (1.14.1.0)
|
||||||
|
- *ci*: Mods to CI to deal with OIIO master raising dependency mins [#1833](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1833) (1.14.1.0)
|
||||||
|
- *ci*: Fix GHA CI after they upgraded nodejs [#1837](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1837) (1.14.1.0)
|
||||||
|
- *ci*: Deal with CentOS 7 EOL and disappearance of yum mirrors [#1839](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1839) (1.14.1.0)
|
||||||
|
- *ci*: Unbreak CI for OIIO auto-build of OCIO for icx case [#1849](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1849) (1.14.2.0)
|
||||||
|
- *ci*: Add VFX Platform 2024 to CI [#1854](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1854) (1.14.2.0)
|
||||||
|
- *ci*: Deal with OIIO renaming its master -> main [#1867](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1867) (1.14.3.0)
|
||||||
|
- *ci*: Fixup to broken clang-format test [#1883](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1883) (1.14.3.0)
|
||||||
|
- *ci*: Bump to latest upload-artifact action. [#1900](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1900) (1.14.3.0)
|
||||||
|
- *ci*: Fix broken CI for ASWF 2021 and 2022 containers [#1905](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1905) (1.14.3.0)
|
||||||
|
- *ci*: Bump to latest version of upload-artifact action [#1915](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1915)
|
||||||
|
- *ci*: Break out reusable build steps [#1919](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1919)
|
||||||
|
- *ci*: Windows CI support (take 1) [#1930](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1930)
|
||||||
|
- *ci*: Move away from soon-to-be-deprecated ubuntu-20.04 GHA runner [#1941](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1941) (1.14.4.0)
|
||||||
|
- *ci*: Improve clang-format check [#1950](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1950) (1.14.4.0)
|
||||||
|
- *ci*: Update cache action to modern version [#1953](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1953) (1.14.4.0)
|
||||||
|
- *ci*: Unbreak CI on Mac by not letting it install llvm 20 [#1962](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1962) (1.14.5.0)
|
||||||
|
* Platform support:
|
||||||
|
- *Mac ARM*: Test with Mac ARM runner [#1770](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1770) (1.14.1.0)
|
||||||
|
- *Mac ARM*: Make finding bison work better on Apple Silicon Macs + homebrew
|
||||||
|
[#1822](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1822) (1.14.1.1)
|
||||||
|
- *Mac*: Use macOS sysroot, arch, minversion for generating bitcode [#1928](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1928) (by Brecht Van Lommel)
|
||||||
|
|
||||||
|
### 📚 Documentation
|
||||||
|
- Get rid of old LaTeX documentation [#1970](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1970) (1.14.5.0)
|
||||||
|
- Fix links to RTD docs from github landing page [#1768](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1768) (1.14.0.0)
|
||||||
|
- Clarify behavior of `round()`: OSL uses "round away from zero" policy for
|
||||||
|
input values exactly half way between two integers, matching C/C++
|
||||||
|
standard round(). But we were not clear about it in the docs.
|
||||||
|
[#1767](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1767) (1.14.1.0)
|
||||||
|
- More detail about supported platforms in INSTALL.md [#1796](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1796) (1.14.1.0)
|
||||||
|
- Fix outdated or wrong repo URLs [#1811](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1811) (1.14.1.0)
|
||||||
|
- Fixes to documentation of new oren_nayar_diffuse_bsdf parameters [#1820](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1820) (1.14.1.0)
|
||||||
|
- Fix typo in stdlib.md [#1877](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1877) (by Alexey Smolenchuk) (1.14.3.0)
|
||||||
|
- Update some URLs to our new vanity URLs [#1902](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1902) (1.14.3.0)
|
||||||
|
- Updated README.md Documentation section. [#1907](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1907) (by Mitch Prater) (1.14.3.0)
|
||||||
|
- Fix typo in the name of the argument "maxdist" of `trace` [#1933](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1933) (by AidanWelch)
|
||||||
|
- Fix typo in Arrays and better document 1D arrays only [#1939](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1939) (by Sparsh Nair)
|
||||||
|
- Fix typo in substr documentation [#1956](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1956) (by Alexey Smolenchuk) (1.14.5.0)
|
||||||
|
- Document the optional "colorspace" parameter for texture funcs [#1969](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1969) (1.14.5.0)
|
||||||
|
|
||||||
|
### 🏢 Project Administration
|
||||||
|
- Account for duplicate emails in the .mailmap [#1759](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1759) (1.14.0.0)
|
||||||
|
- Releases trigger automatic announcements to the Slack channel.
|
||||||
|
[#1766](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1766) [#1777](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1777) (by John Mertic) (1.14.1.0)
|
||||||
|
- Raise our code formatting standard to clang-format 17 [#1761](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1761) (1.14.0.0)
|
||||||
|
- Improve release related docs [#1911](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1911) (1.14.3.0)
|
||||||
|
- Add code reviewing guide [#1908](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1908) (1.14.3.0)
|
||||||
|
- Sign release artifacts [#1913](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1913) (1.14.3.0)
|
||||||
|
|
||||||
|
---
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
Release 1.13.12.0 -- 4 Dec 2024 (compared to 1.13.11.0)
|
||||||
|
---------------------------------------------------------
|
||||||
|
- *bsdfs*: Anisotropic_vdf closure should not set IOR [#1870](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1870) (by Christopher Kulla)
|
||||||
|
- *shaders*: Bugs in vector2.h, vector4.h, color2.h, color4.h, docs [#1892](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1892)
|
||||||
|
- *build*: Support for LLVM 19 [#1873](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1873)
|
||||||
|
- *build*: Fix LLVM find package picking up system-wide libraries [#1866](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1866) (by Sergey Sharybin)
|
||||||
|
- *build*: Fixes for supporting OIIO 3.0 [#1881](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1881) [#1885](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1885) [#1888](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1888)
|
||||||
|
- *fix*: Typo in dual.h made invalid template DualStorage [#1871](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1871)
|
||||||
|
- *ci*: Add VFX Platform 2024 to CI [#1854](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1854)
|
||||||
|
- *ci*: Deal with OIIO renaming its master -> main [#1867](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1867)
|
||||||
|
- *ci*: Various adjustments for OIIO 3.0 becoming the release [#1901](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1901)
|
||||||
|
- *ci*: Fix broken CI for ASWF 2021 and 2022 containers (#1905)
|
||||||
|
- *ci*: Only test against maximum OpenImageIO 2.5.17.0 (because it doesn't
|
||||||
|
yet build properly against OIIO 3.0)
|
||||||
|
|
||||||
|
|
||||||
|
Release 1.13.11.0 -- 1 Sep 2024 (compared to 1.13.10.0)
|
||||||
|
---------------------------------------------------------
|
||||||
|
- *fix/batched*: Assume BatchedRendererServices texture derivatives are in st space. [#1828](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1828) (by sfriedmapixar) (1.13.10.0)
|
||||||
|
- *fix*: Make backfacing shadeop indicate backfacing shader-global is needed [#1827](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1827) (by sfriedmapixar) (1.13.10.0)
|
||||||
|
- *deps*: Handle various OpenImageIO deprecations and changes in the run-up to OIIO 3.0 [#1834](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1834) [#1806](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1806) [#1838](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1838) [#1842](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1842) [#1850](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1850) (1.13.10.0)
|
||||||
|
- *deps*: Adjust to OIIO change to IC/TS API [#1848](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1848) (1.13.10.0)
|
||||||
|
- *deps*: Llvm 18 compat issue - include libclangAPINotes [#1812](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1812) (1.13.10.0)
|
||||||
|
- *deps*: Make finding bison work better on Apple Silicon Macs + homebrew [#1822](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1822) (1.13.10.0)
|
||||||
|
- *ci*: Mods to CI to deal with OIIO master raising dependency mins [#1833](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1833) (1.13.10.0)
|
||||||
|
- *ci*: Deal with CentOS 7 EOL and disappearance of yum mirrors [#1839](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1839) (1.13.10.0)
|
||||||
|
- *ci*: Fix GHA CI after they upgraded nodejs [#1837](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1837) (1.13.10.0)
|
||||||
|
- *admin*: Change release notice icon to use the icon vs the normal logo so it shows up better [#1777](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/1777) (by John Mertic) (1.13.10.0)
|
||||||
|
|
||||||
|
|
||||||
|
Release 1.13.10.0 -- 1 June 2024 (compared to 1.13.9.0)
|
||||||
|
--------------------------------------------------------
|
||||||
|
- *testrender*: Implement new Oren-Nayar model from OpenPBR [#1817](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1817) (by Christopher Kulla)
|
||||||
|
- *docs*: Fix outdated or wrong repo URLs [#1811](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1811)
|
||||||
|
|
||||||
|
|
||||||
|
Release 1.13.9.0 -- 1 May 2024 (compared to 1.13.8.0)
|
||||||
|
--------------------------------------------------------
|
||||||
|
- *deps*: Support for LLVM-18 [#1773](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1773) (by مهدي شينون (Mehdi Chinoune) [#1803](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1803) (by Larry Gritz)
|
||||||
|
- *fix*: Make isconnected() work with downstream renderer "connections." [#1782](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1782) (by sfriedmapixar)
|
||||||
|
- *cleanup*: Change OSL_CONSTEXPR14 to constexpr [#1805](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1805)
|
||||||
|
- *internals build*: Fix ifdef typo [#1804](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1804)
|
||||||
|
- *build*: Propagate cpp version [#1797](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1797)
|
||||||
|
- *build*: Print commit hash of locally built dependencies [#1798](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1798)
|
||||||
|
- *ci*: Lock down to OIIO 2.5 for icc tests [#1799](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1799)
|
||||||
|
- *ci*: Suppress leak sanitizer warnings about internals of robin_hash [#1807](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1807)
|
||||||
|
- *docs*: More detail about supported platforms in INSTALL.md [#1796](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1796)
|
||||||
|
|
||||||
|
|
||||||
|
Release 1.13.8.0 -- 1 Apr 2024 (compared to 1.13.7.0)
|
||||||
|
--------------------------------------------------------
|
||||||
|
* *fix(batched)*: Codegen bug for compref with varying index for batched shading [#1776](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1776) (by Alex Wells)
|
||||||
|
* *fix*: Calculatenormal needs fliphandedness [#1783](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1783) (by sfriedmapixar)
|
||||||
|
* *fix*: Print closure missing error message at compile time instead of run time. [#1781](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1781) (by sfriedmapixar)
|
||||||
|
* *int*: Change long-deprecated OIIO macro to new one [#1788](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1788)
|
||||||
|
* *ci*: Fix broken Macos-13 CI [#1780](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1780)
|
||||||
|
|
||||||
|
Release 1.13.7.0 -- 1 Mar 2024 (compared to 1.13.6.1)
|
||||||
|
--------------------------------------------------------
|
||||||
|
* *fix*: Mute partio error prints [#1774](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1774) (by olegul)
|
||||||
|
* *ci*: Test with Mac ARM runner [#1770](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1770)
|
||||||
|
* *docs*: Fix links to RTD docs from github landing page [#1768](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1768)
|
||||||
|
* *admin*: Switch release announcement workflow to jmertic's awesome action [#1766](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1766)
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
|
||||||
|
Release 1.13 -- Feb 1, 2024 (compared to 1.12)
|
||||||
|
===============================================
|
||||||
|
- beta 1: December 20, 2023
|
||||||
|
- release v1.13.6.1: Feb 1, 2024
|
||||||
|
|
||||||
|
### New minimum dependencies and compatibility changes:
|
||||||
|
|
||||||
|
* For GPU/OptiX mode, OptiX 6.0 support has been removed. For GPU rendering
|
||||||
|
with OptiX, a minimum of OptiX 7.0 is required, and the Cuda minimum has
|
||||||
|
been raised to 9.0 [#1737](https://github.com/AcademySoftwareFoundation/OpenShadingLangauge/pull/1737)
|
||||||
|
* The minimum version OpenImageIO has been raised from 2.2 to 2.4. [#1591](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1591) [#1722](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1722)
|
||||||
|
* The minimum CMake dependency has been raised from 3.12 to 3.15
|
||||||
|
[#1724](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1724) (1.13.5.0)
|
||||||
|
* The minimum Imath/OpenEXR has been raised from 2.3 to 2.4. (Note: OSL 1.13
|
||||||
|
is probably the last major release family that will support Imath/OpenEXR
|
||||||
|
2.x.)
|
||||||
|
|
||||||
|
### OSL Language and oslc compiler:
|
||||||
|
|
||||||
|
* There have been no substantive changes to the OSL language in this release.
|
||||||
|
|
||||||
|
### ⛰️ API changes, new options, new ShadingSystem features (for renderer writers):
|
||||||
|
|
||||||
API changes, new options, new ShadingSystem features (for renderer writers):
|
|
||||||
* A new `shadingStateUniform` pointer field was added to ShaderGlobals for
|
* A new `shadingStateUniform` pointer field was added to ShaderGlobals for
|
||||||
planned future expansion and improved GPU support. #1585 (1.13.1.0)
|
planned future expansion and improved GPU support. #1585 (1.13.1.0)
|
||||||
|
* Adding relaxed type-equivalency to ReParameter() [#1639](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1639) (by cmstein) (1.13.2.1)
|
||||||
|
* Expose llvm groupdata size as a shadergroup attribute
|
||||||
|
[#1642](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1642) (by Chris Hellmuth) (1.13.4.0)
|
||||||
|
* RendererServices API for letting get_texture_handle consider colorspace
|
||||||
|
[#1641](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1641) (1.13.4.0)
|
||||||
|
* Make "compile_report" attribute an int instead of just 0/1. Passing 1 makes
|
||||||
|
a brief report, values >1 are more verbose. (Zero still prints no report.)
|
||||||
|
[#1654](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1654) (1.13.4.0)
|
||||||
|
* Switch `lockgeom` to `interpolated` and `interactive`. The `lockgeom=0`
|
||||||
|
was confusing. Now we use `interpolated=1` to mean "don't optimize it away
|
||||||
|
because it might be interpolated across the geometry and thus won't have
|
||||||
|
the same value at all points being shaded," and the subtly different
|
||||||
|
`interactive=1` to mean "don't optimize it away because although it will
|
||||||
|
always take on the same value at all points at the same time, the user
|
||||||
|
might want to interactively adjust the value and we don't want to have
|
||||||
|
to recompile the shader group if that happens."
|
||||||
|
[#1662](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1662) (1.13.4.0)
|
||||||
|
* Add type information for needed attributes. [#1650](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1650) (by Curtis Black) (1.13.4.0)
|
||||||
|
* Add API for building attribute getter free functions.
|
||||||
|
[#1704](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1704) (by Curtis Black) (1.13.5.0)
|
||||||
|
* Rs fmt specification - Journaling Algorithm for error, warning, fprintf
|
||||||
|
[#1702](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1702) (by Steena Monteiro) [#1711](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1711) [#1715](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1715) (1.13.5.0)
|
||||||
|
|
||||||
|
### 🚀 SIMD batched shading mode
|
||||||
|
|
||||||
SIMD batched shading mode:
|
|
||||||
* Fix some array overruns (asymptomatic, but still potentially buggy) in
|
* Fix some array overruns (asymptomatic, but still potentially buggy) in
|
||||||
common_ancestor_between. #1577 (1.13.0.2)
|
common_ancestor_between. #1577 (1.13.0.2)
|
||||||
|
* Fix issue with closure keyword parameters. #1620 (1.13.2.0/1.12.8.0)
|
||||||
|
* Fix crash when adding a default initialized closure. #1624
|
||||||
|
(1.13.2.0/1.12.8.0)
|
||||||
|
* Fix support for closures with array types. #1630 (1.13.2.0/1.12.8.0)
|
||||||
|
* Fix bug with masked wide llvm_gen_closure() [#1637](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1637) (by danieldresser-ie) (1.13.2.1)
|
||||||
|
* Fix Force LLVM Boolean [#1717](https://github.com/AcademySoftwareFoundation/OpenShadingLangauge/pull/1717) (by Alex Wells)
|
||||||
|
* Batched pointcloud if "index" is not passed [#1753](https://github.com/AcademySoftwareFoundation/OpenShadingLangauge/pull/1753) (by Alex Wells)
|
||||||
|
|
||||||
|
### 🚀 OptiX GPU rendering
|
||||||
|
|
||||||
OptiX rendering:
|
|
||||||
* OptiX 6.0 support has been removed. For GPU rendering with OptiX, a minimum
|
* OptiX 6.0 support has been removed. For GPU rendering with OptiX, a minimum
|
||||||
of OptiX 7.0 is required.
|
of OptiX 7.0 is required.
|
||||||
* Big overhaul/simplification of how strings are represented on the GPU: the
|
* Big overhaul/simplification of how strings are represented on the GPU: the
|
||||||
@@ -34,36 +575,268 @@ OptiX rendering:
|
|||||||
* Better PTX cache hit rate by eliminating several sources of not being
|
* Better PTX cache hit rate by eliminating several sources of not being
|
||||||
strictly deterministic in the PTX text we were generating. #1566 #1570
|
strictly deterministic in the PTX text we were generating. #1566 #1570
|
||||||
(1.13.0.1)
|
(1.13.0.1)
|
||||||
|
* Fix PTX symbol visibility issues. #1609 (1.13.2.0)
|
||||||
|
* Hide more code that is only used for OptiX mode, when OptiX is disabled.
|
||||||
|
#1608 (1.13.2.0)
|
||||||
|
* Remove dependency on OptiX SDK for building core OSL with OptiX support. You
|
||||||
|
can now build OSL with OptiX support enabled even if you don't have the
|
||||||
|
OptiX SDK headers present at build time. But you will still need them to
|
||||||
|
build your OptiX-based application that uses OSL for GPU rendering. #1627
|
||||||
|
(1.13.2.0/1.12.8.0)
|
||||||
|
* GPU/OptiX support of ReParameter [#1686](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1686) (1.13.4.0)
|
||||||
|
* Fix userdata derivatives for interpolated params on GPU [#1685](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1685) (by Pascal Lecocq) (1.13.4.0)
|
||||||
|
* Enable userdata derivatives for interpolated params on GPU
|
||||||
|
[#1657](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1657) (by Chris Hellmuth) (1.13.4.0)
|
||||||
|
* Move qualifying GroupData params onto stack for higher performance.
|
||||||
|
[#1710](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1710) (by Chris Hellmuth) (1.13.5.0)
|
||||||
|
* Handle mixed string casting that plagues optix codegen [#1718](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1718) (1.13.5.0)
|
||||||
|
* Add missing members to ShaderGlobals in rend_lib.h [#1721](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1721) (by Tim Grant) (1.13.5.0)
|
||||||
|
* OptiX direct callable API that owns groupdata buffer
|
||||||
|
[#1683](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1683) (by Chris Hellmuth) (1.13.5.0)
|
||||||
|
* OptiX PTX pipeline overhaul [#1680](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1680) (by Tim Grant) (1.13.5.0)
|
||||||
|
* Perf: Don't insert redundant run layer calls inside a basic block
|
||||||
|
[#1665](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1665) [#1669](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1669) [#1672](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1672) (by Chris Hellmuth) (1.13.4.0)
|
||||||
|
* Fix NVPTX TargetMachine leak, etc. [#1763](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1763) (by Tim Grant)
|
||||||
|
|
||||||
Performance improvements:
|
### 🐛/🔧 Internals: fixes, improvements, and developer concerns
|
||||||
|
|
||||||
Bug fixes and other improvements (internals):
|
|
||||||
* Fix memory leak in oslc ASTvariable_declaration. #1576 (1.13.0.2)
|
* Fix memory leak in oslc ASTvariable_declaration. #1576 (1.13.0.2)
|
||||||
* Fix memory leaks in LPE code in error conditions. #1593 #1594 (1.13.0.3)
|
* Fix memory leaks in LPE code in error conditions. #1593 #1594 (1.13.0.3)
|
||||||
|
* Fix mismatched strides when calling OCIO for transformc with derivs [#1646](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1646) (1.13.4.0)
|
||||||
Internals/developer concerns:
|
* Set up ray types for testrender [#1648](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1648) (1.13.4.0)
|
||||||
|
* Fix userdata binding corner case [#1673](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1673) (by Alejandro Conty) (1.13.4.0)
|
||||||
|
* Fix constant float values being converted to ints [#1674](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1674) (by Declan Russell) (1.13.4.0)
|
||||||
|
* Don't try to ReParameter symbols not in the group [#1693](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1693) (by Alejandro Conty) (1.13.5.0)
|
||||||
|
* Have ReParameter only copy data when it changes [#1698](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1698) (1.13.5.0)
|
||||||
|
* Avoid deprecated OSLQuery ctr in test example [#1699](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1699) (1.13.5.0)
|
||||||
|
* Zero derivs for interactive params when needed [#1700](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1700) (by Alejandro Conty) (1.13.5.0)
|
||||||
|
* oslc bug fix: shader params whose default values involve "init ops" could be
|
||||||
|
incorrectly initialized if their values came from instance parameters set to
|
||||||
|
zero. #1578 (1.13.0.2)
|
||||||
|
* oslc: Add missing `fmod()` variants [#1643](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1643) (1.13.4.0)
|
||||||
|
* Simple constant folding of binary expressions now happen on the oslc side
|
||||||
|
[#1653](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1653) (1.13.4.0)
|
||||||
* platform.h:
|
* platform.h:
|
||||||
- New `OSL_ALLOCA` macro to allocate on the stack. #1589 (1.13.0.3)
|
* New `OSL_ALLOCA` macro to allocate on the stack. #1589 (1.13.0.3)
|
||||||
|
* Define OSL::bitcast utility. #1610 (1.13.2.0)
|
||||||
|
* Make sure that std::hash is defined for ustring and ustringhash. #1599
|
||||||
|
(1.13.1.1)
|
||||||
|
* Deprecate LLVMUtil::internalize_module_functions. #1606 (1.13.1.0)
|
||||||
|
* Work toward always representing strings in shaders as ustringhash rather
|
||||||
|
than ustring: phase 1 #1603 phase2 #1612 (1.13.2.0) [#1726](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1726) (1.13.5.0)
|
||||||
|
* Remove unnecessary setting of locale::global [#1636](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1636) (by danieldresser-ie) (1.13.2.1)
|
||||||
|
* Fully define bitcast template [#1635](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1635) (1.13.2.1)
|
||||||
|
* Fix for ReParameter corner case [#1670](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1670) (by cmstein) (1.13.4.0)
|
||||||
|
* Switch deprecated oiio simd names to modern [#1679](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1679) (1.13.4.0)
|
||||||
|
* Give ShadingSystemImpl a handy use_optix() method [#1682](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1682) (1.13.4.0)
|
||||||
|
* Fix default fmt logic changing in latest openimageio release [#1725](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1725) (1.13.5.0)
|
||||||
|
* The recently added SS::find_symloc can have const args [#1723](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1723) (1.13.5.0)
|
||||||
|
* SymOverrideInfo bitfields should be the same type [#1745](https://github.com/AcademySoftwareFoundation/OpenShadingLangauge/pull/1745)
|
||||||
|
* Fix wrong offset of MxSheen param [#1751](https://github.com/AcademySoftwareFoundation/OpenShadingLangauge/pull/1751) (by Rasmus Bonnedal)
|
||||||
|
* Make get_texture_info robust to empty shaderglobals param [#1731](https://github.com/AcademySoftwareFoundation/OpenShadingLangauge/pull/1731)
|
||||||
|
|
||||||
|
### 🏗 Build/test/CI and platform ports
|
||||||
|
|
||||||
Build & test system improvements:
|
|
||||||
* CMake build system and scripts:
|
* CMake build system and scripts:
|
||||||
- The version number is now a cache variable, and so can be overridden at
|
* The version number is now a cache variable, and so can be overridden at
|
||||||
build time using `-DOSL_VERSION=...`. Use with extreme caution! #1579
|
build time using `-DOSL_VERSION=...`. Use with extreme caution! #1579
|
||||||
(1.13.0.2)
|
(1.13.0.2) Revised again to reduce changes of user error in #1617
|
||||||
|
(1.13.2.0/1.12.7.1)
|
||||||
|
* Add clangSupport library as dependency to fix linker error on some
|
||||||
|
platforms. #1613 (1.13.2.0/1.12.7.1)
|
||||||
|
* Fix incorrect CMake variable name to control symbol visibility
|
||||||
|
[#1681](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1681) (1.13.4.0)
|
||||||
|
* Change cmake option `USE_OPTIX` -> `OSL_USE_OPTIX` [#1668](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1668) (1.13.4.0)
|
||||||
|
* Fix duplicate osl lexing symbols when building as static libraries
|
||||||
|
[#1709](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1709) (by Brecht Van Lommel) (1.13.5.0)
|
||||||
|
* Better cmake verbose behavior [#1752](https://github.com/AcademySoftwareFoundation/OpenShadingLangauge/pull/1752)
|
||||||
* Dependency version support:
|
* Dependency version support:
|
||||||
- Fix some issues that came up with the new icx 2022.0 compiler. #1601
|
* Fix some issues that came up with the new icx 2022.0 compiler. #1601
|
||||||
(1.13.1.0)
|
(1.13.1.0)
|
||||||
|
* Test against OpenColorIO 2.2. #1616 (1.13.2.0/1.12.7.1)
|
||||||
|
* Proper warnings about LLVM 16 [#1658](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1658) (1.13.4.0)
|
||||||
|
* Fix cuda compilation flags for LLVM 15 [#1659](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1659) (1.13.4.0)
|
||||||
|
* Verify that OSL can build with clang16 [#1664](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1664) (1.13.4.0)
|
||||||
|
* Be more careful about paths to look for llvm [#1656](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1656) (1.13.4.0)
|
||||||
|
* Qt6 compatibility [#1655](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1655) (1.13.4.0)
|
||||||
|
* Fix warnings about Qt compilation and enums [#1661](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1661) (1.13.4.0)
|
||||||
|
* Changes to support fmt 10.0 [#1691](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1691) (1.13.5.0)
|
||||||
|
* Raise OpenEXR minimum to 2.4 [#1734](https://github.com/AcademySoftwareFoundation/OpenShadingLangauge/pull/1734)
|
||||||
|
* Fix Partio build errors on pointcloud functions for MSVC [#1757](https://github.com/AcademySoftwareFoundation/OpenShadingLangauge/pull/1757) (by Alex Wells)
|
||||||
|
* Bump Cuda minimum to 9.0 [#1737](https://github.com/AcademySoftwareFoundation/OpenShadingLangauge/pull/1737)
|
||||||
|
* LLVM 16 and 17 support: LLVM opaque pointers support [#1728](https://github.com/AcademySoftwareFoundation/OpenShadingLangauge/pull/1728),
|
||||||
|
LLVM new pass manager support [#1729](https://github.com/AcademySoftwareFoundation/OpenShadingLangauge/pull/1729),
|
||||||
|
finish LLVM 16 and 17 support [#1730](https://github.com/AcademySoftwareFoundation/OpenShadingLangauge/pull/1730) (all by Brecht Van Lommel)
|
||||||
* Testing and Continuous integration (CI) systems:
|
* Testing and Continuous integration (CI) systems:
|
||||||
- Dynamic analysis using address and leak sanitizers. #1581 (1.13.0.3)
|
* Dynamic analysis using address and leak sanitizers. #1581 (1.13.0.3)
|
||||||
- `testshade --help` now prints TextureSystem options and all hardware
|
* `testshade --help` now prints TextureSystem options and all hardware
|
||||||
information. #1584 (1.13.0.3)
|
information. #1584 (1.13.0.3)
|
||||||
- Improvements to SonarCloud and coverage analysis. #1596 (1.13.0.3)
|
* Improvements to SonarCloud and coverage analysis. #1596 (1.13.0.3)
|
||||||
|
#1607 (1.13.1.0)
|
||||||
|
* Disabling the dso version of testshade for the coverage analysis test.
|
||||||
|
#1604 (1.13.1.0)
|
||||||
|
* Be sure to run pointcloud tests when partio is found. #1611 (1.13.2.0)
|
||||||
|
* testshade: better testing of all closure parameter types. #1621
|
||||||
|
(1.13.2.0/1.12.8.0)
|
||||||
|
* Don't use the cached background map on the first bounce
|
||||||
|
[#1649](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1649) (by Christopher Kulla) (1.13.4.0)
|
||||||
|
* Fix builds when USE_PYTHON=OFF [#1675](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1675) (by Declan Russell) (1.13.4.0)
|
||||||
|
* Remove SonarCloud cache setup as it is now offered by default
|
||||||
|
[#1660](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1660) (by Massimo Paladin) (1.13.4.0)
|
||||||
|
* *ci*: Simplify build_llvm.bash script [#1703](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1703) (1.13.5.0)
|
||||||
|
* Test interactive parameter initialization in optix testrender [#1687](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1687) (by Chris Hellmuth) (1.13.5.0)
|
||||||
|
* Fix GPU job not actually enabling OptiX [#1738](https://github.com/AcademySoftwareFoundation/OpenShadingLangauge/pull/1738) (by Brecht Van Lommel)
|
||||||
|
* Fix python-oslquery test failure on macOS [#1739](https://github.com/AcademySoftwareFoundation/OpenShadingLangauge/pull/1739) (by Brecht Van Lommel)
|
||||||
|
* Disable MacOS-11 CI [#1746](https://github.com/AcademySoftwareFoundation/OpenShadingLangauge/pull/1746)
|
||||||
|
* Skip analysis and scorecard workflows on push if only docs changed [#1744](https://github.com/AcademySoftwareFoundation/OpenShadingLangauge/pull/1744)
|
||||||
|
* For clarity, use the term 'runner' instead of 'os' [#1743](https://github.com/AcademySoftwareFoundation/OpenShadingLangauge/pull/1743)
|
||||||
|
* Test ABI compliance [#1748](https://github.com/AcademySoftwareFoundation/OpenShadingLangauge/pull/1748)
|
||||||
|
* Fix tests passing when test commands fail [#1733](https://github.com/AcademySoftwareFoundation/OpenShadingLangauge/pull/1733) (by Brecht Van Lommel)
|
||||||
|
* *ci*: Test against LLVM 17 [#1760](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1760)
|
||||||
* Platform support:
|
* Platform support:
|
||||||
|
* Include `immintrin.h` only when needed. #1605 (1.13.1.0)
|
||||||
|
* Changed snprintf formatting to satisfy some compilers.
|
||||||
|
[#1640](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1640) (by pellerington) (1.13.4.0)
|
||||||
|
* Fix some windows GPU build errors [#1638](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1638) (by Declan Russell) (1.13.4.0)
|
||||||
|
* Fix for Apple clang 14+ warnings [#1697](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1697) (1.13.5.0)
|
||||||
|
* Fix struct align/pack for MSVC [#1754](https://github.com/AcademySoftwareFoundation/OpenShadingLangauge/pull/1754) (by Rasmus Bonnedal)
|
||||||
|
* Refactor icc/icx specific pragma macros [#1756](https://github.com/AcademySoftwareFoundation/OpenShadingLangauge/pull/1756) (by Alex Wells)
|
||||||
|
|
||||||
Documentation:
|
### 📚 Documentation
|
||||||
|
|
||||||
|
* First stab at ReadTheDocs -- new [Experimental OSL Documentation on
|
||||||
|
ReadTheDocs](https://open-shading-language.readthedocs.io/)
|
||||||
|
is still a little rough, but eventually will be our primary documentation.
|
||||||
|
[#1736](https://github.com/AcademySoftwareFoundation/OpenShadingLangauge/pull/1736)
|
||||||
* `doc/RELEASING.md` documents our release process and versioning policies.
|
* `doc/RELEASING.md` documents our release process and versioning policies.
|
||||||
#1572 (1.13.0.2)
|
#1572 (1.13.0.2)
|
||||||
|
* Improve documentation of `trace` function [#1671](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1671) (by AidanWelch) (1.13.4.0)
|
||||||
|
* Update CONTRIBUTING [#1689](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1689) (1.13.5.0)
|
||||||
|
* Update logos [#1705](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1705), Move logos and add an icon-only logo [#1707](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1707) (1.13.5.0)
|
||||||
|
|
||||||
|
### 🏢 Project Administration
|
||||||
|
|
||||||
|
* Alert slack "release-announcements" channel upon OSL release [#1740](https://github.com/AcademySoftwareFoundation/OpenShadingLangauge/pull/1740) [#1749](https://github.com/AcademySoftwareFoundation/OpenShadingLangauge/pull/1749)
|
||||||
|
* Update pull request template [#1741](https://github.com/AcademySoftwareFoundation/OpenShadingLangauge/pull/1741)
|
||||||
|
* Account for duplicate emails in the .mailmap [#1759](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1759)
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
---
|
||||||
|
---
|
||||||
|
|
||||||
|
|
||||||
|
Release 1.12.13.0 -- 1 July 2023 (compared to 1.12.12.0)
|
||||||
|
--------------------------------------------------------
|
||||||
|
- *fix*: Fix constant float values being converted to ints
|
||||||
|
[#1674](https://github.com/OpenShadingLanguage/oiio/pull/1674) (by Declan Russell)
|
||||||
|
- *build*: Fix builds when USE_PYTHON=OFF
|
||||||
|
[#1675](https://github.com/OpenShadingLanguage/oiio/pull/1675) (by Declan Russell)
|
||||||
|
- *build*: Changes to support fmt 10.0
|
||||||
|
[#1691](https://github.com/OpenShadingLanguage/oiio/pull/1691)
|
||||||
|
- *cleanup*: Switch deprecated oiio simd names to modern
|
||||||
|
[#1679](https://github.com/OpenShadingLanguage/oiio/pull/1679)
|
||||||
|
- *testing*: Avoid deprecated OSLQuery ctr in test example
|
||||||
|
[#1699](https://github.com/OpenShadingLanguage/oiio/pull/1699)
|
||||||
|
- *ci*: Fix package name for icc
|
||||||
|
[#1690](https://github.com/OpenShadingLanguage/oiio/pull/1690)
|
||||||
|
- *ci*: Add VFX Platform 2023 tests using new ASWF containers
|
||||||
|
[#1696](https://github.com/OpenShadingLanguage/oiio/pull/1696)
|
||||||
|
- *ci*: Switch oiio obsolete branch names to immutable tags
|
||||||
|
[#1701](https://github.com/OpenShadingLanguage/oiio/pull/1701)
|
||||||
|
- *docs*: Improve documentation of `trace` function
|
||||||
|
[#1671](https://github.com/OpenShadingLanguage/oiio/pull/1671) (by AidanWelch)
|
||||||
|
- *docs*: README.md: added filmography and Siggraph OSL course info.
|
||||||
|
[#1692](https://github.com/OpenShadingLanguage/oiio/pull/1692)
|
||||||
|
[#1694](https://github.com/OpenShadingLanguage/oiio/pull/1694) (by Mitch Prater)
|
||||||
|
- *docs*: Amend the filmography
|
||||||
|
[#1695](https://github.com/OpenShadingLanguage/oiio/pull/1695)
|
||||||
|
- *docs*: Fix incorrect links in CONTRIBUTING
|
||||||
|
[#1688](https://github.com/OpenShadingLanguage/oiio/pull/1688)
|
||||||
|
|
||||||
|
Release 1.12.12.0 -- 1 May 2023 (compared to 1.12.11.0)
|
||||||
|
--------------------------------------------------------
|
||||||
|
* New ShadingSystem getattribute query for shader groups: "attribute_types"
|
||||||
|
retrieves a pointer to the array of TypeDesc values describing the
|
||||||
|
attributes retrieved by existing "attributes_needed" and "attribute_scopes".
|
||||||
|
#1650
|
||||||
|
* Fix a bug with binding userdata when it's used by more than one shader
|
||||||
|
within the group and they disagree about whether derivatives are needed when
|
||||||
|
retrieving the attribute. #1673
|
||||||
|
|
||||||
|
Release 1.12.11.0 -- 5 Apr 2023 (compared to 1.12.10.0)
|
||||||
|
--------------------------------------------------------
|
||||||
|
* Build: Add Qt 6.x compatibility (Qt is only used for `osltoy`). #1655
|
||||||
|
* Build: more careful about paths to look for LLVM. #1656
|
||||||
|
* Build: Fix Cuda compilation flags for LLVM 15. #1659
|
||||||
|
* Notice: OSL does not yet build properly against the newly release LLVM 16.
|
||||||
|
You must use LLVM 9-15. For Mac users who get their llvm from Homebrew,
|
||||||
|
please be aware that Homebrew has changed its default llvm to 16, so you'll
|
||||||
|
need to `brew install llvm@14` and make your OSL CMake define:
|
||||||
|
`-DLLVM_ROOT=/usr/local/opt/llvm@14`
|
||||||
|
|
||||||
|
Release 1.12.10.0 -- 1 Mar 2023 (compared to 1.12.9.0)
|
||||||
|
--------------------------------------------------------
|
||||||
|
* feat(testrender): Modify testrender so that it correctly sets raytype to
|
||||||
|
"camera" for camera rays, "shadow" for shadow rays, and "diffuse" for all
|
||||||
|
secondary rays. Also rerun the shades for background shader group on the
|
||||||
|
camera rays rather than use the cached map. This helps the MaterialX project
|
||||||
|
use testrender for certain unit tests and verification. #1648 #1649
|
||||||
|
* feat: Expose llvm groupdata size as a shadergroup attribute
|
||||||
|
"llvm_groupdata_size". #1642
|
||||||
|
* fix: Crash could result from uncaught exception in OpenColorIO when calling
|
||||||
|
transformc with derivatives for color spaces that require OCIO. #1646
|
||||||
|
* fix: certain uses of fmod() in shaders could fail to generate LLVM code
|
||||||
|
correctly, due to a missing implementation for the fmod(triple,float)
|
||||||
|
varieties. #1643
|
||||||
|
* build: Change snprintf formatting to satisfy some compilers. #1640
|
||||||
|
* CI: Fix broken Mac ci. #1647
|
||||||
|
|
||||||
|
Release 1.12.9.0 -- 1 Feb 2023 (compared to 1.12.8.0)
|
||||||
|
-------------------------------------------------------
|
||||||
|
* Remove unnecessary setting of locale::global. #1630
|
||||||
|
* Batch shading: Fix bug with masked wide closure generation. #1637
|
||||||
|
* Make sure ReParameter() has the same relaxed type checking rules as
|
||||||
|
Parameter(). Before, it was stricter about type conversion. #1639
|
||||||
|
* Windows: Fix some GPU build errors. #1638
|
||||||
|
|
||||||
|
Release 1.12.8.0 -- 3 Jan 2023 (compared to 1.12.7.1)
|
||||||
|
-------------------------------------------------------
|
||||||
|
* Remove dependency on OptiX SDK for building core OSL with OptiX support.
|
||||||
|
You can now build OSL with OptiX support enabled even if you don't have the
|
||||||
|
OptiX SDK headers present at build time. But you will still need them to
|
||||||
|
build your OptiX-based application that uses OSL for GPU rendering. #1627
|
||||||
|
* Batch mode: fix issue with closure keyword parameters. #1620
|
||||||
|
* Batch mode: fix crash when adding a default initialized closure. #1624
|
||||||
|
* Batch mode: Fix support for closures with array types. #1630
|
||||||
|
* testshade: better testing of all closure parameter types. #1621
|
||||||
|
* Fix various CI breaks as dependencies shifted. #1629 #1631 #1633
|
||||||
|
|
||||||
|
Release 1.12.7.1 -- 1 Dec 2022 (compared to 1.12.7.0)
|
||||||
|
-------------------------------------------------------
|
||||||
|
* Add clangSupport library as dependency to fix linker error on some
|
||||||
|
platforms. #1613
|
||||||
|
* Test against OpenColorIO 2.2. #1616
|
||||||
|
* Build: Fix how version overrides work to reduce the chance of user mistakes.
|
||||||
|
#1617
|
||||||
|
|
||||||
|
Release 1.12.7.0 -- 1 Nov 2022 (compared to 1.12.6.2)
|
||||||
|
-------------------------------------------------------
|
||||||
|
* Optix: Change naming of certain compiler-generated constants in a way that
|
||||||
|
improves use of the PTX cache. #1570
|
||||||
|
* Batch: Fix uninitialized members in ReadEvent internals. #1575
|
||||||
|
* `testshade --help` now prints TextureSystem options and hardware info. #1584
|
||||||
|
* oslc: Fix memory leak in ASTvariable_declaration. #1576
|
||||||
|
* Fix memory leaks in light path expression code. #1593 #1594
|
||||||
|
* Include the immintrin.h header only when needed. #1605
|
||||||
|
* icx: Improvements to fix problems exposed by new icx 2022.2 compiler. #1601
|
||||||
|
* Testing: CMake cache variables to control the testing timeout length. #1571
|
||||||
|
* CI: Add a dynamic analysis test using address and leak sanitizers. #1581
|
||||||
|
* CI: Now using SonarCloud static analysis. #1551
|
||||||
|
* CI: Many improvements in testing code coverage #1607
|
||||||
|
* CI: Make sure to run pointcloud tests when partio is found. #1611
|
||||||
|
* Developers: platform.h now defines OSL_ALLOCA macro. #1589
|
||||||
|
* Developers: platform.h now defines OSL::bitcast utility. #1610
|
||||||
|
|
||||||
Release 1.12 -- 1 Oct 2022 (compared to 1.11)
|
Release 1.12 -- 1 Oct 2022 (compared to 1.11)
|
||||||
----------------------------------------------
|
----------------------------------------------
|
||||||
|
|||||||
@@ -2,9 +2,16 @@
|
|||||||
# SPDX-License-Identifier: BSD-3-Clause
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||||
|
|
||||||
cmake_minimum_required (VERSION 3.12)
|
cmake_minimum_required (VERSION 3.19)
|
||||||
|
|
||||||
|
set (OSL_VERSION "1.16.0.0")
|
||||||
|
set (OSL_VERSION_OVERRIDE "" CACHE STRING
|
||||||
|
"Version override (use with caution)!")
|
||||||
|
mark_as_advanced (OSL_VERSION_OVERRIDE)
|
||||||
|
if (OSL_VERSION_OVERRIDE)
|
||||||
|
set (OSL_VERSION ${OSL_VERSION_OVERRIDE})
|
||||||
|
endif ()
|
||||||
|
|
||||||
set (OSL_VERSION "1.13.1.0" CACHE STRING "Version")
|
|
||||||
project (OSL VERSION ${OSL_VERSION}
|
project (OSL VERSION ${OSL_VERSION}
|
||||||
LANGUAGES CXX C
|
LANGUAGES CXX C
|
||||||
HOMEPAGE_URL "https://github.com/AcademySoftwareFoundation/OpenShadingLanguage")
|
HOMEPAGE_URL "https://github.com/AcademySoftwareFoundation/OpenShadingLanguage")
|
||||||
@@ -32,6 +39,28 @@ if (CMAKE_VERSION VERSION_LESS 3.21)
|
|||||||
endif ()
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
# Set up module path for our own cmake modules and add some esential ones
|
||||||
|
list (APPEND CMAKE_MODULE_PATH
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cmake/modules"
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/cmake")
|
||||||
|
|
||||||
|
# Utilities
|
||||||
|
include (colors)
|
||||||
|
include (set_utils)
|
||||||
|
include (check_is_enabled)
|
||||||
|
include (fancy_add_executable)
|
||||||
|
|
||||||
|
# If the user wants to use Conan to build dependencies, they will have done
|
||||||
|
# this prior to the cmake config:
|
||||||
|
# cd <build area>
|
||||||
|
# conan install <source area>
|
||||||
|
# and that will leave a conanbuildinfo.cmake in the build area for us.
|
||||||
|
if (EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
|
||||||
|
include (${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
|
||||||
|
message (STATUS "Using Conan for dependencies")
|
||||||
|
conan_basic_setup()
|
||||||
|
endif()
|
||||||
|
|
||||||
if (NOT CMAKE_BUILD_TYPE)
|
if (NOT CMAKE_BUILD_TYPE)
|
||||||
set (CMAKE_BUILD_TYPE "Release")
|
set (CMAKE_BUILD_TYPE "Release")
|
||||||
endif ()
|
endif ()
|
||||||
@@ -53,6 +82,7 @@ message (STATUS "Project build dir = ${CMAKE_BINARY_DIR}")
|
|||||||
message (STATUS "Project install prefix = ${CMAKE_INSTALL_PREFIX}")
|
message (STATUS "Project install prefix = ${CMAKE_INSTALL_PREFIX}")
|
||||||
message (STATUS "Configuration types = ${CMAKE_CONFIGURATION_TYPES}")
|
message (STATUS "Configuration types = ${CMAKE_CONFIGURATION_TYPES}")
|
||||||
message (STATUS "Build type = ${CMAKE_BUILD_TYPE}")
|
message (STATUS "Build type = ${CMAKE_BUILD_TYPE}")
|
||||||
|
message (STATUS "Supported release = ${${PROJECT_NAME}_SUPPORTED_RELEASE}")
|
||||||
|
|
||||||
# Make the build area layout look a bit more like the final dist layout
|
# Make the build area layout look a bit more like the final dist layout
|
||||||
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||||
@@ -63,7 +93,6 @@ if ("${PROJECT_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
|
|||||||
message (FATAL_ERROR "Not allowed to run in-source build!")
|
message (FATAL_ERROR "Not allowed to run in-source build!")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
|
||||||
option (CMAKE_USE_FOLDERS "Use the FOLDER target property to organize targets into folders." ON)
|
option (CMAKE_USE_FOLDERS "Use the FOLDER target property to organize targets into folders." ON)
|
||||||
mark_as_advanced (CMAKE_USE_FOLDERS)
|
mark_as_advanced (CMAKE_USE_FOLDERS)
|
||||||
if (CMAKE_USE_FOLDERS)
|
if (CMAKE_USE_FOLDERS)
|
||||||
@@ -81,6 +110,11 @@ include (GNUInstallDirs)
|
|||||||
|
|
||||||
|
|
||||||
option (VERBOSE "Print lots of messages while compiling" OFF)
|
option (VERBOSE "Print lots of messages while compiling" OFF)
|
||||||
|
if (VERBOSE)
|
||||||
|
set (CMAKE_MESSAGE_LOG_LEVEL "VERBOSE" CACHE STRING "CMake log level to display")
|
||||||
|
else ()
|
||||||
|
set (CMAKE_MESSAGE_LOG_LEVEL "STATUS" CACHE STRING "CMake log level to display")
|
||||||
|
endif ()
|
||||||
set (OSL_LIBNAME_SUFFIX "" CACHE STRING
|
set (OSL_LIBNAME_SUFFIX "" CACHE STRING
|
||||||
"Optional name appended to ${PROJECT_NAME} libraries that are built")
|
"Optional name appended to ${PROJECT_NAME} libraries that are built")
|
||||||
option (OSL_BUILD_TESTS "Build the unit tests, testshade, testrender" ON)
|
option (OSL_BUILD_TESTS "Build the unit tests, testshade, testrender" ON)
|
||||||
@@ -91,7 +125,8 @@ else ()
|
|||||||
endif ()
|
endif ()
|
||||||
option (OSL_BUILD_PLUGINS "Bool OSL plugins, for example OIIO plugin" ON)
|
option (OSL_BUILD_PLUGINS "Bool OSL plugins, for example OIIO plugin" ON)
|
||||||
option (OSL_BUILD_SHADERS "Build shaders" ON)
|
option (OSL_BUILD_SHADERS "Build shaders" ON)
|
||||||
option (USE_OPTIX "Include OptiX support" OFF)
|
option (OSL_USE_OPTIX "Include OptiX support" OFF)
|
||||||
|
message(STATUS "OSL_USE_OPTIX: ${OSL_USE_OPTIX}")
|
||||||
set (OPTIX_EXTRA_LIBS CACHE STRING "Extra lib targets needed for OptiX")
|
set (OPTIX_EXTRA_LIBS CACHE STRING "Extra lib targets needed for OptiX")
|
||||||
set (CUDA_EXTRA_LIBS CACHE STRING "Extra lib targets needed for CUDA")
|
set (CUDA_EXTRA_LIBS CACHE STRING "Extra lib targets needed for CUDA")
|
||||||
set (CUDA_TARGET_ARCH "sm_60" CACHE STRING "CUDA GPU architecture (e.g. sm_50)")
|
set (CUDA_TARGET_ARCH "sm_60" CACHE STRING "CUDA GPU architecture (e.g. sm_50)")
|
||||||
@@ -100,66 +135,79 @@ set (OSL_SHADER_INSTALL_DIR "${CMAKE_INSTALL_FULL_DATADIR}/${PROJECT_NAME}/shade
|
|||||||
set (OSL_PTX_INSTALL_DIR "${CMAKE_INSTALL_FULL_DATADIR}/${PROJECT_NAME}/ptx"
|
set (OSL_PTX_INSTALL_DIR "${CMAKE_INSTALL_FULL_DATADIR}/${PROJECT_NAME}/ptx"
|
||||||
CACHE STRING "Directory where OptiX PTX files will be installed")
|
CACHE STRING "Directory where OptiX PTX files will be installed")
|
||||||
set (CMAKE_DEBUG_POSTFIX "" CACHE STRING "Library naming postfix for Debug builds (e.g., '_debug')")
|
set (CMAKE_DEBUG_POSTFIX "" CACHE STRING "Library naming postfix for Debug builds (e.g., '_debug')")
|
||||||
|
option (OSL_USTRINGREP_IS_HASH "Always use ustringhash for strings" OFF)
|
||||||
|
|
||||||
|
|
||||||
set (OSL_NO_DEFAULT_TEXTURESYSTEM OFF CACHE BOOL "Do not use create a raw OIIO::TextureSystem")
|
set (OSL_NO_DEFAULT_TEXTURESYSTEM OFF CACHE BOOL "Do not use create a raw OIIO::TextureSystem")
|
||||||
if (OSL_NO_DEFAULT_TEXTURESYSTEM)
|
if (OSL_NO_DEFAULT_TEXTURESYSTEM)
|
||||||
add_definitions ("-DOSL_NO_DEFAULT_TEXTURESYSTEM=1")
|
add_compile_definitions (OSL_NO_DEFAULT_TEXTURESYSTEM=1)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
option (USE_FAST_MATH "Use fast math approximations (if no, then use system math library)" ON)
|
option (USE_FAST_MATH "Use fast math approximations (if no, then use system math library)" ON)
|
||||||
if (USE_FAST_MATH)
|
if (USE_FAST_MATH)
|
||||||
add_definitions ("-DOSL_FAST_MATH=1")
|
add_compile_definitions (OSL_FAST_MATH=1)
|
||||||
else ()
|
else ()
|
||||||
add_definitions ("-DOSL_FAST_MATH=0")
|
add_compile_definitions (OSL_FAST_MATH=0)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
option (OIIO_FMATH_SIMD_FRIENDLY "Make sure OIIO fmath functions are SIMD-friendly" OFF)
|
option (OIIO_FMATH_SIMD_FRIENDLY "Make sure OIIO fmath functions are SIMD-friendly" OFF)
|
||||||
if (OIIO_FMATH_SIMD_FRIENDLY)
|
if (OIIO_FMATH_SIMD_FRIENDLY)
|
||||||
add_definitions (-DOIIO_FMATH_SIMD_FRIENDLY=1)
|
add_compile_definitions (OIIO_FMATH_SIMD_FRIENDLY=1)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (USE_OPTIX)
|
# Define OSL_INTERNAL symbol only when building OSL itself, will not be
|
||||||
add_definitions ("-DOSL_USE_OPTIX=1")
|
# defined for downstream projects using OSL.
|
||||||
|
add_compile_definitions (OSL_INTERNAL=1)
|
||||||
|
|
||||||
|
# To make sure we aren't relying on deprecated OIIO features, we define
|
||||||
|
# OIIO_DISABLE_DEPRECATED before including any OIIO headers.
|
||||||
|
add_compile_definitions (OIIO_DISABLE_DEPRECATED=900000)
|
||||||
|
|
||||||
|
# Namespace settings
|
||||||
|
#
|
||||||
|
# The "outer namespace" defaults to the project name, but it can be overridden
|
||||||
|
# to allow custom builds that put everything inside a unique namespace that
|
||||||
|
# can't conflict with default builds.
|
||||||
|
set (${PROJ_NAME}_OUTER_NAMESPACE ${PROJECT_NAME} CACHE STRING
|
||||||
|
"Customized outer namespace")
|
||||||
|
set (PROJ_NAMESPACE "${${PROJ_NAME}_OUTER_NAMESPACE}") # synonym
|
||||||
|
if (NOT ${PROJ_NAME}_OUTER_NAMESPACE STREQUAL ${PROJECT_NAME})
|
||||||
|
set (${PROJ_NAME}_CUSTOM_OUTER_NAMESPACE 1)
|
||||||
endif ()
|
endif ()
|
||||||
|
# There is also an inner namespace that is either vMAJ_MIN or vMAJ_MIN_PATCH,
|
||||||
|
# depending on the setting of ${PROJ_NAME}_INNER_NAMESPACE_INCLUDE_PATCH.
|
||||||
|
option (${PROJ_NAME}_INNER_NAMESPACE_INCLUDE_PATCH
|
||||||
|
"Should the inner namespace include the patch number" ${${PROJECT_NAME}_DEV_RELEASE})
|
||||||
|
if (${PROJ_NAME}_INNER_NAMESPACE_INCLUDE_PATCH)
|
||||||
|
set (PROJ_VERSION_NAMESPACE "v${PROJECT_VERSION_MAJOR}_${PROJECT_VERSION_MINOR}_${PROJECT_VERSION_PATCH}")
|
||||||
|
else ()
|
||||||
|
set (PROJ_VERSION_NAMESPACE "v${PROJECT_VERSION_MAJOR}_${PROJECT_VERSION_MINOR}")
|
||||||
|
endif ()
|
||||||
|
# PROJ_NAMESPACE_V combines the outer and inner namespaces into one symbol
|
||||||
|
set (PROJ_NAMESPACE_V "${PROJ_NAMESPACE}_${PROJ_VERSION_NAMESPACE}")
|
||||||
|
message(STATUS "Outer namespace PROJ_OUTER_NAMESPACE: ${PROJ_NAMESPACE}")
|
||||||
|
message(STATUS "Inner namespace PROJ_VERSION_NAMESPACE: ${PROJ_VERSION_NAMESPACE}")
|
||||||
|
message(STATUS "Joint namespace PROJ_NAMESPACE_V: ${PROJ_NAMESPACE_V}")
|
||||||
|
|
||||||
|
|
||||||
# Define OSL_INTERNAL symbol only when building OSL itself, will not be
|
# Define OSL_INTERNAL symbol only when building OSL itself, will not be
|
||||||
# defined for downstream projects using OSL.
|
# defined for downstream projects using OSL.
|
||||||
add_definitions (-DOSL_INTERNAL=1)
|
add_definitions (-DOSL_INTERNAL=1)
|
||||||
|
|
||||||
# Set the default namespace. For symbol hiding reasons, it's important that
|
# To make sure we aren't relying on deprecated OIIO features, we define
|
||||||
# the project name is a subset of the namespace name.
|
# OIIO_DISABLE_DEPRECATED before including any OIIO headers.
|
||||||
set (${PROJ_NAME}_NAMESPACE ${PROJECT_NAME} CACHE STRING
|
add_definitions (-DOIIO_DISABLE_DEPRECATED=900000)
|
||||||
"Customized outer namespace base name (version will be added)")
|
|
||||||
option (${PROJ_NAME}_NAMESPACE_INCLUDE_PATCH
|
|
||||||
"Should the inner namespace include the patch number" ${${PROJECT_NAME}_DEV_RELEASE})
|
|
||||||
set (PROJ_NAMESPACE "${${PROJ_NAME}_NAMESPACE}")
|
|
||||||
string(REGEX MATCH ${PROJECT_NAME} NAMESPACE_HAS_PROJECT_NAME ${PROJ_NAMESPACE})
|
|
||||||
if (NOT NAMESPACE_HAS_PROJECT_NAME)
|
|
||||||
set (PROJ_NAMESPACE ${PROJECT_NAME}_${PROJ_NAMESPACE})
|
|
||||||
endif ()
|
|
||||||
set (PROJ_NAMESPACE_V "${PROJ_NAMESPACE}_v${PROJECT_VERSION_MAJOR}_${PROJECT_VERSION_MINOR}")
|
|
||||||
if (${PROJ_NAME}_NAMESPACE_INCLUDE_PATCH)
|
|
||||||
set (PROJ_NAMESPACE_V "${PROJ_NAMESPACE_V}_${PROJECT_VERSION_PATCH}")
|
|
||||||
endif ()
|
|
||||||
message(STATUS "Setting Namespace to: ${PROJ_NAMESPACE_V}")
|
|
||||||
|
|
||||||
|
|
||||||
list (APPEND CMAKE_MODULE_PATH
|
|
||||||
"${PROJECT_SOURCE_DIR}/src/cmake/modules"
|
|
||||||
"${PROJECT_SOURCE_DIR}/src/cmake")
|
|
||||||
|
|
||||||
# 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
|
# All the C++ and compiler related options and adjustments
|
||||||
include (compiler)
|
include (compiler)
|
||||||
|
|
||||||
|
# Dependency finding utilities and all dependency-related options
|
||||||
|
include (dependency_utils)
|
||||||
|
|
||||||
# Utilities and options related to finding python and making python bindings
|
# Utilities and options related to finding python and making python bindings
|
||||||
include (pythonutils)
|
include (pythonutils)
|
||||||
|
|
||||||
|
# Dependency finding utilities and all dependency-related options
|
||||||
include (externalpackages)
|
include (externalpackages)
|
||||||
include (flexbison)
|
include (flexbison)
|
||||||
include (cuda_macros)
|
include (cuda_macros)
|
||||||
@@ -202,10 +250,11 @@ add_subdirectory (src/liboslcomp)
|
|||||||
add_subdirectory (src/liboslquery)
|
add_subdirectory (src/liboslquery)
|
||||||
add_subdirectory (src/liboslexec)
|
add_subdirectory (src/liboslexec)
|
||||||
add_subdirectory (src/liboslnoise)
|
add_subdirectory (src/liboslnoise)
|
||||||
|
add_subdirectory (src/libbsdl)
|
||||||
add_subdirectory (src/oslc)
|
add_subdirectory (src/oslc)
|
||||||
add_subdirectory (src/oslinfo)
|
add_subdirectory (src/oslinfo)
|
||||||
|
|
||||||
if (OSL_BUILD_TESTS)
|
if (OSL_BUILD_TESTS AND BUILD_TESTING)
|
||||||
add_subdirectory (src/testshade)
|
add_subdirectory (src/testshade)
|
||||||
add_subdirectory (src/testrender)
|
add_subdirectory (src/testrender)
|
||||||
endif ()
|
endif ()
|
||||||
@@ -214,7 +263,7 @@ if (OSL_BUILD_PLUGINS)
|
|||||||
add_subdirectory (src/osl.imageio)
|
add_subdirectory (src/osl.imageio)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (USE_QT AND Qt5_FOUND)
|
if (USE_QT AND (Qt5_FOUND OR Qt6_FOUND) AND NOT DISABLE_OSLTOY)
|
||||||
add_subdirectory (src/osltoy)
|
add_subdirectory (src/osltoy)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
@@ -227,11 +276,6 @@ if (INSTALL_DOCS)
|
|||||||
add_subdirectory (src/doc)
|
add_subdirectory (src/doc)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
# Last minute site-specific instructions, if they exist
|
|
||||||
if (OSL_SITE AND EXISTS "${PROJECT_SOURCE_DIR}/site/${OSL_SITE}/cmake/sitecustom.cmake")
|
|
||||||
include ("${PROJECT_SOURCE_DIR}/site/${OSL_SITE}/cmake/sitecustom.cmake")
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
# install pkgconfig files
|
# install pkgconfig files
|
||||||
if ( NOT MSVC )
|
if ( NOT MSVC )
|
||||||
configure_file(src/build-scripts/oslexec.pc.in "${CMAKE_BINARY_DIR}/oslexec.pc" @ONLY)
|
configure_file(src/build-scripts/oslexec.pc.in "${CMAKE_BINARY_DIR}/oslexec.pc" @ONLY)
|
||||||
@@ -280,16 +324,27 @@ configure_package_config_file ("${PROJECT_SOURCE_DIR}/src/cmake/Config.cmake.in"
|
|||||||
install (FILES "${OSL_PROJECT_CONFIG}" "${OSL_VERSION_CONFIG}"
|
install (FILES "${OSL_PROJECT_CONFIG}" "${OSL_VERSION_CONFIG}"
|
||||||
DESTINATION "${OSL_CONFIG_INSTALL_DIR}")
|
DESTINATION "${OSL_CONFIG_INSTALL_DIR}")
|
||||||
|
|
||||||
|
install (FILES src/cmake/llvm_macros.cmake DESTINATION cmake)
|
||||||
|
|
||||||
|
set (PERMISSION_FLAGS OWNER_EXECUTE OWNER_READ OWNER_WRITE
|
||||||
|
GROUP_EXECUTE GROUP_READ
|
||||||
|
WORLD_EXECUTE WORLD_READ)
|
||||||
|
install (FILES src/build-scripts/serialize-bc.py
|
||||||
|
DESTINATION build-scripts
|
||||||
|
PERMISSIONS ${PERMISSION_FLAGS})
|
||||||
|
|
||||||
# install targets files
|
# install targets files
|
||||||
install (EXPORT OSL_EXPORTED_TARGETS
|
install (EXPORT OSL_EXPORTED_TARGETS
|
||||||
DESTINATION ${OSL_CONFIG_INSTALL_DIR}
|
DESTINATION ${OSL_CONFIG_INSTALL_DIR}
|
||||||
FILE ${OSL_TARGETS_EXPORT_NAME}
|
FILE ${OSL_TARGETS_EXPORT_NAME}
|
||||||
NAMESPACE ${PROJECT_NAME}::)
|
NAMESPACE ${PROJECT_NAME}::)
|
||||||
|
|
||||||
if (${PROJECT_NAME}_BUILD_TESTS AND PROJECT_IS_TOP_LEVEL)
|
if (PROJECT_IS_TOP_LEVEL AND BUILD_TESTING AND ${PROJECT_NAME}_BUILD_TESTS)
|
||||||
osl_add_all_tests()
|
osl_add_all_tests()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (PROJECT_IS_TOP_LEVEL)
|
if (PROJECT_IS_TOP_LEVEL)
|
||||||
include (packaging)
|
include (packaging)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
print_package_notfound_report ()
|
||||||
|
|||||||
@@ -10,6 +10,13 @@ why it's an open source project. Please review this document to get a
|
|||||||
briefing on our process.
|
briefing on our process.
|
||||||
|
|
||||||
|
|
||||||
|
General Tips for Open Source Development
|
||||||
|
----------------------------------------
|
||||||
|
|
||||||
|
* GitHub's [Open Source Guides](https://opensource.guide/)
|
||||||
|
- Especially the guide on [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/)
|
||||||
|
|
||||||
|
|
||||||
Mail List and Slack
|
Mail List and Slack
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
@@ -17,13 +24,12 @@ Contributors should be reading the osl-dev mail list:
|
|||||||
|
|
||||||
* [osl-dev](https://lists.aswf.io/g/osl-dev)
|
* [osl-dev](https://lists.aswf.io/g/osl-dev)
|
||||||
|
|
||||||
You can sign up for the mail list on your own using the link above.
|
You can sign up for the mail list on your own using the link above.
|
||||||
|
|
||||||
We also have an `openshadinglanguage` channel on the
|
* The [ASWF Slack](https://slack.aswf.io/) has an `openshadinglanguage`
|
||||||
[ASWF Slack](https://slack.aswf.io/). But note that the Slack channel is
|
channel. Sign up for the Slack on your own, then under "channels", select
|
||||||
not archived, so while it's ok for fleeting comments, it is unreliable as
|
"browse channels" and you should see the openshadinglanguage channel (among
|
||||||
a permanent repository of useful information. Serious discussions that are
|
those of the other projects and working groups).
|
||||||
we would want to refer to over time should be sent to the mail list instead.
|
|
||||||
|
|
||||||
|
|
||||||
Bug Reports and Issue Tracking
|
Bug Reports and Issue Tracking
|
||||||
@@ -35,52 +41,116 @@ https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/issues
|
|||||||
|
|
||||||
**If you are merely asking a question ("how do I...")**, please do not file an
|
**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
|
issue, but instead ask the question on the [OSL developer mail
|
||||||
list](https://lists.aswf.io/g/osl-dev).
|
list](https://lists.aswf.io/g/osl-dev) or on the Slack channel.
|
||||||
|
|
||||||
If you are submitting a bug report, please be sure to note which version of
|
If you are submitting a bug report, please be sure to note which version of
|
||||||
OSL you are using, on what platform (OS/version, which compiler you used,
|
OSL you are using, on what platform (OS/version, which compiler you used,
|
||||||
and any special build flags or other unusual environmental issues). Please
|
and any special build flags or other unusual environmental issues). Please
|
||||||
give an account of
|
give a specific, as-detailed-as-possible account of
|
||||||
|
|
||||||
* what you tried
|
* what you tried (command line, source code example)
|
||||||
* what happened
|
* what you expected to happen
|
||||||
* what you expected to happen instead
|
* what actually happened (crash? error message? ran but didn't give the
|
||||||
|
correct result?)
|
||||||
|
|
||||||
with enough detail that others can reproduce the problem.
|
with enough detail that others can easily reproduce the problem just by
|
||||||
|
following your instructions. Please quote the exact error message you
|
||||||
|
received. If you are having trouble building, please post the full cmake
|
||||||
|
output of a fresh VERBOSE=1 build.
|
||||||
|
|
||||||
|
Suspected security vulnerabilities should be reported by the same process.
|
||||||
|
If confidentiality precludes a public question or issue for any reason, you
|
||||||
|
may contact us privately at [security@openshadinglanguage.org](mailto:security@openshadinglanguage.org).
|
||||||
|
|
||||||
|
|
||||||
|
Policy on AI Tools
|
||||||
|
------------------
|
||||||
|
|
||||||
|
Please read our [Policy on AI Coding Assistants](docs/dev/AI_Policy.md)
|
||||||
|
before contributing or participating in the project in any way mediated by
|
||||||
|
"AI" assistants.
|
||||||
|
|
||||||
|
High-level summary:
|
||||||
|
- Human must always be in the loop, and is the responsible party for
|
||||||
|
the contents of a PR (including fully understanding and being able
|
||||||
|
to explain, defend, and modify it in response to review comments).
|
||||||
|
- Interact with the project and community yourself, not by agent.
|
||||||
|
- Disclose what tools you used and how. At a minimum, we require an
|
||||||
|
"Assisted-by: TOOL/MODEL" line in the commit comments and PR description.
|
||||||
|
- Don't waste maintainer's time with low quality PRs.
|
||||||
|
|
||||||
|
Please do read the whole [Policy on AI Coding Assistants](docs/dev/AI_Policy.md)
|
||||||
|
for all the details.
|
||||||
|
|
||||||
|
The repository includes configuration for several AI coding assistants
|
||||||
|
(Claude Code, Cursor, GitHub Copilot, OpenAI Codex, Opencode). Much of this
|
||||||
|
uses symbolic links to keep a single source of truth in `AGENTS.md`. **Windows
|
||||||
|
users** must enable symlink support before cloning or the agent integrations
|
||||||
|
will silently malfunction:
|
||||||
|
|
||||||
|
1. Enable [Windows Developer Mode](https://learn.microsoft.com/en-us/windows/apps/get-started/enable-your-device-for-development)
|
||||||
|
2. `git config --global core.symlinks true`
|
||||||
|
3. Then clone (or re-clone) the repository.
|
||||||
|
|
||||||
|
The repository supports several AI coding assistants (Claude Code, Cursor,
|
||||||
|
GitHub Copilot, OpenAI Codex, Opencode). After cloning, run the setup script
|
||||||
|
for whichever tool(s) you use:
|
||||||
|
|
||||||
|
```
|
||||||
|
.agents/setup-agent claude # or: cursor, codex, opencode, copilot, all
|
||||||
|
```
|
||||||
|
|
||||||
|
See [docs/dev/Agentic_Coding.md](docs/dev/Agentic_Coding.md) for details.
|
||||||
|
|
||||||
|
|
||||||
Contributor License Agreement (CLA) and Intellectual Property
|
Contributor License Agreement (CLA) and Intellectual Property
|
||||||
-------------------------------------------------------------
|
-------------------------------------------------------------
|
||||||
|
|
||||||
To protect the project -- and the contributors! -- we do require a
|
To protect the project -- and the contributors! -- we do require a Contributor
|
||||||
Contributor License Agreement (CLA) for anybody submitting changes.
|
License Agreement (CLA) for anybody submitting changes. This is for your own
|
||||||
|
safety, as it prevents any possible future disputes between code authors and
|
||||||
|
their employers or anyone else who might think they might own the IP output of
|
||||||
|
the author.
|
||||||
|
|
||||||
* [Corporate CLA](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/ASWF/OSL-CLA-corporate.md)
|
* [Corporate CLA](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/blob/main/ASWF/CLA-corporate.md) :
|
||||||
If you are writing the code as part of your job, or if there is any
|
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
|
possibility that your employers might think they own any intellectual
|
||||||
property you create. This needs to be executed by someone who has
|
property you create. This needs to be executed by someone who has
|
||||||
signatory power for the company.
|
signatory power for the company.
|
||||||
|
|
||||||
* [Individual]((https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/ASWF/OSL-CLA-individual.md)).
|
* [Individual CLA](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/blob/main/ASWF/CLA-individual.md) :
|
||||||
If you are an individual writing the code on your own time and you're SURE
|
If you are an individual writing the code on your own time, using your own
|
||||||
you are the sole owner of any intellectual property you contribute.
|
equipment, and you're SURE you are the sole owner of any intellectual
|
||||||
|
property you contribute.
|
||||||
|
|
||||||
|
Please note that it is extremely common (nearly ubiquitous in the US and
|
||||||
|
Canada, and maybe other places) for full-time employees of technology and
|
||||||
|
entertainment companies to have IP clauses in their employment agreement (in
|
||||||
|
that pile of paperwork you sign on your first day of work and then promptly
|
||||||
|
forget about) that give the company rights to any code you write, even on your
|
||||||
|
own time. The Open Shading Language project expects you to know and follow the
|
||||||
|
rules of your employer and to have them sign a corporate CLA if necessary.
|
||||||
|
|
||||||
|
The easiest way to sign CLAs is digitally [using
|
||||||
|
EasyCLA](https://corporate.v1.easycla.lfx.linuxfoundation.org). There are
|
||||||
|
detailed step-by-step instructions about using the EasyCLA system for
|
||||||
|
[corporate CLAs](https://docs.linuxfoundation.org/lfx/easycla/v2-current/contributors/corporate-contributor)
|
||||||
|
and [individual CLAs](https://docs.linuxfoundation.org/lfx/easycla/v2-current/contributors/individual-contributor#github).
|
||||||
|
|
||||||
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
|
Companies who prefer not to use the online tools may sign, scan, and email
|
||||||
the executed copy to manager@lfprojects.org.
|
the executed copy to manager@lfprojects.org.
|
||||||
|
|
||||||
The CLA allows a company to name a "CLA Manager" (who does not need
|
The corporate 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
|
signatory power) who has the ability to use the online system to add or delete
|
||||||
delete individual employees of the company who are authorized to submit pull
|
individual employees of the company who are authorized to submit pull
|
||||||
requests, without needing to get an executive to amend and sign the
|
requests, without needing to get an executive to amend and sign the agreement
|
||||||
agreement each time.
|
each time.
|
||||||
|
|
||||||
Please note that these CLAs are based on the Apache 2.0 CLAs, and differ
|
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
|
minimally, only as much as was required to correctly describe the EasyCLA
|
||||||
process and our use of a CLA manager.
|
process and our use of a CLA manager.
|
||||||
|
|
||||||
|
**Contribution sign off**
|
||||||
** Contribution sign off
|
|
||||||
|
|
||||||
ASWF requires the use of the [Developer’s Certificate of Origin 1.1
|
ASWF requires the use of the [Developer’s Certificate of Origin 1.1
|
||||||
(DCO)](https://developercertificate.org/), which is the same mechanism that
|
(DCO)](https://developercertificate.org/), which is the same mechanism that
|
||||||
@@ -94,14 +164,90 @@ as a part of the commit message.
|
|||||||
Here is an example Signed-off-by line, which indicates that the submitter
|
Here is an example Signed-off-by line, which indicates that the submitter
|
||||||
accepts the DCO:
|
accepts the DCO:
|
||||||
|
|
||||||
`Signed-off-by: John Doe <john.doe@example.com>`
|
Signed-off-by: John Doe <john.doe@example.com>
|
||||||
|
|
||||||
You can include this automatically when you commit a change to your local
|
You can include this automatically when you commit a change to your local
|
||||||
git repository using <code>git commit -s</code>. You might also want to
|
git repository using `git commit -s`. You might also want to
|
||||||
leverage this [command line tool](https://github.com/coderanger/dco) for
|
leverage this [command line tool](https://github.com/coderanger/dco) for
|
||||||
automatically adding the signoff message on commits.
|
automatically adding the signoff message on commits.
|
||||||
|
|
||||||
|
|
||||||
|
Commit messages
|
||||||
|
---------------
|
||||||
|
|
||||||
|
### Summary heuristic
|
||||||
|
|
||||||
|
Look at the commit history of the project to get a sense of the style and
|
||||||
|
level of detail that is expected in commit messages.
|
||||||
|
|
||||||
|
### General guidelines and expectations
|
||||||
|
|
||||||
|
The first line of the commit message should be a short (less than 80
|
||||||
|
characters) summary of the change, prefixed with the general nature of the
|
||||||
|
change (see below).
|
||||||
|
|
||||||
|
The rest of the commit message should be a more detailed explanation of the
|
||||||
|
changes. Some commits are self-explanatory and don't need more than the
|
||||||
|
summary line. Others may need a more detailed explanation. Hallmarks of
|
||||||
|
a good commit message include:
|
||||||
|
|
||||||
|
* An explanation of why the change is necessary and what you hope to
|
||||||
|
accomplish with it.
|
||||||
|
* A description of any major user- or developer-facing changes that people
|
||||||
|
should be aware of: changes in APIs or behaviors, new features, etc.
|
||||||
|
* An explanation of any tricky implementation details or design decisions that
|
||||||
|
might not be immediately obvious to someone reading the code.
|
||||||
|
* Guideposts for somebody reviewing the code to understand the rationale and
|
||||||
|
have any supporting background information to fully understanding the code
|
||||||
|
changes.
|
||||||
|
|
||||||
|
Remember that at some point in the future, a developer unfamiliar with your
|
||||||
|
change (maybe you, long after you've forgotten the details) might need to
|
||||||
|
understand or fix your patch. Keep that person in mind as your audience and
|
||||||
|
strive to write a commit message that explains the context in a way that saves
|
||||||
|
them time and effort. Be the hero in the story of their future debugging
|
||||||
|
effort!
|
||||||
|
|
||||||
|
### Using "conventional commits" prefixes
|
||||||
|
|
||||||
|
We strive to follow the recommendations known as [conventional
|
||||||
|
commits](https://www.conventionalcommits.org/), which means that we would like
|
||||||
|
merged commit messages to have their first line start with one of the
|
||||||
|
following prefixes:
|
||||||
|
|
||||||
|
- `feat:` new features
|
||||||
|
- `fix:` bug fixes
|
||||||
|
- `perf:` performance improvements
|
||||||
|
- `api:` changes to the public APIs
|
||||||
|
- `int:` changes to code internals that don't affect the public API
|
||||||
|
- `build:` changes to the build system
|
||||||
|
- `test:` changes to the test suite or unit tests
|
||||||
|
- `ci:` changes to the CI system
|
||||||
|
- `docs:` changes to the documentation
|
||||||
|
- `refactor:` code refactoring
|
||||||
|
- `style:` formatting or other stylistic non-functional changes to the code
|
||||||
|
- `admin:` project administration or policy changes
|
||||||
|
- `revert:` reverting a previous commit
|
||||||
|
|
||||||
|
Obviously, some (if not most) PRs may qualify for more than one of these
|
||||||
|
categories (for example, a new feature may also introduce a new API call, add
|
||||||
|
tests, and include new documentation). If that is the case, use your best
|
||||||
|
judgment to pick the category that best captures the essence or most important
|
||||||
|
aspect of the change. When ambiguous, consider the list above to be a priority
|
||||||
|
ranking (e.g., a change that fixes a bug and adds a new test should be listed
|
||||||
|
under `fix:`, because that appears first in the list).
|
||||||
|
|
||||||
|
It is also encouraged, when it makes sense to do so, to put a subcategory in
|
||||||
|
parenthesis after the prefix, like `fix(optix):` or `feat(oslc):`. If there
|
||||||
|
is no clear single format or class that is the man focus of the patch, then
|
||||||
|
you can omit the subcategory.
|
||||||
|
|
||||||
|
API or ABI-breaking changes should additionally be marked with an exclamation
|
||||||
|
point at the end of the prefix, like `feat!:` or `api!:` to make it easily
|
||||||
|
identifiable as a breaking change from the first line of the commit message.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Pull Requests and Code Review
|
Pull Requests and Code Review
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
||||||
@@ -115,7 +261,9 @@ repository. The protocol is like this:
|
|||||||
own repository on GitHub, and then clone it to get a repository on your
|
own repository on GitHub, and then clone it to get a repository on your
|
||||||
local machine.
|
local machine.
|
||||||
|
|
||||||
2. Edit, compile, and test your changes.
|
2. Edit, compile, and test your changes. Run clang-format (see the
|
||||||
|
instructions on coding style below). Our current formatting standard,
|
||||||
|
as checked by our CI, uses clang-format 17.0.
|
||||||
|
|
||||||
3. Push your changes to your fork (each unrelated pull request to a separate
|
3. Push your changes to your fork (each unrelated pull request to a separate
|
||||||
"topic branch", please).
|
"topic branch", please).
|
||||||
@@ -127,30 +275,29 @@ component that deserves extended discussion or debate among the wider OSL
|
|||||||
community, then it may be prudent to email osl-dev pointing everybody to
|
community, then it may be prudent to email osl-dev pointing everybody to
|
||||||
the pull request URL and discussing any issues you think are important.
|
the pull request URL and discussing any issues you think are important.
|
||||||
|
|
||||||
6. The reviewer will look over the code and critique on the "comments" area,
|
6. All pull requests automatically launch CI jobs on GitHub Actions to
|
||||||
|
ensure that the build completes and that the tests suite runs correctly, for
|
||||||
|
a variety of platform, compiler, library, and flag combinations. The status
|
||||||
|
of the CI tests for your PR will be displayed on the GitHub PR page. We will
|
||||||
|
not accept PRs that don't build cleanly or pass the existing testsuite.
|
||||||
|
|
||||||
|
7. The reviewer will look over the code and critique on the "comments" area,
|
||||||
or discuss in email. Reviewers may ask for changes, explain problems they
|
or discuss in email. Reviewers may ask for changes, explain problems they
|
||||||
found, congratulate the author on a clever solution, etc. But until somebody
|
found, congratulate the author on a clever solution, etc. But until somebody
|
||||||
says "LGTM" (looks good to me), the code should not be committed. Sometimes
|
says "LGTM" (looks good to me), the code should not be committed. Sometimes
|
||||||
this takes a few rounds of give and take. Please don't take it hard if your
|
this takes a few rounds of give and take. Please don't take it hard if your
|
||||||
first try is not accepted. It happens to all of us.
|
first try is not accepted. It happens to all of us.
|
||||||
|
|
||||||
7. After approval, one of the senior developers (with commit approval to the
|
8. After approval, one of the senior developers (with commit approval to the
|
||||||
official main repository) will merge your fixes into the master branch.
|
official main repository) will merge your fixes into the main branch.
|
||||||
|
|
||||||
|
Please see the [Code Review](docs/dev/CodeReview.md) document for more
|
||||||
|
explanaton of the code review process.
|
||||||
|
|
||||||
|
|
||||||
Coding Style
|
Coding Style
|
||||||
------------
|
------------
|
||||||
|
|
||||||
There are two overarching rules:
|
|
||||||
|
|
||||||
1. When making changes, conform to the style and conventions of the surrounding code.
|
|
||||||
|
|
||||||
2. Strive for clarity, even if that means occasionally breaking the
|
|
||||||
guidelines. Use your head and ask for advice if your common sense seems to
|
|
||||||
disagree with the conventions.
|
|
||||||
|
|
||||||
Below we try to enumerate the guidelines embodied in the code.
|
|
||||||
|
|
||||||
#### File conventions
|
#### File conventions
|
||||||
|
|
||||||
C++ implementation should be named `*.cpp`. Headers should be named `.h`.
|
C++ implementation should be named `*.cpp`. Headers should be named `.h`.
|
||||||
@@ -158,128 +305,84 @@ All headers should contain
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
All source files should begin with these three lines:
|
||||||
|
|
||||||
All source files should begin with the copyright and license, which can be
|
// Copyright Contributors to the Open Shading Language project.
|
||||||
found in the [LICENSE](LICENSE) file (or cut and pasted from any other other source
|
// SPDX-License-Identifier: BSD-3-Clause
|
||||||
file). Two notes on this:
|
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||||
|
|
||||||
* For NEW source files, please change the copyright year to the present. DO
|
as a comment in the syntax of whatever source code is used in that file (for
|
||||||
NOT edit existing files only to update the copyright year, it just creates
|
example, for python or shell files, use `#` rather than `//`).
|
||||||
pointless deltas and offers no increased protection.
|
|
||||||
|
|
||||||
* Occasionally a file contains substantial code from another project
|
Occasionally a file may contain substantial code from another project and will
|
||||||
and will also list its copyright. Do NOT copy that notice to any new files,
|
also list its original copyright and license information. Do NOT alter that
|
||||||
it really only applies to the particular file in which it appears.
|
notice or copy it to any new files, it really only applies to the particular
|
||||||
|
file in which it appears.
|
||||||
|
|
||||||
#### Formatting
|
#### Formatting
|
||||||
|
|
||||||
We use clang-format to enforce formatting rules for the vast majority of the
|
We use [clang-format](https://clang.llvm.org/docs/ClangFormat.html) v17
|
||||||
code base. It is automatically run during CI and is a CI failure if the code
|
to uniformly format our source code prior to PR submission. Make sure that
|
||||||
does not conform. There are, however, parts of the code base that are not
|
clang-format is installed on your local machine, and just run
|
||||||
clang-formatted, either because we have not yet put them under the
|
|
||||||
clang-format regime, or because individual modules were deemed to be less
|
|
||||||
clear with clang-format than with hand formatting.
|
|
||||||
|
|
||||||
For non-clang-format regions of code, NEVER alter somebody else's code to
|
make clang-format
|
||||||
reformat just because you found something that violates the rules. Let the
|
|
||||||
group/author/leader know, and resist the temptation to change it yourself.
|
|
||||||
|
|
||||||
Each line of text in your code should be at most 80 characters long.
|
and it will automatically reformat your code according to the configuration
|
||||||
Exceptions are allowed for those rare cases where letting a line be longer
|
file found in the `.clang-format` file at the root directory of the OSL
|
||||||
(and wrapping on an 80-character window) is actually a better and clearer
|
source code checkout.
|
||||||
alternative than trying to split it into two lines. Sometimes this happens,
|
|
||||||
but it's extremely rare.
|
|
||||||
|
|
||||||
Indent 4 spaces at a time, and use actual spaces, not tabs. For files that
|
One of the CI test matrix entries runs clang-format and fails if any
|
||||||
must use tabs for some reason, tabs should always be on 8's. Most editors
|
diffs were generated (that is, if any of your code did not 100% conform to
|
||||||
have a setting that forces indentations to be spaces. With emacs, you can do
|
the `.clang-format` formatting configuration). If it fails, clicking on that
|
||||||
this:
|
test log will show you the diffs generated, so that you can easily correct
|
||||||
|
it on your end and update the PR with the formatting fixes.
|
||||||
|
|
||||||
(setq c-default-style "bsd")
|
If you don't have clang-format set up on your machine, and your patch is not
|
||||||
(setq-default indent-tabs-mode nil)
|
very long, you may find that it's more convenient to just submit it and hope
|
||||||
|
for the best, and if it doesn't pass the CI test, look at the diffs in the log
|
||||||
|
for the "clang-format" CI run and make the corrections by hand and then submit
|
||||||
|
an update to the patch (i.e. relying on CI to run clang-format for you).
|
||||||
|
|
||||||
Opening brace on the same line as the condition or loop.
|
Because the basic formatting is automated by clang-format, we won't
|
||||||
|
enumerate the rules here.
|
||||||
|
|
||||||
One statement per line, except in rare cases where violating this rule makes
|
For the occasional non-clang-format regions of code, NEVER alter somebody
|
||||||
the code more clear.
|
else's code to reformat just because you found something that violates the
|
||||||
|
rules. Let the group/author/leader know, and resist the temptation to change
|
||||||
|
it yourself.
|
||||||
|
|
||||||
Three (3) consecutive empty lines between function or class method
|
Each line of text in your code, including comments, should be at most 80
|
||||||
implementations, one blank line between method declarations within a class
|
characters long. Exceptions are allowed for those rare cases where letting a
|
||||||
definition. Put a single blank line within a function if it helps to
|
line be longer (and wrapping on an 80-character window) is actually a better
|
||||||
visually separate different sequential tasks. Don't put multiple blank lines
|
and clearer alternative than trying to split it into two lines. Sometimes this
|
||||||
in a row within a function, or blank lines right after an opening brace or
|
happens, but it's extremely rare.
|
||||||
right before a closing brace. The goal is to use just enough white space to
|
|
||||||
help developers visually parse the code (for example, spotting at a glance
|
|
||||||
where new functions begin), but not so much as to spread it out or be
|
|
||||||
confusing.
|
|
||||||
|
|
||||||
For if, for, while, etc., put a space before the paren, but NOT inside the parens. For example:
|
We prefer three (3) consecutive empty lines between freestanding functions or
|
||||||
|
class definitions, one blank line between method declarations within a class
|
||||||
|
definition. Put a single blank line within a function if it helps to visually
|
||||||
|
separate different sequential tasks, but don't put multiple blank lines in a
|
||||||
|
row within a function, or blank lines right after an opening brace or right
|
||||||
|
before a closing brace. The goal is to use just enough white space to help
|
||||||
|
developers visually parse the code (for example, spotting at a glance where
|
||||||
|
new functions begin), but not so much as to spread it out or be confusing.
|
||||||
|
|
||||||
if (foo) // Yes
|
|
||||||
|
|
||||||
if(foo) // No
|
|
||||||
if ( foo ) // No
|
|
||||||
|
|
||||||
Function calls should have a space between the function name and the opening
|
|
||||||
parenthesis, NO space inside the parenthesis, except for a single blank
|
|
||||||
space between each argument. For example:
|
|
||||||
|
|
||||||
x = foo(a, b); // Yes
|
|
||||||
|
|
||||||
x = foo ( a, b ); // No
|
|
||||||
x = foo (a,b); // No
|
|
||||||
|
|
||||||
Function declarations: function names should begin at column 0 for a full
|
|
||||||
function definition. (It's ok to violate this rule for very short inline
|
|
||||||
functions within class definitions.)
|
|
||||||
|
|
||||||
|
|
||||||
Here is a short code fragment that shows some of these rules in action:
|
|
||||||
|
|
||||||
static int
|
|
||||||
function(int a, int b)
|
|
||||||
{
|
|
||||||
int x = a + b;
|
|
||||||
if (a == 0 || b == 0) {
|
|
||||||
x += 1;
|
|
||||||
x *= 4;
|
|
||||||
} else {
|
|
||||||
x -= 3;
|
|
||||||
}
|
|
||||||
for (int i = 0; i < 3; ++i) {
|
|
||||||
x += a * i;
|
|
||||||
x *= foo(i); // function call
|
|
||||||
}
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
|
|
||||||
Don't ever reformat, re-indent, change whitespace, or make any other such
|
|
||||||
changes to working code. If you're adding just a few lines or fixing a bug
|
|
||||||
in existing code, stick to the style of the surrounding code. In very rare
|
|
||||||
circumstances, and with consensus of the group, reformatting is sometimes
|
|
||||||
helpful to improve code readability, but it should be done as a separate
|
|
||||||
formatting-only checkin.
|
|
||||||
|
|
||||||
#### Identifiers
|
#### Identifiers
|
||||||
|
|
||||||
In general, classes and templates should start with upper case and capitalize new words:
|
In general, classes and templates should start with upper case and
|
||||||
|
capitalize new words: `class CustomerList;` In general, local variables
|
||||||
class CustomerList;
|
should start with lower case. Macros should be `ALL_CAPS`, if used at all.
|
||||||
|
|
||||||
In general, local variables should start with lower case.
|
|
||||||
|
|
||||||
If your class is extremely similar to, or modeled after, something in the
|
If your class is extremely similar to, or modeled after, something in the
|
||||||
standard library, Boost, or something else we interoperate with, it's ok to
|
standard library, or something else we interoperate with, it's ok to
|
||||||
use their naming conventions. For example, very general utility classes and
|
use their naming conventions. For example, very general utility classes and
|
||||||
templates (the kind of thing you would normally find in std or boost) should
|
templates (the kind of thing you would normally find in std) should
|
||||||
be lower case with underscores separating words, as they would be if they
|
be lower case with underscores separating words, as they would be if they
|
||||||
were standards.
|
were standards.
|
||||||
|
|
||||||
template <class T> shared_ptr;
|
template <class T> shared_ptr;
|
||||||
class scoped_mutex;
|
class scoped_mutex;
|
||||||
|
|
||||||
Macros should be ALL_CAPS, if used at all.
|
|
||||||
|
|
||||||
Names of data should generally be nouns. Functions/methods are trickier: a
|
Names of data should generally be nouns. Functions/methods are trickier: a
|
||||||
the name of a function that returns a value but has no side effects should
|
the name of a function that returns a value but has no side effects should
|
||||||
be a noun, but a procedure that performs an action should be a verb.
|
be a noun, but a procedure that performs an action should be a verb.
|
||||||
@@ -306,11 +409,11 @@ Namespaces: yes, use them!
|
|||||||
|
|
||||||
#### Third-party libraries
|
#### Third-party libraries
|
||||||
|
|
||||||
Prefer C++11 `std` rather than Boost or other third party libraries, where
|
Prefer C++17 `std` rather than other third party libraries, where
|
||||||
both can do the same task.
|
both can do the same task.
|
||||||
|
|
||||||
If you see a third party library 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
|
Imath, or LLVM), feel free to any of its public features in OSL
|
||||||
internals (provided those features are present in the minimum version of
|
internals (provided those features are present in the minimum version of
|
||||||
that library that we support).
|
that library that we support).
|
||||||
|
|
||||||
@@ -334,9 +437,6 @@ protected members of classes), please use Doxygen-style comments. They looks
|
|||||||
like this:
|
like this:
|
||||||
|
|
||||||
/// Explanation of a class. Note THREE slashes!
|
/// Explanation of a class. Note THREE slashes!
|
||||||
/// Also, you need at least two lines like this. If you don't have enough
|
|
||||||
/// for two lines, make one line blank like this:
|
|
||||||
///
|
|
||||||
class myclass {
|
class myclass {
|
||||||
....
|
....
|
||||||
float foo; ///< Doxygen comments on same line look like this
|
float foo; ///< Doxygen comments on same line look like this
|
||||||
|
|||||||
@@ -20,21 +20,24 @@ guidance.
|
|||||||
The OSL project grows and thrives from assistance from Contributors.
|
The OSL project grows and thrives from assistance from Contributors.
|
||||||
Contributors include anyone in the community who contributes code,
|
Contributors include anyone in the community who contributes code,
|
||||||
documentation, or other technical artifacts that have been incorporated into
|
documentation, or other technical artifacts that have been incorporated into
|
||||||
the projects repository.
|
the project repository.
|
||||||
|
|
||||||
Anyone can be a Contributor. You need no formal approval from the project,
|
Anyone can be a Contributor. You need no formal approval from the project,
|
||||||
beyond the legal forms.
|
beyond the legal forms.
|
||||||
|
|
||||||
### How to Become a Contributor
|
### How to Become a Contributor
|
||||||
|
|
||||||
* Review the coding standards to ensure your contribution is in line
|
* Review the coding standards and [contributing guidelines](CONTRIBUTING.md)
|
||||||
with the project's coding and styling guidelines.
|
to ensure your contribution is in line with the project's coding and styling
|
||||||
|
guidelines.
|
||||||
|
|
||||||
* Sign the Individual CLA, or if you are employed by an organization that
|
* Sign the Individual CLA, or if you are employed by an organization that
|
||||||
might have any claim to IP you create, have your organization sign the
|
might have any claim to IP you create, have your organization sign the
|
||||||
Corporate CLA.
|
Corporate CLA.
|
||||||
|
|
||||||
* Submit your code as a PR with the appropriate DCO sign-off.
|
* Submit your code as a PR with the appropriate DCO sign-off on each commit.
|
||||||
|
The easiest way to do this is to ensure that you commit your code with `git
|
||||||
|
commit -s`.
|
||||||
|
|
||||||
## Committers
|
## Committers
|
||||||
|
|
||||||
@@ -75,9 +78,10 @@ request that the TSC restore them to active Committer status.
|
|||||||
|
|
||||||
## Technical Steering Committee
|
## Technical Steering Committee
|
||||||
|
|
||||||
The Technical Steering Committee (TSC) has final authority over this
|
The Technical Steering Committee (TSC) has final authority over this project.
|
||||||
project. As defined in the project charter, TSC responsibilities include,
|
As defined in the project [technical charter](https://github.com/AcademySoftwareFoundation/foundation/blob/main/project_charters/open-shading-language_charter.md),
|
||||||
but are not limited to:
|
in addition to committer activities, TSC responsibilities also include, but
|
||||||
|
are not limited to:
|
||||||
|
|
||||||
* Coordinating technical direction of the Project.
|
* Coordinating technical direction of the Project.
|
||||||
|
|
||||||
@@ -134,10 +138,10 @@ Current voting members of the TSC are:
|
|||||||
* Eric Enderton - NVIDIA
|
* Eric Enderton - NVIDIA
|
||||||
* Stephen Friedman - Pixar
|
* Stephen Friedman - Pixar
|
||||||
* Nicolas Guiard - Isotropix
|
* Nicolas Guiard - Isotropix
|
||||||
* Clint Hanson - DNEG
|
* Thiago Ize - Autodesk
|
||||||
* Adrien Herubel - Autodesk
|
* Lee Kerley - Apple
|
||||||
* Lee Kerley - Sony Pictures Imageworks
|
|
||||||
* Mitch Prater - Laika
|
* Mitch Prater - Laika
|
||||||
|
* Alexey Smolenchuk - DNEG
|
||||||
* Brecht Van Lommel - Blender
|
* Brecht Van Lommel - Blender
|
||||||
* Alex Wells - Intel
|
* Alex Wells - Intel
|
||||||
|
|
||||||
@@ -179,6 +183,9 @@ her absence. Meetings may also be streamed online where appropriate;
|
|||||||
connection details will be posted to the osl-dev mail list in advance of the
|
connection details will be posted to the osl-dev mail list in advance of the
|
||||||
scheduled meeting.
|
scheduled meeting.
|
||||||
|
|
||||||
|
The biweekly TSC meetings can be found on the [ASWF Calendar](https://calendar.openshadinglanguage.org),
|
||||||
|
just click on the OSL TSC meeting entries to get the Zoom link.
|
||||||
|
|
||||||
Items are added to the TSC agenda which are considered contentious or are
|
Items are added to the TSC agenda which are considered contentious or are
|
||||||
modifications of governance, contribution policy, TSC membership, or release
|
modifications of governance, contribution policy, TSC membership, or release
|
||||||
process, in addition to topics involving the high-level technical direction
|
process, in addition to topics involving the high-level technical direction
|
||||||
@@ -202,9 +209,11 @@ The TSC may invite additional persons to participate in a non-voting
|
|||||||
capacity.
|
capacity.
|
||||||
|
|
||||||
The meeting chair is responsible for ensuring that minutes are taken and
|
The meeting chair is responsible for ensuring that minutes are taken and
|
||||||
archived in the project repository.
|
archived.
|
||||||
|
|
||||||
Due to the challenges of scheduling a global meeting with participants in
|
Due to the challenges of scheduling a global meeting with participants in
|
||||||
several time zones, the TSC will seek to resolve as many agenda items as
|
several time zones, the TSC will seek to resolve as many agenda items as
|
||||||
possible outside of meetings on the public mailing list.
|
possible outside of meetings on the public mailing list or through GitHub
|
||||||
|
issues, discussions, and pull requests.
|
||||||
|
|
||||||
|
Meeting notes (usually very brief) can be found at: https://docs.google.com/document/d/1yf0bG6eoE2EvKZBNZX3nskdTvu99ADTDTNOknCDJd1I
|
||||||
|
|||||||
@@ -4,24 +4,32 @@
|
|||||||
Building OSL
|
Building OSL
|
||||||
============
|
============
|
||||||
|
|
||||||
OSL currently compiles and runs cleanly on Linux, Mac OS X, and Windows.
|
OSL currently compiles and runs cleanly on Linux (x86_64), Mac OS X (x86_64
|
||||||
|
and aarch64), and Windows (x86_64). It may build and run on other platforms as
|
||||||
|
well, but we don't officially support or test other than these platforms.
|
||||||
|
|
||||||
|
Shader execution is supported on the native architectures of those x86_64 and
|
||||||
|
aarch64 platforms, a special batched 4-, 8- or 16-wide SIMD execution mode
|
||||||
|
requiring x86_64 with SSE2, AVX/AVX2 or AVX-512 instructions, as well as on
|
||||||
|
NVIDIA GPUs using Cuda+OptiX.
|
||||||
|
|
||||||
Dependencies
|
Dependencies
|
||||||
------------
|
------------
|
||||||
|
|
||||||
OSL requires the following dependencies or tools.
|
OSL requires the following dependencies or tools.
|
||||||
NEW or CHANGED dependencies since the last major release are **bold**.
|
NEW or CHANGED minimum dependencies since the last major release are **bold**.
|
||||||
|
|
||||||
* Build system: [CMake](https://cmake.org/) 3.12 or newer (tested through 3.24)
|
* Build system: [CMake](https://cmake.org/) 3.19 or newer (tested
|
||||||
|
through 4.2)
|
||||||
|
|
||||||
* A suitable C++14 or C++17 compiler to build OSL itself, which may be any of:
|
* A suitable C++17 compiler to build OSL itself, which may be any of:
|
||||||
- GCC 6.1 or newer (tested through gcc 12.1)
|
- GCC 9.3 or newer (tested through gcc 14)
|
||||||
- Clang 3.4 or newer (tested through clang 15)
|
- Clang 5 or newer (tested through clang 22)
|
||||||
- Microsoft Visual Studio 2017 or newer
|
- Microsoft Visual Studio 2017 or newer
|
||||||
- Intel C++ compiler icc version 17 or newer or LLVM-based icx compiler
|
- **Intel LLVM-based icx compiler version 2022 or newer** (note: the classic `icc` compiler is no longer supported).
|
||||||
version 2022 or newer.
|
|
||||||
|
|
||||||
* **[OpenImageIO](http://openimageio.org) 2.3 or newer** (tested through 2.4)
|
* [OpenImageIO](http://openimageio.org) 3.0 or newer (tested through 3.1
|
||||||
|
and main)
|
||||||
|
|
||||||
OSL uses OIIO both for its texture mapping functionality as well as
|
OSL uses OIIO both for its texture mapping functionality as well as
|
||||||
numerous utility classes. If you are integrating OSL into an existing
|
numerous utility classes. If you are integrating OSL into an existing
|
||||||
@@ -35,37 +43,36 @@ NEW or CHANGED dependencies since the last major release are **bold**.
|
|||||||
|
|
||||||
After building OpenImageIO, if you don't have it installed in a
|
After building OpenImageIO, if you don't have it installed in a
|
||||||
"standard" place (like /usr/include), you should set the environment
|
"standard" place (like /usr/include), you should set the environment
|
||||||
variable $OpenImageIO_ROOT to point to the compiled distribution, and
|
variable `$OpenImageIO_ROOT` to point to the compiled distribution, and
|
||||||
then OSL's build scripts will be able to find it. You should also have
|
then OSL's build scripts will be able to find it. You should also have
|
||||||
$OpenImageIO_ROOT/lib to be in your LD_LIBRARY_PATH (or
|
$OpenImageIO_ROOT/lib to be in your LD_LIBRARY_PATH (or
|
||||||
DYLD_LIBRARY_PATH on OS X).
|
DYLD_LIBRARY_PATH on OS X).
|
||||||
|
|
||||||
* [LLVM](http://www.llvm.org) 9, 10, 11, 12, 13, 14, or 15, including
|
* [LLVM](http://www.llvm.org) **14.0 or newer**, 15, 16, 17, 18, 19, 20, 21,
|
||||||
clang libraries.
|
22, including clang libraries.
|
||||||
|
|
||||||
* (optional) For GPU rendering on NVIDIA GPUs:
|
* (optional) For GPU rendering on NVIDIA GPUs:
|
||||||
* [OptiX](https://developer.nvidia.com/rtx/ray-tracing/optix) 7.0 or higher.
|
* [OptiX](https://developer.nvidia.com/rtx/ray-tracing/optix) 7.0 or higher.
|
||||||
* [Cuda](https://developer.nvidia.com/cuda-downloads) 8.0 or higher.
|
* [Cuda](https://developer.nvidia.com/cuda-downloads) 9.0 or higher. It is
|
||||||
|
recommended that you use 11.0 or higher.
|
||||||
|
|
||||||
* [Boost](https://www.boost.org) 1.55 or newer (tested through boost 1.80)
|
* [Imath](https://github.com/AcademySoftwareFoundation/Imath) 3.1 or newer.
|
||||||
* [Ilmbase or Imath](https://github.com/AcademySoftwareFoundation/openexr) 2.3
|
|
||||||
or newer (recommended: 2.4 or higher; tested through 3.1)
|
|
||||||
* [Flex](https://github.com/westes/flex) 2.5.35 or newer and
|
* [Flex](https://github.com/westes/flex) 2.5.35 or newer and
|
||||||
[GNU Bison](https://www.gnu.org/software/bison/) 2.7 or newer.
|
[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
|
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
|
old, and it's better to install a newer Bison (via Homebrew is one way to
|
||||||
do this easily).
|
do this easily).
|
||||||
* [PugiXML](http://pugixml.org/)
|
* [PugiXML](http://pugixml.org/) >= 1.8 (we have tested through 1.15).
|
||||||
* (optional) [Partio](https://www.disneyanimation.com/technology/partio.html)
|
* (optional) [Partio](https://www.disneyanimation.com/technology/partio.html)
|
||||||
If it is not found at build time, the OSL `pointcloud` functions will not
|
If it is not found at build time, the OSL `pointcloud` functions will not
|
||||||
be operative.
|
be operative.
|
||||||
* (optional) Python: If you are building the Python bindings or running the
|
* (optional) Python: If you are building the Python bindings or running the
|
||||||
testsuite:
|
testsuite:
|
||||||
* Python >= 2.7 (tested against 2.7, 3.7, 3.8, 3.9, 3.10)
|
* **Python >= 3.9** (tested through 3.14)
|
||||||
* pybind11 >= 2.4.2 (Tested through 2.10)
|
* pybind11 >= 2.7 (tested through 3.0)
|
||||||
* NumPy
|
* NumPy (tested through 2.4)
|
||||||
* (optional) Qt >= 5.6 (tested through 5.15). If not found at build time,
|
* (optional) Qt5 >= 5.6 or Qt6 (tested Qt5 through 5.15 and Qt6 through 6.10).
|
||||||
the `osltoy` application will be disabled.
|
If not found at build time, the `osltoy` application will be disabled.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -87,20 +94,27 @@ Here are the steps to check out, build, and test the OSL distribution:
|
|||||||
|
|
||||||
Note: OSL uses 'CMake' for its cross-platform build system. But for
|
Note: OSL uses 'CMake' for its cross-platform build system. But for
|
||||||
simplicity, we have made a "make wrapper" around it, so that by just
|
simplicity, we have made a "make wrapper" around it, so that by just
|
||||||
typing 'make' everything will build. Type 'make help' for other
|
typing 'make' everything will build. Type 'make help' for other
|
||||||
options, and note that 'make nuke' will blow everything away for the
|
options, and note that 'make nuke' will blow everything away for the
|
||||||
freshest possible compile.
|
freshest possible compile.
|
||||||
|
|
||||||
NOTE: If the build breaks due to compiler warnings which have been
|
You can also ignore the top level Makefile wrapper, and instead use
|
||||||
elevated to errors, you can try "make clean" followed by
|
CMake directly:
|
||||||
"make STOP_ON_WARNING=0", that create a build that will only stop for
|
|
||||||
|
cmake -B build -S .
|
||||||
|
cmake --build build --target install
|
||||||
|
|
||||||
|
NOTE: If the build breaks due to compiler warnings which have been elevated
|
||||||
|
to errors, you can try "make clean" followed by "make STOP_ON_WARNING=0",
|
||||||
|
or if using cmake directly, add `-DSTOP_ON_WARNING=0` to the cmake
|
||||||
|
configuration command. That will create a build that will only stop for
|
||||||
full errors, not warnings.
|
full errors, not warnings.
|
||||||
|
|
||||||
4. After compilation, you'll end up with a full OSL distribution in
|
4. After compilation, you'll end up with a full OSL distribution in
|
||||||
dist/
|
dist/
|
||||||
|
|
||||||
5. Add the "dist/bin" to your $PATH, and "dist/lib" to your
|
5. Add the "dist/bin" to your `$PATH`, and "dist/lib" to your
|
||||||
$LD_LIBRAY_PATH (or $DYLD_LIBRARY_PATH on MacOS), or copy the contents
|
`$LD_LIBRARY_PATH` (or `$DYLD_LIBRARY_PATH` on MacOS), or copy the contents
|
||||||
of those files to appropriate directories. Public include files
|
of those files to appropriate directories. Public include files
|
||||||
(those needed when building applications that incorporate OSL)
|
(those needed when building applications that incorporate OSL)
|
||||||
can be found in "dist/include", and documentation can be found
|
can be found in "dist/include", and documentation can be found
|
||||||
@@ -110,7 +124,32 @@ Here are the steps to check out, build, and test the OSL distribution:
|
|||||||
test suite with:
|
test suite with:
|
||||||
|
|
||||||
make test
|
make test
|
||||||
|
|
||||||
|
Conda Environment
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
To simplify installation of Python and other dependencies, you can use
|
||||||
|
the provided Conda environment setup script located at `src/build-scripts/`
|
||||||
|
by running:
|
||||||
|
|
||||||
|
source src/build-scripts/configure_conda_env.bash
|
||||||
|
|
||||||
|
**This script will:**
|
||||||
|
* Check for Miniconda installation.
|
||||||
|
* Create a Conda environment named `osl-env` if it doesn't exist.
|
||||||
|
* Install all required dependencies into the environment.
|
||||||
|
* Activate the environment for the current shell session.
|
||||||
|
|
||||||
|
After running this script, the `osl-env` environment will be created, and
|
||||||
|
all you need to do when opening a new shell session is simply activate the
|
||||||
|
Conda environment.
|
||||||
|
|
||||||
|
**When to use it:**
|
||||||
|
Run this script after cloning the repository and before building OSL. It
|
||||||
|
sets up a consistent development environment without manually installing
|
||||||
|
all dependencies. If you already have all required dependencies installed,
|
||||||
|
running it is optional.
|
||||||
|
|
||||||
Troubleshooting
|
Troubleshooting
|
||||||
----------------
|
----------------
|
||||||
|
|
||||||
|
|||||||
@@ -19,9 +19,6 @@
|
|||||||
|
|
||||||
working_dir := ${shell pwd}
|
working_dir := ${shell pwd}
|
||||||
|
|
||||||
# Figure out which architecture we're on
|
|
||||||
include ${working_dir}/src/make/detectplatform.mk
|
|
||||||
|
|
||||||
MY_MAKE_FLAGS ?=
|
MY_MAKE_FLAGS ?=
|
||||||
MY_NINJA_FLAGS ?=
|
MY_NINJA_FLAGS ?=
|
||||||
MY_CMAKE_FLAGS ?=
|
MY_CMAKE_FLAGS ?=
|
||||||
@@ -29,15 +26,6 @@ BUILDSENTINEL ?= Makefile
|
|||||||
NINJA ?= ninja
|
NINJA ?= ninja
|
||||||
CMAKE ?= cmake
|
CMAKE ?= cmake
|
||||||
CMAKE_BUILD_TYPE ?= Release
|
CMAKE_BUILD_TYPE ?= Release
|
||||||
|
|
||||||
# Site-specific build instructions
|
|
||||||
OSL_SITE ?= ${shell uname -n}
|
|
||||||
ifneq (${shell echo ${OSL_SITE} | grep imageworks.com},)
|
|
||||||
include ${working_dir}/site/spi/Makefile-bits
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Set up variables holding the names of platform-dependent directories --
|
|
||||||
# set these after evaluating site-specific instructions
|
|
||||||
build_dir ?= build
|
build_dir ?= build
|
||||||
dist_dir ?= dist
|
dist_dir ?= dist
|
||||||
|
|
||||||
@@ -46,12 +34,11 @@ INSTALL_PREFIX ?= ${working_dir}/${dist_dir}
|
|||||||
VERBOSE ?= ${SHOWCOMMANDS}
|
VERBOSE ?= ${SHOWCOMMANDS}
|
||||||
ifneq (${VERBOSE},)
|
ifneq (${VERBOSE},)
|
||||||
MY_MAKE_FLAGS += VERBOSE=${VERBOSE}
|
MY_MAKE_FLAGS += VERBOSE=${VERBOSE}
|
||||||
MY_CMAKE_FLAGS += -DVERBOSE:BOOL=${VERBOSE}
|
MY_CMAKE_FLAGS += -DVERBOSE:BOOL=${VERBOSE} --log-level=VERBOSE
|
||||||
ifneq (${VERBOSE},0)
|
ifneq (${VERBOSE},0)
|
||||||
MY_NINJA_FLAGS += -v
|
MY_NINJA_FLAGS += -v
|
||||||
TEST_FLAGS += -V
|
TEST_FLAGS += -V
|
||||||
endif
|
endif
|
||||||
$(info OSL_SITE = ${OSL_SITE})
|
|
||||||
$(info dist_dir = ${dist_dir})
|
$(info dist_dir = ${dist_dir})
|
||||||
$(info INSTALL_PREFIX = ${INSTALL_PREFIX})
|
$(info INSTALL_PREFIX = ${INSTALL_PREFIX})
|
||||||
endif
|
endif
|
||||||
@@ -152,10 +139,6 @@ ifneq (${USE_SIMD},)
|
|||||||
MY_CMAKE_FLAGS += -DUSE_SIMD:STRING="${USE_SIMD}"
|
MY_CMAKE_FLAGS += -DUSE_SIMD:STRING="${USE_SIMD}"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq (${USE_BATCHED},)
|
|
||||||
MY_CMAKE_FLAGS += -DUSE_BATCHED:STRING="${USE_BATCHED}"
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifneq (${VEC_REPORT},)
|
ifneq (${VEC_REPORT},)
|
||||||
MY_CMAKE_FLAGS += -DVEC_REPORT:BOOL="${VEC_REPORT}"
|
MY_CMAKE_FLAGS += -DVEC_REPORT:BOOL="${VEC_REPORT}"
|
||||||
endif
|
endif
|
||||||
@@ -209,7 +192,10 @@ ifneq (${BUILD_MISSING_DEPS},)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq (${USE_OPTIX},)
|
ifneq (${USE_OPTIX},)
|
||||||
MY_CMAKE_FLAGS += -DUSE_OPTIX:BOOL=${USE_OPTIX}
|
MY_CMAKE_FLAGS += -DOSL_USE_OPTIX:BOOL=${USE_OPTIX}
|
||||||
|
endif
|
||||||
|
ifneq (${OSL_USE_OPTIX},)
|
||||||
|
MY_CMAKE_FLAGS += -DOSL_USE_OPTIX:BOOL=${OSL_USE_OPTIX}
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq (${USE_PYTHON},)
|
ifneq (${USE_PYTHON},)
|
||||||
@@ -220,14 +206,6 @@ ifneq (${PYTHON_VERSION},)
|
|||||||
MY_CMAKE_FLAGS += -DPYTHON_VERSION:STRING=${PYTHON_VERSION}
|
MY_CMAKE_FLAGS += -DPYTHON_VERSION:STRING=${PYTHON_VERSION}
|
||||||
endif
|
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_CMAKE_FLAGS = ${MY_CMAKE_FLAGS})
|
||||||
#$(info MY_MAKE_FLAGS = ${MY_MAKE_FLAGS})
|
#$(info MY_MAKE_FLAGS = ${MY_MAKE_FLAGS})
|
||||||
@@ -358,9 +336,8 @@ help:
|
|||||||
@echo " C++ compiler and build process:"
|
@echo " C++ compiler and build process:"
|
||||||
@echo " VERBOSE=1 Show all compilation commands"
|
@echo " VERBOSE=1 Show all compilation commands"
|
||||||
@echo " STOP_ON_WARNING=0 Do not stop building if compiler warns"
|
@echo " STOP_ON_WARNING=0 Do not stop building if compiler warns"
|
||||||
@echo " OSL_SITE=xx Use custom site build mods"
|
|
||||||
@echo " MYCC=xx MYCXX=yy Use custom compilers"
|
@echo " MYCC=xx MYCXX=yy Use custom compilers"
|
||||||
@echo " CMAKE_CXX_STANDARD=14 C++ standard to build with (default is 14)"
|
@echo " CMAKE_CXX_STANDARD=17 C++ standard to build with (default is 17)"
|
||||||
@echo " USE_LIBCPLUSPLUS=1 For clang, use libc++"
|
@echo " USE_LIBCPLUSPLUS=1 For clang, use libc++"
|
||||||
@echo " GLIBCXX_USE_CXX11_ABI=1 For gcc, use the new string ABI"
|
@echo " GLIBCXX_USE_CXX11_ABI=1 For gcc, use the new string ABI"
|
||||||
@echo " EXTRA_CPP_ARGS= Additional args to the C++ command"
|
@echo " EXTRA_CPP_ARGS= Additional args to the C++ command"
|
||||||
@@ -380,10 +357,9 @@ help:
|
|||||||
@echo " if found. And you can hint where to find it with Foo_ROOT=path"
|
@echo " if found. And you can hint where to find it with Foo_ROOT=path"
|
||||||
@echo " Note that it is case sensitive!"
|
@echo " Note that it is case sensitive!"
|
||||||
@echo " Finding and Using Dependencies:"
|
@echo " Finding and Using Dependencies:"
|
||||||
@echo " BOOST_ROOT=path Custom Boost installation"
|
|
||||||
@echo " USE_QT=0 Skip anything that needs Qt"
|
@echo " USE_QT=0 Skip anything that needs Qt"
|
||||||
@echo " LLVM-related options:"
|
@echo " LLVM-related options:"
|
||||||
@echo " LLVM_VERSION=12.0 Specify which LLVM version to use"
|
@echo " LLVM_VERSION=19.0 Specify which LLVM version to use"
|
||||||
@echo " LLVM_DIRECTORY=xx Specify where LLVM lives"
|
@echo " LLVM_DIRECTORY=xx Specify where LLVM lives"
|
||||||
@echo " LLVM_NAMESPACE=xx Specify custom LLVM namespace"
|
@echo " LLVM_NAMESPACE=xx Specify custom LLVM namespace"
|
||||||
@echo " LLVM_STATIC=1 Use static LLVM libraries"
|
@echo " LLVM_STATIC=1 Use static LLVM libraries"
|
||||||
@@ -397,9 +373,9 @@ help:
|
|||||||
@echo " USE_SIMD=arch Build with SIMD support (comma-separated choices:"
|
@echo " USE_SIMD=arch Build with SIMD support (comma-separated choices:"
|
||||||
@echo " 0, sse2, sse3, ssse3, sse4.1, sse4.2, f16c,"
|
@echo " 0, sse2, sse3, ssse3, sse4.1, sse4.2, f16c,"
|
||||||
@echo " avx, avx2, avx512f)"
|
@echo " avx, avx2, avx512f)"
|
||||||
@echo " USE_OPTIX=1 Build the OptiX test renderer"
|
@echo " OSL_USE_OPTIX=1 Build the OptiX test renderer"
|
||||||
@echo " USE_BATCHED=targets Build batched SIMD execution of shaders for (comma-separated choices:"
|
@echo " USE_BATCHED=targets Build batched SIMD execution of shaders for (comma-separated choices:"
|
||||||
@echo " 0, b8_AVX, b8_AVX2, b8_AVX2_noFMA,"
|
@echo " 0, b4_SSE2, b8_AVX, b8_AVX2, b8_AVX2_noFMA,"
|
||||||
@echo " b8_AVX512, b8_AVX512_noFMA,"
|
@echo " b8_AVX512, b8_AVX512_noFMA,"
|
||||||
@echo " b16_AVX512, b16_AVX512_noFMA)"
|
@echo " b16_AVX512, b16_AVX512_noFMA)"
|
||||||
@echo " VEC_REPORT=0 Generate compiler vectorization reports"
|
@echo " VEC_REPORT=0 Generate compiler vectorization reports"
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
<div align="center">
|
<div align="center">
|
||||||
<img src="https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/blob/main/src/doc/Figures/osl-short.png" width=256 height=128>
|
<img src="ASWF/logos/openshadinglanguage-stacked-Shaded.png">
|
||||||
|
|
||||||
<H1>Open Shading Language</H1>
|
<!-- <H1>Open Shading Language</H1> -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
[](https://www.youtube.com/watch?v=nmwMz1YnGPA "Open Shading Language Reel 2020")
|
[](https://www.youtube.com/watch?v=nmwMz1YnGPA "Open Shading Language Reel 2020")
|
||||||
|
|
||||||
[](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/actions)
|
[](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/actions)
|
||||||
[](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/LICENSE.md)
|
[](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/blob/main/LICENSE.md)
|
||||||
[](https://bestpractices.coreinfrastructure.org/projects/3061)
|
[](https://bestpractices.coreinfrastructure.org/projects/3061)
|
||||||
|
[](https://open-shading-language.readthedocs.io/en/main/?badge=main)
|
||||||
|
|
||||||
|
|
||||||
Introduction
|
Introduction
|
||||||
@@ -219,14 +219,15 @@ inferred from public sources, or that we've been told is ok to list here. If
|
|||||||
an OSL-using project is missing and it's not a secret, just email the OSL
|
an OSL-using project is missing and it's not a secret, just email the OSL
|
||||||
project leader or submit a PR with edits to this file.*
|
project leader or submit a PR with edits to this file.*
|
||||||
|
|
||||||
Renderers and other tools with OSL support (in approximate order of
|
### Renderers and other production tools with OSL support
|
||||||
adding OSL support):
|
|
||||||
* Sony Pictures Imageworks: in-house "Arnold" renderer
|
(In approximate order of adding OSL support)
|
||||||
|
|
||||||
|
* [Sony Pictures Imageworks: in-house "Arnold" renderer](https://dl.acm.org/doi/10.1145/3180495)
|
||||||
* [Blender/Cycles](https://docs.blender.org/manual/en/dev/render/shader_nodes/osl.html)
|
* [Blender/Cycles](https://docs.blender.org/manual/en/dev/render/shader_nodes/osl.html)
|
||||||
* [Chaos Group: V-Ray](https://www.chaosgroup.com/)
|
* [Chaos Group: V-Ray](https://www.chaosgroup.com/)
|
||||||
* [Pixar: PhotoRealistic RenderMan RIS](https://renderman.pixar.com)
|
* [Pixar: PhotoRealistic RenderMan RIS](https://renderman.pixar.com)
|
||||||
* [Isotropix: Clarisse](http://www.isotropix.com/clarisse)
|
* Isotropix: [Clarisse iFX](https://www.isotropix.com/products/clarisse/ifx) / [Clarisse BUiLDER](https://www.isotropix.com/products/clarisse/builder) / [Angie](https://www.isotropix.com/products/angie)
|
||||||
* [Isotropix: Angie](http://www.isotropix.com/angie)
|
|
||||||
* [Autodesk Beast](http://www.autodesk.com/products/beast/overview)
|
* [Autodesk Beast](http://www.autodesk.com/products/beast/overview)
|
||||||
* [Appleseed](http://appleseedhq.net)
|
* [Appleseed](http://appleseedhq.net)
|
||||||
* [Animal Logic: Glimpse renderer](https://www.fxguide.com/featured/a-glimpse-at-animal-logic/)
|
* [Animal Logic: Glimpse renderer](https://www.fxguide.com/featured/a-glimpse-at-animal-logic/)
|
||||||
@@ -237,7 +238,13 @@ adding OSL support):
|
|||||||
* [Autodesk: 3DS Max 2019](https://help.autodesk.com/view/3DSMAX/2019/ENU/?guid=__developer_3ds_max_sdk_features_rendering_osl_html)
|
* [Autodesk: 3DS Max 2019](https://help.autodesk.com/view/3DSMAX/2019/ENU/?guid=__developer_3ds_max_sdk_features_rendering_osl_html)
|
||||||
* [Maxon: Redshift](https://www.maxon.net/en/redshift)
|
* [Maxon: Redshift](https://www.maxon.net/en/redshift)
|
||||||
|
|
||||||
Films using OSL (grouped by year of release date):
|
### Significant work using OSL, grouped by year of release date:
|
||||||
|
|
||||||
|
(Here we are considering "significant work" to mean a feature film released
|
||||||
|
theatrically or on a major streaming platform, TV/streaming series heavily
|
||||||
|
featuring visual effects or animation, or short films that have won or been
|
||||||
|
nominated for major awards.)
|
||||||
|
|
||||||
* **(2012)**
|
* **(2012)**
|
||||||
Men in Black 3, The Amazing Spider-Man, Hotel Transylvania
|
Men in Black 3, The Amazing Spider-Man, Hotel Transylvania
|
||||||
* **(2013)**
|
* **(2013)**
|
||||||
@@ -272,6 +279,7 @@ Films using OSL (grouped by year of release date):
|
|||||||
Ghostbusters,
|
Ghostbusters,
|
||||||
Star Trek Beyond,
|
Star Trek Beyond,
|
||||||
Suicide Squad,
|
Suicide Squad,
|
||||||
|
Kubo and the Two Strings,
|
||||||
Kingsglaive: Final Fantasy XV,
|
Kingsglaive: Final Fantasy XV,
|
||||||
Storks,
|
Storks,
|
||||||
Miss Peregrine's Home for Peculiar Children,
|
Miss Peregrine's Home for Peculiar Children,
|
||||||
@@ -306,7 +314,7 @@ Films using OSL (grouped by year of release date):
|
|||||||
* **(2018)**
|
* **(2018)**
|
||||||
Peter Rabbit,
|
Peter Rabbit,
|
||||||
Black Panther,
|
Black Panther,
|
||||||
Annnihilation,
|
Annihilation,
|
||||||
Red Sparrow,
|
Red Sparrow,
|
||||||
Pacific Rim Uprising,
|
Pacific Rim Uprising,
|
||||||
Avengers Infinity War,
|
Avengers Infinity War,
|
||||||
@@ -354,7 +362,8 @@ Films using OSL (grouped by year of release date):
|
|||||||
Richard Jewell,
|
Richard Jewell,
|
||||||
Game of Thrones (S8),
|
Game of Thrones (S8),
|
||||||
Lost in Space (S1),
|
Lost in Space (S1),
|
||||||
Togo
|
Togo,
|
||||||
|
Missing Link
|
||||||
* **(2020)**
|
* **(2020)**
|
||||||
Underwater,
|
Underwater,
|
||||||
Birds of Prey,
|
Birds of Prey,
|
||||||
@@ -370,7 +379,9 @@ Films using OSL (grouped by year of release date):
|
|||||||
Over the Moon,
|
Over the Moon,
|
||||||
Wonder Woman 1984,
|
Wonder Woman 1984,
|
||||||
Soul,
|
Soul,
|
||||||
The Mandalorian (S2)
|
The Mandalorian (S2),
|
||||||
|
The Boys (S2),
|
||||||
|
Umbrella Academy (S2)
|
||||||
* **(2021)**
|
* **(2021)**
|
||||||
Chaos Walking,
|
Chaos Walking,
|
||||||
Peter Rabbit 2: The Runaway,
|
Peter Rabbit 2: The Runaway,
|
||||||
@@ -383,6 +394,7 @@ Films using OSL (grouped by year of release date):
|
|||||||
F9,
|
F9,
|
||||||
Vivo,
|
Vivo,
|
||||||
Jungle Cruise,
|
Jungle Cruise,
|
||||||
|
Cinderella,
|
||||||
Dune,
|
Dune,
|
||||||
No Time To Die,
|
No Time To Die,
|
||||||
Ron's Gone Wrong,
|
Ron's Gone Wrong,
|
||||||
@@ -390,8 +402,9 @@ Films using OSL (grouped by year of release date):
|
|||||||
Last Night in Soho,
|
Last Night in Soho,
|
||||||
Ghostbusters: Afterlife,
|
Ghostbusters: Afterlife,
|
||||||
Spider-Man 3: No Way Home,
|
Spider-Man 3: No Way Home,
|
||||||
Matrix Resurrections
|
Matrix Resurrections,
|
||||||
* **(2022 / upcoming)**
|
Sing 2
|
||||||
|
* **(2022)**
|
||||||
Hotel Transylvania 4: Transformania,
|
Hotel Transylvania 4: Transformania,
|
||||||
Death on the Nile,
|
Death on the Nile,
|
||||||
Uncharted,
|
Uncharted,
|
||||||
@@ -404,71 +417,141 @@ Films using OSL (grouped by year of release date):
|
|||||||
Thor: Love and Thunder,
|
Thor: Love and Thunder,
|
||||||
The Sea Beast,
|
The Sea Beast,
|
||||||
DC League of Super Pets,
|
DC League of Super Pets,
|
||||||
|
Minions: Rise of Gru,
|
||||||
Bullet Train,
|
Bullet Train,
|
||||||
|
Slumberland,
|
||||||
|
Glass Onion,
|
||||||
|
Puss in Boots: The Last Wish,
|
||||||
|
Archive 81 (series),
|
||||||
|
Moon Night (series),
|
||||||
|
Obi-Wan Kenobi (series),
|
||||||
|
The Boys (S3),
|
||||||
|
Andor (S1),
|
||||||
|
Troll,
|
||||||
|
She-Hulk (series)
|
||||||
|
* **(2023)**
|
||||||
|
Ant-Man and the Wasp: Quantumania,
|
||||||
|
The Mandalorian S3,
|
||||||
|
The Magician's Elephant,
|
||||||
|
Super Mario Bros Film,
|
||||||
|
Guardians of the Galaxy 3,
|
||||||
|
Spider-Man: Across the Spider-Verse,
|
||||||
|
Elemental,
|
||||||
|
Indiana Jones and the Dial of Destiny,
|
||||||
|
Nimona,
|
||||||
|
The Marvels,
|
||||||
|
Leo,
|
||||||
|
The Boys (S4),
|
||||||
|
The Moon,
|
||||||
|
Migration,
|
||||||
|
* **(2024)**
|
||||||
|
Ghostbusters: Frozen Empire,
|
||||||
|
The Garfield Movie,
|
||||||
|
Inside Out 2,
|
||||||
|
Red One,
|
||||||
|
Dream Productions (series),
|
||||||
|
The Lord of the Rings: The Rings of Power (S2),
|
||||||
|
* **(2025)**
|
||||||
|
Win or Lose (series),
|
||||||
|
A Minecraft Movie,
|
||||||
|
K-Pop Demon Hunters,
|
||||||
|
Fountain of Youth,
|
||||||
|
Elio,
|
||||||
|
Fantastic Four: First Steps,
|
||||||
|
Heads of State,
|
||||||
|
Bad Guys 2,
|
||||||
|
In Your Dreams,
|
||||||
|
The Last of Us (S2),
|
||||||
|
Murderbot (S1),
|
||||||
|
* **(2026 / upcoming)**
|
||||||
|
GOAT,
|
||||||
|
Hoppers,
|
||||||
|
Project Hail Mary,
|
||||||
...
|
...
|
||||||
|
|
||||||
|
|
||||||
|
👷 Building and Installation
|
||||||
Building and Installation
|
----------------------------
|
||||||
-------------------------
|
|
||||||
|
|
||||||
Please read the [INSTALL.md](INSTALL.md) file for detailed instructions on
|
Please read the [INSTALL.md](INSTALL.md) file for detailed instructions on
|
||||||
how to build and install OSL.
|
how to build and install OSL.
|
||||||
|
|
||||||
|
|
||||||
Documentation
|
💁 Documentation
|
||||||
-------------
|
----------------
|
||||||
|
|
||||||
The OSL language specification can be found at
|
The OSL language specification can be found at [OSL Documentation on ReadTheDocs](https://docs.openshadinglanguage.org)
|
||||||
[src/doc/osl-languagespec.pdf](src/doc/osl-languagespec.pdf) (in a source
|
There is also a [PDF version](https://readthedocs.org/projects/open-shading-language/downloads/pdf/stable/).
|
||||||
distribution) or in the share/doc/OSL/osl-languagespec.pdf file of an
|
|
||||||
installed binary distribution.
|
For those interested in learning to program OSL shaders there is the
|
||||||
|
[Siggraph 2024 Course](https://dl.acm.org/doi/proceedings/10.1145/3664475),
|
||||||
|
[Shader Writing in Open Shading Language](https://dl.acm.org/doi/10.1145/3664475.3664534)
|
||||||
|
and its companion
|
||||||
|
[Supplementary Materials](https://github.com/LaikaStudios/OSLShaderWriting),
|
||||||
|
which use RenderMan<sup>®</sup> in the examples but which are primarily about writing OSL shaders.
|
||||||
|
|
||||||
|
There is also the [Shader Writing in Open Shading Language book](https://www.routledge.com/Shader-Writing-in-Open-Shading-Language-with-RenderManr-Examples/Prater/p/book/9781032421100).
|
||||||
|
This covers all the material from the Siggraph course but in far greater detail. It also includes much more information about how OSL operates and covers a much broader range of shader examples.
|
||||||
|
|
||||||
|
|
||||||
Contact & reporting problems
|
🚑 Contact & reporting problems
|
||||||
----------------------------
|
-------------------------------
|
||||||
|
|
||||||
Simple "how do I...", "I'm having trouble", or "is this a bug" questions are
|
Simple "how do I...", "I'm having trouble", or "is this a bug" questions are
|
||||||
best asked on the [osl-dev developer mail
|
best asked on the [osl-dev developer mail list](https://lists.aswf.io/g/osl-dev).
|
||||||
list](https://lists.aswf.io/g/osl-dev).
|
|
||||||
That's where the most people will see it and potentially be able to answer
|
That's where the most people will see it and potentially be able to answer
|
||||||
your question quickly (more so than a GH "issue").
|
your question quickly (more so than a GH "issue"). For quick questions, you
|
||||||
|
could also try the [ASWF Slack](https://slack.aswf.io) `#openshadinglanguage`
|
||||||
|
channel.
|
||||||
|
|
||||||
Bugs, build problems, and discovered vulnerabilities that you are relatively
|
A bug or build problem that you are relatively certain is a legit problem in
|
||||||
certain is a legit problem in the code, and for which you can give clear
|
the code, and **for which you can give clear instructions for how to
|
||||||
instructions for how to reproduce, should be [reported as
|
reproduce**, should be [reported as
|
||||||
issues](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/issues).
|
issues](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/issues).
|
||||||
|
|
||||||
If you think you've found a potential vulnerability in OSL, please
|
To report a security vulnerability that is serious enough that it should not
|
||||||
confidentially report it by emailing the project administrators at
|
be discussed publicly until a patch is ready, please file a GitHub [security
|
||||||
[security@openshadinglanguage.org](security@openshadinglanguage.org).
|
advisory](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/security/advisories/new).
|
||||||
|
|
||||||
If any other issue requires confidentiality that precludes a public question
|
If any other issue requires confidentiality that precludes a public question
|
||||||
or issue, you may contact the project administrator privately at
|
or issue, you may contact the project administrator privately at
|
||||||
[lg@larrygritz.com](lg@larrygritz.com).
|
[lg@larrygritz.com](lg@larrygritz.com).
|
||||||
|
|
||||||
|
|
||||||
Contributing
|
🔧 Contributing and developer documentation
|
||||||
------------
|
-------------------------------------------
|
||||||
|
|
||||||
OSL welcomes code contributions, and nearly 50 people have done so over the
|
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)
|
years. We take code contributions via the usual GitHub pull request (PR)
|
||||||
mechanism. Please see [CONTRIBUTING](CONTRIBUTING.md) for detailed
|
mechanism.
|
||||||
instructions.
|
|
||||||
|
* [CONTRIBUTING](CONTRIBUTING.md) has detailed instructions about the
|
||||||
|
development process.
|
||||||
|
* [AI Policy](docs/dev/AI_Policy.md) decribes our policies on AI coding
|
||||||
|
assistance tools.
|
||||||
|
* [RELEASING](docs/dev/RELEASING.md) explains our policies and procedures for
|
||||||
|
making releases. We have a major, possibly-compatibility-breaking, release
|
||||||
|
annually in September/October, and minor bug fix and safe feature addition
|
||||||
|
release at the beginning of every month.
|
||||||
|
* Other developer documentation is in the [docs/dev](docs/dev) directory.
|
||||||
|
* You may also have luck learning a bit about the organization and
|
||||||
|
architecture of the project by reading the [DeepWiki Analysis of
|
||||||
|
OpenShadingLanguage](https://deepwiki.com/AcademySoftwareFoundation/OpenShadingLanguage).
|
||||||
|
But take it with a grain of salt -- like any LLM-generated summary, there
|
||||||
|
may be inaccuracies lurking.
|
||||||
|
|
||||||
|
|
||||||
Contacts, Links, and References
|
☎️ Communications channels and additional resources
|
||||||
-------------------------------
|
---------------------------------------------------
|
||||||
|
|
||||||
[OSL GitHub page](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage)
|
|
||||||
|
|
||||||
[Read or subscribe to the OSL development mail list](https://lists.aswf.io/g/osl-dev)
|
|
||||||
|
|
||||||
[Most recent PDF of the OSL language specification](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/blob/main/src/doc/osl-languagespec.pdf
|
|
||||||
)
|
|
||||||
|
|
||||||
[OSL home page](http://openshadinglanguage.org)
|
|
||||||
|
|
||||||
|
* [OSL home page](http://openshadinglanguage.org)
|
||||||
|
* [OSL GitHub page](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage)
|
||||||
|
* [OSL Documentation on ReadTheDocs](https://docs.openshadinglanguage.org)
|
||||||
|
* [Developer mail list](https://lists.aswf.io/g/osl-dev)
|
||||||
|
* [ASWF Slack](https://slack.aswf.io) (look for the `#openshadinglanguage` channel)
|
||||||
|
* Biweekly Technical Steering Committee (TSC) Zoom meetings are on the [ASWF
|
||||||
|
Calendar](https://calendar.openshadinglanguage.org) (click on the OSL
|
||||||
|
meeting entries, every second Monday, to get the Zoom link, anyone may join)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -480,19 +563,24 @@ The current project leadership is documented in the
|
|||||||
|
|
||||||
Many people have contributed features, bug fixes, and other changes to OSL
|
Many people have contributed features, bug fixes, and other changes to OSL
|
||||||
over the years: Steve Agland, Shane Ambler, Martijn Berger, Farchad
|
over the years: Steve Agland, Shane Ambler, Martijn Berger, Farchad
|
||||||
Bidgolirad, Nicholas Bishop, Solomon Boulos, Stefan Bruens, Stefan Büttner,
|
Bidgolirad, Alexandru Biscoveanu, Nicholas Bishop, Curtis Black, Rasmus
|
||||||
Matthaus G. Chajdas, Clark Chen, Alejandro Conty, Dieter De Baets, Thomas
|
Bonnedal, Solomon Boulos, Stefan Bruens, Stefan Büttner, Matthaus G. Chajdas,
|
||||||
Dinges, Mads Drøschler, Luke Emrose, Louis Feng, Mark Final, Henri Fousse,
|
Clark Chen, Mehdi Chinoune, Alejandro Conty, Damien Courtois, Dieter De Baets,
|
||||||
Stephen Friedman, Syoyo Fujita, Tim Grant, Larry Gritz, Nicolas Guiard, Euan
|
Thomas Dinges, Daniel Dresser, Mads Drøschler, Peter Ellerington, Luke Emrose,
|
||||||
Haahr, Derek Haase, Sven-Hendrik Haase, John Haddon, Niklas Harrysson, Daniel
|
Louis Feng, Mark Final, Henri Fousse, Stephen Friedman, Syoyo Fujita, Alex
|
||||||
Heckenberg, Adrien Herubel, Thiago Ize, Matt Johnson, Ronan Keryell, Chris
|
Fuller, Tim Grant, Larry Gritz, Nicolas Guiard, Euan Haahr, Derek Haase,
|
||||||
Kulla, Elvic Liang, Max Liani, Adam Martinez, John Mertic, Bastien Montagne,
|
Sven-Hendrik Haase, John Haddon, Niklas Harrysson, Daniel Heckenberg, Chris
|
||||||
Steena Monteiro, Alexis Oblet, Erich Ocean, Mikko Ohtamaa, Jino Park, Alexei
|
Hellmuth, Christian Heusel, Adrien Herubel, Dan Horák, Thiago Ize, Matt
|
||||||
Pawlow, Jay Reynolds, Declan Russell, Benoit Ruiz, Patrick Scheibe, Alex
|
Johnson, Ronan Keryell, Chris Kulla, Elvic Liang, Max Liani, Sv. Lockal, Silvia Lopez,
|
||||||
Schworer, Jonathan Scruggs, Sergey Sharybin, Sandip Shukla, Cliff Stein,
|
Adam Martinez, John Mertic, Bastien Montagne, Steena Monteiro, Patrick Mours,
|
||||||
Stephan Steinbach, Luya Tshimbalanga, Esteban Tovagliari, Brecht Van Lommel,
|
Alexis Oblet, Erich Ocean, Mikko Ohtamaa, Jean-Francois Panisset, Jino Park,
|
||||||
Alexander von Knorring, Alex Wells, Roman Zulak. (Listed alphabetically; if
|
Alexei Pawlow, Mitch Prater, Jay Reynolds, Declan Russell, Benoit Ruiz,
|
||||||
we've left anybody out, it is inadvertent, please let us know.)
|
Patrick Scheibe, Alex Schworer, Jonathan Scruggs, Sergey Sharybin, Mark
|
||||||
|
Sisson, Sandip Shukla, Alexey Smolenchuk, Cliff Stein, Stephan Steinbach, Taraash, Luya
|
||||||
|
Tshimbalanga, Esteban Tovagliari, Brecht Van Lommel, Thibault Vergne,
|
||||||
|
Alexander von Knorring, Aidan Welch, Alex Wells, Roman Zulak. (Listed
|
||||||
|
alphabetically; if we've left anybody out, it is inadvertent, please let us
|
||||||
|
know.)
|
||||||
|
|
||||||
We cannot possibly express sufficient gratitude to the managers at Sony
|
We cannot possibly express sufficient gratitude to the managers at Sony
|
||||||
Pictures Imageworks who allowed this project to proceed, supported it
|
Pictures Imageworks who allowed this project to proceed, supported it
|
||||||
@@ -518,7 +606,6 @@ The OSL implementation depends upon several other open source packages,
|
|||||||
all with compatible licenses:
|
all with compatible licenses:
|
||||||
|
|
||||||
* [OpenImageIO](http://www.openimageio.org)
|
* [OpenImageIO](http://www.openimageio.org)
|
||||||
* [Boost](http://www.boost.org)
|
|
||||||
* [IlmBase](http://www.openexr.com)
|
* [IlmBase](http://www.openexr.com)
|
||||||
* [LLVM Compiler Infrastructure](http://llvm.org)
|
* [LLVM Compiler Infrastructure](http://llvm.org)
|
||||||
|
|
||||||
|
|||||||
@@ -8,20 +8,67 @@ security vulnerabilities.
|
|||||||
| Version / branch | Supported |
|
| Version / branch | Supported |
|
||||||
| --------- | ---------------------------------------------------- |
|
| --------- | ---------------------------------------------------- |
|
||||||
| main | :white_check_mark: :construction: ALL fixes immediately, but this is a branch under development with a frequently unstable ABI and occasionally unstable API. |
|
| main | :white_check_mark: :construction: ALL fixes immediately, but this is a branch under development with a frequently unstable ABI and occasionally unstable API. |
|
||||||
| 1.12.x | :white_check_mark: All fixes that can be backported without breaking ABI compatibility. New tagged releases monthly. |
|
| 1.15.x | :white_check_mark: All fixes that can be backported without breaking ABI compatibility. New tagged releases monthly. |
|
||||||
| 1.11.x | :warning: Only the most critical fixes, only if they can be easily backported. |
|
| 1.14.x | :warning: Only the most critical fixes, only if they can be easily backported. |
|
||||||
| <= 1.10.x | :x: No longer receiving patches of any kind. |
|
| <= 1.13.x | :x: No longer receiving patches of any kind. |
|
||||||
|
|
||||||
|
|
||||||
## Reporting a Vulnerability
|
## Reporting a Vulnerability
|
||||||
|
|
||||||
If you think you've found a potential vulnerability in OSL, please report it
|
If you think you've found a potential vulnerability in OSL, please
|
||||||
by emailing the project administrators at
|
report it to the maintainers. Include detailed steps to reproduce the issue,
|
||||||
[security@openshadinglanguage.org](security@openshadinglanguage.org). Only the
|
and any other information that could aid an investigation.
|
||||||
project administrators have access to these messages. Include detailed steps to
|
|
||||||
reproduce the issue, and any other information that could aid an
|
|
||||||
investigation. Our policy is to respond to vulnerability reports within 14
|
|
||||||
days.
|
|
||||||
|
|
||||||
Our policy is to address critical security vulnerabilities rapidly and post
|
The best way to report a vulnerability is to file a GitHub [security
|
||||||
patches as quickly as possible.
|
advisory](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/security/advisories/new).
|
||||||
|
If that is not possible, it is also fine to email your report to
|
||||||
|
security@openshadinglanguage.org. Only the project administrators have access
|
||||||
|
to these reports.
|
||||||
|
|
||||||
|
Our policy is to respond to vulnerability reports within 14 days, and to
|
||||||
|
address critical security vulnerabilities rapidly and post patches as quickly
|
||||||
|
as possible.
|
||||||
|
|
||||||
|
|
||||||
|
## What do we consider a vulnerability?
|
||||||
|
|
||||||
|
We only consider a situation to be a security vulnerability if an untrusted
|
||||||
|
party can plausibly trigger the flaw through normal product inputs (for
|
||||||
|
example, a maliciously crafted oso file that might compromise a renderer when
|
||||||
|
loaded). We do not support requesting a CVE for API-only or caller-controlled
|
||||||
|
failures with no realistic adversarial path.
|
||||||
|
|
||||||
|
The OSL project adopts the same security stance as many other language
|
||||||
|
compilers: we believe that shaders that will be JITed and executed are by
|
||||||
|
definition *trusted inputs*, and should not be accepted from untrusted
|
||||||
|
sources. A shader that causes damage when it faithfully executes is not a
|
||||||
|
vulnerability per se. In rare circumstances, we might consider it a
|
||||||
|
vulnerability if a maliciously crafted shader can cause the renderer or OSL
|
||||||
|
library to do something damaging that is different from what the shader text
|
||||||
|
implies.
|
||||||
|
|
||||||
|
Flaws whose root cause lies in a dependency should be reported and fixed
|
||||||
|
upstream; the upstream project owns the CVE when one is warranted.
|
||||||
|
|
||||||
|
|
||||||
|
## Other security features
|
||||||
|
|
||||||
|
### Signed tags
|
||||||
|
|
||||||
|
Starting with OSL 1.14.3.0, we cryptographically sign release tags.
|
||||||
|
To verify a tag, you can use the `git tag -v` command, which will check
|
||||||
|
the signature against the public key that is included in the repository.
|
||||||
|
For example,
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git tag -v v1.14.3.0
|
||||||
|
```
|
||||||
|
|
||||||
|
## Outstanding Security Issues
|
||||||
|
|
||||||
|
None known
|
||||||
|
|
||||||
|
|
||||||
|
## History of CVE Fixes
|
||||||
|
|
||||||
|
None to date
|
||||||
|
|||||||
@@ -12,12 +12,6 @@ In no particular order:
|
|||||||
BSD 3-Clause License
|
BSD 3-Clause License
|
||||||
SPDX-License-Identifier: BSD-3-Clause
|
SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
* 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
|
|
||||||
parts of the CMake build system.
|
|
||||||
|
|
||||||
* OpenEXR, Copyright (c) Contributors to the OpenEXR Project.
|
* OpenEXR, Copyright (c) Contributors to the OpenEXR Project.
|
||||||
https://github.com/AcademySoftwareFoundation/OpenEXR
|
https://github.com/AcademySoftwareFoundation/OpenEXR
|
||||||
|
|
||||||
@@ -107,6 +101,34 @@ Public domain
|
|||||||
but of course I'd appreciate it if you kept my name somewhere.
|
but of course I'd appreciate it if you kept my name somewhere.
|
||||||
|
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Apache 2.0 License.
|
||||||
|
SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
* OpenImageIO Copyright (c) Contributors to the OpenImageIO Project.
|
||||||
|
https://github.com/AcademySoftwareFoundation/OpenImageIO
|
||||||
|
|
||||||
|
Many bits of code flow back and forth between OIIO and OSL, especially
|
||||||
|
parts of the CMake build system.
|
||||||
|
|
||||||
|
* ninjatracing.py utility for build profiling is Apache-2.0 licensed
|
||||||
|
and comes from https://github.com/nico/ninjatracing.
|
||||||
|
Copyright 2018 Nico Weber.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
|
||||||
|
|
||||||
-------------------------------------------------------------------------
|
-------------------------------------------------------------------------
|
||||||
|
|
||||||
Modified Apache 2.0 License
|
Modified Apache 2.0 License
|
||||||
|
|||||||
@@ -0,0 +1,112 @@
|
|||||||
|
<!-- SPDX-License-Identifier: CC-BY-4.0 -->
|
||||||
|
<!-- Copyright Contributors to the Open Shading Language Project. -->
|
||||||
|
|
||||||
|
Inlining Options for OptiX and CUDA
|
||||||
|
===================================
|
||||||
|
|
||||||
|
When compiling shaders for OptiX and CUDA (and in general), there is a tradeoff
|
||||||
|
between compile speed and shade-time performance. The LLVM optimizer generally
|
||||||
|
does a good job of balancing these concerns, but there might be cases where a
|
||||||
|
renderer can give additional hints to the optimizer to tip the balance one way
|
||||||
|
or the other.
|
||||||
|
|
||||||
|
Aggressive inlining can increase the run-time performance, but can negatively
|
||||||
|
impact the compile speed. Inlining can be very helpful with small functions
|
||||||
|
where the function call overhead tends to dwarf the useful instructions, so it
|
||||||
|
is important to inline such functions when possible.
|
||||||
|
|
||||||
|
Choosing to __not__ inline certain functions (e.g., very large noise functions)
|
||||||
|
allows them to be excluded from the module prior to running the LLVM optimizer
|
||||||
|
and JIT engine, which can greatly improve the compile time. This is particularly
|
||||||
|
beneficial when a function is not likely to be inlined anyway; removing such
|
||||||
|
large functions from the module prior to optimization can speed up compilation
|
||||||
|
considerably without affecting the generated PTX.
|
||||||
|
|
||||||
|
ShadingSystem Attributes
|
||||||
|
------------------------
|
||||||
|
|
||||||
|
There are a number of `ShadingSystem` attributes to help control the inlining
|
||||||
|
behavior. The default settings should work well in most circumstances, but they
|
||||||
|
can be adjusted to favor compile speed over shade-time performance, or vice
|
||||||
|
versa.
|
||||||
|
|
||||||
|
* `optix_no_inline_thresh`: Don't inline functions greater-than or equal-to the
|
||||||
|
threshold. This allows them to be excluded from the module prior to
|
||||||
|
optimization, which reduces the size of module and can greatly speed up the
|
||||||
|
optimization and JIT stages.
|
||||||
|
|
||||||
|
* `optix_force_inline_thresh`: Force inline functions less-than or equal-to the
|
||||||
|
threshold. This tends to be most helpful with relatively low values, < 30.
|
||||||
|
|
||||||
|
* `optix_no_inline`: Don't inline any functions. Offers the best compile times
|
||||||
|
at the expense of shade-time performance. This option is not recommended, but is
|
||||||
|
included for benchmarking and tuning purposes.
|
||||||
|
|
||||||
|
* `optix_no_inline_layer_funcs`: Don't inline the shader layer functions. This
|
||||||
|
can moderately improve compile times at the expense of shade-time performance.
|
||||||
|
|
||||||
|
* `optix_merge_layer_funcs`: Allow layer functions that are only called once to
|
||||||
|
be merged into their caller, even if `optix_no_inline_layer_funcs` is set. This
|
||||||
|
can help restore some of the shade-time performance lost by enabling
|
||||||
|
`optix_no_inline_layer_funcs`.
|
||||||
|
|
||||||
|
* `optix_no_inline_rend_lib`: Don't inline any functions defined in the
|
||||||
|
renderer-supplied `rend_lib` module. As an alternative, the renderer can simply
|
||||||
|
not supply the LLVM bitcode for the `rend_lib` module to the `ShadingSystem`.
|
||||||
|
|
||||||
|
Inline/Noinline Function Registration
|
||||||
|
-------------------------------------
|
||||||
|
|
||||||
|
In addition to the `ShadingSystem` attributes, individual functions can be
|
||||||
|
registered with the `ShadingSystem` as `inline` or `noinline`. Functions can
|
||||||
|
be unregistered to restore the default inlining behavior. This registration
|
||||||
|
takes precedence over the `ShadingSystem` inlining attributes, which allows
|
||||||
|
very fine-grained control when needed.
|
||||||
|
|
||||||
|
```C++
|
||||||
|
// Register
|
||||||
|
shadingsys->register_inline_function(ustring("osl_abs_ff"));
|
||||||
|
shadingsys->register_noinline_function(ustring("osl_gabornoise_dfdfdf"));
|
||||||
|
|
||||||
|
// Unregister
|
||||||
|
shadingsys->unregister_inline_function(ustring("osl_abs_ff"));
|
||||||
|
shadingsys->unregister_noinline_function(ustring("osl_gabornoise_dfdfdf"));
|
||||||
|
```
|
||||||
|
|
||||||
|
It might be best to prefer the `ShadingSystem` attributes to control the inlining
|
||||||
|
behavior, and to strategically register functions when it is known to be
|
||||||
|
beneficial through benchmarking and profiling.
|
||||||
|
|
||||||
|
Tuning and Analysis
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
We have added a Python script (`src/build-scripts/analyze-ptx.py`) to help
|
||||||
|
identify functions that might be good candidates for inlining/noinling. This
|
||||||
|
script will generate a summary of the functions in the input PTX file, with a
|
||||||
|
list of all functions and their sizes in CSV format. It will also generate a
|
||||||
|
graphical reprensentation of the callgraph in DOT and PDF format.
|
||||||
|
|
||||||
|
An example tuning workflow might include the following steps:
|
||||||
|
|
||||||
|
1. Run `analyze-ptx.py` on the "shadeops" and "rend_lib" PTX files to generate
|
||||||
|
a list of the functions contained in those modules.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ analyze_ptx.py shadeop_cuda.ptx
|
||||||
|
$ analyze_ptx.py rend_lib_myrender.ptx
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Run `analyze-ptx.py` on the generated PTX for a representative shader:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ analyze_ptx.py myshader.ptx
|
||||||
|
```
|
||||||
|
|
||||||
|
3. View the summary file (`myshader-summary.txt`) and the callgraph
|
||||||
|
(`myshader-callgraph.gv`) to deterimine which library functions were _not_
|
||||||
|
inlined. They will appear as boxes with a dashed outline in the callgraph.
|
||||||
|
|
||||||
|
In particular, be on the lookout for trivial functions (e.g., `osl_floor_ff`)
|
||||||
|
which have not been inlined. If such functions appear, that might be a sign
|
||||||
|
that the inline thresholds need to be adjusted, or that it might be
|
||||||
|
beneficial to register specific functions.
|
||||||
@@ -16,6 +16,6 @@ Method #1:
|
|||||||
https://github.com/debaetsd/OSL_build
|
https://github.com/debaetsd/OSL_build
|
||||||
|
|
||||||
Method #2:
|
Method #2:
|
||||||
Go through `doc/build_install/windows/Readme.md` and using batch files to install OSL cleanly!
|
Go through `docs/build_install/windows/Readme.md` and using batch files to install OSL cleanly!
|
||||||
|
|
||||||
## macOS
|
## macOS
|
||||||
@@ -64,8 +64,6 @@ My System and Setup Configuration:
|
|||||||
|
|
||||||
**OpenShadingLanguage:** cloned from latest master branch
|
**OpenShadingLanguage:** cloned from latest master branch
|
||||||
|
|
||||||
**Boost:** 1.70
|
|
||||||
|
|
||||||
**LLVM:** 11.0.0 C++ is set on C++14
|
**LLVM:** 11.0.0 C++ is set on C++14
|
||||||
|
|
||||||
**CLANG:** 11.0.0 C++ is set on C++14
|
**CLANG:** 11.0.0 C++ is set on C++14
|
||||||
@@ -106,7 +104,7 @@ so I studied its python build script and found we can use same logic for install
|
|||||||
It still needs some other works to make it complete for all dependencies (optional).
|
It still needs some other works to make it complete for all dependencies (optional).
|
||||||
|
|
||||||
We will keep Pixar name on it as inspiration code (or we can keep their copyright)
|
We will keep Pixar name on it as inspiration code (or we can keep their copyright)
|
||||||
You can Run the installer from: `yourpath/OpenShadingLanguage/doc/build_install/windows/build_osl.bat`
|
You can Run the installer from: `yourpath/OpenShadingLanguage/docs/build_install/windows/build_osl.bat`
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -146,15 +144,15 @@ For running batch scripts without any problem I recommend to create some base en
|
|||||||
|
|
||||||
|
|
|
|
||||||
|
|
||||||
Open `doc/build_install/windows/osl_env_vars_setup.bat` in your editor and edit paths' values based on your installation folders.
|
Open `docs/build_install/windows/osl_env_vars_setup.bat` in your editor and edit paths' values based on your installation folders.
|
||||||
|
|
||||||
### **2.3 Set Flags based on your needs**
|
### **2.3 Set Flags based on your needs**
|
||||||
|
|
||||||
The main build launcher is here `doc/build_install/windows/build_osl.bat`
|
The main build launcher is here `docs/build_install/windows/build_osl.bat`
|
||||||
|
|
||||||
For now we can not assign pre-installed llvm or boost so we have to build all together at once and put all of them in one directory.
|
For now we can not assign pre-installed llvm so we have to build all together at once and put all of them in one directory.
|
||||||
|
|
||||||
I am working on it to see how we can use external llvm and boost installation without error.
|
I am working on it to see how we can use external llvm installation without error.
|
||||||
|
|
||||||
**Table of flags we can assign to the command**
|
**Table of flags we can assign to the command**
|
||||||
|
|
||||||
@@ -163,7 +161,6 @@ I am working on it to see how we can use external llvm and boost installation wi
|
|||||||
| --osl | Implemented | Yes |
|
| --osl | Implemented | Yes |
|
||||||
| --python | Implemented | Yes |
|
| --python | Implemented | Yes |
|
||||||
| --zlib | Implemented | Yes |
|
| --zlib | Implemented | Yes |
|
||||||
| --boost | Implemented | Yes |
|
|
||||||
| --llvm | Implemented | Yes |
|
| --llvm | Implemented | Yes |
|
||||||
| --clang | Implemented | Yes |
|
| --clang | Implemented | Yes |
|
||||||
| --pugixml | Implemented | Yes |
|
| --pugixml | Implemented | Yes |
|
||||||
@@ -199,7 +196,7 @@ Based on Environment Variables you set in previous sections you can just call th
|
|||||||
**My Method:**
|
**My Method:**
|
||||||
|
|
||||||
- Open Powershell
|
- Open Powershell
|
||||||
- Go to: yourPath/OpenShadingLanguage/doc/build_install/windows
|
- Go to: yourPath/OpenShadingLanguage/docs/build_install/windows
|
||||||
- Run build_osl.bat release
|
- Run build_osl.bat release
|
||||||
|
|
||||||
### **3.1 Running the code based on your config**
|
### **3.1 Running the code based on your config**
|
||||||
@@ -298,7 +295,7 @@ That's it
|
|||||||
TIP: this process is getting better, I will update the document soon
|
TIP: this process is getting better, I will update the document soon
|
||||||
|
|
||||||
**Conclusion:**
|
**Conclusion:**
|
||||||
For easy installation you just need to setup your Environment Variables in `yourPath/OpenShadingLanguage/doc/build_install/windows/osl_env_vars_setup.bat` based on your paths
|
For easy installation you just need to setup your Environment Variables in `yourPath/OpenShadingLanguage/docs/build_install/windows/osl_env_vars_setup.bat` based on your paths
|
||||||
|
|
||||||
It is a custom setup, for example all dependencies are built before osl, because I had lots of issues on using external installation (like llvm)
|
It is a custom setup, for example all dependencies are built before osl, because I had lots of issues on using external installation (like llvm)
|
||||||
and I tried this method on llvm 7, 8 and 9, all with error, so my current build setup is on llvm 11 and C++14, it can be changed in code. (I am trying to make it easy to use for changing configs with arguments)
|
and I tried this method on llvm 7, 8 and 9, all with error, so my current build setup is on llvm 11 and C++14, it can be changed in code. (I am trying to make it easy to use for changing configs with arguments)
|
||||||
@@ -14,17 +14,17 @@ cls
|
|||||||
|
|
||||||
set OSL_INPUT_CONFIG=%1
|
set OSL_INPUT_CONFIG=%1
|
||||||
|
|
||||||
if "%OSL_INPUT_CONFIG%" equ "debug" (
|
if "%OSL_INPUT_CONFIG%" equ "debug" (
|
||||||
set OSL_LOCATION_DIR=osl_debug
|
set OSL_LOCATION_DIR=osl_debug
|
||||||
set OSL_BUILD_CONFIG=--debug
|
set OSL_BUILD_CONFIG=--debug
|
||||||
goto RUN
|
goto RUN
|
||||||
)
|
)
|
||||||
if "%OSL_INPUT_CONFIG%" equ "release" (
|
if "%OSL_INPUT_CONFIG%" equ "release" (
|
||||||
set OSL_LOCATION_DIR=osl_release
|
set OSL_LOCATION_DIR=osl_release
|
||||||
set OSL_BUILD_CONFIG=
|
set OSL_BUILD_CONFIG=
|
||||||
goto RUN
|
goto RUN
|
||||||
)
|
)
|
||||||
if "%OSL_INPUT_CONFIG%" equ "" (
|
if "%OSL_INPUT_CONFIG%" equ "" (
|
||||||
echo --= Enter debug or release as argument
|
echo --= Enter debug or release as argument
|
||||||
exit
|
exit
|
||||||
)
|
)
|
||||||
@@ -44,5 +44,5 @@ call %VCVARS_LOCATION%/vcvarsall.bat x64
|
|||||||
|
|
||||||
cls
|
cls
|
||||||
|
|
||||||
python build_osl.py --generator "Visual Studio 16 2019" --osl --python %OSL_BUILD_CONFIG% --zlib --boost --llvm --clang --pugixml --openexr --tiff --jpeg --png --flex --bison --opencolorio --openimageio --libraw --pybind11 %BASE_LOCATION%/%OSL_LOCATION_DIR%
|
python build_osl.py --generator "Visual Studio 16 2019" --osl --python %OSL_BUILD_CONFIG% --zlib --llvm --clang --pugixml --openexr --tiff --jpeg --png --flex --bison --opencolorio --openimageio --libraw --pybind11 %BASE_LOCATION%/%OSL_LOCATION_DIR%
|
||||||
|
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
#
|
#
|
||||||
# Copyright Contributors to the Open Shading Language project.
|
# Copyright Contributors to the Open Shading Language project.
|
||||||
# SPDX-License-Identifier: Modified Apache 2.0 License
|
# SPDX-License-Identifier: Modified Apache 2.0 License
|
||||||
# Coyright Notice From Pixar USD (Modified Apache 2.0 License)
|
# Copyright Notice From Pixar USD (Modified Apache 2.0 License)
|
||||||
# 90% of the content is changed to be compatible for installing OSL and its dependencies
|
# 90% of the content is changed to be compatible for installing OSL and its dependencies
|
||||||
#
|
#
|
||||||
# Based on USD build_scripts by Pixar Animation Studio
|
# Based on USD build_scripts by Pixar Animation Studio
|
||||||
#
|
#
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@@ -32,9 +32,7 @@
|
|||||||
# KIND, either express or implied. See the Apache License for the specific
|
# KIND, either express or implied. See the Apache License for the specific
|
||||||
# language governing permissions and limitations under the Apache License.
|
# language governing permissions and limitations under the Apache License.
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
from __future__ import print_function
|
|
||||||
|
|
||||||
from distutils.spawn import find_executable
|
from distutils.spawn import find_executable
|
||||||
|
|
||||||
@@ -208,7 +206,7 @@ def GetPythonInfo():
|
|||||||
|
|
||||||
This function is used to extract build information from the Python
|
This function is used to extract build information from the Python
|
||||||
interpreter used to launch this script. This information is used
|
interpreter used to launch this script. This information is used
|
||||||
in the Boost and OSL builds. By taking this approach we can support
|
in the OSL builds. By taking this approach we can support
|
||||||
having OSL builds for different Python versions built on the same
|
having OSL builds for different Python versions built on the same
|
||||||
machine. This is very useful, especially when developers have multiple
|
machine. This is very useful, especially when developers have multiple
|
||||||
versions installed on their machine, which is quite common now with
|
versions installed on their machine, which is quite common now with
|
||||||
@@ -730,170 +728,6 @@ def InstallZlib(context, force, buildArgs):
|
|||||||
|
|
||||||
ZLIB = Dependency("zlib", InstallZlib, "include/zlib.h")
|
ZLIB = Dependency("zlib", InstallZlib, "include/zlib.h")
|
||||||
|
|
||||||
############################################################
|
|
||||||
# boost
|
|
||||||
|
|
||||||
if Linux() or MacOS():
|
|
||||||
if Python3():
|
|
||||||
BOOST_URL = "https://downloads.sourceforge.net/project/boost/boost/1.70.0/boost_1_70_0.tar.gz"
|
|
||||||
else:
|
|
||||||
BOOST_URL = "https://downloads.sourceforge.net/project/boost/boost/1.61.0/boost_1_61_0.tar.gz"
|
|
||||||
BOOST_VERSION_FILE = "include/boost/version.hpp"
|
|
||||||
elif Windows():
|
|
||||||
# The default installation of boost on Windows puts headers in a versioned
|
|
||||||
# subdirectory, which we have to account for here. In theory, specifying
|
|
||||||
# "layout=system" would make the Windows install match Linux/MacOS, but that
|
|
||||||
# causes problems for other dependencies that look for boost.
|
|
||||||
#
|
|
||||||
# boost 1.70 is required for Visual Studio 2019. For simplicity, we use
|
|
||||||
# this version for all older Visual Studio versions as well.
|
|
||||||
BOOST_URL = "https://downloads.sourceforge.net/project/boost/boost/1.70.0/boost_1_70_0.tar.gz"
|
|
||||||
BOOST_VERSION_FILE = "include/boost-1_70/boost/version.hpp"
|
|
||||||
|
|
||||||
|
|
||||||
def InstallBoost_Helper(context, force, buildArgs):
|
|
||||||
# Documentation files in the boost archive can have exceptionally
|
|
||||||
# long paths. This can lead to errors when extracting boost on Windows,
|
|
||||||
# since paths are limited to 260 characters by default on that platform.
|
|
||||||
# To avoid this, we skip extracting all documentation.
|
|
||||||
#
|
|
||||||
# For some examples, see: https://svn.boost.org/trac10/ticket/11677
|
|
||||||
dontExtract = ["*/doc/*", "*/libs/*/doc/*"]
|
|
||||||
|
|
||||||
with CurrentWorkingDirectory(DownloadURL(BOOST_URL, context, force, dontExtract)):
|
|
||||||
bootstrap = "bootstrap.bat" if Windows() else "./bootstrap.sh"
|
|
||||||
Run(
|
|
||||||
'{bootstrap} --prefix="{instDir}"'.format(
|
|
||||||
bootstrap=bootstrap, instDir=context.instDir
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
# b2 supports at most -j64 and will error if given a higher value.
|
|
||||||
num_procs = min(64, context.numJobs)
|
|
||||||
|
|
||||||
b2_settings = [
|
|
||||||
'--prefix="{instDir}"'.format(instDir=context.instDir),
|
|
||||||
'--build-dir="{buildDir}"'.format(buildDir=context.buildDir),
|
|
||||||
"-j{procs}".format(procs=num_procs),
|
|
||||||
"address-model=64",
|
|
||||||
"link=shared",
|
|
||||||
"runtime-link=shared",
|
|
||||||
"threading=multi",
|
|
||||||
"variant={variant}".format(
|
|
||||||
variant="debug" if context.buildDebug else "release"
|
|
||||||
),
|
|
||||||
"--with-atomic",
|
|
||||||
"--with-program_options",
|
|
||||||
"--with-regex",
|
|
||||||
]
|
|
||||||
|
|
||||||
if context.buildPython:
|
|
||||||
b2_settings.append("--with-python")
|
|
||||||
pythonInfo = GetPythonInfo()
|
|
||||||
if Windows():
|
|
||||||
# Unfortunately Boost build scripts require the Python folder
|
|
||||||
# that contains the executable on Windows
|
|
||||||
pythonPath = os.path.dirname(pythonInfo[0])
|
|
||||||
else:
|
|
||||||
# While other platforms want the complete executable path
|
|
||||||
pythonPath = pythonInfo[0]
|
|
||||||
# This is the only platform-independent way to configure these
|
|
||||||
# settings correctly and robustly for the Boost jam build system.
|
|
||||||
# There are Python config arguments that can be passed to bootstrap
|
|
||||||
# but those are not available in boostrap.bat (Windows) so we must
|
|
||||||
# take the following approach:
|
|
||||||
projectPath = "python-config.jam"
|
|
||||||
with open(projectPath, "w") as projectFile:
|
|
||||||
# Note that we must escape any special characters, like
|
|
||||||
# backslashes for jam, hence the mods below for the path
|
|
||||||
# arguments. Also, if the path contains spaces jam will not
|
|
||||||
# handle them well. Surround the path parameters in quotes.
|
|
||||||
line = 'using python : %s : "%s" : "%s" ;\n' % (
|
|
||||||
pythonInfo[3],
|
|
||||||
pythonPath.replace("\\", "\\\\"),
|
|
||||||
pythonInfo[2].replace("\\", "\\\\"),
|
|
||||||
)
|
|
||||||
projectFile.write(line)
|
|
||||||
b2_settings.append("--user-config=python-config.jam")
|
|
||||||
|
|
||||||
if context.buildOIIO:
|
|
||||||
b2_settings.append("--with-date_time")
|
|
||||||
|
|
||||||
if context.buildOIIO:
|
|
||||||
b2_settings.append("--with-system")
|
|
||||||
b2_settings.append("--with-thread")
|
|
||||||
# if Linux():
|
|
||||||
# b2_settings.append("toolset=gcc")
|
|
||||||
|
|
||||||
if context.buildOPENVDB:
|
|
||||||
b2_settings.append("--with-iostreams")
|
|
||||||
|
|
||||||
# b2 with -sNO_COMPRESSION=1 fails with the following error message:
|
|
||||||
# error: at [...]/boost_1_61_0/tools/build/src/kernel/modules.jam:107
|
|
||||||
# error: Unable to find file or target named
|
|
||||||
# error: '/zlib//zlib'
|
|
||||||
# error: referred to from project at
|
|
||||||
# error: 'libs/iostreams/build'
|
|
||||||
# error: could not resolve project reference '/zlib'
|
|
||||||
|
|
||||||
# But to avoid an extra library dependency, we can still explicitly
|
|
||||||
# exclude the bzip2 compression from boost_iostreams (note that
|
|
||||||
# OpenVDB uses blosc compression).
|
|
||||||
b2_settings.append("-sNO_BZIP2=1")
|
|
||||||
|
|
||||||
if context.buildOIIO:
|
|
||||||
b2_settings.append("--with-filesystem")
|
|
||||||
|
|
||||||
if force:
|
|
||||||
b2_settings.append("-a")
|
|
||||||
|
|
||||||
if Windows():
|
|
||||||
# toolset parameter for Visual Studio documented here:
|
|
||||||
# https://github.com/boostorg/build/blob/develop/src/tools/msvc.jam
|
|
||||||
if context.cmakeToolset == "v142":
|
|
||||||
b2_settings.append("toolset=msvc-14.2")
|
|
||||||
elif context.cmakeToolset == "v141":
|
|
||||||
b2_settings.append("toolset=msvc-14.1")
|
|
||||||
elif context.cmakeToolset == "v140":
|
|
||||||
b2_settings.append("toolset=msvc-14.0")
|
|
||||||
elif IsVisualStudio2019OrGreater():
|
|
||||||
b2_settings.append("toolset=msvc-14.2")
|
|
||||||
elif IsVisualStudio2017OrGreater():
|
|
||||||
b2_settings.append("toolset=msvc-14.1")
|
|
||||||
else:
|
|
||||||
b2_settings.append("toolset=msvc-14.0")
|
|
||||||
|
|
||||||
if MacOS():
|
|
||||||
# Must specify toolset=clang to ensure install_name for boost
|
|
||||||
# libraries includes @rpath
|
|
||||||
b2_settings.append("toolset=clang")
|
|
||||||
|
|
||||||
# Add on any user-specified extra arguments.
|
|
||||||
b2_settings += buildArgs
|
|
||||||
|
|
||||||
b2 = "b2" if Windows() else "./b2"
|
|
||||||
Run("{b2} {options} install".format(b2=b2, options=" ".join(b2_settings)))
|
|
||||||
|
|
||||||
|
|
||||||
def InstallBoost(context, force, buildArgs):
|
|
||||||
# Boost's build system will install the version.hpp header before
|
|
||||||
# building its libraries. We make sure to remove it in case of
|
|
||||||
# any failure to ensure that the build script detects boost as a
|
|
||||||
# dependency to build the next time it's run.
|
|
||||||
try:
|
|
||||||
InstallBoost_Helper(context, force, buildArgs)
|
|
||||||
except:
|
|
||||||
versionHeader = os.path.join(context.instDir, BOOST_VERSION_FILE)
|
|
||||||
if os.path.isfile(versionHeader):
|
|
||||||
try:
|
|
||||||
os.remove(versionHeader)
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
raise
|
|
||||||
|
|
||||||
|
|
||||||
BOOST = Dependency("boost", InstallBoost, BOOST_VERSION_FILE)
|
|
||||||
|
|
||||||
############################################################
|
############################################################
|
||||||
# JPEGTurbo
|
# JPEGTurbo
|
||||||
|
|
||||||
@@ -1060,7 +894,7 @@ def InstallPtex_Windows(context, force, buildArgs):
|
|||||||
)
|
)
|
||||||
PatchFile(
|
PatchFile(
|
||||||
"src\\tests\\CMakeLists.txt",
|
"src\\tests\\CMakeLists.txt",
|
||||||
[("add_definitions(-DPTEX_STATIC)", "# add_definitions(-DPTEX_STATIC)")],
|
[("add_compile_definitions(PTEX_STATIC)", "# add_compile_definitions(PTEX_STATIC)")],
|
||||||
)
|
)
|
||||||
|
|
||||||
# Patch Ptex::String to export symbol for operator<<
|
# Patch Ptex::String to export symbol for operator<<
|
||||||
@@ -1212,8 +1046,7 @@ def InstallOSL(context, force, buildArgs):
|
|||||||
extraArgs.append("-DUSE_PYTHON=0")
|
extraArgs.append("-DUSE_PYTHON=0")
|
||||||
|
|
||||||
extraArgs.append("-DOSL_BUILD_TESTS=0")
|
extraArgs.append("-DOSL_BUILD_TESTS=0")
|
||||||
# if you are using LLVM 10 or higher C++ should be set on 14
|
extraArgs.append("-DCMAKE_CXX_STANDARD=17")
|
||||||
extraArgs.append("-DCMAKE_CXX_STANDARD=14")
|
|
||||||
|
|
||||||
# if you are using LLVM 10 or higher C++ should be set on 11
|
# if you are using LLVM 10 or higher C++ should be set on 11
|
||||||
# extraArgs.append("-DCMAKE_CXX_STANDARD=11")
|
# extraArgs.append("-DCMAKE_CXX_STANDARD=11")
|
||||||
@@ -1235,10 +1068,6 @@ def InstallOSL(context, force, buildArgs):
|
|||||||
# extraArgs.append('-DCMAKE_CXX_FLAGS="-fPIC"')
|
# extraArgs.append('-DCMAKE_CXX_FLAGS="-fPIC"')
|
||||||
|
|
||||||
if Windows():
|
if Windows():
|
||||||
# for now have to use manual boost build
|
|
||||||
extraArgs.append("-DBoost_NO_BOOST_CMAKE=On")
|
|
||||||
extraArgs.append("-DBoost_NO_SYSTEM_PATHS=True")
|
|
||||||
|
|
||||||
# Increase the precompiled header buffer limit.
|
# Increase the precompiled header buffer limit.
|
||||||
extraArgs.append('-DCMAKE_CXX_FLAGS="/Zm150"')
|
extraArgs.append('-DCMAKE_CXX_FLAGS="/Zm150"')
|
||||||
if context.buildDebug:
|
if context.buildDebug:
|
||||||
@@ -1313,11 +1142,6 @@ def InstallOpenVDB(context, force, buildArgs):
|
|||||||
"-DOPENVDB_BUILD_UNITTESTS=OFF",
|
"-DOPENVDB_BUILD_UNITTESTS=OFF",
|
||||||
]
|
]
|
||||||
|
|
||||||
# Make sure to use boost installed by the build script and not any
|
|
||||||
# system installed boost
|
|
||||||
extraArgs.append("-DBoost_NO_BOOST_CMAKE=On")
|
|
||||||
extraArgs.append("-DBoost_NO_SYSTEM_PATHS=True")
|
|
||||||
|
|
||||||
extraArgs.append('-DBLOSC_ROOT="{instDir}"'.format(instDir=context.instDir))
|
extraArgs.append('-DBLOSC_ROOT="{instDir}"'.format(instDir=context.instDir))
|
||||||
extraArgs.append('-DTBB_ROOT="{instDir}"'.format(instDir=context.instDir))
|
extraArgs.append('-DTBB_ROOT="{instDir}"'.format(instDir=context.instDir))
|
||||||
# OpenVDB needs Half type from IlmBase
|
# OpenVDB needs Half type from IlmBase
|
||||||
@@ -1331,8 +1155,8 @@ OPENVDB = Dependency("OpenVDB", InstallOpenVDB, "include/openvdb/openvdb.h")
|
|||||||
############################################################
|
############################################################
|
||||||
# OpenImageIO
|
# OpenImageIO
|
||||||
|
|
||||||
# OIIO_URL = "https://github.com/OpenImageIO/oiio/archive/Release-2.2.7.0.zip"
|
# OIIO_URL = "https://github.com/AcademySoftwareFoundation/OpenImageIO/archive/Release-2.2.7.0.zip"
|
||||||
OIIO_URL = "https://github.com/OpenImageIO/oiio/archive/Release-2.1.20.0.zip"
|
OIIO_URL = "https://github.com/AcademySoftwareFoundation/OpenImageIO/archive/Release-2.1.20.0.zip"
|
||||||
|
|
||||||
|
|
||||||
def InstallOpenImageIO(context, force, buildArgs):
|
def InstallOpenImageIO(context, force, buildArgs):
|
||||||
@@ -1359,12 +1183,6 @@ def InstallOpenImageIO(context, force, buildArgs):
|
|||||||
if not context.buildPTEX:
|
if not context.buildPTEX:
|
||||||
extraArgs.append("-DUSE_PTEX=OFF")
|
extraArgs.append("-DUSE_PTEX=OFF")
|
||||||
|
|
||||||
# Make sure to use boost installed by the build script and not any
|
|
||||||
# system installed boost
|
|
||||||
if Windows():
|
|
||||||
extraArgs.append("-DBoost_NO_BOOST_CMAKE=On")
|
|
||||||
extraArgs.append("-DBoost_NO_SYSTEM_PATHS=True")
|
|
||||||
|
|
||||||
# Add on any user-specified extra arguments.
|
# Add on any user-specified extra arguments.
|
||||||
extraArgs += buildArgs
|
extraArgs += buildArgs
|
||||||
|
|
||||||
@@ -1444,20 +1262,20 @@ options, like --force or --build-args.
|
|||||||
|
|
||||||
- Downloading Libraries:
|
- Downloading Libraries:
|
||||||
If curl or powershell (on Windows) are installed and located in PATH, they
|
If curl or powershell (on Windows) are installed and located in PATH, they
|
||||||
will be used to download dependencies. Otherwise, a built-in downloader will
|
will be used to download dependencies. Otherwise, a built-in downloader will
|
||||||
be used.
|
be used.
|
||||||
|
|
||||||
- Specifying Custom Build Arguments:
|
- Specifying Custom Build Arguments:
|
||||||
Users may specify custom build arguments for libraries using the --build-args
|
Users may specify custom build arguments for libraries using the --build-args
|
||||||
option. This values for this option must take the form <library name>,<option>.
|
option. This values for this option must take the form <library name>,<option>.
|
||||||
For example:
|
For example:
|
||||||
|
|
||||||
%(prog)s --build-args boost,cxxflags=... OSL,-DCMAKE_CXX_STANDARD=14 ...
|
%(prog)s --build-args cxxflags=... OSL,-DCMAKE_CXX_STANDARD=17 ...
|
||||||
|
|
||||||
These arguments will be passed directly to the build system for the specified
|
These arguments will be passed directly to the build system for the specified
|
||||||
library. Multiple quotes may be needed to ensure arguments are passed on
|
library. Multiple quotes may be needed to ensure arguments are passed on
|
||||||
exactly as desired. Users must ensure these arguments are suitable for the
|
exactly as desired. Users must ensure these arguments are suitable for the
|
||||||
specified library and do not conflict with other options, otherwise build
|
specified library and do not conflict with other options, otherwise build
|
||||||
errors may occur.
|
errors may occur.
|
||||||
|
|
||||||
""".format(
|
""".format(
|
||||||
@@ -1629,14 +1447,6 @@ subgroup.add_argument(
|
|||||||
help="Build zlib for OSL",
|
help="Build zlib for OSL",
|
||||||
)
|
)
|
||||||
subgroup = group.add_mutually_exclusive_group()
|
subgroup = group.add_mutually_exclusive_group()
|
||||||
subgroup.add_argument(
|
|
||||||
"--boost",
|
|
||||||
dest="build_boost",
|
|
||||||
action="store_true",
|
|
||||||
default=False,
|
|
||||||
help="Build boost for OSL",
|
|
||||||
)
|
|
||||||
subgroup = group.add_mutually_exclusive_group()
|
|
||||||
subgroup.add_argument(
|
subgroup.add_argument(
|
||||||
"--llvm",
|
"--llvm",
|
||||||
dest="build_llvm",
|
dest="build_llvm",
|
||||||
@@ -1935,7 +1745,6 @@ class InstallContext:
|
|||||||
|
|
||||||
self.buildOIIO = args.build_oiio
|
self.buildOIIO = args.build_oiio
|
||||||
self.buildZLIB = args.build_zlib
|
self.buildZLIB = args.build_zlib
|
||||||
self.buildBOOST = args.build_boost
|
|
||||||
self.buildLLVM = args.build_llvm
|
self.buildLLVM = args.build_llvm
|
||||||
self.buildCLANG = args.build_clang
|
self.buildCLANG = args.build_clang
|
||||||
self.buildPUGIXML = args.build_pugixml
|
self.buildPUGIXML = args.build_pugixml
|
||||||
@@ -2003,12 +1812,9 @@ requiredDependencies = []
|
|||||||
|
|
||||||
# Determine list of dependencies that are required based on options
|
# Determine list of dependencies that are required based on options
|
||||||
# user has selected.
|
# user has selected.
|
||||||
# BOOST is deleted becauseI want to use system installed boost
|
|
||||||
if Windows():
|
if Windows():
|
||||||
if context.buildZLIB:
|
if context.buildZLIB:
|
||||||
requiredDependencies += [ZLIB]
|
requiredDependencies += [ZLIB]
|
||||||
if context.buildBOOST:
|
|
||||||
requiredDependencies += [BOOST]
|
|
||||||
|
|
||||||
if Windows():
|
if Windows():
|
||||||
if context.buildLLVM:
|
if context.buildLLVM:
|
||||||
@@ -2117,12 +1923,7 @@ else:
|
|||||||
|
|
||||||
if find_executable("cmake"):
|
if find_executable("cmake"):
|
||||||
# Check cmake requirements
|
# Check cmake requirements
|
||||||
if Windows():
|
cmake_required_version = (3, 15)
|
||||||
# Windows build depend on boost 1.70, which is not supported before
|
|
||||||
# cmake version 3.14
|
|
||||||
cmake_required_version = (3, 14)
|
|
||||||
else:
|
|
||||||
cmake_required_version = (3, 12)
|
|
||||||
cmake_version = GetCMakeVersion()
|
cmake_version = GetCMakeVersion()
|
||||||
if not cmake_version:
|
if not cmake_version:
|
||||||
PrintError("Failed to determine CMake version")
|
PrintError("Failed to determine CMake version")
|
||||||
@@ -2179,9 +1980,8 @@ Building with settings: ------------
|
|||||||
Building {buildType}
|
Building {buildType}
|
||||||
Config {buildConfig}
|
Config {buildConfig}
|
||||||
|
|
||||||
Mandatory Dependencies: ------------
|
Mandatory Dependencies: ------------
|
||||||
Zlib: {buildZLIB}
|
Zlib: {buildZLIB}
|
||||||
Boost: {buildBOOST}
|
|
||||||
LLVM: {buildLLVM}
|
LLVM: {buildLLVM}
|
||||||
CLANG: {buildCLANG}
|
CLANG: {buildCLANG}
|
||||||
PugiXML: {buildPUGIXML}
|
PugiXML: {buildPUGIXML}
|
||||||
@@ -2193,7 +1993,7 @@ Building with settings: ------------
|
|||||||
Flex: {buildFLEX}
|
Flex: {buildFLEX}
|
||||||
Bison: {buildBISON}
|
Bison: {buildBISON}
|
||||||
|
|
||||||
Optional Dependencies: ------------
|
Optional Dependencies: ------------
|
||||||
Ptex: {buildPTEX}
|
Ptex: {buildPTEX}
|
||||||
OpenColorIO: {buildOCIO}
|
OpenColorIO: {buildOCIO}
|
||||||
LibRaw: {buildLIBRAW}
|
LibRaw: {buildLIBRAW}
|
||||||
@@ -2266,7 +2066,6 @@ summaryMsg = summaryMsg.format(
|
|||||||
buildPTEX=("On" if context.buildPTEX else "Off"),
|
buildPTEX=("On" if context.buildPTEX else "Off"),
|
||||||
buildOIIO=("On" if context.buildOIIO else "Off"),
|
buildOIIO=("On" if context.buildOIIO else "Off"),
|
||||||
buildZLIB=("On" if context.buildZLIB else "Off"),
|
buildZLIB=("On" if context.buildZLIB else "Off"),
|
||||||
buildBOOST=("On" if context.buildBOOST else "Off"),
|
|
||||||
buildLLVM=("On" if context.buildLLVM else "Off"),
|
buildLLVM=("On" if context.buildLLVM else "Off"),
|
||||||
buildCLANG=("On" if context.buildCLANG else "Off"),
|
buildCLANG=("On" if context.buildCLANG else "Off"),
|
||||||
buildPUGIXML=("On" if context.buildPUGIXML else "Off"),
|
buildPUGIXML=("On" if context.buildPUGIXML else "Off"),
|
||||||
|
Before Width: | Height: | Size: 100 KiB After Width: | Height: | Size: 100 KiB |
@@ -0,0 +1,13 @@
|
|||||||
|
# Copyright Contributors to the Open Shading Language project.
|
||||||
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||||
|
|
||||||
|
# Ignore temporary specs that may be ephemeral or local to an individual
|
||||||
|
# developer, to prevent cluttering the output of `git status` and prevent
|
||||||
|
# people from accidentally checking in specs that are only meant for them.
|
||||||
|
specs/*
|
||||||
|
|
||||||
|
# But don't ignore the ones that belong to this project and are checked in. As
|
||||||
|
# we add specs that we intend to commit and make available to all project
|
||||||
|
# developers, they must be individually added here.
|
||||||
|
!specs/002-backend-cpp
|
||||||
@@ -0,0 +1,170 @@
|
|||||||
|
Policy on AI Coding Assistants
|
||||||
|
==============================
|
||||||
|
|
||||||
|
- Initial policy merged 23-Mar-2026
|
||||||
|
|
||||||
|
|
||||||
|
Use of "AI coding assistants" is permitted on this project, with the following
|
||||||
|
guidelines and principles.
|
||||||
|
|
||||||
|
Summary of our core values:
|
||||||
|
- Human must always be in the loop, and is the responsible party for
|
||||||
|
the contents of a PR (including fully understanding and being able
|
||||||
|
to explain, defend, and modify it in response to review comments).
|
||||||
|
- Interact with the project and community yourself, not by agent.
|
||||||
|
- Disclose what tools you used and how. At a minimum, we require an
|
||||||
|
"Assisted-by: TOOL/MODEL" line in the commit comments and PR description.
|
||||||
|
- Don't waste maintainer's time with low quality PRs.
|
||||||
|
|
||||||
|
The long version:
|
||||||
|
|
||||||
|
### Human authorship and interaction with the project
|
||||||
|
|
||||||
|
**The human making a PR is considered the author** and is fully responsible
|
||||||
|
for the code they submit.
|
||||||
|
|
||||||
|
**No PRs should be submitted, reviewed/merged, or deployed without a human
|
||||||
|
fully in the loop.** You may use agents locally to help you write code (and
|
||||||
|
docs, tests, etc.), but you may not use agents to autonomously interact with
|
||||||
|
the project community. Submit your own PRs, write your own discussion
|
||||||
|
comments, respond to community members in your own words, approve or reject
|
||||||
|
code in review using your own brain.
|
||||||
|
|
||||||
|
Code autonomously submitted without an identifiable human author and
|
||||||
|
responsible party will be immediately closed, and the account associated with
|
||||||
|
the submission may be banned from future project participation.
|
||||||
|
|
||||||
|
**DO NOT "vibe code."** This term refers to a pure prompt-to-behavior cycle
|
||||||
|
where the human accepts un-inspected code based on the program behavior alone.
|
||||||
|
We don't want this. Code that must be maintained by the project should be
|
||||||
|
truly understood. Project code is ideally the result of discussion / pair
|
||||||
|
programming between the author and assistant, but even if the machine is doing
|
||||||
|
most of the work, all code should be approved and fully understood by the
|
||||||
|
author prior to PR submission.
|
||||||
|
|
||||||
|
### Professionalism and quality
|
||||||
|
|
||||||
|
**The usual high quality level of PRs should be maintained regardless of tools
|
||||||
|
used.** This includes not only code, but also the design, testing, PR
|
||||||
|
preparation, and the author's ability to explain and defend the code and
|
||||||
|
respond to questions and requests for changes. We never want to hear "but the
|
||||||
|
AI..." as an excuse for anything.
|
||||||
|
|
||||||
|
**PRs should always be [reviewed](CodeReview.md) and approved by someone other
|
||||||
|
than their author if at all possible.** This is especially true of code with
|
||||||
|
machine-generated components, because of the additional risk that the
|
||||||
|
submitter/operator may not fully understand what they did not write
|
||||||
|
themselves. This is part of the reason for AI tool disclosure -- to ensure
|
||||||
|
that another pair of eyes is on it. AI code review may be requested for
|
||||||
|
additional input, but the AI cannot give "approval", nor merge code itself.
|
||||||
|
|
||||||
|
Even when using a coding assistant to write the code, you are strongly
|
||||||
|
encouraged to write your own PR description, in your own words, if for no
|
||||||
|
other reason than to force yourself to understand the code well enough to
|
||||||
|
describe it to others.
|
||||||
|
|
||||||
|
### Disclosure
|
||||||
|
|
||||||
|
**Disclosure is required.** Patches that were written with the aid of AI
|
||||||
|
coding assistants must have, at a minimum, the following line in the commit
|
||||||
|
comment and PR description body:
|
||||||
|
|
||||||
|
Assisted-by: TOOL / MODEL
|
||||||
|
|
||||||
|
Ideally, to the extent practical, the PR description should also have a brief
|
||||||
|
description of how the tool was used, including the gist of key prompts or
|
||||||
|
summarizing the direction of the dialog. A full log is not necessary; a short
|
||||||
|
summary will do.
|
||||||
|
|
||||||
|
There are several reasons for this disclosure/documentation, even though it
|
||||||
|
will sometimes be inconvenient:
|
||||||
|
- Reproducibility: We want even automated work to be reproducible by others in
|
||||||
|
principle, just like a scientific paper.
|
||||||
|
- Education: We want to actively teach each other what tools, prompts, or
|
||||||
|
methods are successful at making high quality results for the project.
|
||||||
|
- Metrics: We would like the ability to look back and compare assisted vs
|
||||||
|
non-assisted code for things like defect rate (how often were new bugs
|
||||||
|
introduced or commits needed to be reverted), whether people are more likely
|
||||||
|
to write comprehensive tests when using assistants, etc.
|
||||||
|
- Compliance: Many key users and developers are in companies where they need
|
||||||
|
to disclose how AI tools were used in their work, and in other software that
|
||||||
|
they use. Let's make it easy for them.
|
||||||
|
- Insurance: Should future legal decisions radically change the IP status of
|
||||||
|
AI-generated code, or if particular models are implicated in copyright
|
||||||
|
violations, we want a way to find out which contributions might need to be
|
||||||
|
revisited in order to bring the project back into compliance.
|
||||||
|
|
||||||
|
### Intellectual Property
|
||||||
|
|
||||||
|
Regardless of how the code came to be -- from your head alone, from a friend,
|
||||||
|
from Stack Overflow, from a blog post, from reading other code bases, or from
|
||||||
|
a coding assistant -- we expect the terms of the
|
||||||
|
[DCO](https://developercertificate.org/) and CLA to apply, and for the author
|
||||||
|
to take reasonable care that code is not copied from a source with an
|
||||||
|
incompatible license.
|
||||||
|
|
||||||
|
You may find that your confidence about complying with the DCO+CLA depends on:
|
||||||
|
|
||||||
|
- If you provided a detailed specification and how much you edited or guided
|
||||||
|
the results yourself.
|
||||||
|
- Whether you are modifying or extending existing code versus writing large
|
||||||
|
amounts of entirely new code.
|
||||||
|
- The degree to which the generated code seems to fit into our structure and
|
||||||
|
idiomatic style, and therefore seems unlikely to be copied from elsewhere.
|
||||||
|
- Whether your tool has guardrails to prevent answers that are too similar to
|
||||||
|
existing code, for example as claimed by [Claude](https://privacy.claude.com/en/articles/10023638-why-am-i-receiving-an-output-blocked-by-content-filtering-policy-error) and [Copilot](https://docs.github.com/en/copilot/how-tos/manage-your-account/).
|
||||||
|
|
||||||
|
### Extractive submissions
|
||||||
|
|
||||||
|
**Maintainer time and attention are precious commodities**, and use of coding
|
||||||
|
assistants is not an excuse to submit poor PRs or to externalize costs onto
|
||||||
|
maintainers/reviewers (such as responsibility for understanding, testing, or
|
||||||
|
fixing PRs that the human author does not have a full understanding of).
|
||||||
|
|
||||||
|
Maintainers are free to take counter-measures against submitters of sub-par
|
||||||
|
PRs, or other violations of this policy, up to and including banning habitual
|
||||||
|
abusers from future participation in the project.
|
||||||
|
|
||||||
|
**We discourage use of AI tools to fix GitHub issues labeled as "good first
|
||||||
|
issue" or for "Dev Days" work.** Cultivating and educating new contributors is
|
||||||
|
important, and as such, we do not want people to swoop in and use automated
|
||||||
|
tools to trivially solve tasks that were curated specifically for somebody to
|
||||||
|
actually learn from. We expect each developer to implement at most one "good
|
||||||
|
first issue" per Dev Days occasion, and we encourage you to solve the problem
|
||||||
|
with your own brain to maximize the learning experience.
|
||||||
|
|
||||||
|
### Exceptions
|
||||||
|
|
||||||
|
This AI tool use policy is not meant to encompass cases such as:
|
||||||
|
- "Smart auto-complete", spell-checking, grammar checking, or other uses that
|
||||||
|
aren't really contributing substantively to authorship.
|
||||||
|
- Use of LLMs to explain code or learn about the codebase, answer basic
|
||||||
|
programming questions, help with background research, or audit the code
|
||||||
|
for bugs that are subsequently confirmed and fixed by people.
|
||||||
|
- Language translation for non-fluent English speakers or other accessibility
|
||||||
|
accommodations.
|
||||||
|
- Trivial or de-minimis fixes such as fixing a typo, obviously wrong variable
|
||||||
|
use, etc.
|
||||||
|
- Reviewing your own code for mistakes prior to submitting a PR (as long as it
|
||||||
|
isn't making the fixes for you).
|
||||||
|
|
||||||
|
### Creative contributions -- out of scope
|
||||||
|
|
||||||
|
This project repository contains code for tools, and their documentation. We
|
||||||
|
don't really directly host any artistically creative work here, so we have not
|
||||||
|
addressed additional policy issues that might come up in such a context.
|
||||||
|
|
||||||
|
If you are representing a different project that is using this document for
|
||||||
|
guidance or inspiration for your own policies, please be aware that you may
|
||||||
|
have needs that are not covered by these policies but deserve well-crafted
|
||||||
|
guidance.
|
||||||
|
|
||||||
|
### References and inspiration
|
||||||
|
|
||||||
|
Our policy has been informed and inspired by the following efforts in other communities:
|
||||||
|
- [LLVM AI Tool Policy](https://llvm.org/docs/AIToolPolicy.html)
|
||||||
|
- [Fedora Project policy on AI-assisted contributions](https://communityblog.fedoraproject.org/council-policy-proposal-policy-on-ai-assisted-contributions/)
|
||||||
|
- [Linux Foundation policy on Generative AI](https://www.linuxfoundation.org/legal/generative-ai)
|
||||||
|
- [Rust policy on rejecting burdensome PRs](https://github.com/rust-lang/compiler-team/issues/893)
|
||||||
|
- The METR paper [Measuring the Impact of Early-2025 AI on Experienced Open-Source Developer Productivity](https://metr.org/blog/2025-07-10-early-2025-ai-experienced-os-dev-study/)
|
||||||
|
- [GitHub Blog: Rethinking open source mentorship in the AI era](https://github.blog/open-source/maintainers/rethinking-open-source-mentorship-in-the-ai-era/)
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
<!-- SPDX-License-Identifier: CC-BY-4.0 -->
|
||||||
|
<!-- Copyright Contributors to the OpenImageIO Project. -->
|
||||||
|
|
||||||
|
# Agentic coding / coding assistants
|
||||||
|
|
||||||
|
Please start by reading [our policy on using "AI" coding
|
||||||
|
assistsants](AI_Policy.md).
|
||||||
|
|
||||||
|
|
||||||
|
## Multi-tool setup
|
||||||
|
|
||||||
|
We aim to allow people to use whatever agentic or coding assistant tools they
|
||||||
|
want. The repository ships with a setup script that configures tool-specific
|
||||||
|
files locally for whichever assistant(s) you use.
|
||||||
|
|
||||||
|
### Generic: `AGENTS.md` and `.agents/`
|
||||||
|
|
||||||
|
As much as possible, we use identical instructions and files across all coding
|
||||||
|
assistants.
|
||||||
|
|
||||||
|
`AGENTS.md` is the main file providing overall repo-specific instructions and
|
||||||
|
context to agents. Many coding agents already read this file directly; for
|
||||||
|
those that don't, the setup script creates the necessary links or wrappers.
|
||||||
|
|
||||||
|
`.agents/skills/` is where shared skill files live. Many tools find skills
|
||||||
|
here automatically; for those that need them elsewhere, the setup script
|
||||||
|
creates the appropriate links.
|
||||||
|
|
||||||
|
### Running the setup script
|
||||||
|
|
||||||
|
After cloning, run `.agents/setup-agent <tool>` for the tool(s) you use:
|
||||||
|
|
||||||
|
```
|
||||||
|
.agents/setup-agent claude # Claude Code
|
||||||
|
.agents/setup-agent cursor # Cursor
|
||||||
|
.agents/setup-agent codex # OpenAI Codex
|
||||||
|
.agents/setup-agent opencode # Opencode
|
||||||
|
.agents/setup-agent copilot # GitHub Copilot
|
||||||
|
.agents/setup-agent all # all of the above
|
||||||
|
```
|
||||||
|
|
||||||
|
The script is idempotent — running it multiple times is safe. To undo:
|
||||||
|
|
||||||
|
```
|
||||||
|
.agents/setup-agent clear # remove all tool setup
|
||||||
|
.agents/setup-agent clear claude # remove setup for one tool
|
||||||
|
```
|
||||||
|
|
||||||
|
Tool-specific directories (`.claude/`, `.cursor/`, `.codex/`, `.opencode/`,
|
||||||
|
`.github/copilot-instructions.md`) are created locally only and are listed in
|
||||||
|
`.gitignore`. Each developer runs the script for the tool they use; nothing
|
||||||
|
tool-specific is committed to the repository.
|
||||||
|
|
||||||
|
The script header contains per-tool documentation (what each tool reads
|
||||||
|
natively, what requires setup, and links to relevant docs) — consult it when
|
||||||
|
adding support for a new tool or updating the strategy for an existing one.
|
||||||
|
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
<!-- SPDX-License-Identifier: CC-BY-4.0 -->
|
||||||
|
<!-- Copyright Contributors to the Open Shading Language Project. -->
|
||||||
|
|
||||||
|
# Build profiling
|
||||||
|
|
||||||
|
These are instructions for profiling the build process of OSL --
|
||||||
|
useful for figuring out where the build process is spending its time, and
|
||||||
|
where it might be optimized.
|
||||||
|
|
||||||
|
## Profiling module compilation with clang -ftime-trace
|
||||||
|
|
||||||
|
These instructions are based on the following references:
|
||||||
|
|
||||||
|
- general instructions: https://www.superfunc.zone/posts/001-speeding-up-c-builds/
|
||||||
|
- ninjatracing.py script: https://github.com/nico/ninjatracing
|
||||||
|
- Background info: https://aras-p.info/blog/2019/01/16/time-trace-timeline-flame-chart-profiler-for-Clang/
|
||||||
|
|
||||||
|
The steps are as follows, and they require the use of clang, ninja, and
|
||||||
|
the chrome browser:
|
||||||
|
|
||||||
|
1. Build with clang using the `-ftime-trace`, flag which is set when you use
|
||||||
|
the OSL build option -DOSL_BUILD_PROFILE=1. You MUST use clang, as this
|
||||||
|
is a clang-specific feature, and you must use the ninja builder (use CMake
|
||||||
|
arguments `-G ninja`). This must be a *fresh* build, not an incremental
|
||||||
|
build (or the results will only reflect the incrementally build parts).
|
||||||
|
|
||||||
|
This will result in a file, build/.ninja_log, containing timings from
|
||||||
|
the build process.
|
||||||
|
|
||||||
|
2. Prepare the output using the `ninjatracing.py` script as follows:
|
||||||
|
|
||||||
|
```
|
||||||
|
python3 src/build-scripts/ninjatracing.py -a build/.ninja_log > top_level.json
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Running the Chrome browser, visit the URL `chrome://tracing`, and LOAD that
|
||||||
|
json file created in the previous step. This will display a timeline of the
|
||||||
|
build process, showing which thread, in what order, and how long each
|
||||||
|
module took to compile.
|
||||||
|
|
||||||
|
4. For even more detail on what's happening within the compilation of each
|
||||||
|
module, you can use the `-e` flag to expand the output:
|
||||||
|
|
||||||
|
```
|
||||||
|
python3 src/build-scripts/ninjatracing.py -a -e -g 50000 build/.ninja_log > expanded.json
|
||||||
|
```
|
||||||
|
|
||||||
|
Loading this in Chrome's tracing view, as above, will show a full flame
|
||||||
|
chart of the build process, showing the time spent in the different
|
||||||
|
functional parts of the compiler and which functions of OSL it is
|
||||||
|
compiling or which templates are being instantiated.
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
Release 1.14.0 (Fall 2024) -- compared to 1.13
|
||||||
|
-------------------------------------------------
|
||||||
|
|
||||||
|
### New minimum dependencies and compatibility changes:
|
||||||
|
* *Blah*: Raise minimum to 1.2...
|
||||||
|
|
||||||
|
### OSL Language, standard library, and oslc compiler (for shader writers):
|
||||||
|
* *New feature*: item
|
||||||
|
|
||||||
|
### ⛰️ API changes and new ShadingSystem features (for renderer writers):
|
||||||
|
|
||||||
|
### 🚀 SIMD batched shading mode
|
||||||
|
|
||||||
|
### 🚀 OptiX GPU rendering
|
||||||
|
|
||||||
|
### 🐛/🔧 Internals: fixes, improvements, and developer concerns
|
||||||
|
|
||||||
|
|
||||||
|
### 🏗 Build/test/CI and platform ports
|
||||||
|
* CMake build system and scripts:
|
||||||
|
- item
|
||||||
|
* Testing and Continuous integration (CI) systems:
|
||||||
|
- *test*: item
|
||||||
|
- *ci*: item
|
||||||
|
* Platform support:
|
||||||
|
- *win*: item
|
||||||
|
|
||||||
|
### 📚 Documentation
|
||||||
|
- *docs*: item
|
||||||
|
|
||||||
|
### 🏢 Project Administration
|
||||||
|
- *admin*: item
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
Release 1.2.3.4 (Month DD, YYYY) -- compared to 1.2.3.3
|
||||||
|
-------------------------------------------------------
|
||||||
|
- *category*: Description [#1234](https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/1234) (by someuser)
|
||||||
|
|
||||||
@@ -0,0 +1,196 @@
|
|||||||
|
<!-- SPDX-License-Identifier: CC-BY-4.0 -->
|
||||||
|
<!-- Copyright Contributors to the Open Shading Language Project. -->
|
||||||
|
|
||||||
|
|
||||||
|
Code Review Procedures
|
||||||
|
======================
|
||||||
|
|
||||||
|
### Why do we code review?
|
||||||
|
|
||||||
|
Code review is a process where someone other than the author of a patch
|
||||||
|
examines the proposed changes and approves or critiques them. The main
|
||||||
|
benefits are to:
|
||||||
|
|
||||||
|
- Encourage submitters to ensure that their changes are well thought out,
|
||||||
|
tested, and documented so that their intent and wisdom will be clear to
|
||||||
|
others.
|
||||||
|
- Directly find shortcomings in or suggest improvements to the proposed
|
||||||
|
changes, and ensure that the changes are consistent with the project's best
|
||||||
|
practices.
|
||||||
|
- Minimize the amount of the code base that has only been seen or is only
|
||||||
|
understood by one person.
|
||||||
|
- Improve security and robustness of the code base by assuring that at least
|
||||||
|
two people (submitter and reviewer) agree that every patch is reasonable and
|
||||||
|
safe.
|
||||||
|
|
||||||
|
### Reviewer guidelines -- what you should be looking for
|
||||||
|
|
||||||
|
Code review is not difficult, and it doesn't require you to be a senior
|
||||||
|
developer or a domain expert. Even if you don't particularly understand that
|
||||||
|
region of the code and are not a domain expert in the feature being changed,
|
||||||
|
you can still provide a helpful second pair of eyes to look for obvious red
|
||||||
|
flags and give an adequate review:
|
||||||
|
|
||||||
|
- This may seem too obvious to say explicitly, but a big part of review is
|
||||||
|
just looking at the PR and seeing that it doesn't appear to deface,
|
||||||
|
purposely/obviously break, or introduce malware into the project.
|
||||||
|
- Does the explanation of the PR make logical sense and appear to match (as
|
||||||
|
near as you can tell) the changes in the code? Does it seem sensible, even
|
||||||
|
if you don't understand all the details?
|
||||||
|
- Does the test pass all of our existing CI tests? (If it does, at least we
|
||||||
|
are reasonably sure it doesn't break commonly used features.)
|
||||||
|
- Is there any evidence that the changes have been tested? Ideally, something
|
||||||
|
already in, or added to the testsuite by this PR, exercises the new or
|
||||||
|
altered code. (Though sometimes a patch addresses an edge case that's very
|
||||||
|
hard to reproduce in the testsuite, and you have to rely on the submitter's
|
||||||
|
word and the sensibility of their explanation.)
|
||||||
|
- Not required, but nice if we can get it: You're an expert in the part of
|
||||||
|
the code being changed, and you agree that this is the best way to achieve
|
||||||
|
an improvement.
|
||||||
|
- Any objections should be explained in detail and invite counter-arguments
|
||||||
|
from the author or other onlookers. A reviewer should never close a PR
|
||||||
|
unless it fails to conform to even the basic requirements of any submitted
|
||||||
|
PR, or if enough time has passed that it's clear that the PR has been
|
||||||
|
abandoned by its author. It's ok to ultimately say "no" to a PR that can't
|
||||||
|
be salvaged, but that should be the result of a dialogue.
|
||||||
|
|
||||||
|
Obviously, you also want any review comments you give to be constructive and
|
||||||
|
helpful. If you don't understand something, ask for clarification. If you
|
||||||
|
think something is wrong, suggest a fix if you know how to fix it. If you
|
||||||
|
think something is missing, suggest what you think should be added. Follow the
|
||||||
|
expected kind and constructive tone of the project's community.
|
||||||
|
|
||||||
|
### Submitter guidelines -- how to encourage good reviews and timely merges
|
||||||
|
|
||||||
|
A few tips for submitters to help ensure that your PRs get reviewed and merged
|
||||||
|
in a timely manner and are respectful of the reviewers' time and effort:
|
||||||
|
|
||||||
|
- Aim for small PRs that do a specific thing in a clear way. It is better to
|
||||||
|
implement a large change with a series of PRs that each take a small,
|
||||||
|
obvious step forward, than to have one huge PR that makes changes so
|
||||||
|
extensive that nobody quite knows how to evaluate it.
|
||||||
|
- Make sure your PR commit summary message clearly explains the why and how of
|
||||||
|
your changes. You want someone to read that and judge whether it's a
|
||||||
|
sensible approach, know what to look for in the code, and have their
|
||||||
|
examination of the code make them say "yes, I see, of course, great, just as
|
||||||
|
I expected!"
|
||||||
|
- Make sure your PR includes a test (if not covered by existing tests).
|
||||||
|
- Make sure your PR fully passes our CI tests.
|
||||||
|
- Make sure your PR modifies the documentation as necessary if it adds new
|
||||||
|
features, changes any public APIs, or alters behavior of existing features.
|
||||||
|
- If your PR alters public C++ APIs for which there are also Python bindings,
|
||||||
|
make sure that the changes are also reflected in the Python bindings and any
|
||||||
|
other language bindings we support.
|
||||||
|
- If you are adding new language features or behaviors, make sure they are
|
||||||
|
implemented and tested in all of the back-ends: single point shading,
|
||||||
|
batch shading, GPU/OptiX.
|
||||||
|
|
||||||
|
### Code review procedures -- in the ideal case
|
||||||
|
|
||||||
|
In the best of circumstances, the code review process should be as follows for
|
||||||
|
**EVERY** pull request:
|
||||||
|
|
||||||
|
- At least one reviewer critiques and eventually (possibly after changes are
|
||||||
|
made) approves the pull request. Reviewers, by definition, are not the same
|
||||||
|
person as the author.
|
||||||
|
- Reviewers should indicate their approval by clicking the "Approve" button in
|
||||||
|
GitHub, or by adding a comment that says "LGTM" (looks good to me).
|
||||||
|
- If possible, reviewers should have some familiarity with the code being
|
||||||
|
changed (though for a large code base, this is not always possible).
|
||||||
|
- At least a few work days should elapse between posting the PR and merging
|
||||||
|
it, even if an approving review is received immediately. This is to allow
|
||||||
|
additional reviewers or dissenting voices to get a chance to weigh in.
|
||||||
|
- If the reviewer has suggestions for improvement, it's the original author
|
||||||
|
who should make the changes and push them to the PR, or at the very least,
|
||||||
|
the author should okay any changes made by the reviewer before a merge
|
||||||
|
occurs (if at all practical).
|
||||||
|
|
||||||
|
Not all patches need the highest level of scrutiny. Reviews can be cursory and
|
||||||
|
quick, and merges performed without additional delay, in some common low-risk
|
||||||
|
circumstances:
|
||||||
|
|
||||||
|
- The patch fixes broken CI, taking the project from a verifiably broken state
|
||||||
|
to passing all of our CI builds and tests.
|
||||||
|
- The changes are only to documentation, comments, or other non-code files,
|
||||||
|
and so cannot break the build or introduce new bugs.
|
||||||
|
- The code changes are trivial and are obviously correct. (This is a judgment
|
||||||
|
call, but if the author or reviewer or both are among the project's senior
|
||||||
|
developers, they don't need to performatively pretend that they aren't sure
|
||||||
|
it's a good patch.)
|
||||||
|
- The changes are to *localized* and *low risk* code, that even if wrong,
|
||||||
|
would only have the potential to break individual non-critical features or
|
||||||
|
rarely-used code paths.
|
||||||
|
|
||||||
|
Conversely, some patches are so important or risky that if possible, they
|
||||||
|
should be reviewed by multiple people, preferably from different stakeholder
|
||||||
|
institutions than the author, and ensure that the approval is made with a
|
||||||
|
detailed understanding of the issues. In these cases, it may also be worth
|
||||||
|
bringing up the issue up at a TSC meeting to ensure the attention of many
|
||||||
|
stakeholders. These include:
|
||||||
|
|
||||||
|
- *New directions*: Addition of major new features, new strategic initiatives,
|
||||||
|
or changes to APIs that introduce new idioms or usage patterns should give
|
||||||
|
ample time for all stakeholders to provide feedback. In such cases, it may
|
||||||
|
be worth having the PR open for comments for weeks, not just days.
|
||||||
|
- *Risky changes*: Changes to core classes or code that could subtly break
|
||||||
|
many things if not done right, or introduce performance regressions to
|
||||||
|
critical cases.
|
||||||
|
- *Compatibility breaks*: changes that propose to break backward API
|
||||||
|
compatibility with existing code or data files, or that change the required
|
||||||
|
toolchain or dependencies needed to build the project.
|
||||||
|
- *Security*: Changes that could introduce security vulnerabilities, or that
|
||||||
|
fix tricky security issues where the best fix is not obvious.
|
||||||
|
|
||||||
|
### Code review compromises -- because things are rarely ideal
|
||||||
|
|
||||||
|
We would love to have many senior reviewers constantly watching for PRs, doing
|
||||||
|
thorough reviews immediately, and following the above guidelines without
|
||||||
|
exception. Wouldn't that be great! But in reality, we have to compromise,
|
||||||
|
hurry, or cut corners, or nothing would ever get done. Some of these
|
||||||
|
compromises are understandable and acceptable if they aren't happening too
|
||||||
|
often.
|
||||||
|
|
||||||
|
- Lack of reviews: If no reviews are forthcoming after a couple days, a "are
|
||||||
|
there any objections?" comment may be added to the PR, and if no objections
|
||||||
|
are raised within another few days, the PR may be merged by the author if
|
||||||
|
they are a senior developer on the project. This is a fact of life, but
|
||||||
|
should be minimized (with a rigor proportional to where the patch falls on
|
||||||
|
the "low risk / high risk" scale described above). If this is done, you
|
||||||
|
should leave an additional comment explaining why it was merged without
|
||||||
|
review and inviting people to submit post-merge comments if they
|
||||||
|
subsequently spot something that can be improved.
|
||||||
|
- Time-critical patches: urgent security fixes, broken CI or builds, critical
|
||||||
|
bugs affecting major stakeholders who are waiting for a repaired release,
|
||||||
|
fixes that are blocking other work or preventing other PRs from advancing.
|
||||||
|
In such cases, it is understandable for senior developers to try to speed up
|
||||||
|
the process of getting the changes integrated (though the very nature of
|
||||||
|
their criticality also indicates that it's worth getting a review if at all
|
||||||
|
possible).
|
||||||
|
- Failing tests: Sometimes a PR must be merged despite failing CI tests.
|
||||||
|
Usually this is for one of two reasons: (1) spurious CI failures are known
|
||||||
|
to be occurring at that time and are unrelated to the PR; (2) the PR is part
|
||||||
|
of a series of patches that are only expected to fully pass CI when the last
|
||||||
|
piece is completed.
|
||||||
|
|
||||||
|
These changes are understandable, but we still are striving to reduce their
|
||||||
|
frequency. It is the responsibility of the senior developers, TSC members, and
|
||||||
|
major stakeholders to be monitoring the incoming PRs and helping with reviews
|
||||||
|
as much as possible, to ensure that review exceptions are rare.
|
||||||
|
|
||||||
|
### Code review pathologies -- things to avoid
|
||||||
|
|
||||||
|
These are anti-patterns that generally are indications of an unhealthy open
|
||||||
|
source project:
|
||||||
|
|
||||||
|
* An author merging their own PR without any review comments that indicate
|
||||||
|
meaningful scrutiny or approval from another party, and without giving
|
||||||
|
adequate warning that a merge will occur if no reviews are received.
|
||||||
|
* PRs languishing for weeks or months without any review or merge.
|
||||||
|
* PRs that don't adequately test their changes (basically crossing your
|
||||||
|
fingers and hoping it works).
|
||||||
|
* PRs that are merged despite failing CI that might be related or, if
|
||||||
|
unrelated, that might be masking problems with the PR being evaluated.
|
||||||
|
|
||||||
|
Again, sometimes these things happen out of necessity to keep the project
|
||||||
|
moving forward under constrained development resources. But we strive as much
|
||||||
|
as possible to ensure that they are rare exceptions.
|
||||||
@@ -10,17 +10,18 @@
|
|||||||
Our release numbers are of the form `MAJOR.MINOR.PATCH.TWEAK`, and we follow
|
Our release numbers are of the form `MAJOR.MINOR.PATCH.TWEAK`, and we follow
|
||||||
an almost-semantic-versioning scheme.
|
an almost-semantic-versioning scheme.
|
||||||
|
|
||||||
MAJOR changes are those that break backward-compatibility of the public APIs,
|
MAJOR releases are those that break backward-compatibility of the public APIs,
|
||||||
requiring existing application code to change their source code where it calls
|
requiring existing application code to change their source code where it calls
|
||||||
OSL API functions in order to compile and work correctly.
|
OSL API functions in order to compile and work correctly.
|
||||||
|
|
||||||
MINOR changes guarantee API backward-compatibility with prior releases that
|
MINOR releases guarantee API backward-compatibility with prior releases that
|
||||||
have the same major number, but can introduce ABI or link incompatibilities.
|
have the same major number, but can introduce ABI or link incompatibilities.
|
||||||
Applications using OSL need to be recompiled to move to a new minor release,
|
Applications using OSL need to be recompiled to move to a new minor release,
|
||||||
but should not need to change their source code. Minor releases are allowed
|
but should not need to change their source code (except, of course, to take
|
||||||
to drop support for sufficiently old compilers and dependencies.
|
advantage of new features). Minor releases are allowed to drop support for
|
||||||
|
sufficiently old compilers and dependencies.
|
||||||
|
|
||||||
PATCH changes guarantee both API and ABI/link backward-compatibility with
|
PATCH releases guarantee both API and ABI/link backward-compatibility with
|
||||||
prior releases that have the same minor number. Features and new public API
|
prior releases that have the same minor number. Features and new public API
|
||||||
calls may be added (thus deviating from strict semantic versioning), but only
|
calls may be added (thus deviating from strict semantic versioning), but only
|
||||||
if they preserve ABI/link compatibility. This means that standalone functions
|
if they preserve ABI/link compatibility. This means that standalone functions
|
||||||
@@ -32,7 +33,7 @@ guarantee that any compilers or dependencies supported for the first release
|
|||||||
of a minor series will continue to be supported for all patches to that minor
|
of a minor series will continue to be supported for all patches to that minor
|
||||||
series.
|
series.
|
||||||
|
|
||||||
TWEAK changes are restricted to critical bug fixes or build breaks that do
|
TWEAK releases are restricted to critical bug fixes or build breaks that do
|
||||||
not alter public APIs in any way.
|
not alter public APIs in any way.
|
||||||
|
|
||||||
### Cadence of releases
|
### Cadence of releases
|
||||||
@@ -66,10 +67,10 @@ for releases.
|
|||||||
|
|
||||||
In the "main" branch:
|
In the "main" branch:
|
||||||
|
|
||||||
- TWEAK changes within "main" only guarantee ABI back-compatibility, but may
|
- TWEAK tags within "main" only guarantee ABI back-compatibility, but may
|
||||||
have additions or non-bug-fix behavior changes (akin to patch releases
|
have additions or non-bug-fix behavior changes (akin to patch releases
|
||||||
within a release branch).
|
within a release branch).
|
||||||
- PATCH changes within "main" are allowed to break ABI or API (changes that
|
- PATCH tags within "main" are allowed to break ABI or API (changes that
|
||||||
would require minor or major releases, if they were not in "main").
|
would require minor or major releases, if they were not in "main").
|
||||||
- Beware of unmarked breaks in compatibility of commits in main that are
|
- Beware of unmarked breaks in compatibility of commits in main that are
|
||||||
in between developer preview tags.
|
in between developer preview tags.
|
||||||
@@ -83,10 +84,10 @@ In the "main" branch:
|
|||||||
(and thus the branch markers will move over time). Branch names obey the
|
(and thus the branch markers will move over time). Branch names obey the
|
||||||
following conventions:
|
following conventions:
|
||||||
|
|
||||||
- `main` is the area for arbitrary changes intended for the next year's major
|
- `main` is the area for arbitrary changes intended for the next year's
|
||||||
or minor release.
|
major or minor release.
|
||||||
- `dev-1.2` are the areas for staging additions to the next month's patch
|
- `dev-1.2` are the areas for staging additions that will become the next
|
||||||
release for the designated minor version series.
|
tweak or patch release for the minor version series.
|
||||||
- `release` is a special branch marker that is always set to the latest tag of
|
- `release` is a special branch marker that is always set to the latest tag of
|
||||||
the currently supported, stable release family. People can count on
|
the currently supported, stable release family. People can count on
|
||||||
"release" always being the latest stable release, whatever that may be at
|
"release" always being the latest stable release, whatever that may be at
|
||||||
@@ -133,8 +134,8 @@ project during this soft freeze.
|
|||||||
By mid-June (about 1-2 months before the beta of a new annual big release),
|
By mid-June (about 1-2 months before the beta of a new annual big release),
|
||||||
you should branch and mark it as an alpha.
|
you should branch and mark it as an alpha.
|
||||||
|
|
||||||
At the tip of "main," create a new branch named `dev-MAJOR.MINOR` that will be
|
At the tip of "main", create a new branch named `dev-MAJOR.MINOR` that will
|
||||||
the staging area for the next release.
|
be the staging area for the next release.
|
||||||
|
|
||||||
Customarily, at that point we add a commit to main (but not to the new
|
Customarily, at that point we add a commit to main (but not to the new
|
||||||
dev-MAJ.MIN branch) that bumps main's version to the next minor level, to
|
dev-MAJ.MIN branch) that bumps main's version to the next minor level, to
|
||||||
@@ -144,7 +145,8 @@ branch, and henceforth, any big or compatibility-breaking changes will only be
|
|||||||
committed to main and not backported to the release branch. (Though we are
|
committed to main and not backported to the release branch. (Though we are
|
||||||
loose about this rule during the alpha period and allow continued breaking
|
loose about this rule during the alpha period and allow continued breaking
|
||||||
changes in the alpha, but by the time we call it beta, we allow no more
|
changes in the alpha, but by the time we call it beta, we allow no more
|
||||||
breaking changes.)
|
breaking changes.) Also at this stage, the main branch's CHANGES.md should
|
||||||
|
have a heading added at the top for the *next* version.
|
||||||
|
|
||||||
|
|
||||||
### Prior to a release
|
### Prior to a release
|
||||||
@@ -169,18 +171,17 @@ breaking changes.)
|
|||||||
|
|
||||||
3. Ensure docs are up to date:
|
3. Ensure docs are up to date:
|
||||||
|
|
||||||
- Actually read the [README.md](../README.md), [INSTALL.md](../INSTALL.md),
|
- [README.md](README.md): Actually read it! Make sure it all seems
|
||||||
and other repository docs and make sure all the information is up to
|
accurate and up to date.
|
||||||
date. Check the "contributor credits" in the README against the recent
|
- [INSTALL.md](INSTALL.md): Be sure that it accurately reflects the
|
||||||
repo history to be sure new contributors are listed. Also check the
|
current minimum and latest-tested versions of each dependency.
|
||||||
list of films and make sure it includes any recent productions that are
|
- [CREDITS.md](CREDITS.md): Check against the recent repo history to be
|
||||||
known to have used OSL.
|
sure new contributors are listed.
|
||||||
- Skim the primary user documentation to look for any obvious errors,
|
- [SECURITY.md](SECURITY.md): Make sure it accurately reflects the
|
||||||
especially the parts that describe new features. In the case of PDF docs
|
status of which branches get updates.
|
||||||
(such as osl-languagespec.pdf), make sure that a new PDF book is built if
|
- Skim the [user documentation](https://docs.openshadinglanguage.org) to
|
||||||
the documentation source has been changed since the last release.
|
ensure it's building correctly and doesn't have any obvious errors,
|
||||||
- If we are using any online docs (like readthedocs), make sure it is
|
especially the parts that describe new features.
|
||||||
building and looks correct on the web site.
|
|
||||||
|
|
||||||
4. Make sure the the top-level CMakeLists.txt file is updated:
|
4. Make sure the the top-level CMakeLists.txt file is updated:
|
||||||
|
|
||||||
@@ -229,17 +230,33 @@ truly critical bugs or build breaks that users will encounter.
|
|||||||
|
|
||||||
The following are the steps for making the release:
|
The following are the steps for making the release:
|
||||||
|
|
||||||
1. Edit the top-level CMakeLists.txt to remove any RC designation
|
1. Double check the top-level CMakeLists.txt to ensure the right version
|
||||||
(i.e., `PROJECT_VERSION_RELEASE_TYPE` should be set to `""`).
|
number and type of version designation (i.e.,
|
||||||
|
`PROJECT_VERSION_RELEASE_TYPE` should be set appropriately).
|
||||||
|
|
||||||
2. Edit CHANGES.md to reflect the correct date of the release and ensure it
|
2. Edit CHANGES.md to reflect the correct date of the release and ensure it
|
||||||
includes any last-minute changes that were made during beta or release
|
includes any last-minute changes that were made during beta or release
|
||||||
candidate stages.
|
candidate stages. Please see the section "Generating release notes" below.
|
||||||
|
|
||||||
3. Push it to **your** GitHub, make sure it passes CI.
|
3. Push it to **your** GitHub fork, make sure it passes CI.
|
||||||
|
|
||||||
4. Tag the release: `git tag v1.2.3.4` (no more beta, RC, or dev suffix).
|
4. Tag the release with a signed tag:
|
||||||
|
|
||||||
|
$ git tag -s v1.2.3.4 # add a signed tag
|
||||||
|
$ git tag -v v1.2.3.4 # verify the tag
|
||||||
|
|
||||||
|
Be sure that the tag also reflects if it's an alpha (v1.2.3.4-alpha),
|
||||||
|
beta (v1.2.3.4-beta), release candidate (v1.2.3.4-RC1), or developer
|
||||||
|
preview (v1.2.3.4-dev). If it's a final release, just use the plain
|
||||||
|
version number (v1.2.3.4).
|
||||||
|
|
||||||
|
Note that the tag signing requires you to have a GPG key set up and
|
||||||
|
associated with your GitHub account. Please see [GitHub's signed tagging instructions](https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-tags) for more information.
|
||||||
|
|
||||||
|
If you get errors messages "gpg: signing failed: Inappropriate ioctl for device", then the solution is to first:
|
||||||
|
|
||||||
|
$ export GPG_TTY=$(tty)
|
||||||
|
|
||||||
5. If this will now be the recommended stable release, move the `release`
|
5. If this will now be the recommended stable release, move the `release`
|
||||||
branch marker to the same position.
|
branch marker to the same position.
|
||||||
|
|
||||||
@@ -253,7 +270,7 @@ The following are the steps for making the release:
|
|||||||
select "Draft a new release." Choose the new tag you just pushed. Make the
|
select "Draft a new release." Choose the new tag you just pushed. Make the
|
||||||
release title "Open Shading Language v1.2.3.4" (and beta, etc., designation
|
release title "Open Shading Language v1.2.3.4" (and beta, etc., designation
|
||||||
if applicable). In the description, paste the release notes for this
|
if applicable). In the description, paste the release notes for this
|
||||||
release (from Changes.md). If this is a beta or release candidate, check
|
release (from CHANGES.md). If this is a beta or release candidate, check
|
||||||
"this is a pre-release" box at the bottom.
|
"this is a pre-release" box at the bottom.
|
||||||
|
|
||||||
8. Announce the release on the [osl-dev mail list](https://lists.aswf.io/g/osl-dev)
|
8. Announce the release on the [osl-dev mail list](https://lists.aswf.io/g/osl-dev)
|
||||||
@@ -334,8 +351,99 @@ Odds and ends to do after the tag is pushed and the announcements are sent:
|
|||||||
- Re-read RELEASING.md and ensure that the instructions match what you
|
- Re-read RELEASING.md and ensure that the instructions match what you
|
||||||
have done. Update as necessary.
|
have done. Update as necessary.
|
||||||
|
|
||||||
- For annual beta releases, post a short message to the "Open Shading
|
- Go to [OSL's docs hosted on readthedocs.org](https://docs.openshadinglanguage.org),
|
||||||
Language" channel of the ASWF slack. It can be a one-line announcement and
|
and ensure that the new release is built, visible, and is the default
|
||||||
then just a link to the GitHub release page for this version.
|
release shown (specified in the Admin section). I tend to keep the latest
|
||||||
|
patch of each minor release available for reference indefinitely, but hide
|
||||||
|
the docs for earlier patch releases within that minor release series.
|
||||||
|
|
||||||
|
- Edit the top-level CMakeList.txt to update the version to the *next*
|
||||||
|
anticipated release on the branch, in order to ensure that anybody building
|
||||||
|
from subsequent patches won't get a release number that advertises itself
|
||||||
|
incorrectly as a prior tagged release. Also edit CHANGES.md to add a new
|
||||||
|
(blank) heading for the next patch or release.
|
||||||
|
|
||||||
|
|
||||||
|
## Generating release notes
|
||||||
|
|
||||||
|
We strongly encourage the use of "conventional commit" prefixes in commit
|
||||||
|
messages. See [CONTRIBUTING.md](CONTRIBUTING.md#commit-messages) for details.
|
||||||
|
|
||||||
|
Many PRs are submitted (even by the author of this section you are now
|
||||||
|
reading!) without the conventional commit prefix. The person who approves and
|
||||||
|
merges the commit should take responsibility during the merge process to edit
|
||||||
|
the commit message to add the appropriate prefix (and for that matter, to edit
|
||||||
|
any part of the commit message for clarity). But at the end of the day, if we
|
||||||
|
end up with some commits lacking a conventional commit prefix, it's no big
|
||||||
|
deal -- we can fix it all up by hand when we make the release notes. But
|
||||||
|
having CC prefixes in as many commit messages possible helps make the release
|
||||||
|
notes process be simpler and more automated.
|
||||||
|
|
||||||
|
We have been using the [git-cliff](https://github.com/orhun/git-cliff) tool
|
||||||
|
as the starting point for release notes. The command we use is:
|
||||||
|
|
||||||
|
git cliff -c src/doc/cliff.toml -d v1.2.3.4..HEAD > cliff.out.md
|
||||||
|
|
||||||
|
where v1.2.3.4 in this example is the tag of the last release. You could also
|
||||||
|
use commit hashes to denote the range of changes you want to document.
|
||||||
|
|
||||||
|
**For monthly patch releases**
|
||||||
|
|
||||||
|
We have found that the git-cliff output is most of what we need for the patch
|
||||||
|
releases, and can be copied into the CHANGES.md file with only some minor
|
||||||
|
editing needed. The template for the patch release notes can be found in
|
||||||
|
[Changes-skeleton-patch.md](docs/dev/Changes-skeleton-patch.md).
|
||||||
|
|
||||||
|
* Get rid of the headings that git-cliff generates. We don't use the headings
|
||||||
|
for the patch releases.
|
||||||
|
* Add prefixes to any commits that don't have them (they will be marked as
|
||||||
|
"uncategorized" by git-cliff), and feel free to change any of the existing
|
||||||
|
prefixes that you think are wrong or could be improved for clarity.
|
||||||
|
* Rearrange the order of the entries to be logical and readable. I prefer the
|
||||||
|
order: feature enhancements, bug fixes, build system fixes that might impact
|
||||||
|
users, internal changes, test improvements, documentation and administrative
|
||||||
|
changes.
|
||||||
|
* For patch releases, feel free to omit any entries that you think are not
|
||||||
|
user-facing and are too minor to be worth mentioning in the release notes.
|
||||||
|
|
||||||
|
Strive to keep the release notes just long enough for users to know if the
|
||||||
|
patch contains any fixes relevant to them, but short enough to be read at a
|
||||||
|
glance and without extraneous detail.
|
||||||
|
|
||||||
|
Here is an example of well-constructed monthly patch release notes:
|
||||||
|
https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/releases/tag/v1.13.12.0
|
||||||
|
|
||||||
|
**For annual major/minor releases**
|
||||||
|
|
||||||
|
For major releases, the git-cliff output is just a starting point and need
|
||||||
|
significant editing to get the detail and quality level we expect for our
|
||||||
|
major releases. A simple bullet list of commits is not sufficient -- we aim
|
||||||
|
for a prose-based description of important changes that "tell the story" of
|
||||||
|
the year's work and will be thoroughly understood by our stakeholders who need
|
||||||
|
to understand what has changed.
|
||||||
|
|
||||||
|
* Copy all the headings from [Changes-skeleton-major.md](docs/dev/Changes-skeleton-major.md)
|
||||||
|
or the previous year's release notes to get the skeleton of the major and
|
||||||
|
minor headers that you fit everything into. Note that it mostly corresponds
|
||||||
|
to sections of the git-cliff output, but with a more carefully constructed
|
||||||
|
hierarchy of categories.
|
||||||
|
* Add prefixes to any commits that don't have them (they will be marked as
|
||||||
|
"uncategorized" by git-cliff), and feel free to change any of the existing
|
||||||
|
prefixes that you think are wrong or could be improved for clarity.
|
||||||
|
* Rearrange the git-cliff output into the hierarchy of our preferred major
|
||||||
|
release notes organization. Within each section and subsection, group
|
||||||
|
similar changes together. The chronological order of the commits isn't as
|
||||||
|
important as clearly explaining what changed over the course of the year.
|
||||||
|
* The git-cliff output is a good starting point for populating the notes with
|
||||||
|
every PR, plus automatically adding a reference and link to the PR and the
|
||||||
|
name of the author of the patch.
|
||||||
|
* Look with a skeptical eye at the one-line bullet points from git-cliff (i.e,
|
||||||
|
from the first line of each PR's commit message). Often, they are too terse
|
||||||
|
or tend to [bury the lede](https://www.dictionary.com/e/slang/bury-the-lede/).
|
||||||
|
Expand into as much explanation is necessary for users who need to know
|
||||||
|
about the change or feature to know whether it is relevant and have some
|
||||||
|
idea what to do or that they should look at the relevant PRs for more
|
||||||
|
detail.
|
||||||
|
|
||||||
|
Here is an example of well-constructed annual major release notes:
|
||||||
|
https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/releases/tag/v1.14.3.0
|
||||||
@@ -1,217 +0,0 @@
|
|||||||
# Copyright Contributors to the Open Shading Language project.
|
|
||||||
# SPDX-License-Identifier: BSD-3-Clause
|
|
||||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
|
||||||
|
|
||||||
# SPI-specific settings
|
|
||||||
ifneq (${VERBOSE},)
|
|
||||||
$(info Including spi/Makefile-bits)
|
|
||||||
endif
|
|
||||||
|
|
||||||
$(info Building generic OSL)
|
|
||||||
PYLIB_LIB_PREFIX ?= 0
|
|
||||||
PYLIB_INCLUDE_SONAME ?= 0
|
|
||||||
#$(info MAKECMDGOALS = $(MAKECMDGOALS))
|
|
||||||
|
|
||||||
|
|
||||||
## Detect which SPI platform and set $platform, $COMPILER,
|
|
||||||
## and PYTHON_VERSION. Lots of other decisions are based on these.
|
|
||||||
ifeq (${SP_OS}, rhel7)
|
|
||||||
# Rhel7 (current)
|
|
||||||
platform := rhel7
|
|
||||||
SPI_COMPILER_PLATFORM ?= gcc-6.3
|
|
||||||
ifeq (${SPI_COMPILER_PLATFORM},gcc-6.3)
|
|
||||||
CMAKE_CXX_STANDARD ?= 14
|
|
||||||
endif
|
|
||||||
LLVM_VERSION ?= 12.0.0
|
|
||||||
else ifeq (${platform}, macosx)
|
|
||||||
# Generic OSX machines (including LG's laptop)
|
|
||||||
COMPILER ?= clang
|
|
||||||
SP_OS ?= macosx
|
|
||||||
else
|
|
||||||
$(error Unknown SP_OS=${SP_OS} platform=${platform})
|
|
||||||
endif # endif ${SP_OS}
|
|
||||||
|
|
||||||
MY_CMAKE_FLAGS += -DSP_OS=${SP_OS}
|
|
||||||
MY_CMAKE_FLAGS += -DSPI_COMPILER_PLATFORM=${SPI_COMPILER_PLATFORM}
|
|
||||||
MY_CMAKE_FLAGS += -DEXTRA_CPP_ARGS:STRING="-DOSL_SPI=1" -DOSL_SITE:STRING=spi
|
|
||||||
MY_CMAKE_FLAGS += -DSPI_TESTS=1
|
|
||||||
MY_CMAKE_FLAGS += -DOSL_NAMESPACE_INCLUDE_PATCH=1
|
|
||||||
REZ_PACKAGE_ROOT ?= /shots/spi/home/software/packages
|
|
||||||
SPCOMP2_ROOT ?= /shots/spi/home/lib/SpComp2
|
|
||||||
|
|
||||||
MY_CMAKE_FLAGS += -DOSL_EXTRA_NVCC_ARGS="--compiler-bindir=/opt/rh/devtoolset-6/root/bin/gcc"
|
|
||||||
|
|
||||||
## Rhel7 (current)
|
|
||||||
ifeq (${SP_OS}, rhel7)
|
|
||||||
PYTHON_VERSION ?= 2.7
|
|
||||||
USE_SIMD ?= sse4.1,aes
|
|
||||||
CMAKE ?= cmake
|
|
||||||
USE_NINJA ?= 1
|
|
||||||
NINJA ?= ninja
|
|
||||||
ifeq ($(USE_NINJA),1)
|
|
||||||
MY_CMAKE_FLAGS += -DCMAKE_MAKE_PROGRAM=${NINJA}
|
|
||||||
endif
|
|
||||||
export CCACHE_CPP2 ?= 1
|
|
||||||
# Override lib64 and use SPI convention of lib
|
|
||||||
MY_CMAKE_FLAGS += -DCMAKE_INSTALL_LIBDIR="${INSTALL_PREFIX}/lib"
|
|
||||||
|
|
||||||
#
|
|
||||||
# Compilers:
|
|
||||||
#
|
|
||||||
# A variety of tags can be used to try specific versions of gcc or
|
|
||||||
# clang from the site-specific places we have installed them.
|
|
||||||
LLVM_DIRECTORY ?= /shots/spi/home/lib/arnold/rhel7/llvm_12.0.0
|
|
||||||
LLVM_DIRECTORY ?= /shots/spi/home/software/packages/llvm/${LLVM_VERSION}/${SPI_COMPILER_PLATFORM}
|
|
||||||
ifeq (${COMPILER},clang9)
|
|
||||||
LLVM_DIRECTORY := /shots/spi/home/software/packages/llvm/9.0.1-1/${SPI_COMPILER_PLATFORM}
|
|
||||||
MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=${LLVM_DIRECTORY}/bin/clang \
|
|
||||||
-DCMAKE_CXX_COMPILER=${LLVM_DIRECTORY}/bin/clang++
|
|
||||||
else ifeq (${COMPILER},clang10)
|
|
||||||
LLVM_DIRECTORY := /shots/spi/home/software/packages/llvm/10.0.0-1/${SPI_COMPILER_PLATFORM}
|
|
||||||
MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=${LLVM_DIRECTORY}/bin/clang \
|
|
||||||
-DCMAKE_CXX_COMPILER=${LLVM_DIRECTORY}/bin/clang++
|
|
||||||
else ifeq (${COMPILER},clang11)
|
|
||||||
LLVM_DIRECTORY := /shots/spi/home/software/packages/llvm/11.0.0/${SPI_COMPILER_PLATFORM}
|
|
||||||
MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=${LLVM_DIRECTORY}/bin/clang \
|
|
||||||
-DCMAKE_CXX_COMPILER=${LLVM_DIRECTORY}/bin/clang++
|
|
||||||
else ifeq (${COMPILER},clang12)
|
|
||||||
LLVM_DIRECTORY := /shots/spi/home/software/packages/llvm/12.0.0-final/${SPI_COMPILER_PLATFORM}
|
|
||||||
MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=${LLVM_DIRECTORY}/bin/clang \
|
|
||||||
-DCMAKE_CXX_COMPILER=${LLVM_DIRECTORY}/bin/clang++
|
|
||||||
else ifeq (${COMPILER},clang)
|
|
||||||
MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
|
|
||||||
else ifeq (${COMPILER}, gcc6)
|
|
||||||
MY_CMAKE_FLAGS += \
|
|
||||||
-DCMAKE_C_COMPILER=/opt/rh/devtoolset-6/root/usr/bin/gcc \
|
|
||||||
-DCMAKE_CXX_COMPILER=/opt/rh/devtoolset-6/root/usr/bin/g++
|
|
||||||
else ifeq (${COMPILER},gcc)
|
|
||||||
MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++
|
|
||||||
else ifeq (${COMPILER},)
|
|
||||||
# default compiler is clang, taken from the LLVM directory
|
|
||||||
MY_CMAKE_FLAGS += \
|
|
||||||
-DCMAKE_C_COMPILER=${LLVM_DIRECTORY}/bin/clang \
|
|
||||||
-DCMAKE_CXX_COMPILER=${LLVM_DIRECTORY}/bin/clang++
|
|
||||||
endif
|
|
||||||
|
|
||||||
MY_CMAKE_FLAGS +=
|
|
||||||
-DLLVM_STATIC=1 \
|
|
||||||
-DLLVM_VERSION=${LLVM_VERSION} \
|
|
||||||
-DLLVM_DIRECTORY=${LLVM_DIRECTORY}
|
|
||||||
|
|
||||||
#
|
|
||||||
# Boost
|
|
||||||
#
|
|
||||||
BOOSTVERS ?= 1.70
|
|
||||||
MY_CMAKE_FLAGS += \
|
|
||||||
-DBOOST_INCLUDEDIR=/usr/include/boostroot/boost${BOOSTVERS}.0 \
|
|
||||||
-DBOOST_LIBRARYDIR=/usr/lib64/boostroot/boost${BOOSTVERS}.0
|
|
||||||
|
|
||||||
#
|
|
||||||
# Python
|
|
||||||
#
|
|
||||||
Python_INCLUDE_DIR ?= /usr/include/python${PYTHON_VERSION}
|
|
||||||
PYTHON_LIBRARY_DIR ?= /usr/lib64
|
|
||||||
Python_LIBRARY ?= ${PYTHON_LIBRARY_DIR}/libpython${PYTHON_VERSION}.so
|
|
||||||
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
|
|
||||||
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
|
|
||||||
endif
|
|
||||||
MY_CMAKE_FLAGS += \
|
|
||||||
-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}
|
|
||||||
|
|
||||||
|
|
||||||
# Set our preferred OpenEXR path, but allow env variable to override
|
|
||||||
# with custom/test version.
|
|
||||||
OPENEXR_VERSION ?= 2.4.1-2
|
|
||||||
OpenEXR_ROOT ?= ${REZ_PACKAGE_ROOT}/OpenEXR/${OPENEXR_VERSION}/${SPI_COMPILER_PLATFORM}
|
|
||||||
$(info OpenEXR_ROOT = $(OpenEXR_ROOT))
|
|
||||||
MY_CMAKE_FLAGS += -DOpenEXR_ROOT=${OpenEXR_ROOT}
|
|
||||||
|
|
||||||
Partio_VERSION ?= 1.10.6
|
|
||||||
partio_ROOT ?= ${REZ_PACKAGE_ROOT}/partio/${Partio_VERSION}/${SPI_COMPILER_PLATFORM}/python-${PYTHON_VERSION}/boost-${BOOSTVERS}
|
|
||||||
MY_CMAKE_FLAGS += -Dpartio_ROOT="${partio_ROOT}"
|
|
||||||
|
|
||||||
pugixml_VERSION ?= 1.10.0
|
|
||||||
pugixml_ROOT ?= ${REZ_PACKAGE_ROOT}/pugixml/${pugixml_VERSION}/${SPI_COMPILER_PLATFORM}
|
|
||||||
MY_CMAKE_FLAGS += -Dpugixml_ROOT="${pugixml_ROOT}"
|
|
||||||
|
|
||||||
ifneq ($(OpenImageIO_ROOT),)
|
|
||||||
MY_CMAKE_FLAGS += -DOpenImageIO_ROOT=${OpenImageIO_ROOT}
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Cuda/OptiX
|
|
||||||
USE_OPTIX ?= 1
|
|
||||||
CUDA_VERSION ?= 11.1.1
|
|
||||||
OPTIX_VERSION ?= 7.2.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}
|
|
||||||
OptiX_ROOT ?= /shots/spi/home/lib/arnold/rhel7/optix_${OPTIX_VERSION}
|
|
||||||
OPTIXHOME = ${OptiX_ROOT}
|
|
||||||
MY_CMAKE_FLAGS += -DUSE_OPTIX=${USE_OPTIX} \
|
|
||||||
-DCUDA_TOOLKIT_ROOT_DIR=${CUDA_TOOLKIT_ROOT_DIR} \
|
|
||||||
-DCUDA_EXTRA_LIBS=${CUDA_EXTRA_LIBS} \
|
|
||||||
-DOPTIXHOME=${OPTIXHOME} -DOPTIX_EXTRA_LIBS=lzma
|
|
||||||
|
|
||||||
# end rhel7
|
|
||||||
|
|
||||||
## Generic OSX machines (including LG's laptop)
|
|
||||||
else ifeq (${platform}, macosx)
|
|
||||||
CMAKE_CXX_STANDARD ?= 14
|
|
||||||
USE_SIMD ?= sse4.2
|
|
||||||
MY_CMAKE_FLAGS += -DCMAKE_BUILD_WITH_INSTALL_RPATH=1
|
|
||||||
MY_CMAKE_FLAGS += -DCMAKE_INSTALL_NAME_DIR="${working_dir}/dist/lib"
|
|
||||||
|
|
||||||
BOOSTVERS=${BOOSTVERS}${BOOSTSPSUFFIX}
|
|
||||||
LLVM_DIRECTORY ?= /usr/local/opt/llvm
|
|
||||||
|
|
||||||
# A variety of tags can be used to try specific versions of gcc or
|
|
||||||
# clang from the site-specific places we have installed them.
|
|
||||||
ifeq (${COMPILER}, gcc6)
|
|
||||||
MY_CMAKE_FLAGS += \
|
|
||||||
-DCMAKE_C_COMPILER=gcc-6 -DCMAKE_CXX_COMPILER=g++-6
|
|
||||||
USE_LIBCPLUSPLUS := 0
|
|
||||||
else ifeq (${COMPILER}, gcc9)
|
|
||||||
MY_CMAKE_FLAGS += \
|
|
||||||
-DCMAKE_C_COMPILER=gcc-9 -DCMAKE_CXX_COMPILER=g++-9
|
|
||||||
USE_LIBCPLUSPLUS := 0
|
|
||||||
else ifeq (${COMPILER},clang14)
|
|
||||||
MY_CMAKE_FLAGS += \
|
|
||||||
-DCMAKE_C_COMPILER=/usr/local/opt/llvm@14/bin/clang \
|
|
||||||
-DCMAKE_CXX_COMPILER=/usr/local/opt/llvm@14/bin/clang++
|
|
||||||
else ifeq (${COMPILER},clang15)
|
|
||||||
MY_CMAKE_FLAGS += \
|
|
||||||
-DCMAKE_C_COMPILER=/usr/local/opt/llvm@15/bin/clang \
|
|
||||||
-DCMAKE_CXX_COMPILER=/usr/local/opt/llvm@15/bin/clang++
|
|
||||||
else ifeq (${COMPILER},clang)
|
|
||||||
MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
|
|
||||||
else ifeq (${COMPILER},gcc)
|
|
||||||
MY_CMAKE_FLAGS += -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++
|
|
||||||
else ifeq (${COMPILER},)
|
|
||||||
# default compiler is clang, taken from the LLVM directory
|
|
||||||
MY_CMAKE_FLAGS += \
|
|
||||||
-DCMAKE_C_COMPILER=${LLVM_DIRECTORY}/bin/clang \
|
|
||||||
-DCMAKE_CXX_COMPILER=${LLVM_DIRECTORY}/bin/clang++
|
|
||||||
else ifeq (${COMPILER},llvm)
|
|
||||||
# "llvm" means "use the clang from our llvm"
|
|
||||||
MY_CMAKE_FLAGS += \
|
|
||||||
-DCMAKE_C_COMPILER=${LLVM_DIRECTORY}/bin/clang \
|
|
||||||
-DCMAKE_CXX_COMPILER=${LLVM_DIRECTORY}/bin/clang++
|
|
||||||
endif
|
|
||||||
|
|
||||||
# end generic OSX
|
|
||||||
|
|
||||||
else
|
|
||||||
$(error Unknown SP_OS=${SP_OS})
|
|
||||||
endif # endif ${SP_OS}
|
|
||||||
|
|
||||||
|
|
||||||
ifneq (${VERBOSE},)
|
|
||||||
$(info MY_CMAKE_FLAGS: $(MY_CMAKE_FLAGS))
|
|
||||||
endif
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
<cfg>
|
|
||||||
<version>@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@.@PROJECT_VERSION_TWEAK@</version>
|
|
||||||
<appdir architecture="@SP_OS@">@OSL_REZ_INSTALL_PATH@</appdir>
|
|
||||||
<launchprogram></launchprogram>
|
|
||||||
<setup></setup>
|
|
||||||
</cfg>
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
# Copyright Contributors to the Open Shading Language project.
|
|
||||||
# SPDX-License-Identifier: BSD-3-Clause
|
|
||||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
|
||||||
|
|
||||||
option (${PROJ_NAME}_SPIREZ "Enable extra bits for building for SPI Rez install" OFF)
|
|
||||||
if (${PROJ_NAME}_SPIREZ)
|
|
||||||
set (appcfg_filename "${CMAKE_BINARY_DIR}/${PROJECT_NAME}_${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}.${PROJECT_VERSION_TWEAK}.xml")
|
|
||||||
configure_file ("${PROJECT_SOURCE_DIR}/site/spi/appcfg.xml.in" "${appcfg_filename}")
|
|
||||||
endif ()
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
#!/usr/bin/env python
|
|
||||||
|
|
||||||
# Copyright Contributors to the Open Shading Language project.
|
|
||||||
# SPDX-License-Identifier: BSD-3-Clause
|
|
||||||
# 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
|
|
||||||
# "20101". This is necessary to turn external release designations into
|
|
||||||
# integer SpComp2 version numbers.
|
|
||||||
|
|
||||||
from __future__ import print_function
|
|
||||||
import sys
|
|
||||||
|
|
||||||
if len(sys.argv) != 2 :
|
|
||||||
print('Need 1 argument: version number with dots')
|
|
||||||
exit(1)
|
|
||||||
|
|
||||||
vers = sys.argv[1]
|
|
||||||
parts = vers.split('.')
|
|
||||||
print ('{:d}{:02d}{:02d}'.format(int(parts[0]), int(parts[1]), int(parts[2])))
|
|
||||||
@@ -23,6 +23,3 @@ sonar.exclusions=src/include/OSL/Imath/*.h,src/build-scripts/*
|
|||||||
# C/C++ analyzer properties
|
# C/C++ analyzer properties
|
||||||
sonar.cfamily.build-wrapper-output=build/bw_output
|
sonar.cfamily.build-wrapper-output=build/bw_output
|
||||||
sonar.cfamily.gcov.reportsPath=_coverage
|
sonar.cfamily.gcov.reportsPath=_coverage
|
||||||
|
|
||||||
sonar.cfamily.cache.enabled=true
|
|
||||||
sonar.cfamily.cache.path=/tmp/sonarcache
|
|
||||||
|
|||||||
@@ -0,0 +1,413 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
# Copyright Contributors to the Open Shading Language project.
|
||||||
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||||
|
|
||||||
|
|
||||||
|
import getopt
|
||||||
|
import graphviz
|
||||||
|
import itertools
|
||||||
|
import os
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
|
||||||
|
from collections import OrderedDict
|
||||||
|
from dataclasses import dataclass, field
|
||||||
|
from typing import Dict
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
# PTX parsing helpers
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# pre-compile some regex patterns to speed up parsing
|
||||||
|
call_ptn = re.compile(r"^\s*(call\.uni).*$")
|
||||||
|
dec_ptn = re.compile(r"^\s*(\.pragma|\.extern|\.visible|\.func|\.local|\.global|\.reg|\.param|LBB[0-9_]+\:)(.*)$")
|
||||||
|
fn_ptn = re.compile(r"^(\.visible \.func|\.visible \.entry|\.weak \.func|\.func).*[\s]+([a-zA-Z0-9_]+)[\(\)]*$")
|
||||||
|
inst_ptn = re.compile(r"^\s*([@!%p0-9 ]*)([a-zA-Z0-9\.]+)\s*([a-zA-Z0-9\$\.,% _\[\]{}+-]+);.*$")
|
||||||
|
mem_ptn = re.compile(r"^\s*(st|ld).*;$")
|
||||||
|
ret_ptn = re.compile(r"^\s*(ret);.*$")
|
||||||
|
|
||||||
|
def get_func_name(line):
|
||||||
|
match = fn_ptn.match(line)
|
||||||
|
if match:
|
||||||
|
return match.group(2)
|
||||||
|
else:
|
||||||
|
return ""
|
||||||
|
|
||||||
|
def is_func_or_decl(line):
|
||||||
|
match = fn_ptn.match(line)
|
||||||
|
if match:
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
|
||||||
|
def is_call_start(line):
|
||||||
|
if line.find("call.uni") != -1:
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
|
||||||
|
def is_instruction(line):
|
||||||
|
match = call_ptn.match(line)
|
||||||
|
if match:
|
||||||
|
return True
|
||||||
|
if len(line) < 4:
|
||||||
|
return False
|
||||||
|
if not line.endswith(';'):
|
||||||
|
return False
|
||||||
|
|
||||||
|
match = dec_ptn.match(line)
|
||||||
|
if not match:
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
|
||||||
|
def is_mem_inst(line):
|
||||||
|
match = mem_ptn.match(line)
|
||||||
|
if match:
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
|
||||||
|
def parse_inst(line):
|
||||||
|
if not is_instruction(line):
|
||||||
|
return "", "", ""
|
||||||
|
match = call_ptn.match(line)
|
||||||
|
if match:
|
||||||
|
return "", "call.uni", ""
|
||||||
|
match = ret_ptn.match(line)
|
||||||
|
if match:
|
||||||
|
return "", "ret", ""
|
||||||
|
match = inst_ptn.match(line)
|
||||||
|
if match:
|
||||||
|
return match.group(1), match.group(2), match.group(3)
|
||||||
|
else:
|
||||||
|
return "", "", ""
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class FuncStats:
|
||||||
|
func_name: str = ""
|
||||||
|
inst_count: int = 0
|
||||||
|
call_count: int = 0
|
||||||
|
mem_count: int = 0
|
||||||
|
call_dict: Dict[str, int] = field(default_factory=dict) # func name, count
|
||||||
|
inst_dict: Dict[str, int] = field(default_factory=dict) # inst, count
|
||||||
|
|
||||||
|
@dataclass
|
||||||
|
class FileStats:
|
||||||
|
total_funcs: int = 0
|
||||||
|
total_insts: int = 0
|
||||||
|
total_mem_insts: int = 0
|
||||||
|
total_calls: int = 0
|
||||||
|
extern_funcs: Dict[str, int] = field(default_factory=dict) # func name, count
|
||||||
|
func_calls: Dict[str, int] = field(default_factory=dict) # func name, count
|
||||||
|
summary_dict: Dict[str, str] = field(default_factory=dict) # func name, summary
|
||||||
|
inst_dict: Dict[str, int] = field(default_factory=dict) # inst, count
|
||||||
|
largest_function: str = ""
|
||||||
|
largest_size: int = 0
|
||||||
|
csv_string: str = ""
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
def parse_ptx(ptx_filename):
|
||||||
|
# read the raw PTX into a string
|
||||||
|
raw_ptx = ""
|
||||||
|
with open(ptx_filename, 'r') as ptx_file:
|
||||||
|
raw_ptx = ptx_file.read()
|
||||||
|
|
||||||
|
# variables to keep track of the parsing state
|
||||||
|
begin_func_or_decl = False
|
||||||
|
begin_call = False
|
||||||
|
in_func = False
|
||||||
|
brace_count = 0
|
||||||
|
|
||||||
|
func_stats = FuncStats()
|
||||||
|
func_dict = {}
|
||||||
|
|
||||||
|
for line in raw_ptx.splitlines():
|
||||||
|
# strip off comments
|
||||||
|
if line.find("//") != -1:
|
||||||
|
line = line[:line.find("//")]
|
||||||
|
|
||||||
|
# trim whitespace and trailing commas
|
||||||
|
line = line.strip(" \t\n\r,")
|
||||||
|
|
||||||
|
# keep track of when we hit a function declaration or definition
|
||||||
|
if is_func_or_decl(line):
|
||||||
|
begin_func_or_decl = True
|
||||||
|
func_stats.func_name = get_func_name(line)
|
||||||
|
|
||||||
|
# keep track of braces so we can have some picture of nesting
|
||||||
|
brace_count = brace_count + line.count('{')
|
||||||
|
brace_count = brace_count - line.count('}')
|
||||||
|
|
||||||
|
# if we hit a call.uni, we need to look for the name of the callee
|
||||||
|
# on the next pass
|
||||||
|
if is_call_start(line):
|
||||||
|
begin_call = True
|
||||||
|
func_stats.call_count = func_stats.call_count + 1
|
||||||
|
elif begin_call:
|
||||||
|
begin_call = False
|
||||||
|
func_stats.call_dict[line] = func_stats.call_dict.get(line, 0) + 1
|
||||||
|
|
||||||
|
pred, opcode, args = parse_inst(line)
|
||||||
|
if in_func and opcode != "":
|
||||||
|
func_stats.inst_count = func_stats.inst_count + 1
|
||||||
|
func_stats.mem_count = func_stats.mem_count + is_mem_inst(line)
|
||||||
|
inst = opcode
|
||||||
|
func_stats.inst_dict[inst] = func_stats.inst_dict.get((inst), 0) + 1
|
||||||
|
|
||||||
|
if begin_func_or_decl and brace_count == 1:
|
||||||
|
in_func = True
|
||||||
|
begin_func_or_decl = False
|
||||||
|
|
||||||
|
# exiting the function -- save off the stats
|
||||||
|
if in_func and brace_count == 0:
|
||||||
|
func_dict[func_stats.func_name] = func_stats
|
||||||
|
|
||||||
|
# prepare for the next iteration
|
||||||
|
func_stats = FuncStats()
|
||||||
|
begin_func_or_decl = False
|
||||||
|
begin_call = False
|
||||||
|
in_func = False
|
||||||
|
brace_count = 0
|
||||||
|
|
||||||
|
return func_dict
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
def gather_file_stats(func_dict):
|
||||||
|
file_stats = FileStats()
|
||||||
|
file_stats.total_funcs = len(func_dict)
|
||||||
|
file_stats.csv_string = "Function Name, Total Instructions, Memory Instructions, Function Calls\n"
|
||||||
|
|
||||||
|
# print the function statistics
|
||||||
|
for key, entry in sorted(func_dict.items()):
|
||||||
|
func_name = entry.func_name
|
||||||
|
file_stats.total_insts += entry.inst_count
|
||||||
|
file_stats.total_mem_insts += entry.mem_count
|
||||||
|
file_stats.total_calls += entry.call_count
|
||||||
|
|
||||||
|
# keep track of the largest function
|
||||||
|
if entry.inst_count > file_stats.largest_size:
|
||||||
|
file_stats.largest_function = func_name
|
||||||
|
file_stats.largest_size = entry.inst_count
|
||||||
|
|
||||||
|
# clamp the counts to prevent divide-by-zero
|
||||||
|
inst_count = max(1, entry.inst_count)
|
||||||
|
mem_count = max(1, entry.mem_count)
|
||||||
|
call_count = max(1, entry.call_count)
|
||||||
|
|
||||||
|
summary_string = ""
|
||||||
|
summary_string += " Function: {}\n".format(func_name)
|
||||||
|
summary_string += " Total Instructions: {}\n".format(inst_count)
|
||||||
|
summary_string += " Memory Instructions: {} ({:.2f}%)\n".format(mem_count, 100 * float(mem_count)/inst_count)
|
||||||
|
summary_string += " Total Calls: {}\n".format(entry.call_count)
|
||||||
|
|
||||||
|
summary_string += "\n"
|
||||||
|
summary_string += "Top 10 Function Calls (name, count, %):\n"
|
||||||
|
for name, count in itertools.islice(sorted(entry.call_dict.items(), key=lambda item: -item[1]), 0, 11):
|
||||||
|
summary_string += " {}, {}, {:.2f}%\n".format(name, count, 100 * float(count)/max(1,file_stats.total_calls))
|
||||||
|
|
||||||
|
# print the instruction mix
|
||||||
|
summary_string += "\n"
|
||||||
|
summary_string += "Instruction Mix (name, count, %):\n"
|
||||||
|
for inst, count in sorted(entry.inst_dict.items()):
|
||||||
|
summary_string += " {}, {}, {:.2f}%\n".format(inst, count, 100 * float(count)/inst_count)
|
||||||
|
file_stats.inst_dict[inst] = file_stats.inst_dict.get((inst), 0) + count
|
||||||
|
|
||||||
|
# print the call mix
|
||||||
|
summary_string += "\n"
|
||||||
|
summary_string += "Function Calls (name, count, %):\n"
|
||||||
|
for name, count in sorted(entry.call_dict.items()):
|
||||||
|
file_stats.func_calls[name] = file_stats.func_calls.get((name), 0) + count
|
||||||
|
summary_string += " {}, {}, {:.2f}%\n".format(name, count, 100 * float(count)/call_count)
|
||||||
|
if not name in func_dict:
|
||||||
|
file_stats.extern_funcs[name] = 1
|
||||||
|
|
||||||
|
file_stats.summary_dict[func_name] = summary_string
|
||||||
|
|
||||||
|
file_stats.csv_string += "{},{},{},{}\n".format(func_name, entry.inst_count, entry.mem_count, entry.call_count)
|
||||||
|
|
||||||
|
return file_stats
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
def generate_summary(func_dict, file_stats, out_name):
|
||||||
|
summary_string = "Overall Stats\n"
|
||||||
|
summary_string += " Total Functions: {}\n".format(file_stats.total_funcs)
|
||||||
|
summary_string += " Total Instructions: {}\n".format(file_stats.total_insts)
|
||||||
|
summary_string += " Memory Instructions: {} ({:.2f}%)\n".format(file_stats.total_mem_insts, 100 * float(file_stats.total_mem_insts)/max(1, file_stats.total_insts))
|
||||||
|
summary_string += " Total Calls: {}\n".format(file_stats.total_calls)
|
||||||
|
summary_string += " Biggest Function: {} ({} instructions)\n".format(file_stats.largest_function, file_stats.largest_size)
|
||||||
|
|
||||||
|
summary_string += "\n"
|
||||||
|
summary_string += "Top 10 Function Calls (name, count, %):\n"
|
||||||
|
for name, count in itertools.islice(sorted(file_stats.func_calls.items(), key=lambda item: -item[1]), 0, 11):
|
||||||
|
summary_string += " {}, {}, {:.2f}%\n".format(name, count, 100 * float(count)/max(1,file_stats.total_calls))
|
||||||
|
|
||||||
|
summary_string += "\n"
|
||||||
|
summary_string += "Function Call Counts (name, count, %):\n"
|
||||||
|
for name, count in sorted(file_stats.func_calls.items()):
|
||||||
|
summary_string += " {}, {}, {:.2f}%\n".format(name, count, 100 * float(count)/max(1,file_stats.total_calls))
|
||||||
|
|
||||||
|
summary_string += "\n"
|
||||||
|
summary_string += "Instruction Mix (name, count, %):\n"
|
||||||
|
for name, count in sorted(file_stats.inst_dict.items()):
|
||||||
|
summary_string += " {}, {}, {:.2f}%\n".format(name, count, 100 * float(count)/max(1,file_stats.total_insts))
|
||||||
|
|
||||||
|
summary_string += "\n"
|
||||||
|
summary_string += "Uncalled Functions:\n"
|
||||||
|
for name, count in sorted(func_dict.items()):
|
||||||
|
if not name in file_stats.func_calls:
|
||||||
|
summary_string += " {}\n".format(name)
|
||||||
|
|
||||||
|
summary_string += "\n"
|
||||||
|
summary_string += "Extern Functions:\n"
|
||||||
|
for name, val in sorted(file_stats.extern_funcs.items()):
|
||||||
|
summary_string += " {}\n".format(name)
|
||||||
|
|
||||||
|
with open("{}-summary.txt".format(out_name), "w") as summary_file:
|
||||||
|
summary_file.write(summary_string)
|
||||||
|
for func_name, summary in sorted(file_stats.summary_dict.items()):
|
||||||
|
summary_file.write("\n#---------------------------------------\n")
|
||||||
|
summary_file.write(summary)
|
||||||
|
|
||||||
|
with open("{}.csv".format(out_name), "w") as csv_file:
|
||||||
|
csv_file.write(file_stats.csv_string)
|
||||||
|
|
||||||
|
return summary_string
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
def wrap_name(name):
|
||||||
|
wrapped_name = ""
|
||||||
|
cur_line = ""
|
||||||
|
last_char = ''
|
||||||
|
wrap_len = 20
|
||||||
|
split_pos = 0
|
||||||
|
line_pos = 0
|
||||||
|
|
||||||
|
for cur_char in name:
|
||||||
|
cur_line = cur_line + cur_char
|
||||||
|
line_pos = line_pos + 1
|
||||||
|
|
||||||
|
if not cur_char.isalpha():
|
||||||
|
# prefer to split at non-alphabetic characters
|
||||||
|
split_pos = line_pos
|
||||||
|
elif last_char.isupper() and not cur_char.isupper():
|
||||||
|
# otherwise, prefer to split at the first capitalized letter
|
||||||
|
# of some group
|
||||||
|
split_pos = line_pos - 2
|
||||||
|
|
||||||
|
if line_pos == wrap_len:
|
||||||
|
wrapped_name = wrapped_name + cur_line[:split_pos] + '\n'
|
||||||
|
cur_line = cur_line[split_pos:]
|
||||||
|
line_pos = len(cur_line)
|
||||||
|
|
||||||
|
last_char = cur_char
|
||||||
|
|
||||||
|
wrapped_name = wrapped_name + cur_line + '\n'
|
||||||
|
return wrapped_name.strip(" \t\n\r,")
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
def generate_callgraph(func_dict, file_stats, out_name):
|
||||||
|
callgraph = graphviz.Digraph("{} Call Graph".format(out_name),
|
||||||
|
filename="{}-callgraph.gv".format(out_name),
|
||||||
|
engine="dot")
|
||||||
|
|
||||||
|
callgraph.attr("graph", rankdir="TB")
|
||||||
|
callgraph.attr("graph", splines="true")
|
||||||
|
callgraph.attr("graph", concentrate="false")
|
||||||
|
callgraph.attr("graph", clusterrank="none")
|
||||||
|
callgraph.attr("node", fontname="Courier New")
|
||||||
|
callgraph.attr("node", shape="square")
|
||||||
|
callgraph.attr("node", nojustify="true")
|
||||||
|
callgraph.attr("node", width="2.5")
|
||||||
|
callgraph.attr("node", height="2.5")
|
||||||
|
callgraph.attr("edge", penwidth="3")
|
||||||
|
callgraph.attr("edge", constrain="false")
|
||||||
|
|
||||||
|
# create a summary node
|
||||||
|
with callgraph.subgraph(name="Summary") as c:
|
||||||
|
c.attr("graph", rankdir="TB")
|
||||||
|
c.attr("graph", splines="true")
|
||||||
|
c.attr("graph", concentrate="false")
|
||||||
|
c.attr("graph", clusterrank="none")
|
||||||
|
c.attr("node", fontname="Courier New")
|
||||||
|
c.attr("node", shape="square")
|
||||||
|
c.attr("node", nojustify="false")
|
||||||
|
c.attr("node", width="2.5")
|
||||||
|
c.attr("node", height="2.5")
|
||||||
|
c.attr("edge", penwidth="3")
|
||||||
|
c.attr("edge", constrain="false")
|
||||||
|
c.node(name="SUMMARY",
|
||||||
|
label="Summary\linsts: {}\lfuncs: {}\lcalls: {}\l".format
|
||||||
|
(file_stats.total_insts, file_stats.total_funcs, file_stats.total_calls))
|
||||||
|
|
||||||
|
# create the nodes
|
||||||
|
for func_name, entry in sorted(func_dict.items()):
|
||||||
|
num_calls_to = 0
|
||||||
|
if func_name in file_stats.func_calls:
|
||||||
|
num_calls_to = file_stats.func_calls[func_name]
|
||||||
|
label = "{}\n\ninsts: {}\lcalls from: {}\lcalls to: {}\l".format(
|
||||||
|
wrap_name(func_name),
|
||||||
|
entry.inst_count,
|
||||||
|
entry.call_count,
|
||||||
|
num_calls_to)
|
||||||
|
callgraph.node(name=wrap_name(func_name), label=label)
|
||||||
|
|
||||||
|
# create nodes for the extern functions
|
||||||
|
callgraph.attr("node", style="dashed")
|
||||||
|
for key, entry in sorted(file_stats.extern_funcs.items()):
|
||||||
|
func_name = key
|
||||||
|
callgraph.node(wrap_name(func_name))
|
||||||
|
|
||||||
|
# cycle through a handful of edge colors to add a little eye candy
|
||||||
|
color_idx = 0
|
||||||
|
edge_colors = [ "#FF000080", # red
|
||||||
|
"#00800F80", # green
|
||||||
|
"#FFAF0080", # orange
|
||||||
|
"#0000FF80", # blue
|
||||||
|
"#40404080" ] # gray
|
||||||
|
|
||||||
|
# create the edges
|
||||||
|
for key, entry in sorted(func_dict.items()):
|
||||||
|
func_name = entry.func_name
|
||||||
|
callgraph.attr("edge", color=edge_colors[color_idx])
|
||||||
|
for calleeName, count in sorted(entry.call_dict.items()):
|
||||||
|
callgraph.attr("edge", tooltip="{} -> {}".format(func_name, calleeName))
|
||||||
|
callgraph.edge(wrap_name(func_name), wrap_name(calleeName))
|
||||||
|
color_idx = (color_idx + 1) % len(edge_colors)
|
||||||
|
|
||||||
|
callgraph.render()
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
def main():
|
||||||
|
if len(sys.argv) != 2:
|
||||||
|
sys.exit("Wrong number of arguments\nUsage: $ parse-ptx.py <path-to-PTX-file>")
|
||||||
|
|
||||||
|
in_name = sys.argv[1]
|
||||||
|
if not os.path.isfile(in_name):
|
||||||
|
sys.exit("Unable to open PTX file")
|
||||||
|
|
||||||
|
out_name = os.path.splitext(os.path.basename(in_name))[0]
|
||||||
|
func_dict = parse_ptx(in_name)
|
||||||
|
file_stats = gather_file_stats(func_dict)
|
||||||
|
|
||||||
|
generate_summary(func_dict, file_stats, out_name)
|
||||||
|
generate_callgraph(func_dict, file_stats, out_name)
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Utility script to download and build abi checking tools
|
||||||
|
#
|
||||||
|
# Copyright Contributors to the Open Shading Language project.
|
||||||
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||||
|
|
||||||
|
# Exit the whole script if any command fails.
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
# Where to install the final results
|
||||||
|
: ${LOCAL_DEPS_DIR:=${PWD}/ext}
|
||||||
|
: ${ABITOOLS_INSTALL_DIR:=${LOCAL_DEPS_DIR}/dist}
|
||||||
|
|
||||||
|
mkdir -p ${LOCAL_DEPS_DIR}
|
||||||
|
pushd ${LOCAL_DEPS_DIR}
|
||||||
|
|
||||||
|
git clone https://github.com/lvc/vtable-dumper
|
||||||
|
pushd vtable-dumper ; make install prefix=${ABITOOLS_INSTALL_DIR} ; popd
|
||||||
|
|
||||||
|
git clone https://github.com/lvc/abi-dumper
|
||||||
|
pushd abi-dumper ; make install prefix=${ABITOOLS_INSTALL_DIR} ; popd
|
||||||
|
|
||||||
|
git clone https://github.com/lvc/abi-compliance-checker
|
||||||
|
pushd abi-compliance-checker ; make install prefix=${ABITOOLS_INSTALL_DIR} ; popd
|
||||||
|
|
||||||
|
popd
|
||||||
|
|
||||||
|
# ls -R ${LOCAL_DEPS_DIR}
|
||||||
|
export PATH=${PATH}:${ABITOOLS_INSTALL_DIR}/bin
|
||||||
@@ -12,7 +12,7 @@ set -ex
|
|||||||
echo "Building cmake"
|
echo "Building cmake"
|
||||||
uname
|
uname
|
||||||
|
|
||||||
CMAKE_VERSION=${CMAKE_VERSION:=3.12.4}
|
CMAKE_VERSION=${CMAKE_VERSION:=3.31.3}
|
||||||
LOCAL_DEPS_DIR=${LOCAL_DEPS_DIR:=${PWD}/ext}
|
LOCAL_DEPS_DIR=${LOCAL_DEPS_DIR:=${PWD}/ext}
|
||||||
CMAKE_INSTALL_DIR=${CMAKE_INSTALL_DIR:=${LOCAL_DEPS_DIR}/cmake}
|
CMAKE_INSTALL_DIR=${CMAKE_INSTALL_DIR:=${LOCAL_DEPS_DIR}/cmake}
|
||||||
|
|
||||||
@@ -25,8 +25,8 @@ fi
|
|||||||
|
|
||||||
if [[ `uname` == "Linux" && `uname -m` == "aarch64" ]] ; then
|
if [[ `uname` == "Linux" && `uname -m` == "aarch64" ]] ; then
|
||||||
mkdir -p ${CMAKE_INSTALL_DIR} || true
|
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
|
curl --location "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}-Linux-aarch64.sh" -o "cmake.sh"
|
||||||
tar -xjf cmake-3.17.0-h28c56e5_0.tar.bz2 -C ${CMAKE_INSTALL_DIR}
|
sh cmake.sh --skip-license --prefix=${CMAKE_INSTALL_DIR}
|
||||||
export PATH=${CMAKE_INSTALL_DIR}/bin:$PATH
|
export PATH=${CMAKE_INSTALL_DIR}/bin:$PATH
|
||||||
|
|
||||||
# In case we ever need to build from scratch:
|
# In case we ever need to build from scratch:
|
||||||
|
|||||||
@@ -0,0 +1,57 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Utility script to download and build libpng
|
||||||
|
#
|
||||||
|
# Copyright Contributors to the Open Shading Language project.
|
||||||
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||||
|
|
||||||
|
# Exit the whole script if any command fails.
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
# Repo and branch/tag/commit of libpng to download if we don't have it yet
|
||||||
|
LIBPNG_REPO=${LIBPNG_REPO:=https://github.com/glennrp/libpng.git}
|
||||||
|
LIBPNG_VERSION=${LIBPNG_VERSION:=v1.6.35}
|
||||||
|
|
||||||
|
# Where to put libpng repo source (default to the ext area)
|
||||||
|
LIBPNG_SRC_DIR=${LIBPNG_SRC_DIR:=${PWD}/ext/libpng}
|
||||||
|
# Temp build area (default to a build/ subdir under source)
|
||||||
|
LIBPNG_BUILD_DIR=${LIBPNG_BUILD_DIR:=${LIBPNG_SRC_DIR}/build}
|
||||||
|
# Install area for libpng (default to ext/dist)
|
||||||
|
LIBPNG_INSTALL_DIR=${LIBPNG_INSTALL_DIR:=${PWD}/ext/dist}
|
||||||
|
#LIBPNG_CONFIG_OPTS=${LIBPNG_CONFIG_OPTS:=}
|
||||||
|
|
||||||
|
pwd
|
||||||
|
echo "libpng install dir will be: ${LIBPNG_INSTALL_DIR}"
|
||||||
|
|
||||||
|
mkdir -p ./ext
|
||||||
|
pushd ./ext
|
||||||
|
|
||||||
|
# Clone libpng project from GitHub and build
|
||||||
|
if [[ ! -e ${LIBPNG_SRC_DIR} ]] ; then
|
||||||
|
echo "git clone ${LIBPNG_REPO} ${LIBPNG_SRC_DIR}"
|
||||||
|
git clone ${LIBPNG_REPO} ${LIBPNG_SRC_DIR}
|
||||||
|
fi
|
||||||
|
cd ${LIBPNG_SRC_DIR}
|
||||||
|
|
||||||
|
|
||||||
|
echo "git checkout ${LIBPNG_VERSION} --force"
|
||||||
|
git checkout ${LIBPNG_VERSION} --force
|
||||||
|
|
||||||
|
if [[ -z $DEP_DOWNLOAD_ONLY ]]; then
|
||||||
|
time cmake -S . -B ${LIBPNG_BUILD_DIR} -DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DCMAKE_INSTALL_PREFIX=${LIBPNG_INSTALL_DIR} \
|
||||||
|
-DPNG_EXECUTABLES=OFF \
|
||||||
|
-DPNG_TESTS=OFF \
|
||||||
|
${LIBPNG_CONFIG_OPTS}
|
||||||
|
time cmake --build ${LIBPNG_BUILD_DIR} --config Release --target install
|
||||||
|
fi
|
||||||
|
|
||||||
|
# ls -R ${LIBPNG_INSTALL_DIR}
|
||||||
|
popd
|
||||||
|
|
||||||
|
|
||||||
|
# Set up paths. These will only affect the caller if this script is
|
||||||
|
# run with 'source' rather than in a separate shell.
|
||||||
|
export PNG_ROOT=$LIBPNG_INSTALL_DIR
|
||||||
|
|
||||||
@@ -12,39 +12,36 @@ set -ex
|
|||||||
echo "Building LLVM"
|
echo "Building LLVM"
|
||||||
uname
|
uname
|
||||||
|
|
||||||
|
: ${LLVM_VERSION:=18.1.8}
|
||||||
|
: ${LLVM_INSTALL_DIR:=${PWD}/llvm-install}
|
||||||
|
mkdir -p $LLVM_INSTALL_DIR || true
|
||||||
|
|
||||||
if [[ `uname` == "Linux" ]] ; then
|
if [[ `uname` == "Linux" ]] ; then
|
||||||
LLVM_VERSION=${LLVM_VERSION:=13.0.0}
|
: ${LLVM_DISTRO_NAME:=ubuntu-18.04}
|
||||||
LLVM_INSTALL_DIR=${LLVM_INSTALL_DIR:=${PWD}/llvm-install}
|
|
||||||
if [[ "$GITHUB_WORKFLOW" != "" ]] ; then
|
|
||||||
LLVM_DISTRO_NAME=${LLVM_DISTRO_NAME:=ubuntu-18.04}
|
|
||||||
elif [[ "$TRAVIS_DIST" == "trusty" ]] ; then
|
|
||||||
LLVM_DISTRO_NAME=${LLVM_DISTRO_NAME:=ubuntu-14.04}
|
|
||||||
elif [[ "$TRAVIS_DIST" == "xenial" ]] ; then
|
|
||||||
LLVM_DISTRO_NAME=${LLVM_DISTRO_NAME:=ubuntu-16.04}
|
|
||||||
elif [[ "$TRAVIS_DIST" == "bionic" ]] ; then
|
|
||||||
LLVM_DISTRO_NAME=${LLVM_DISTRO_NAME:=ubuntu-18.04}
|
|
||||||
else
|
|
||||||
LLVM_DISTRO_NAME=${LLVM_DISTRO_NAME:=error}
|
|
||||||
fi
|
|
||||||
LLVMTAR=clang+llvm-${LLVM_VERSION}-x86_64-linux-gnu-${LLVM_DISTRO_NAME}.tar.xz
|
LLVMTAR=clang+llvm-${LLVM_VERSION}-x86_64-linux-gnu-${LLVM_DISTRO_NAME}.tar.xz
|
||||||
echo LLVMTAR = $LLVMTAR
|
echo LLVMTAR = $LLVMTAR
|
||||||
if [[ "$LLVM_VERSION" == "10.0.0" ]] || [[ "$LLVM_VERSION" == "11.0.0" ]] \
|
curl --location https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/${LLVMTAR} -o $LLVMTAR
|
||||||
|| [[ "$LLVM_VERSION" == "11.1.0" ]] || [[ "$LLVM_VERSION" == "12.0.0" ]] \
|
|
||||||
|| [[ "$LLVM_VERSION" == "13.0.0" ]] || [[ "$LLVM_VERSION" == "14.0.0" ]] ;
|
|
||||||
then
|
|
||||||
# new
|
|
||||||
curl --location https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/${LLVMTAR} -o $LLVMTAR
|
|
||||||
else
|
|
||||||
curl --location http://releases.llvm.org/${LLVM_VERSION}/${LLVMTAR} -o $LLVMTAR
|
|
||||||
fi
|
|
||||||
ls -l $LLVMTAR
|
ls -l $LLVMTAR
|
||||||
tar xf $LLVMTAR
|
tar xf $LLVMTAR
|
||||||
rm -f $LLVMTAR
|
rm -f $LLVMTAR
|
||||||
echo "Installed ${LLVM_VERSION} in ${LLVM_INSTALL_DIR}"
|
|
||||||
mkdir -p $LLVM_INSTALL_DIR && true
|
|
||||||
mv clang+llvm*/* $LLVM_INSTALL_DIR
|
mv clang+llvm*/* $LLVM_INSTALL_DIR
|
||||||
export LLVM_DIRECTORY=$LLVM_INSTALL_DIR
|
elif [[ `uname -s` == "Windows" || "${RUNNER_OS}" == "Windows" ]] ; then
|
||||||
export PATH=${LLVM_INSTALL_DIR}/bin:$PATH
|
echo "Installing Windows LLVM"
|
||||||
# ls -a $LLVM_DIRECTORY
|
: ${LLVM_DISTRO_NAME:=ubuntu-18.04}
|
||||||
|
LLVMTAR=clang+llvm-${LLVM_VERSION}-x86_64-pc-windows-msvc.tar.xz
|
||||||
|
echo LLVMTAR = $LLVMTAR
|
||||||
|
curl --location https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/${LLVMTAR} -o $LLVMTAR
|
||||||
|
ls -l $LLVMTAR
|
||||||
|
tar xf $LLVMTAR
|
||||||
|
rm -f $LLVMTAR
|
||||||
|
mv clang+llvm*/* $LLVM_INSTALL_DIR
|
||||||
|
else
|
||||||
|
echo Bad uname `uname`
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "Installed LLVM ${LLVM_VERSION} in ${LLVM_INSTALL_DIR}"
|
||||||
|
ls -a $LLVM_INSTALL_DIR || true
|
||||||
|
ls -a $LLVM_INSTALL_DIR/* || true
|
||||||
|
export LLVM_DIRECTORY=$LLVM_INSTALL_DIR
|
||||||
|
export PATH=${LLVM_INSTALL_DIR}/bin:$PATH
|
||||||
|
export LLVM_ROOT=${LLVM_INSTALL_DIR}
|
||||||
|
|||||||
@@ -11,21 +11,26 @@ set -ex
|
|||||||
|
|
||||||
# Which OCIO to retrieve, how to build it
|
# Which OCIO to retrieve, how to build it
|
||||||
OPENCOLORIO_REPO=${OPENCOLORIO_REPO:=https://github.com/AcademySoftwareFoundation/OpenColorIO.git}
|
OPENCOLORIO_REPO=${OPENCOLORIO_REPO:=https://github.com/AcademySoftwareFoundation/OpenColorIO.git}
|
||||||
OPENCOLORIO_VERSION=${OPENCOLORIO_VERSION:=v1.1.1}
|
OPENCOLORIO_VERSION=${OPENCOLORIO_VERSION:=v2.3.2}
|
||||||
|
|
||||||
# Where to install the final results
|
# Where to install the final results
|
||||||
LOCAL_DEPS_DIR=${LOCAL_DEPS_DIR:=${PWD}/ext}
|
LOCAL_DEPS_DIR=${LOCAL_DEPS_DIR:=${PWD}/ext}
|
||||||
OPENCOLORIO_SOURCE_DIR=${OPENCOLORIO_SOURCE_DIR:=${LOCAL_DEPS_DIR}/OpenColorIO}
|
OPENCOLORIO_SOURCE_DIR=${OPENCOLORIO_SOURCE_DIR:=${LOCAL_DEPS_DIR}/OpenColorIO}
|
||||||
OPENCOLORIO_BUILD_DIR=${OPENCOLORIO_BUILD_DIR:=${LOCAL_DEPS_DIR}/OpenColorIO-build}
|
OPENCOLORIO_BUILD_DIR=${OPENCOLORIO_BUILD_DIR:=${LOCAL_DEPS_DIR}/OpenColorIO-build}
|
||||||
OPENCOLORIO_INSTALL_DIR=${OPENCOLORIO_INSTALL_DIR:=${LOCAL_DEPS_DIR}/dist}
|
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"}
|
OPENCOLORIO_BUILD_TYPE=${OPENCOLORIO_BUILD_TYPE:=Release}
|
||||||
# Just need libs:
|
# Just need libs:
|
||||||
OPENCOLORIO_BUILDOPTS="-DOCIO_BUILD_APPS=OFF -DOCIO_BUILD_NUKE=OFF \
|
OPENCOLORIO_CMAKE_FLAGS+=" -DOCIO_BUILD_APPS=OFF -DOCIO_BUILD_NUKE=OFF \
|
||||||
-DOCIO_BUILD_DOCS=OFF -DOCIO_BUILD_TESTS=OFF \
|
-DOCIO_BUILD_DOCS=OFF -DOCIO_BUILD_TESTS=OFF \
|
||||||
-DOCIO_BUILD_GPU_TESTS=OFF \
|
-DOCIO_BUILD_GPU_TESTS=OFF \
|
||||||
-DOCIO_BUILD_PYTHON=OFF -DOCIO_BUILD_PYGLUE=OFF \
|
-DOCIO_BUILD_PYTHON=OFF -DOCIO_BUILD_PYGLUE=OFF \
|
||||||
-DOCIO_BUILD_JAVA=OFF \
|
-DOCIO_BUILD_JAVA=OFF \
|
||||||
-DBUILD_SHARED_LIBS=${OPENCOLORIO_BUILD_SHARED_LIBS:=ON}"
|
-DBUILD_SHARED_LIBS=${OPENCOLORIO_BUILD_SHARED_LIBS:=ON}"
|
||||||
|
|
||||||
|
# Fix yaml-cpp which breaks against cmake 4.0 because of too-old cmake min.
|
||||||
|
# Remove when yaml-cpp is fixed to declare its own minimum high enough.
|
||||||
|
export CMAKE_POLICY_VERSION_MINIMUM=3.5
|
||||||
|
|
||||||
BASEDIR=`pwd`
|
BASEDIR=`pwd`
|
||||||
pwd
|
pwd
|
||||||
echo "OpenColorIO install dir will be: ${OPENCOLORIO_INSTALL_DIR}"
|
echo "OpenColorIO install dir will be: ${OPENCOLORIO_INSTALL_DIR}"
|
||||||
@@ -42,13 +47,13 @@ cd ${OPENCOLORIO_SOURCE_DIR}
|
|||||||
|
|
||||||
echo "git checkout ${OPENCOLORIO_VERSION} --force"
|
echo "git checkout ${OPENCOLORIO_VERSION} --force"
|
||||||
git checkout ${OPENCOLORIO_VERSION} --force
|
git checkout ${OPENCOLORIO_VERSION} --force
|
||||||
mkdir -p ${OPENCOLORIO_BUILD_DIR}
|
echo "Building OpenColorIO from commit" `git rev-parse --short HEAD`
|
||||||
cd ${OPENCOLORIO_BUILD_DIR}
|
|
||||||
time cmake -DCMAKE_BUILD_TYPE=Release \
|
cmake -S ${OPENCOLORIO_SOURCE_DIR} -B ${OPENCOLORIO_BUILD_DIR} \
|
||||||
|
-DCMAKE_BUILD_TYPE=${OPENCOLORIO_BUILD_TYPE} \
|
||||||
-DCMAKE_INSTALL_PREFIX=${OPENCOLORIO_INSTALL_DIR} \
|
-DCMAKE_INSTALL_PREFIX=${OPENCOLORIO_INSTALL_DIR} \
|
||||||
-DCMAKE_CXX_FLAGS="${OPENCOLORIO_CXX_FLAGS}" \
|
${OPENCOLORIO_CMAKE_FLAGS}
|
||||||
${OPENCOLORIO_BUILDOPTS} ${OPENCOLORIO_SOURCE_DIR}
|
time cmake --build ${OPENCOLORIO_BUILD_DIR} --target install --config ${OPENCOLORIO_BUILD_TYPE}
|
||||||
time cmake --build . --config Release --target install
|
|
||||||
popd
|
popd
|
||||||
|
|
||||||
# ls -R ${OPENCOLORIO_INSTALL_DIR}
|
# ls -R ${OPENCOLORIO_INSTALL_DIR}
|
||||||
|
|||||||
@@ -1,18 +1,17 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Utility script to download and build OpenEXR & IlmBase
|
# Utility script to download and build OpenEXR & Imath
|
||||||
#
|
|
||||||
# Copyright Contributors to the Open Shading Language project.
|
# Copyright Contributors to the Open Shading Language project.
|
||||||
# SPDX-License-Identifier: BSD-3-Clause
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||||
|
|
||||||
|
|
||||||
# Exit the whole script if any command fails.
|
# Exit the whole script if any command fails.
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
# Which OpenEXR to retrieve, how to build it
|
# Which OpenEXR to retrieve, how to build it
|
||||||
OPENEXR_REPO=${OPENEXR_REPO:=https://github.com/AcademySoftwareFoundation/openexr.git}
|
OPENEXR_REPO=${OPENEXR_REPO:=https://github.com/AcademySoftwareFoundation/openexr.git}
|
||||||
OPENEXR_VERSION=${OPENEXR_VERSION:=v3.1.1}
|
OPENEXR_VERSION=${OPENEXR_VERSION:=v3.2.4}
|
||||||
|
|
||||||
# Where to install the final results
|
# Where to install the final results
|
||||||
LOCAL_DEPS_DIR=${LOCAL_DEPS_DIR:=${PWD}/ext}
|
LOCAL_DEPS_DIR=${LOCAL_DEPS_DIR:=${PWD}/ext}
|
||||||
@@ -28,51 +27,34 @@ pwd
|
|||||||
echo "Building OpenEXR ${OPENEXR_VERSION}"
|
echo "Building OpenEXR ${OPENEXR_VERSION}"
|
||||||
echo "OpenEXR build dir will be: ${OPENEXR_BUILD_DIR}"
|
echo "OpenEXR build dir will be: ${OPENEXR_BUILD_DIR}"
|
||||||
echo "OpenEXR install dir will be: ${OPENEXR_INSTALL_DIR}"
|
echo "OpenEXR install dir will be: ${OPENEXR_INSTALL_DIR}"
|
||||||
echo "OpenEXR Build type is ${OPENEXR_BUILD_TYPE}"
|
echo "OpenEXR build type is ${OPENEXR_BUILD_TYPE}"
|
||||||
echo "CMAKE_PREFIX_PATH is ${CMAKE_PREFIX_PATH}"
|
echo "CMAKE_PREFIX_PATH is ${CMAKE_PREFIX_PATH}"
|
||||||
|
|
||||||
# Clone OpenEXR project (including IlmBase) from GitHub and build
|
# Clone OpenEXR project (including Imath) from GitHub and build
|
||||||
if [[ ! -e ${OPENEXR_SOURCE_DIR} ]] ; then
|
if [[ ! -e ${OPENEXR_SOURCE_DIR} ]] ; then
|
||||||
echo "git clone ${OPENEXR_REPO} ${OPENEXR_SOURCE_DIR}"
|
echo "git clone ${OPENEXR_REPO} ${OPENEXR_SOURCE_DIR}"
|
||||||
git clone ${OPENEXR_REPO} ${OPENEXR_SOURCE_DIR}
|
git clone ${OPENEXR_REPO} ${OPENEXR_SOURCE_DIR}
|
||||||
fi
|
fi
|
||||||
mkdir -p ${OPENEXR_INSTALL_DIR} && true
|
mkdir -p ${OPENEXR_INSTALL_DIR} && true
|
||||||
mkdir -p ${OPENEXR_BUILD_DIR} && true
|
|
||||||
|
|
||||||
pushd ${OPENEXR_SOURCE_DIR}
|
pushd ${OPENEXR_SOURCE_DIR}
|
||||||
git checkout ${OPENEXR_VERSION} --force
|
git checkout ${OPENEXR_VERSION} --force
|
||||||
|
echo "Building OpenEXR from commit" `git rev-parse --short HEAD`
|
||||||
|
|
||||||
if [[ ${OPENEXR_VERSION} == "v2.3.0" ]] ; then
|
cmake -S ${OPENEXR_SOURCE_DIR} -B ${OPENEXR_BUILD_DIR} \
|
||||||
# Simplified setup for 2.3+
|
-DCMAKE_BUILD_TYPE=${OPENEXR_BUILD_TYPE} \
|
||||||
cd ${OPENEXR_BUILD_DIR}
|
-DCMAKE_INSTALL_PREFIX="${OPENEXR_INSTALL_DIR}" \
|
||||||
cmake -DCMAKE_BUILD_TYPE=${OPENEXR_BUILD_TYPE} \
|
-DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" \
|
||||||
-DCMAKE_INSTALL_PREFIX="${OPENEXR_INSTALL_DIR}" \
|
-DBUILD_SHARED_LIBS=${OpenEXR_LOCAL_BUILD_SHARED_LIBS:=ON} \
|
||||||
-DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" \
|
-DOPENEXR_BUILD_TOOLS=0 \
|
||||||
-DILMBASE_PACKAGE_PREFIX="${OPENEXR_INSTALL_DIR}" \
|
-DBUILD_TESTING=0 \
|
||||||
-DOPENEXR_BUILD_UTILS=0 \
|
-DOPENEXR_VIEWERS_ENABLE=0 \
|
||||||
-DOPENEXR_BUILD_TESTS=0 \
|
-DINSTALL_OPENEXR_EXAMPLES=0 \
|
||||||
-DOPENEXR_BUILD_PYTHON_LIBS=0 \
|
-DOPENEXR_INSTALL_EXAMPLES=0 \
|
||||||
-DCMAKE_CXX_FLAGS="${OPENEXR_CXX_FLAGS}" \
|
-DCMAKE_INSTALL_LIBDIR=lib \
|
||||||
${OPENEXR_CMAKE_FLAGS} ${OPENEXR_SOURCE_DIR}
|
-DCMAKE_CXX_FLAGS="${OPENEXR_CXX_FLAGS}" \
|
||||||
time cmake --build . --target install --config ${OPENEXR_BUILD_TYPE}
|
${OPENEXR_CMAKE_FLAGS}
|
||||||
else
|
time cmake --build ${OPENEXR_BUILD_DIR} --target install --config ${OPENEXR_BUILD_TYPE}
|
||||||
# Simplified setup for 2.4+
|
|
||||||
cd ${OPENEXR_BUILD_DIR}
|
|
||||||
cmake -DCMAKE_BUILD_TYPE=${OPENEXR_BUILD_TYPE} \
|
|
||||||
-DCMAKE_INSTALL_PREFIX="${OPENEXR_INSTALL_DIR}" \
|
|
||||||
-DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" \
|
|
||||||
-DILMBASE_PACKAGE_PREFIX="${OPENEXR_INSTALL_DIR}" \
|
|
||||||
-DOPENEXR_BUILD_UTILS=0 \
|
|
||||||
-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}
|
|
||||||
time cmake --build . --target install --config ${OPENEXR_BUILD_TYPE}
|
|
||||||
fi
|
|
||||||
|
|
||||||
popd
|
popd
|
||||||
|
|
||||||
@@ -80,9 +62,12 @@ popd
|
|||||||
|
|
||||||
# Set up paths. These will only affect the caller if this script is
|
# Set up paths. These will only affect the caller if this script is
|
||||||
# run with 'source' rather than in a separate shell.
|
# run with 'source' rather than in a separate shell.
|
||||||
export ILMBASE_ROOT=$OPENEXR_INSTALL_DIR
|
export OpenEXR_ROOT=$OPENEXR_INSTALL_DIR
|
||||||
export OPENEXR_ROOT=$OPENEXR_INSTALL_DIR
|
# Environment variables are case insensitive on Windows, don't set
|
||||||
export ILMBASE_LIBRARY_DIR=$OPENEXR_INSTALL_DIR/lib
|
# it a second time with different case. This seems to trigger a bug
|
||||||
export OPENEXR_LIBRARY_DIR=$OPENEXR_INSTALL_DIR/lib
|
# where the next cmake command fails to find the compiler.
|
||||||
export LD_LIBRARY_PATH=$OPENEXR_ROOT/lib:$LD_LIBRARY_PATH
|
if [[ $(uname -s) != "Windows" && "${RUNNER_OS}" != "Windows" ]]; then
|
||||||
|
export OPENEXR_ROOT=$OPENEXR_INSTALL_DIR
|
||||||
|
fi
|
||||||
|
export LD_LIBRARY_PATH=$OpenEXR_ROOT/lib:$LD_LIBRARY_PATH
|
||||||
|
|
||||||
|
|||||||
@@ -9,54 +9,56 @@
|
|||||||
# Exit the whole script if any command fails.
|
# Exit the whole script if any command fails.
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
OPENIMAGEIO_REPO=${OPENIMAGEIO_REPO:=OpenImageIO/oiio}
|
OPENIMAGEIO_REPO=${OPENIMAGEIO_REPO:=AcademySoftwareFoundation/OpenImageIO}
|
||||||
OPENIMAGEIO_VERSION=${OPENIMAGEIO_VERSION:=release}
|
OPENIMAGEIO_VERSION=${OPENIMAGEIO_VERSION:=release}
|
||||||
|
|
||||||
LOCAL_DEPS_DIR=${LOCAL_DEPS_DIR:=${PWD}/ext}
|
LOCAL_DEPS_DIR=${LOCAL_DEPS_DIR:=${PWD}/ext}
|
||||||
OPENIMAGEIO_SRCDIR=${OPENIMAGEIO_SRCDIR:=${LOCAL_DEPS_DIR}/OpenImageIO}
|
OPENIMAGEIO_SOURCE_DIR=${OPENIMAGEIO_SOURCE_DIR:=${LOCAL_DEPS_DIR}/OpenImageIO}
|
||||||
OPENIMAGEIO_BUILD_DIR=${OPENIMAGEIO_BUILD_DIR:=${OPENIMAGEIO_SRCDIR}/build}
|
OPENIMAGEIO_BUILD_DIR=${OPENIMAGEIO_BUILD_DIR:=${OPENIMAGEIO_SOURCE_DIR}/build}
|
||||||
OPENIMAGEIO_INSTALLDIR=${OPENIMAGEIO_INSTALLDIR:=${LOCAL_DEPS_DIR}/dist}
|
OPENIMAGEIO_INSTALL_DIR=${OPENIMAGEIO_INSTALL_DIR:=${LOCAL_DEPS_DIR}/dist}
|
||||||
OPENIMAGEIO_CMAKE_FLAGS=${OPENIMAGEIO_CMAKE_FLAGS:=""}
|
|
||||||
OPENIMAGEIO_BUILD_TYPE=${OPENIMAGEIO_BUILD_TYPE:=Release}
|
OPENIMAGEIO_BUILD_TYPE=${OPENIMAGEIO_BUILD_TYPE:=Release}
|
||||||
|
OPENIMAGEIO_CMAKE_FLAGS=${OPENIMAGEIO_CMAKE_FLAGS:=""}
|
||||||
OPENIMAGEIO_CXXFLAGS=${OPENIMAGEIO_CXXFLAGS:=""}
|
OPENIMAGEIO_CXXFLAGS=${OPENIMAGEIO_CXXFLAGS:=""}
|
||||||
BASEDIR=$PWD
|
BASEDIR=$PWD
|
||||||
CMAKE_GENERATOR=${CMAKE_GENERATOR:="Unix Makefiles"}
|
|
||||||
|
|
||||||
if [ ! -e $OPENIMAGEIO_SRCDIR ] ; then
|
pwd
|
||||||
git clone https://github.com/${OPENIMAGEIO_REPO} $OPENIMAGEIO_SRCDIR
|
echo "OpenImageIO build dir will be: ${OPENIMAGEIO_BUILD_DIR}"
|
||||||
|
echo "OpenImageIO install dir will be: ${OPENIMAGEIO_INSTALL_DIR}"
|
||||||
|
echo "OpenImageIO Build type is ${OPENIMAGEIO_BUILD_TYPE}"
|
||||||
|
echo "CXX: '${CXX}'"
|
||||||
|
echo "CC: '${CC}'"
|
||||||
|
echo "CMAKE_CXX_COMPILER: '${CMAKE_CXX_COMPILER}'"
|
||||||
|
|
||||||
|
if [ ! -e $OPENIMAGEIO_SOURCE_DIR ] ; then
|
||||||
|
git clone https://github.com/${OPENIMAGEIO_REPO} $OPENIMAGEIO_SOURCE_DIR
|
||||||
fi
|
fi
|
||||||
|
mkdir -p ${OPENIMAGEIO_INSTALL_DIR} && true
|
||||||
|
|
||||||
mkdir -p ${OPENIMAGEIO_INSTALLDIR} && true
|
|
||||||
mkdir -p ${OPENIMAGEIO_BUILD_DIR} && true
|
mkdir -p ${OPENIMAGEIO_BUILD_DIR} && true
|
||||||
|
|
||||||
pushd $OPENIMAGEIO_SRCDIR
|
pushd $OPENIMAGEIO_SOURCE_DIR
|
||||||
git fetch --all -p
|
git fetch --all -p
|
||||||
git checkout $OPENIMAGEIO_VERSION --force
|
git checkout $OPENIMAGEIO_VERSION --force
|
||||||
|
echo "Building OpenImageIO from ${OPENIMAGEIO_REPO} / ${OPENIMAGEIO_VERSION} @ commit" `git rev-parse --short HEAD`
|
||||||
|
|
||||||
if [[ "$USE_SIMD" != "" ]] ; then
|
if [[ "$USE_SIMD" != "" ]] ; then
|
||||||
OPENIMAGEIO_CMAKE_FLAGS="$OPENIMAGEIO_CMAKE_FLAGS -DUSE_SIMD=$USE_SIMD"
|
OPENIMAGEIO_CMAKE_FLAGS+=" -DUSE_SIMD=$USE_SIMD"
|
||||||
fi
|
|
||||||
if [[ "$DEBUG" == "1" ]] ; then
|
|
||||||
OPENIMAGEIO_CMAKE_FLAGS="$OPENIMAGEIO_CMAKE_FLAGS -DCMAKE_BUILD_TYPE=Debug"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# if [[ "$ARCH" == "windows64" ]] ; then
|
|
||||||
pushd ${OPENIMAGEIO_BUILD_DIR}
|
cmake -S ${OPENIMAGEIO_SOURCE_DIR} -B ${OPENIMAGEIO_BUILD_DIR} \
|
||||||
cmake .. -G "$CMAKE_GENERATOR" \
|
-DCMAKE_BUILD_TYPE="${OPENIMAGEIO_BUILD_TYPE}" \
|
||||||
-DCMAKE_BUILD_TYPE="$OPENIMAGEIO_BUILD_TYPE" \
|
-DCMAKE_PREFIX_PATH="${CMAKE_PREFIX_PATH}" \
|
||||||
-DCMAKE_INSTALL_PREFIX="$OPENIMAGEIO_INSTALLDIR" \
|
-DCMAKE_INSTALL_PREFIX="${OPENIMAGEIO_INSTALL_DIR}" \
|
||||||
-DPYTHON_VERSION="$PYTHON_VERSION" \
|
-DPYTHON_VERSION="${PYTHON_VERSION}" \
|
||||||
-DCMAKE_INSTALL_LIBDIR="$OPENIMAGEIO_INSTALLDIR/lib" \
|
-DCMAKE_INSTALL_LIBDIR="${OPENIMAGEIO_INSTALL_DIR}/lib" \
|
||||||
-DCMAKE_CXX_STANDARD="$CMAKE_CXX_STANDARD" \
|
-DCMAKE_CXX_STANDARD="${CMAKE_CXX_STANDARD}" \
|
||||||
$OPENIMAGEIO_CMAKE_FLAGS -DVERBOSE=1
|
${OPENIMAGEIO_CMAKE_FLAGS} -DVERBOSE=1
|
||||||
echo "Parallel build $CMAKE_BUILD_PARALLEL_LEVEL"
|
echo "Parallel build $CMAKE_BUILD_PARALLEL_LEVEL"
|
||||||
time cmake --build . --target install --config ${OPENIMAGEIO_BUILD_TYPE}
|
time cmake --build ${OPENIMAGEIO_BUILD_DIR} --target install --config ${OPENIMAGEIO_BUILD_TYPE}
|
||||||
popd
|
|
||||||
|
|
||||||
popd
|
popd
|
||||||
|
|
||||||
export OpenImageIO_ROOT=$OPENIMAGEIO_INSTALLDIR
|
export OpenImageIO_ROOT=$OPENIMAGEIO_INSTALL_DIR
|
||||||
export PATH=$OpenImageIO_ROOT/bin:$PATH
|
|
||||||
export DYLD_LIBRARY_PATH=$OpenImageIO_ROOT/lib:$DYLD_LIBRARY_PATH
|
export DYLD_LIBRARY_PATH=$OpenImageIO_ROOT/lib:$DYLD_LIBRARY_PATH
|
||||||
export LD_LIBRARY_PATH=$OpenImageIO_ROOT/lib:$LD_LIBRARY_PATH
|
export LD_LIBRARY_PATH=$OpenImageIO_ROOT/lib:$LD_LIBRARY_PATH
|
||||||
export PYTHONPATH=$OpenImageIO_ROOT/lib/python${PYTHON_VERSION}/site-packages:$PYTHONPATH
|
export PYTHONPATH=$OpenImageIO_ROOT/lib/python${PYTHON_VERSION}/site-packages:$PYTHONPATH
|
||||||
|
|||||||
@@ -11,40 +11,43 @@ set -ex
|
|||||||
|
|
||||||
# Repo and branch/tag/commit of pugixml to download if we don't have it yet
|
# 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_REPO=${PUGIXML_REPO:=https://github.com/zeux/pugixml.git}
|
||||||
PUGIXML_VERSION=${PUGIXML_VERSION:=v1.10}
|
PUGIXML_VERSION=${PUGIXML_VERSION:=v1.11.4}
|
||||||
|
|
||||||
# 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)
|
|
||||||
LOCAL_DEPS_DIR=${LOCAL_DEPS_DIR:=${PWD}/ext}
|
LOCAL_DEPS_DIR=${LOCAL_DEPS_DIR:=${PWD}/ext}
|
||||||
|
PUGIXML_SOURCE_DIR=${PUGIXML_SOURCE_DIR:=${LOCAL_DEPS_DIR}/pugixml}
|
||||||
|
PUGIXML_BUILD_DIR=${PUGIXML_BUILD_DIR:=${PUGIXML_SOURCE_DIR}/build}
|
||||||
PUGIXML_INSTALL_DIR=${PUGIXML_INSTALL_DIR:=${LOCAL_DEPS_DIR}/dist}
|
PUGIXML_INSTALL_DIR=${PUGIXML_INSTALL_DIR:=${LOCAL_DEPS_DIR}/dist}
|
||||||
#PUGIXML_BUILD_OPTS=${PUGIXML_BUILD_OPTS:=}
|
PUGIXML_BUILD_TYPE=${PUGIXML_BUILD_TYPE:=Release}
|
||||||
|
|
||||||
pwd
|
pwd
|
||||||
echo "pugixml install dir will be: ${PUGIXML_INSTALL_DIR}"
|
echo "Building Pugixml ${PUGIXML_VERSION}"
|
||||||
|
echo "Pugixml source dir will be: ${PUGIXML_SOURCE_DIR}"
|
||||||
mkdir -p ./ext
|
echo "Pugixml build dir will be: ${PUGIXML_BUILD_DIR}"
|
||||||
pushd ./ext
|
echo "Pugixml install dir will be: ${PUGIXML_INSTALL_DIR}"
|
||||||
|
echo "Pugixml build type is ${PUGIXML_BUILD_TYPE}"
|
||||||
|
echo "CMAKE_PREFIX_PATH is ${CMAKE_PREFIX_PATH}"
|
||||||
|
|
||||||
# Clone pugixml project from GitHub and build
|
# Clone pugixml project from GitHub and build
|
||||||
if [[ ! -e ${PUGIXML_SRC_DIR} ]] ; then
|
if [[ ! -e ${PUGIXML_SOURCE_DIR} ]] ; then
|
||||||
echo "git clone ${PUGIXML_REPO} ${PUGIXML_SRC_DIR}"
|
echo "git clone ${PUGIXML_REPO} ${PUGIXML_SOURCE_DIR}"
|
||||||
git clone ${PUGIXML_REPO} ${PUGIXML_SRC_DIR}
|
git clone ${PUGIXML_REPO} ${PUGIXML_SOURCE_DIR}
|
||||||
fi
|
fi
|
||||||
cd ${PUGIXML_SRC_DIR}
|
mkdir -p ${PUGIXML_INSTALL_DIR} && true
|
||||||
|
|
||||||
|
pushd ${PUGIXML_SOURCE_DIR}
|
||||||
echo "git checkout ${PUGIXML_VERSION} --force"
|
echo "git checkout ${PUGIXML_VERSION} --force"
|
||||||
git checkout ${PUGIXML_VERSION} --force
|
git checkout ${PUGIXML_VERSION} --force
|
||||||
|
echo "Building pugixml from commit" `git rev-parse --short HEAD`
|
||||||
|
|
||||||
mkdir -p ${PUGIXML_BUILD_DIR}
|
if [[ -z $DEP_DOWNLOAD_ONLY ]]; then
|
||||||
cd ${PUGIXML_BUILD_DIR}
|
time cmake -S ${PUGIXML_SOURCE_DIR} -B ${PUGIXML_BUILD_DIR} \
|
||||||
time cmake -DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=${PUGIXML_BUILD_TYPE} \
|
||||||
-DCMAKE_INSTALL_PREFIX=${PUGIXML_INSTALL_DIR} \
|
-DCMAKE_INSTALL_PREFIX=${PUGIXML_INSTALL_DIR} \
|
||||||
-DBUILD_SHARED_LIBS=ON \
|
-DBUILD_SHARED_LIBS=${PUGIXML_LOCAL_BUILD_SHARED_LIBS:=ON} \
|
||||||
-DBUILD_TESTS=OFF \
|
-DBUILD_TESTS=OFF \
|
||||||
${PUGIXML_BUILD_OPTS} ..
|
${PUGIXML_CMAKE_FLAGS}
|
||||||
time cmake --build . --config Release --target install
|
time cmake --build ${PUGIXML_BUILD_DIR} --target install --config ${PUGIXML_BUILD_TYPE}
|
||||||
|
fi
|
||||||
|
|
||||||
# ls -R ${PUGIXML_INSTALL_DIR}
|
# ls -R ${PUGIXML_INSTALL_DIR}
|
||||||
popd
|
popd
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# Utility script to download and build pybind11
|
|
||||||
#
|
|
||||||
# Copyright Contributors to the Open Shading Language project.
|
# Copyright Contributors to the Open Shading Language project.
|
||||||
# SPDX-License-Identifier: BSD-3-Clause
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||||
|
|
||||||
|
# Utility script to download and build pybind11
|
||||||
|
|
||||||
# Exit the whole script if any command fails.
|
# Exit the whole script if any command fails.
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
# Repo and branch/tag/commit of pybind11 to download if we don't have it yet
|
# 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_REPO=${PYBIND11_REPO:=https://github.com/pybind/pybind11.git}
|
||||||
PYBIND11_VERSION=${PYBIND11_VERSION:=v2.8.1}
|
PYBIND11_VERSION=${PYBIND11_VERSION:=v3.0.0}
|
||||||
|
|
||||||
# Where to put pybind11 repo source (default to the ext area)
|
# Where to put pybind11 repo source (default to the ext area)
|
||||||
PYBIND11_SRC_DIR=${PYBIND11_SRC_DIR:=${PWD}/ext/pybind11}
|
PYBIND11_SRC_DIR=${PYBIND11_SRC_DIR:=${PWD}/ext/pybind11}
|
||||||
@@ -22,6 +22,10 @@ LOCAL_DEPS_DIR=${LOCAL_DEPS_DIR:=${PWD}/ext}
|
|||||||
PYBIND11_INSTALL_DIR=${PYBIND11_INSTALL_DIR:=${LOCAL_DEPS_DIR}/dist}
|
PYBIND11_INSTALL_DIR=${PYBIND11_INSTALL_DIR:=${LOCAL_DEPS_DIR}/dist}
|
||||||
#PYBIND11_BUILD_OPTS=${PYBIND11_BUILD_OPTS:=}
|
#PYBIND11_BUILD_OPTS=${PYBIND11_BUILD_OPTS:=}
|
||||||
|
|
||||||
|
# Fix for pybind11 breaking against cmake 4.0 because of too-old cmake min.
|
||||||
|
# Remove when pybind11 is fixed to declare its own minimum high enough.
|
||||||
|
export CMAKE_POLICY_VERSION_MINIMUM=3.5
|
||||||
|
|
||||||
if [[ "${PYTHON_VERSION}" != "" ]] ; then
|
if [[ "${PYTHON_VERSION}" != "" ]] ; then
|
||||||
PYBIND11_BUILD_OPTS+=" -DPYBIND11_PYTHON_VERSION=${PYTHON_VERSION}"
|
PYBIND11_BUILD_OPTS+=" -DPYBIND11_PYTHON_VERSION=${PYTHON_VERSION}"
|
||||||
fi
|
fi
|
||||||
@@ -41,16 +45,14 @@ cd ${PYBIND11_SRC_DIR}
|
|||||||
|
|
||||||
echo "git checkout ${PYBIND11_VERSION} --force"
|
echo "git checkout ${PYBIND11_VERSION} --force"
|
||||||
git checkout ${PYBIND11_VERSION} --force
|
git checkout ${PYBIND11_VERSION} --force
|
||||||
|
echo "Building pybind11 from commit" `git rev-parse --short HEAD`
|
||||||
mkdir -p ${PYBIND11_BUILD_DIR}
|
|
||||||
cd ${PYBIND11_BUILD_DIR}
|
|
||||||
|
|
||||||
if [[ -z $DEP_DOWNLOAD_ONLY ]]; then
|
if [[ -z $DEP_DOWNLOAD_ONLY ]]; then
|
||||||
time cmake -DCMAKE_BUILD_TYPE=Release \
|
time cmake -S . -B ${PYBIND11_BUILD_DIR} -DCMAKE_BUILD_TYPE=Release \
|
||||||
-DCMAKE_INSTALL_PREFIX=${PYBIND11_INSTALL_DIR} \
|
-DCMAKE_INSTALL_PREFIX=${PYBIND11_INSTALL_DIR} \
|
||||||
-DPYBIND11_TEST=OFF \
|
-DPYBIND11_TEST=OFF \
|
||||||
${PYBIND11_BUILD_OPTS} ..
|
${PYBIND11_BUILD_OPTS}
|
||||||
time cmake --build . --config Release --target install
|
time cmake --build ${PYBIND11_BUILD_DIR} --config Release --target install
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ls -R ${PYBIND11_INSTALL_DIR}
|
# ls -R ${PYBIND11_INSTALL_DIR}
|
||||||
|
|||||||
@@ -0,0 +1,58 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Utility script to download and build zlib
|
||||||
|
#
|
||||||
|
# Copyright Contributors to the OpenImageIO project.
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
# https://github.com/AcademySoftwareFoundation/OpenImageIO
|
||||||
|
|
||||||
|
# Exit the whole script if any command fails.
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
# Repo and branch/tag/commit of zlib to download if we don't have it yet
|
||||||
|
ZLIB_REPO=${ZLIB_REPO:=https://github.com/madler/zlib.git}
|
||||||
|
ZLIB_VERSION=${ZLIB_VERSION:=v1.2.11}
|
||||||
|
|
||||||
|
# Where to put zlib repo source (default to the ext area)
|
||||||
|
ZLIB_SRC_DIR=${ZLIB_SRC_DIR:=${PWD}/ext/zlib}
|
||||||
|
# Temp build area (default to a build/ subdir under source)
|
||||||
|
ZLIB_BUILD_DIR=${ZLIB_BUILD_DIR:=${ZLIB_SRC_DIR}/build}
|
||||||
|
# Install area for zlib (default to ext/dist)
|
||||||
|
ZLIB_INSTALL_DIR=${ZLIB_INSTALL_DIR:=${PWD}/ext/dist}
|
||||||
|
#ZLIB_CONFIG_OPTS=${ZLIB_CONFIG_OPTS:=}
|
||||||
|
|
||||||
|
# Fix zlib which breaks against cmake 4.0 because of too-old cmake min.
|
||||||
|
# Remove when zlib is fixed to declare its own minimum high enough.
|
||||||
|
export CMAKE_POLICY_VERSION_MINIMUM=3.5
|
||||||
|
|
||||||
|
pwd
|
||||||
|
echo "zlib install dir will be: ${ZLIB_INSTALL_DIR}"
|
||||||
|
|
||||||
|
mkdir -p ./ext
|
||||||
|
pushd ./ext
|
||||||
|
|
||||||
|
# Clone zlib project from GitHub and build
|
||||||
|
if [[ ! -e ${ZLIB_SRC_DIR} ]] ; then
|
||||||
|
echo "git clone ${ZLIB_REPO} ${ZLIB_SRC_DIR}"
|
||||||
|
git clone ${ZLIB_REPO} ${ZLIB_SRC_DIR}
|
||||||
|
fi
|
||||||
|
cd ${ZLIB_SRC_DIR}
|
||||||
|
|
||||||
|
echo "git checkout ${ZLIB_VERSION} --force"
|
||||||
|
git checkout ${ZLIB_VERSION} --force
|
||||||
|
|
||||||
|
if [[ -z $DEP_DOWNLOAD_ONLY ]]; then
|
||||||
|
time cmake -S . -B ${ZLIB_BUILD_DIR} -DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DCMAKE_INSTALL_PREFIX=${ZLIB_INSTALL_DIR} \
|
||||||
|
${ZLIB_CONFIG_OPTS}
|
||||||
|
time cmake --build ${ZLIB_BUILD_DIR} --config Release --target install
|
||||||
|
fi
|
||||||
|
|
||||||
|
# ls -R ${ZLIB_INSTALL_DIR}
|
||||||
|
popd
|
||||||
|
|
||||||
|
|
||||||
|
# Set up paths. These will only affect the caller if this script is
|
||||||
|
# run with 'source' rather than in a separate shell.
|
||||||
|
export ZLIB_ROOT=$ZLIB_INSTALL_DIR
|
||||||
|
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
#!/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 -e
|
||||||
|
|
||||||
|
# Arguments to this script are:
|
||||||
|
# BUILDDIR_NEW BUILDDIR_OLD LIBRARIES...
|
||||||
|
|
||||||
|
BUILDDIR_NEW=$1
|
||||||
|
shift
|
||||||
|
BUILDDIR_OLD=$1
|
||||||
|
shift
|
||||||
|
LIBS=$*
|
||||||
|
|
||||||
|
#
|
||||||
|
# First, create ABI dumps from both builds
|
||||||
|
#
|
||||||
|
ABI_ARGS="-bin-only -skip-cxx -public-headers $PWD/dist/include/OSL "
|
||||||
|
echo "ABI_CHECK: PWD=${PWD} "
|
||||||
|
ls -l $BUILDDIR_NEW
|
||||||
|
ls -l $BUILDDIR_OLD
|
||||||
|
for dir in $BUILDDIR_NEW $BUILDDIR_OLD ; do
|
||||||
|
for lib in $LIBS ; do
|
||||||
|
abi-dumper $ABI_ARGS ${dir}/lib/${lib}.so -o ${dir}/abi-${lib}.dump
|
||||||
|
done
|
||||||
|
done
|
||||||
|
echo "Saved ABI dumps"
|
||||||
|
|
||||||
|
#
|
||||||
|
# Run the ABI compliance checker, saving the outputs to files
|
||||||
|
#
|
||||||
|
for lib in $LIBS ; do
|
||||||
|
abi-compliance-checker -l $lib -old $BUILDDIR_OLD/abi-$lib.dump -new $BUILDDIR_NEW/abi-$lib.dump | tee ${lib}-abi-results.txt || true
|
||||||
|
echo -e "\x1b[33;1m"
|
||||||
|
echo -e "$lib"
|
||||||
|
fgrep "Binary compatibility:" ${lib}-abi-results.txt
|
||||||
|
echo -e "\x1b[33;0m"
|
||||||
|
done
|
||||||
|
|
||||||
|
#
|
||||||
|
# If the "Binary compatibility" summary results say anything other than 100%,
|
||||||
|
# we fail!
|
||||||
|
#
|
||||||
|
for lib in $LIBS ; do
|
||||||
|
if [[ `fgrep "Binary compatibility:" ${lib}-abi-results.txt | grep -v 100\%` != "" ]] ; then
|
||||||
|
cp -r compat_reports ${BUILDDIR_NEW}/compat_reports
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
@@ -8,6 +8,12 @@
|
|||||||
# any command in it fails. This is crucial for CI tests.
|
# any command in it fails. This is crucial for CI tests.
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
|
OSL_CMAKE_FLAGS="$MY_CMAKE_FLAGS $OSL_CMAKE_FLAGS"
|
||||||
|
export OSL_SRC_DIR=${OSL_SRC_DIR:=$PWD}
|
||||||
|
export OSL_BUILD_DIR=${OSL_BUILD_DIR:=${OSL_SRC_DIR}/build}
|
||||||
|
export OSL_INSTALL_DIR=${OSL_INSTALL_DIR:=${OSL_SRC_DIR}/dist}
|
||||||
|
export OSL_CMAKE_BUILD_TYPE=${OSL_CMAKE_BUILD_TYPE:=${CMAKE_BUILD_TYPE:=Release}}
|
||||||
|
|
||||||
if [[ "$USE_SIMD" != "" ]] ; then
|
if [[ "$USE_SIMD" != "" ]] ; then
|
||||||
OSL_CMAKE_FLAGS="$OSL_CMAKE_FLAGS -DUSE_SIMD=$USE_SIMD"
|
OSL_CMAKE_FLAGS="$OSL_CMAKE_FLAGS -DUSE_SIMD=$USE_SIMD"
|
||||||
fi
|
fi
|
||||||
@@ -16,9 +22,8 @@ if [[ -n "$CODECOV" ]] ; then
|
|||||||
OSL_CMAKE_FLAGS="$OSL_CMAKE_FLAGS -DCODECOV=${CODECOV}"
|
OSL_CMAKE_FLAGS="$OSL_CMAKE_FLAGS -DCODECOV=${CODECOV}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
pushd build
|
cmake -S ${OSL_SRC_DIR} -B ${OSL_BUILD_DIR} -G "$CMAKE_GENERATOR" \
|
||||||
cmake .. -G "$CMAKE_GENERATOR" \
|
-DCMAKE_BUILD_TYPE="${OSL_CMAKE_BUILD_TYPE}" \
|
||||||
-DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}" \
|
|
||||||
-DCMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH" \
|
-DCMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH" \
|
||||||
-DCMAKE_INSTALL_PREFIX="$OSL_ROOT" \
|
-DCMAKE_INSTALL_PREFIX="$OSL_ROOT" \
|
||||||
-DUSE_PYTHON="${USE_PYTHON:=1}" \
|
-DUSE_PYTHON="${USE_PYTHON:=1}" \
|
||||||
@@ -29,15 +34,15 @@ cmake .. -G "$CMAKE_GENERATOR" \
|
|||||||
$OSL_CMAKE_FLAGS -DVERBOSE=1
|
$OSL_CMAKE_FLAGS -DVERBOSE=1
|
||||||
|
|
||||||
# Save a copy of the generated files for debugging broken CI builds.
|
# Save a copy of the generated files for debugging broken CI builds.
|
||||||
mkdir cmake-save || /bin/true
|
mkdir ${OSL_BUILD_DIR}/cmake-save || true
|
||||||
cp -r CMake* *.cmake cmake-save
|
cp -r ${OSL_BUILD_DIR}/CMake* ${OSL_BUILD_DIR}/*.cmake ${OSL_BUILD_DIR}/cmake-save
|
||||||
|
|
||||||
: ${BUILDTARGET:=install}
|
: ${BUILDTARGET:=install}
|
||||||
if [[ "$BUILDTARGET" != "none" ]] ; then
|
if [[ "$BUILDTARGET" != "none" ]] ; then
|
||||||
echo "Parallel build ${CMAKE_BUILD_PARALLEL_LEVEL} of target ${BUILDTARGET}"
|
echo "Parallel build ${CMAKE_BUILD_PARALLEL_LEVEL} of target ${BUILDTARGET}"
|
||||||
time ${OSL_CMAKE_BUILD_WRAPPER} cmake --build . --target ${BUILDTARGET} --config ${CMAKE_BUILD_TYPE}
|
time ${OSL_CMAKE_BUILD_WRAPPER} cmake --build ${OSL_BUILD_DIR} --target ${BUILDTARGET} --config ${OSL_CMAKE_BUILD_TYPE}
|
||||||
|
ccache --show-stats || true
|
||||||
fi
|
fi
|
||||||
popd
|
|
||||||
|
|
||||||
if [[ "${DEBUG_CI:=0}" != "0" ]] ; then
|
if [[ "${DEBUG_CI:=0}" != "0" ]] ; then
|
||||||
echo "PATH=$PATH"
|
echo "PATH=$PATH"
|
||||||
@@ -48,6 +53,7 @@ if [[ "${DEBUG_CI:=0}" != "0" ]] ; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$BUILDTARGET" == clang-format ]] ; then
|
if [[ "$BUILDTARGET" == clang-format ]] ; then
|
||||||
|
echo "Running " `which clang-format` " version " `clang-format --version`
|
||||||
git diff --color
|
git diff --color
|
||||||
THEDIFF=`git diff`
|
THEDIFF=`git diff`
|
||||||
if [[ "$THEDIFF" != "" ]] ; then
|
if [[ "$THEDIFF" != "" ]] ; then
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Copyright Contributors to the Open Shading Language project.
|
||||||
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||||
|
|
||||||
# Run code coverage analysis
|
# Run code coverage analysis
|
||||||
# This assumes that the build occurred with CODECOV=1 andtests have already
|
# This assumes that the build occurred with CODECOV=1 andtests have already
|
||||||
# fully run.
|
# fully run.
|
||||||
@@ -31,4 +35,9 @@ for g in $(find ../build -name "*.gcno" -type f); do
|
|||||||
echo "dirname $g = $(dirname $g) to " `$(echo "$g" | sed -e 's/\/build\//\//' -e 's/\.gcno/\.cpp/' -e 's/\.cpp\.cpp/\.cpp/' -e 's/\/CMakeFiles.*\.dir\//\//')`
|
echo "dirname $g = $(dirname $g) to " `$(echo "$g" | sed -e 's/\/build\//\//' -e 's/\.gcno/\.cpp/' -e 's/\.cpp\.cpp/\.cpp/' -e 's/\/CMakeFiles.*\.dir\//\//')`
|
||||||
gcov -l -p -o $(dirname "$g") $(echo "$g" | sed -e 's/\/build\//\//' -e 's/\.gcno/\.cpp/' -e 's/\/CMakeFiles.*\.dir\//\//')
|
gcov -l -p -o $(dirname "$g") $(echo "$g" | sed -e 's/\/build\//\//' -e 's/\.gcno/\.cpp/' -e 's/\/CMakeFiles.*\.dir\//\//')
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Remove pointless .gcov files so we don't analyze them
|
||||||
|
rm -f "*opt*include*"
|
||||||
|
rm -f "*usr*local*"
|
||||||
|
|
||||||
popd
|
popd
|
||||||
|
|||||||
@@ -11,47 +11,76 @@
|
|||||||
# Environment variables we always need
|
# Environment variables we always need
|
||||||
export PATH=/usr/local/bin/_ccache:/usr/lib/ccache:$PATH
|
export PATH=/usr/local/bin/_ccache:/usr/lib/ccache:$PATH
|
||||||
export USE_CCACHE=${USE_CCACHE:=1}
|
export USE_CCACHE=${USE_CCACHE:=1}
|
||||||
export CCACHE_CPP2=1
|
export CCACHE_CPP2=
|
||||||
export CCACHE_DIR=/tmp/ccache
|
export CCACHE_DIR=$HOME/.ccache
|
||||||
if [[ "${RUNNER_OS}" == "macOS" ]] ; then
|
export CCACHE_COMPRESSION=yes
|
||||||
export CCACHE_DIR=$HOME/.ccache
|
if [[ "$(which ccache)" != "" ]] ; then
|
||||||
|
# Try to coax dependency building into also using ccache
|
||||||
|
# Wait, no, this breaks old OIIO!
|
||||||
|
# export CMAKE_CXX_COMPILER_LAUNCHER="ccache"
|
||||||
|
# export CMAKE_C_COMPILER_LAUNCHER="ccache"
|
||||||
|
ccache -z
|
||||||
fi
|
fi
|
||||||
mkdir -p $CCACHE_DIR
|
mkdir -p $CCACHE_DIR
|
||||||
|
|
||||||
|
export DISTDIR=$PWD/dist
|
||||||
export OSL_ROOT=$PWD/dist
|
export OSL_ROOT=$PWD/dist
|
||||||
export DYLD_LIBRARY_PATH=$OSL_ROOT/lib:$DYLD_LIBRARY_PATH
|
export DYLD_LIBRARY_PATH=$DISTDIR/lib:$DYLD_LIBRARY_PATH
|
||||||
export LD_LIBRARY_PATH=$OSL_ROOT/lib:$LD_LIBRARY_PATH
|
export LD_LIBRARY_PATH=$DISTDIR/lib:$LD_LIBRARY_PATH
|
||||||
export OIIO_LIBRARY_PATH=$OSL_ROOT/lib:${OIIO_LIBRARY_PATH}
|
export LD_LIBRARY_PATH=$DISTDIR/lib64:$LD_LIBRARY_PATH
|
||||||
|
export OIIO_LIBRARY_PATH=$DISTDIR/lib
|
||||||
|
export OPENIMAGEIO_PLUGIN_PATH=$DISTDIR/lib:${OPENIMAGEIO_PLUGIN_PATH}
|
||||||
export LSAN_OPTIONS=suppressions=$PWD/src/build-scripts/nosanitize.txt
|
export LSAN_OPTIONS=suppressions=$PWD/src/build-scripts/nosanitize.txt
|
||||||
export ASAN_OPTIONS=print_suppressions=0:detect_odr_violation=1
|
export ASAN_OPTIONS=print_suppressions=0:detect_odr_violation=1
|
||||||
|
# export UBSAN_OPTIONS=suppressions=$PWD/src/build-scripts/ubsan-suppressions.txt
|
||||||
|
|
||||||
export USE_PYTHON=${USE_PYTHON:=1}
|
export PYTHON_VERSION=${PYTHON_VERSION:="3.7"}
|
||||||
export PYTHON_VERSION=${PYTHON_VERSION:="2.7"}
|
export PYTHONPATH=$DISTDIR/lib/python${PYTHON_VERSION}/site-packages:$PYTHONPATH
|
||||||
export PYTHONPATH=/usr/local/lib/python${PYTHON_VERSION}/site-packages:$PYTHONPATH
|
cmake --version
|
||||||
export PYTHONPATH=/usr/local/lib64/python${PYTHON_VERSION}/site-packages:$PYTHONPATH
|
|
||||||
export PYTHONPATH=$OSL_ROOT/lib/python${PYTHON_VERSION}/site-packages:$PYTHONPATH
|
|
||||||
export BUILD_MISSING_DEPS=${BUILD_MISSING_DEPS:=1}
|
|
||||||
export COMPILER=${COMPILER:=gcc}
|
|
||||||
export CXX=${CXX:=g++}
|
|
||||||
export OSL_CI=true
|
export OSL_CI=true
|
||||||
|
export OpenImageIO_CI=true
|
||||||
export USE_NINJA=${USE_NINJA:=1}
|
export USE_NINJA=${USE_NINJA:=1}
|
||||||
export CMAKE_GENERATOR=${CMAKE_GENERATOR:=Ninja}
|
export CMAKE_GENERATOR=${CMAKE_GENERATOR:=Ninja}
|
||||||
export CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:=Release}
|
export CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE:=Release}
|
||||||
export CMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD:=11}
|
export CMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD:=17}
|
||||||
|
|
||||||
export PARALLEL=${PARALLEL:=4}
|
|
||||||
export PAR_MAKEFLAGS=-j${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 LOCAL_DEPS_DIR=${LOCAL_DEPS_DIR:=$HOME/ext}
|
||||||
export CMAKE_PREFIX_PATH=${LOCAL_DEPS_DIR}/dist:${CMAKE_PREFIX_PATH}
|
export PATH=${LOCAL_DEPS_DIR}/dist/bin:$PATH
|
||||||
export LD_LIBRARY_PATH=${LOCAL_DEPS_DIR}/dist/lib:$LD_LIBRARY_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 LD_LIBRARY_PATH=${LOCAL_DEPS_DIR}/dist/lib64:$LD_LIBRARY_PATH
|
||||||
export DYLD_LIBRARY_PATH=${LOCAL_DEPS_DIR}/dist/lib:$DYLD_LIBRARY_PATH
|
export DYLD_LIBRARY_PATH=${LOCAL_DEPS_DIR}/dist/lib:$DYLD_LIBRARY_PATH
|
||||||
|
|
||||||
export TESTSUITE_CLEANUP_ON_SUCCESS=${TESTSUITE_CLEANUP_ON_SUCCESS:=1}
|
export TESTSUITE_CLEANUP_ON_SUCCESS=${TESTSUITE_CLEANUP_ON_SUCCESS:=1}
|
||||||
|
|
||||||
|
# For CI, default to building missing dependencies automatically
|
||||||
|
export OpenImageIO_BUILD_MISSING_DEPS=${OpenImageIO_BUILD_MISSING_DEPS:=all}
|
||||||
|
export OSL_BUILD_MISSING_DEPS=${OSL_BUILD_MISSING_DEPS:=all}
|
||||||
|
|
||||||
|
# Sonar
|
||||||
|
export BUILD_WRAPPER_OUT_DIR="${PWD}/bw_output"
|
||||||
|
export BW_OUTPUT_DIR="${PWD}/bw_output"
|
||||||
|
|
||||||
|
# Parallel builds
|
||||||
|
if [[ `uname -s` == "Linux" ]] ; then
|
||||||
|
echo "procs: " `nproc`
|
||||||
|
head -40 /proc/cpuinfo
|
||||||
|
export PARALLEL=${PARALLEL:=$((2 + `nproc`))}
|
||||||
|
elif [[ "${RUNNER_OS}" == "macOS" ]] ; then
|
||||||
|
echo "procs: " `sysctl -n hw.ncpu`
|
||||||
|
sysctl machdep.cpu.features
|
||||||
|
export PARALLEL=${PARALLEL:=$((2 + `sysctl -n hw.ncpu`))}
|
||||||
|
elif [[ "${RUNNER_OS}" == "Windows" ]] ; then
|
||||||
|
# Presumably Windows
|
||||||
|
export PARALLEL=${PARALLEL:=$((2 + ${NUMBER_OF_PROCESSORS}))}
|
||||||
|
else
|
||||||
|
export PARALLEL=${PARALLEL:=6}
|
||||||
|
fi
|
||||||
|
export PAR_MAKEFLAGS=-j${PARALLEL}
|
||||||
|
export CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL:=${PARALLEL}}
|
||||||
|
export CTEST_PARALLEL_LEVEL=${CTEST_PARALLEL_LEVEL:=${PARALLEL}}
|
||||||
|
export OIIO_USE_CUDA=1
|
||||||
|
export CUDAToolkit_ROOT=/usr/local/cuda
|
||||||
|
|
||||||
mkdir -p build dist
|
mkdir -p build dist
|
||||||
|
|
||||||
echo "HOME = $HOME"
|
echo "HOME = $HOME"
|
||||||
@@ -66,8 +95,10 @@ ls
|
|||||||
env | sort
|
env | sort
|
||||||
|
|
||||||
if [[ `uname -s` == "Linux" ]] ; then
|
if [[ `uname -s` == "Linux" ]] ; then
|
||||||
|
echo "nprocs: " `nproc`
|
||||||
head -40 /proc/cpuinfo
|
head -40 /proc/cpuinfo
|
||||||
elif [[ ${RUNNER_OS} == "macOS" ]] ; then
|
elif [[ "${RUNNER_OS}" == "macOS" ]] ; then
|
||||||
|
echo "nprocs: " `sysctl -n hw.ncpu`
|
||||||
sysctl machdep.cpu.features
|
sysctl machdep.cpu.features
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,55 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Copyright Contributors to the Open Shading Language project.
|
||||||
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||||
|
|
||||||
|
# --- Colors ---
|
||||||
|
RED='\033[0;31m'
|
||||||
|
YELLOW='\033[1;33m'
|
||||||
|
GREEN='\033[0;32m'
|
||||||
|
NC='\033[0m' # No Color
|
||||||
|
|
||||||
|
|
||||||
|
# --- Check if the script is sourced ---
|
||||||
|
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
|
||||||
|
echo -e "${YELLOW}Please run this script as:"
|
||||||
|
echo -e " ${NC}source $(basename "${BASH_SOURCE[0]}")"
|
||||||
|
echo -e "Otherwise, '${YELLOW}conda activate${NC}' won't persist in your current shell."
|
||||||
|
return 0 2>/dev/null || exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# --- Check if Miniconda exists ---
|
||||||
|
if [ ! -f "$HOME/miniconda3/etc/profile.d/conda.sh" ]; then
|
||||||
|
echo -e "${RED}Miniconda not found at ~/miniconda3.${NC}"
|
||||||
|
echo -e "Please install Miniconda before running this script"
|
||||||
|
echo -e "${YELLOW}Important:${NC} During installation, decline any PATH modifications."
|
||||||
|
echo -e "This script activates the environment per session using 'source'."
|
||||||
|
return 0 2>/dev/null || exit 0
|
||||||
|
else
|
||||||
|
# Load Conda
|
||||||
|
source ~/miniconda3/etc/profile.d/conda.sh
|
||||||
|
|
||||||
|
# Create OSL environment if it doesn't exist
|
||||||
|
if ! conda info --envs | grep -q "osl-env"; then
|
||||||
|
echo "Creating osl-env Conda environment..."
|
||||||
|
conda create -y -n osl-env
|
||||||
|
|
||||||
|
# Activate the environment
|
||||||
|
conda activate osl-env
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
echo "Installing dependencies in osl-env..."
|
||||||
|
conda install -y -c conda-forge \
|
||||||
|
cmake \
|
||||||
|
llvmdev=20.1.8 clangdev clangxx_linux-64 libcxx \
|
||||||
|
python=3.12 numpy pybind11 \
|
||||||
|
openimageio=2.5 imath flex bison pugixml zlib
|
||||||
|
else
|
||||||
|
echo -e "${GREEN}osl-env environment already exists.${NC}"
|
||||||
|
|
||||||
|
# Activate the environment
|
||||||
|
conda activate osl-env
|
||||||
|
fi
|
||||||
|
|
||||||
|
fi
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
from __future__ import print_function, absolute_import
|
|
||||||
|
|
||||||
# Copyright Contributors to the Open Shading Language project.
|
# Copyright Contributors to the Open Shading Language project.
|
||||||
# SPDX-License-Identifier: BSD-3-Clause
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||||
|
|||||||
@@ -7,19 +7,29 @@
|
|||||||
|
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
|
# Make extra space on the runners
|
||||||
|
df -h .
|
||||||
|
time rm -rf /usr/local/lib/android /host/root/usr/local/lib/android &
|
||||||
|
sleep 3
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Install system packages when those are acceptable for dependencies.
|
# Install system packages when those are acceptable for dependencies.
|
||||||
#
|
#
|
||||||
if [[ "$ASWF_ORG" != "" ]] ; then
|
if [[ "$ASWF_ORG" != "" ]] ; then
|
||||||
# Using ASWF CentOS container
|
# Using ASWF container
|
||||||
|
|
||||||
export PATH=/opt/rh/devtoolset-6/root/usr/bin:/usr/local/bin:$PATH
|
|
||||||
|
|
||||||
#ls /etc/yum.repos.d
|
#ls /etc/yum.repos.d
|
||||||
|
|
||||||
sudo yum install -y giflib giflib-devel && true
|
if [[ "$ASWF_VFXPLATFORM_VERSION" == "2021" || "$ASWF_VFXPLATFORM_VERSION" == "2022" ]] ; then
|
||||||
# sudo yum install -y ffmpeg ffmpeg-devel && true
|
# CentOS 7 based containers need the now-nonexistant centos repo to be
|
||||||
|
# excluded or all the subsequent yum install commands will fail.
|
||||||
|
yum-config-manager --disable centos-sclo-rh || true
|
||||||
|
sed -i 's,^mirrorlist=,#,; s,^#baseurl=http://mirror\.centos\.org/centos/$releasever,baseurl=https://vault.centos.org/7.9.2009,' /etc/yum.repos.d/CentOS-Base.repo
|
||||||
|
fi
|
||||||
|
|
||||||
|
# sudo /usr/bin/yum install -y giflib giflib-devel || true
|
||||||
|
# sudo /usr/bin/yum install -y ffmpeg ffmpeg-devel || true
|
||||||
|
|
||||||
if [[ "${CONAN_LLVM_VERSION}" != "" ]] ; then
|
if [[ "${CONAN_LLVM_VERSION}" != "" ]] ; then
|
||||||
mkdir conan
|
mkdir conan
|
||||||
@@ -40,62 +50,76 @@ if [[ "$ASWF_ORG" != "" ]] ; then
|
|||||||
popd
|
popd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$CXX" == "icpc" || "$CC" == "icc" || "$USE_ICC" != "" || "$CXX" == "icpx" || "$CC" == "icx" || "$USE_ICX" != "" ]] ; then
|
if [[ "${CONAN_PACKAGES}" != "" ]] ; then
|
||||||
sudo cp src/build-scripts/oneAPI.repo /etc/yum.repos.d
|
export PATH=$PWD/conan/bin:$PATH
|
||||||
sudo yum install -y intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic-2022.1.0-3768
|
export LD_LIBRARY_PATH=$PWD/conan/lib:$LD_LIBRARY_PATH
|
||||||
# Because multiple (possibly newer) versions of oneAPI may be installed,
|
mkdir -p conan
|
||||||
# use a config file to specify compiler and tbb versions
|
pushd conan
|
||||||
# NOTE: oneAPI components have independent version numbering.
|
for pkg in ${CONAN_PACKAGES} ; do
|
||||||
set +e; source /opt/intel/oneapi/setvars.sh --config oneapi_2022.1.0.cfg; set -e
|
echo "Installing $pkg via Conan..."
|
||||||
|
time conan install $pkg
|
||||||
|
done
|
||||||
|
popd
|
||||||
|
ls -R conan
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "$CXX" == "icpc" || "$CC" == "icc" || "$USE_ICC" != "" ]] ; then
|
if [[ "$CXX" == "icpc" || "$CC" == "icc" || "$USE_ICC" != "" ]] ; then
|
||||||
echo "Verifying installation of Intel(r) C++ Compiler:"
|
sudo dnf -y install https://download.rockylinux.org/pub/rocky/8.10/BaseOS/x86_64/os/Packages/c/ca-certificates-2025.2.80_v9.0.304-80.2.el8_10.noarch.rpm
|
||||||
icpc --version
|
# Lock down icc to 2022.1 because newer versions hosted on the Intel
|
||||||
fi
|
# repo require a glibc too new for the ASWF CentOS7-based containers
|
||||||
if [[ "$CXX" == "icpx" || "$CC" == "icx" || "$USE_ICX" != "" ]] ; then
|
# we run CI on.
|
||||||
echo "Verifying installation of Intel(r) oneAPI DPC++/C++ Compiler:"
|
sudo cp src/build-scripts/oneAPI.repo /etc/yum.repos.d
|
||||||
icpx --version
|
sudo /usr/bin/yum install -y intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic-2022.1.0.x86_64
|
||||||
fi
|
set +e; source /opt/intel/oneapi/setvars.sh --config oneapi_2022.1.0.cfg; set -e
|
||||||
|
elif [[ "$CXX" == "icpc" || "$CC" == "icc" || "$USE_ICC" != "" || "$CXX" == "icpx" || "$CC" == "icx" || "$USE_ICX" != "" ]] ; then
|
||||||
|
sudo dnf -y install https://download.rockylinux.org/pub/rocky/8.10/BaseOS/x86_64/os/Packages/c/ca-certificates-2025.2.80_v9.0.304-80.2.el8_10.noarch.rpm
|
||||||
|
# Lock down icx to 2023.1 because newer versions hosted on the Intel
|
||||||
|
# repo require a libstd++ too new for the ASWF containers we run CI on
|
||||||
|
# because their default install of gcc 9 based toolchain.
|
||||||
|
sudo cp src/build-scripts/oneAPI.repo /etc/yum.repos.d
|
||||||
|
sudo yum install -y intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic-2023.1.0.x86_64
|
||||||
|
# sudo yum install -y intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic
|
||||||
|
set +e; source /opt/intel/oneapi/setvars.sh; set -e
|
||||||
|
echo "Verifying installation of Intel(r) oneAPI DPC++/C++ Compiler:"
|
||||||
|
icpx --version
|
||||||
fi
|
fi
|
||||||
|
|
||||||
else
|
else
|
||||||
# Using native Ubuntu runner
|
# Using native Ubuntu runner
|
||||||
|
|
||||||
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
|
if [[ "${SKIP_APT_GET_UPDATE}" != "1" ]] ; then
|
||||||
time sudo apt-get update
|
time sudo apt-get update
|
||||||
|
fi
|
||||||
|
|
||||||
time sudo apt-get -q install -y \
|
if [[ "${SKIP_SYSTEM_DEPS_INSTALL}" != "1" ]] ; then
|
||||||
git cmake ninja-build ccache g++ \
|
time sudo apt-get -q install -y \
|
||||||
libboost-dev libboost-thread-dev libboost-filesystem-dev \
|
git cmake ccache ninja-build g++ \
|
||||||
libilmbase-dev libopenexr-dev \
|
libboost-dev libboost-thread-dev libboost-filesystem-dev \
|
||||||
libtiff-dev libgif-dev libpng-dev \
|
libtiff-dev libpng-dev \
|
||||||
flex bison libbison-dev \
|
flex bison libbison-dev \
|
||||||
libpugixml-dev \
|
libpugixml-dev \
|
||||||
libopencolorio-dev
|
libopencolorio-dev
|
||||||
|
fi
|
||||||
|
|
||||||
time sudo apt-get -q install -y \
|
if [[ "${QT_VERSION:-5}" == "5" ]] ; then
|
||||||
qt5-default || /bin/true
|
time sudo apt-get -q install -y qt5-default || /bin/true
|
||||||
|
elif [[ "${QT_VERSION}" == "6" ]] ; then
|
||||||
|
time sudo apt-get -q install -y qt6-base-dev || /bin/true
|
||||||
|
fi
|
||||||
|
if [[ "${EXTRA_DEP_PACKAGES}" != "" ]] ; then
|
||||||
|
time sudo apt-get -q install -y ${EXTRA_DEP_PACKAGES}
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${USE_PYTHON}" != "0" ]] ; then
|
||||||
|
time sudo apt-get -q install -y python3-numpy
|
||||||
|
fi
|
||||||
|
if [[ "${PIP_INSTALLS}" != "" ]] ; then
|
||||||
|
time pip3 install ${PIP_INSTALLS}
|
||||||
|
fi
|
||||||
|
|
||||||
export CMAKE_PREFIX_PATH=/usr/lib/x86_64-linux-gnu:$CMAKE_PREFIX_PATH
|
export CMAKE_PREFIX_PATH=/usr/lib/x86_64-linux-gnu:$CMAKE_PREFIX_PATH
|
||||||
|
|
||||||
# Nonstandard python versions
|
if [[ "$CXX" == "g++-9" ]] ; then
|
||||||
if [[ "${PYTHON_VERSION}" == "3.9" ]] ; then
|
|
||||||
time sudo apt-get -q install -y python3.9-dev python3-numpy
|
|
||||||
pip3 --version
|
|
||||||
pip3 install numpy
|
|
||||||
elif [[ "$PYTHON_VERSION" == "2.7" ]] ; then
|
|
||||||
time sudo apt-get -q install -y python-dev python-numpy
|
|
||||||
else
|
|
||||||
pip3 install numpy
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "$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
|
time sudo apt-get install -y g++-9
|
||||||
elif [[ "$CXX" == "g++-10" ]] ; then
|
elif [[ "$CXX" == "g++-10" ]] ; then
|
||||||
time sudo apt-get install -y g++-10
|
time sudo apt-get install -y g++-10
|
||||||
@@ -103,6 +127,8 @@ else
|
|||||||
time sudo apt-get install -y g++-11
|
time sudo apt-get install -y g++-11
|
||||||
elif [[ "$CXX" == "g++-12" ]] ; then
|
elif [[ "$CXX" == "g++-12" ]] ; then
|
||||||
time sudo apt-get install -y g++-12
|
time sudo apt-get install -y g++-12
|
||||||
|
elif [[ "$CXX" == "g++-13" ]] ; then
|
||||||
|
time sudo apt-get install -y g++-13
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$CXX" == "icpc" || "$CC" == "icc" || "$USE_ICC" != "" || "$CXX" == "icpx" || "$CC" == "icx" || "$USE_ICX" != "" ]] ; then
|
if [[ "$CXX" == "icpc" || "$CC" == "icc" || "$USE_ICC" != "" || "$CXX" == "icpx" || "$CC" == "icx" || "$USE_ICX" != "" ]] ; then
|
||||||
@@ -117,46 +143,59 @@ else
|
|||||||
set +e; source /opt/intel/oneapi/setvars.sh --config oneapi_2022.1.0.cfg; set -e
|
set +e; source /opt/intel/oneapi/setvars.sh --config oneapi_2022.1.0.cfg; set -e
|
||||||
fi
|
fi
|
||||||
|
|
||||||
source src/build-scripts/build_llvm.bash
|
if [[ "$LLVM_VERSION" != "" ]] ; then
|
||||||
|
source src/build-scripts/build_llvm.bash
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "$CMAKE_VERSION" != "" ]] ; then
|
||||||
|
source src/build-scripts/build_cmake.bash
|
||||||
|
fi
|
||||||
|
cmake --version
|
||||||
|
|
||||||
|
|
||||||
if [[ "$OPTIX_VERSION" != "" ]] ; then
|
if [[ "$OPTIX_VERSION" != "" ]] ; then
|
||||||
echo "Requested OPTIX_VERSION = '${OPTIX_VERSION}'"
|
OPTIXREPO=${OPTIXREPO:=https://github.com/NVIDIA/optix-dev}
|
||||||
mkdir -p $LOCAL_DEPS_DIR/dist/include/internal
|
echo "Requested OPTIX_VERSION = '${OPTIX_VERSION}' from ${OPTIXREPO}"
|
||||||
OPTIXLOC=https://developer.download.nvidia.com/redist/optix/v${OPTIX_VERSION}
|
export OptiX_ROOT=$LOCAL_DEPS_DIR/dist/optix-dev
|
||||||
for f in optix.h optix_device.h optix_function_table.h \
|
git clone -b v${OPTIX_VERSION} ${OPTIXREPO} ${OptiX_ROOT}
|
||||||
optix_function_table_definition.h optix_host.h \
|
export PATH=$PATH:/usr/local/cuda-12/bin
|
||||||
optix_stack_size.h optix_stubs.h optix_types.h optix_7_device.h \
|
export LD_LIBRARY_PATH=/usr/local/cuda-12/lib64:$LD_LIBRARY_PATH
|
||||||
optix_7_host.h optix_7_types.h \
|
find / -name "*nv*so" -print || true
|
||||||
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
|
fi
|
||||||
|
|
||||||
|
|
||||||
source src/build-scripts/build_pybind11.bash
|
|
||||||
|
#
|
||||||
|
# Packages we need to build from scratch.
|
||||||
|
#
|
||||||
|
|
||||||
|
if [[ "$PYBIND11_VERSION" != "0" ]] ; then
|
||||||
|
source src/build-scripts/build_pybind11.bash
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "$OPENEXR_VERSION" != "" ]] ; then
|
if [[ "$OPENEXR_VERSION" != "" ]] ; then
|
||||||
source src/build-scripts/build_openexr.bash
|
source src/build-scripts/build_openexr.bash
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# if [[ "$PUGIXML_VERSION" != "" ]] ; then
|
if [[ "$PUGIXML_VERSION" != "0" ]] ; then
|
||||||
source src/build-scripts/build_pugixml.bash
|
source src/build-scripts/build_pugixml.bash
|
||||||
export MY_CMAKE_FLAGS+=" -DUSE_EXTERNAL_PUGIXML=1 "
|
export MY_CMAKE_FLAGS+=" -DUSE_EXTERNAL_PUGIXML=1 "
|
||||||
# fi
|
fi
|
||||||
|
|
||||||
if [[ "$OPENCOLORIO_VERSION" != "" ]] ; then
|
if [[ "$OPENCOLORIO_VERSION" != "" ]] ; then
|
||||||
source src/build-scripts/build_opencolorio.bash
|
source src/build-scripts/build_opencolorio.bash
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$OPENIMAGEIO_VERSION" != "" ]] ; then
|
if [[ "$OPENIMAGEIO_VERSION" != "" ]] ; then
|
||||||
|
|
||||||
|
if [[ "$REMOVE_INSTALLED_OPENIMAGEIO" == "1" ]] ; then
|
||||||
|
sudo rm -rf /usr/local/include/OpenImageIO
|
||||||
|
sudo rm -rf /usr/local/lib*/cmake/OpenImageIO
|
||||||
|
sudo rm -rf /usr/local/lib*/libOpenImageIO*
|
||||||
|
sudo rm -rf /usr/local/lib*/python*/site-packages/OpenImageIO*
|
||||||
|
fi
|
||||||
|
|
||||||
# There are many parts of OIIO we don't need to build for OSL's tests
|
# There are many parts of OIIO we don't need to build for OSL's tests
|
||||||
export ENABLE_iinfo=0 ENABLE_iv=0 ENABLE_igrep=0
|
export ENABLE_iinfo=0 ENABLE_iv=0 ENABLE_igrep=0
|
||||||
export ENABLE_iconvert=0 ENABLE_testtex=0
|
export ENABLE_iconvert=0 ENABLE_testtex=0
|
||||||
@@ -165,20 +204,27 @@ if [[ "$OPENIMAGEIO_VERSION" != "" ]] ; then
|
|||||||
export ENABLE_BMP=0 ENABLE_cineon=0 ENABLE_DDS=0 ENABLE_DPX=0 ENABLE_FITS=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_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_RLA=0 ENABLE_SGI=0 ENABLE_SOCKET=0 ENABLE_SOFTIMAGE=0
|
||||||
export ENABLE_TARGA=0 ENABLE_WEBP=0
|
export ENABLE_TARGA=0 ENABLE_WEBP=0 ENABLE_jpegxl=0 ENABLE_libuhdr=0
|
||||||
# We don't need to run OIIO's tests
|
# We don't need to run OIIO's tests
|
||||||
export OPENIMAGEIO_CMAKE_FLAGS+=" -DOIIO_BUILD_TESTING=OFF -DOIIO_BUILD_TESTS=0"
|
export OPENIMAGEIO_CMAKE_FLAGS+=" -DOIIO_BUILD_TESTING=OFF -DOIIO_BUILD_TESTS=0"
|
||||||
# Don't let warnings in OIIO break OSL's CI run
|
# Don't let warnings in OIIO break OSL's CI run
|
||||||
export OPENIMAGEIO_CMAKE_FLAGS+=" -DSTOP_ON_WARNING=OFF"
|
export OPENIMAGEIO_CMAKE_FLAGS+=" -DSTOP_ON_WARNING=OFF"
|
||||||
export OPENIMAGEIO_CMAKE_FLAGS+=" -DUSE_OPENGL=0"
|
export OPENIMAGEIO_CMAKE_FLAGS+=" -DUSE_OPENGL=0 -DUSE_JXL=0"
|
||||||
if [[ $OPENIMAGEIO_VERSION == master && "${OPENIMAGEIO_UNITY:-1}" != "0" ]] ; then
|
export OPENIMAGEIO_CMAKE_FLAGS+=" -DUSE_OPENCV=0 -DUSE_FFMPEG=0 -DUSE_QT=0"
|
||||||
|
if [[ "${OPENIMAGEIO_UNITY:-1}" != "0" ]] ; then
|
||||||
# Speed up the OIIO build by doing a "unity" build. (Note: this is
|
# Speed up the OIIO build by doing a "unity" build. (Note: this is
|
||||||
# only a savings in CI where there are only 1-2 cores available, and
|
# only a savings in CI where there are only 1-2 cores available.)
|
||||||
# is only supported for OIIO 2.3.14 and later)
|
|
||||||
export OPENIMAGEIO_CMAKE_FLAGS+=" -DCMAKE_UNITY_BUILD=ON -DCMAKE_UNITY_BUILD_MODE=BATCH"
|
export OPENIMAGEIO_CMAKE_FLAGS+=" -DCMAKE_UNITY_BUILD=ON -DCMAKE_UNITY_BUILD_MODE=BATCH"
|
||||||
fi
|
fi
|
||||||
source src/build-scripts/build_openimageio.bash
|
source src/build-scripts/build_openimageio.bash
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ "$ABI_CHECK" != "" ]] ; then
|
||||||
|
source src/build-scripts/build_abi_tools.bash
|
||||||
|
fi
|
||||||
|
|
||||||
|
df -h .
|
||||||
|
df -h /host/root || true
|
||||||
|
|
||||||
# Save the env for use by other stages
|
# Save the env for use by other stages
|
||||||
src/build-scripts/save-env.bash
|
src/build-scripts/save-env.bash
|
||||||
|
|||||||
@@ -4,37 +4,34 @@
|
|||||||
# SPDX-License-Identifier: BSD-3-Clause
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||||
|
|
||||||
|
echo "gh-win-installdeps.bash"
|
||||||
|
env | sort
|
||||||
|
|
||||||
# DEP_DIR="$PWD/ext/dist"
|
# DEP_DIR="$PWD/ext/dist"
|
||||||
DEP_DIR="$PWD/dist"
|
DEP_DIR="$PWD/dist"
|
||||||
mkdir -p "$DEP_DIR"
|
mkdir -p "$DEP_DIR"
|
||||||
INT_DIR="build"
|
mkdir -p ext
|
||||||
VCPKG_INSTALLATION_ROOT=/c/vcpkg
|
VCPKG_INSTALLATION_ROOT=/c/vcpkg
|
||||||
|
|
||||||
export CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH:=.}
|
export CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH:=.}
|
||||||
export CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH;$DEP_DIR"
|
export CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH;$DEP_DIR"
|
||||||
export BOOST_ROOT=${BOOST_ROOT_1_72_0}
|
export CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH;$VCPKG_INSTALLATION_ROOT/installed/x64-windows-release"
|
||||||
|
export PATH="$PATH:$DEP_DIR/bin:$DEP_DIR/lib:$VCPKG_INSTALLATION_ROOT/installed/x64-windows-release/bin:$PWD/ext/dist/bin:$PWD/ext/dist/lib"
|
||||||
BOOST_UNIX_PATH=$(echo "/$BOOST_ROOT" | sed -e 's/\\/\//g' -e 's/://')
|
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$DEP_DIR/bin:$VCPKG_INSTALLATION_ROOT/installed/x64-windows-release/bin"
|
||||||
echo "BOOST_UNIX_PATH=$BOOST_UNIX_PATH"
|
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$DEP_DIR/lib:$VCPKG_INSTALLATION_ROOT/installed/x64-windows-release/lib"
|
||||||
|
|
||||||
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 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/*/Enterprise/VC/Tools/MSVC" && true
|
|
||||||
#ls -l "C:/Program Files (x86)/Microsoft Visual Studio" && true
|
|
||||||
|
|
||||||
|
|
||||||
if [[ "$PYTHON_VERSION" == "3.6" ]] ; then
|
if [[ "$PYTHON_VERSION" == "3.9" ]] ; then
|
||||||
export CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH;/c/hostedtoolcache/windows/Python/3.6.8/x64"
|
export CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH;/c/hostedtoolcache/windows/Python/3.9.13/x64"
|
||||||
else
|
export Python_EXECUTABLE="/c/hostedtoolcache/windows/Python/3.9.13/x64/python3.exe"
|
||||||
export CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH;/c/hostedtoolcache/windows/Python/3.7.9/x64"
|
export PYTHONPATH=$OpenImageIO_ROOT/lib/python${PYTHON_VERSION}/site-packages
|
||||||
export Python_EXECUTABLE="/c/hostedtoolcache/windows/Python/3.7.9/x64/python.exe"
|
elif [[ "$PYTHON_VERSION" == "3.12" ]] ; then
|
||||||
|
export CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH;/c/hostedtoolcache/windows/Python/3.12.10/x64"
|
||||||
|
export Python_EXECUTABLE="/c/hostedtoolcache/windows/Python/3.12.10/x64/python3.exe"
|
||||||
|
export PYTHONPATH=$OpenImageIO_ROOT/lib/python${PYTHON_VERSION}/site-packages
|
||||||
|
elif [[ "$PYTHON_VERSION" == "3.14" ]] ; then
|
||||||
|
export CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH;/c/hostedtoolcache/windows/Python/3.14.3/x64"
|
||||||
|
export Python_EXECUTABLE="/c/hostedtoolcache/windows/Python/3.14.3/x64/python3.exe"
|
||||||
export PYTHONPATH=$OpenImageIO_ROOT/lib/python${PYTHON_VERSION}/site-packages
|
export PYTHONPATH=$OpenImageIO_ROOT/lib/python${PYTHON_VERSION}/site-packages
|
||||||
fi
|
fi
|
||||||
pip install numpy
|
pip install numpy
|
||||||
@@ -50,28 +47,17 @@ vcpkg list
|
|||||||
echo "---------------"
|
echo "---------------"
|
||||||
# vcpkg update
|
# vcpkg update
|
||||||
#
|
#
|
||||||
# # vcpkg install zlib:x64-windows
|
# Example of how it's done:
|
||||||
vcpkg install tiff:x64-windows
|
# vcpkg install tiff:x64-windows-release
|
||||||
vcpkg install libpng:x64-windows
|
# vcpkg install pugixml:x64-windows-release
|
||||||
#vcpkg install giflib:x64-windows
|
# vcpkg install opencolorio:x64-windows-release
|
||||||
#vcpkg install freetype:x64-windows
|
# vcpkg install openimageio:x64-windows-release
|
||||||
# vcpkg install openexr:x64-windows
|
|
||||||
# vcpkg install libjpeg-turbo:x64-windows
|
|
||||||
|
|
||||||
# vcpkg install libraw:x64-windows
|
|
||||||
# vcpkg install openjpeg: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 -R "$VCPKG_INSTALLATION_ROOT" || true
|
||||||
|
#
|
||||||
|
export CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH:$VCPKG_INSTALLATION_ROOT/installed/x64-windows-release"
|
||||||
|
#
|
||||||
echo "All VCPkg installs:"
|
echo "All VCPkg installs:"
|
||||||
vcpkg list
|
vcpkg list
|
||||||
#
|
#
|
||||||
@@ -89,69 +75,84 @@ export ZLIB_ROOT=$PWD/ext/dist
|
|||||||
src/build-scripts/build_libpng.bash
|
src/build-scripts/build_libpng.bash
|
||||||
export PNG_ROOT=$PWD/ext/dist
|
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
|
source src/build-scripts/build_pybind11.bash
|
||||||
#export pybind11_ROOT=$PWD/ext/dist
|
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
|
if [[ "$OPENEXR_VERSION" != "" ]] ; then
|
||||||
# unzip ffmpeg-dev.zip
|
source src/build-scripts/build_openexr.bash
|
||||||
# FFmpeg_ROOT=$PWD/ffmpeg-4.2.1-win64-dev
|
fi
|
||||||
|
|
||||||
echo "CMAKE_PREFIX_PATH = $CMAKE_PREFIX_PATH"
|
if [[ "$PUGIXML_VERSION" != "" ]] ; then
|
||||||
|
source src/build-scripts/build_pugixml.bash
|
||||||
|
export OSL_CMAKE_FLAGS+=" -DUSE_EXTERNAL_PUGIXML=1 "
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$OPENCOLORIO_VERSION" != "" ]] ; then
|
||||||
|
source src/build-scripts/build_opencolorio.bash
|
||||||
|
fi
|
||||||
|
|
||||||
OPENEXR_CXX_FLAGS=" /W1 /EHsc /DWIN32=1 "
|
cp $DEP_DIR/lib/*.lib $DEP_DIR/bin || true
|
||||||
#OPENEXR_BUILD_TYPE=$CMAKE_BUILD_TYPE
|
cp $DEP_DIR/bin/*.dll $DEP_DIR/lib || true
|
||||||
OPENEXR_INSTALL_DIR=$DEP_DIR
|
|
||||||
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
|
|
||||||
# the above line is admittedly sketchy
|
|
||||||
|
|
||||||
cp $DEP_DIR/lib/*.lib $DEP_DIR/bin
|
if [[ "$OPENIMAGEIO_VERSION" != "" ]] ; then
|
||||||
cp $DEP_DIR/bin/*.dll $DEP_DIR/lib
|
# There are many parts of OIIO we don't need to build for OSL's tests
|
||||||
|
export ENABLE_iinfo=0 ENABLE_iv=0 ENABLE_igrep=0
|
||||||
|
export ENABLE_iconvert=0 ENABLE_testtex=0
|
||||||
|
# For speed of compiling OIIO, disable the file formats that we don't
|
||||||
|
# need for OSL's tests
|
||||||
|
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 ENABLE_jpegxl=0 ENABLE_libuhdr=0
|
||||||
|
# We don't need to run OIIO's tests
|
||||||
|
export OPENIMAGEIO_CMAKE_FLAGS+=" -DOIIO_BUILD_TESTING=OFF -DOIIO_BUILD_TESTS=0"
|
||||||
|
# Don't let warnings in OIIO break OSL's CI run
|
||||||
|
export OPENIMAGEIO_CMAKE_FLAGS+=" -DSTOP_ON_WARNING=OFF"
|
||||||
|
# export OPENIMAGEIO_CMAKE_FLAGS+=" -DUSE_OPENGL=0"
|
||||||
|
export USE_QT=0 USE_OPENCV=0 USE_FFMPEG=0 USE_QT=0
|
||||||
|
if [[ "${OPENIMAGEIO_UNITY:-1}" != "0" ]] ; then
|
||||||
|
# Speed up the OIIO build by doing a "unity" build. (Note: this is
|
||||||
|
# only a savings in CI where there are only 1-2 cores available.)
|
||||||
|
export OPENIMAGEIO_CMAKE_FLAGS+=" -DCMAKE_UNITY_BUILD=ON -DCMAKE_UNITY_BUILD_MODE=BATCH"
|
||||||
|
fi
|
||||||
|
source src/build-scripts/build_openimageio.bash
|
||||||
|
fi
|
||||||
|
|
||||||
|
cp $DEP_DIR/lib/*.lib $DEP_DIR/bin || true
|
||||||
#OPENIMAGEIO_BRANCH=lg-cmake312
|
cp $DEP_DIR/bin/*.dll $DEP_DIR/lib || true
|
||||||
OPENIMAGEIO_INSTALLDIR=$DEP_DIR
|
echo "DEP_DIR $DEP_DIR :"
|
||||||
OPENIMAGEIO_CMAKE_FLAGS+=" -DOIIO_BUILD_TESTS=0 -DOIIO_BUILD_TOOLS=0"
|
|
||||||
OPENIMAGEIO_CMAKE_FLAGS+=" -DUSE_OPENGL=0 -DUSE_GENERATED_EXPORT_HEADER=1"
|
|
||||||
OPENIMAGEIO_CMAKE_FLAGS+=" -DENABLE_DPX=0 -DENABLE_CINEON=0 -DENABLE_DDS=0"
|
|
||||||
OPENIMAGEIO_CMAKE_FLAGS+=" -DENABLE_IFF=0 -DENABLE_ICO=0 -DENABLE_PSD=0"
|
|
||||||
OPENIMAGEIO_CMAKE_FLAGS+=" -DENABLE_PNM=0 -DENABLE_ZFILE=0 -DENABLE_SOFTIMAGE=0"
|
|
||||||
OPENIMAGEIO_CMAKE_FLAGS+=" -DLINKSTATIC=1 -DBUILD_SHARED_LIBS=0"
|
|
||||||
export OPENIMAGEIO_CMAKE_FLAGS
|
|
||||||
source src/build-scripts/build_openimageio.bash
|
|
||||||
|
|
||||||
|
|
||||||
cp $DEP_DIR/lib/*.lib $DEP_DIR/bin
|
|
||||||
cp $DEP_DIR/bin/*.dll $DEP_DIR/lib
|
|
||||||
echo "after OIIO install, DEP_DIR $DEP_DIR :"
|
|
||||||
ls -R -l "$DEP_DIR"
|
ls -R -l "$DEP_DIR"
|
||||||
|
|
||||||
|
if [[ "$LLVM_VERSION" != "" ]] ; then
|
||||||
# export PATH="$PATH:$DEP_DIR/bin:$VCPKG_INSTALLATION_ROOT/installed/x64-windows/bin"
|
echo "Running llvm_build.bash"
|
||||||
export PATH="$DEP_DIR/lib:$DEP_DIR/bin:$PATH:$VCPKG_INSTALLATION_ROOT/installed/x64-windows/lib"
|
source src/build-scripts/build_llvm.bash
|
||||||
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$VCPKG_INSTALLATION_ROOT/installed/x64-windows/lib:$DEP_DIR/lib:$DEP_DIR/bin"
|
elif [[ "$LLVM_GOOGLE_DRIVE_ID" != "" ]] then
|
||||||
|
echo "Installing LLVM from google drive"
|
||||||
|
mkdir -p $HOME/llvm
|
||||||
|
pushd $HOME/llvm
|
||||||
|
#LLVM_GOOGLE_DRIVE_ID="1uy7PNVlTQ-H56unXGOS6siRWtNcdS1J7"
|
||||||
|
LLVM_ZIP_FILENAME=llvm-build.zip
|
||||||
|
time curl --insecure -L "https://drive.usercontent.google.com/download?id=${LLVM_GOOGLE_DRIVE_ID}&confirm=xxx" -o $LLVM_ZIP_FILENAME
|
||||||
|
unzip $LLVM_ZIP_FILENAME > /dev/null
|
||||||
|
export LLVM_ROOT=$PWD/llvm-build
|
||||||
|
popd
|
||||||
|
else
|
||||||
|
export LLVM_ROOT=$LLVM_PATH
|
||||||
|
fi
|
||||||
|
echo "LLVM_ROOT = $LLVM_ROOT"
|
||||||
|
|
||||||
|
|
||||||
# source src/build-scripts/build_openexr.bash
|
mkdir -p winflexbison
|
||||||
# export CMAKE_PREFIX_PATH="$CMAKE_PREFIX_PATH;$ILMBASE_ROOT;$OPENEXR_ROOT"
|
pushd winflexbison
|
||||||
# source src/build-scripts/build_opencolorio.bash
|
WFBZIP=win_flex_bison-2.5.25.zip
|
||||||
|
curl --location https://github.com/lexxmark/winflexbison/releases/download/v2.5.25/$WFBZIP -o $WFBZIP
|
||||||
|
unzip $WFBZIP
|
||||||
|
export FLEX_ROOT=$PWD
|
||||||
|
export BISON_ROOT=$PWD
|
||||||
|
ls .
|
||||||
|
popd
|
||||||
|
|
||||||
|
|
||||||
# For CI on Windows, prefer to pick up static libs where possible
|
|
||||||
OSL_CMAKE_FLAGS="$OSL_CMAKE_FLAGS -DLINKSTATIC=1 -DBUILD_SHARED_LIBS=0"
|
|
||||||
|
|
||||||
# Save the env for use by other stages
|
# Save the env for use by other stages
|
||||||
src/build-scripts/save-env.bash
|
src/build-scripts/save-env.bash
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
global: *OSL*; test_shade; *osl*imageio*; *osl_input_extensions;
|
global: *OSL*; *osl*imageio*; *osl_input_extensions; PyInit*;
|
||||||
local: osl_*; *pvt*; *;
|
local: osl_*; *pvt*; *;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -19,52 +19,68 @@ if [[ `which brew` == "" ]] ; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# set -ex
|
||||||
|
|
||||||
if [[ "$DO_BREW_UPDATE" != "" ]] ; then
|
if [[ "${DO_BREW_UPDATE:=0}" != "0" ]] ; then
|
||||||
brew update >/dev/null
|
brew update >/dev/null
|
||||||
fi
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
echo "Before my brew installs:"
|
echo "Before my brew installs:"
|
||||||
brew list --versions
|
brew list --versions
|
||||||
|
|
||||||
brew install --display-times -q gcc ccache cmake ninja boost || true
|
if [[ "$OSL_BREW_INSTALL_PACKAGES" == "" ]] ; then
|
||||||
brew link --overwrite gcc
|
OSL_BREW_INSTALL_PACKAGES=" \
|
||||||
brew install --display-times -q python@${PYTHON_VERSION} || true
|
bison \
|
||||||
brew unlink python@2.7 || true
|
ccache \
|
||||||
brew unlink python@3.8 || true
|
expat \
|
||||||
brew unlink python@3.9 || true
|
flex \
|
||||||
brew unlink python@3.10 || true
|
fmt \
|
||||||
brew link --overwrite --force python@${PYTHON_VERSION} || true
|
imath \
|
||||||
brew upgrade --display-times -q cmake || true
|
llvm${LLVMBREWVER} \
|
||||||
brew install --display-times -q ilmbase openexr
|
ninja \
|
||||||
#brew install --display-times -q freetype
|
numpy \
|
||||||
brew install --display-times -q opencolorio partio pugixml
|
opencolorio \
|
||||||
brew install --display-times -q pybind11 numpy || true
|
openexr \
|
||||||
brew install --display-times -q tbb || true
|
partio \
|
||||||
brew install --display-times -q flex bison
|
ptex \
|
||||||
brew install --display-times -q llvm${LLVMBREWVER}
|
pugixml \
|
||||||
brew install --display-times -q qt
|
pybind11 \
|
||||||
|
robin-map \
|
||||||
|
tbb \
|
||||||
|
"
|
||||||
|
if [[ "${USE_OPENVDB:=1}" != "0" ]] && [[ "${INSTALL_OPENVDB:=1}" != "0" ]] ; then
|
||||||
|
OSL_BREW_INSTALL_PACKAGES+=" openvdb"
|
||||||
|
fi
|
||||||
|
if [[ "${USE_QT:=1}" != "0" ]] && [[ "${INSTALL_QT:=1}" != "0" ]] ; then
|
||||||
|
OSL_BREW_INSTALL_PACKAGES+=" qt${QT_VERSION}"
|
||||||
|
fi
|
||||||
|
if [[ "${EXTRA_BREW_PACKAGES}" != "" ]] ; then
|
||||||
|
brew install --display-times -q ${EXTRA_BREW_PACKAGES}
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
brew install --display-times -q $OSL_BREW_INSTALL_PACKAGES $OSL_BREW_EXTRA_INSTALL_PACKAGES || true
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "After brew installs:"
|
echo "After brew installs:"
|
||||||
brew list --versions
|
brew list --versions
|
||||||
|
|
||||||
# Needed on some systems
|
# Needed on some systems
|
||||||
if [[ $PYTHON_VERSION != "2.7" ]] ; then
|
pip${PYTHON_VERSION} install numpy || true
|
||||||
pip3 install numpy
|
|
||||||
else
|
|
||||||
pip install numpy
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Set up paths. These will only affect the caller if this script is
|
# Set up paths. These will only affect the caller if this script is
|
||||||
# run with 'source' rather than in a separate shell.
|
# run with 'source' rather than in a separate shell.
|
||||||
export PATH=/usr/local/opt/qt5/bin:$PATH
|
export PATH=${HOMEBREW_PREFIX}/opt/qt5/bin:$PATH
|
||||||
export PATH=/usr/local/opt/python/libexec/bin:$PATH
|
export PATH=${HOMEBREW_PREFIX}/opt/python/libexec/bin:$PATH
|
||||||
export PYTHONPATH=/usr/local/lib/python${PYTHON_VERSION}/site-packages:$PYTHONPATH
|
export PYTHONPATH=${HOMEBREW_PREFIX}/lib/python${PYTHON_VERSION}/site-packages:$PYTHONPATH
|
||||||
# export PATH=/usr/local/opt/llvm${LLVMBREWVER}/bin:$PATH
|
echo "PYTHONPATH=$PYTHONPATH"
|
||||||
export LLVM_DIRECTORY=/usr/local/opt/llvm${LLVMBREWVER}
|
ls ${HOMEBREW_PREFIX}/lib/python${PYTHON_VERSION}
|
||||||
export LLVM_ROOT=/usr/local/opt/llvm${LLVMBREWVER}
|
# export PATH=${HOMEBREW_PREFIX}/opt/llvm${LLVMBREWVER}/bin:$PATH
|
||||||
export PATH=/usr/local/opt/flex/bin:/usr/local/opt/bison/bin:$PATH
|
export LLVM_DIRECTORY=${HOMEBREW_PREFIX}/opt/llvm${LLVMBREWVER}
|
||||||
|
export LLVM_ROOT=${HOMEBREW_PREFIX}/opt/llvm${LLVMBREWVER}
|
||||||
|
export PATH=$LLVM_ROOT/bin:$PATH
|
||||||
|
echo LLVM_ROOT=${LLVM_ROOT}
|
||||||
|
# ls $LLVM_ROOT
|
||||||
|
export PATH=${HOMEBREW_PREFIX}/opt/flex/bin:${HOMEBREW_PREFIX}/opt/bison/bin:$PATH
|
||||||
|
|
||||||
# Save the env for use by other stages
|
# Save the env for use by other stages
|
||||||
src/build-scripts/save-env.bash
|
src/build-scripts/save-env.bash
|
||||||
|
|||||||
@@ -0,0 +1,190 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# Copyright 2018 Nico Weber
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
|
"""Converts one (or several) .ninja_log files into chrome's about:tracing format.
|
||||||
|
|
||||||
|
If clang -ftime-trace .json files are found adjacent to generated files they
|
||||||
|
are embedded.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
ninja -C $BUILDDIR
|
||||||
|
ninjatracing $BUILDDIR/.ninja_log > trace.json
|
||||||
|
"""
|
||||||
|
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
import optparse
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
class Target:
|
||||||
|
"""Represents a single line read for a .ninja_log file. Start and end times
|
||||||
|
are milliseconds."""
|
||||||
|
def __init__(self, start, end):
|
||||||
|
self.start = int(start)
|
||||||
|
self.end = int(end)
|
||||||
|
self.targets = []
|
||||||
|
|
||||||
|
|
||||||
|
def read_targets(log, show_all):
|
||||||
|
"""Reads all targets from .ninja_log file |log_file|, sorted by start
|
||||||
|
time"""
|
||||||
|
header = log.readline()
|
||||||
|
m = re.search(r'^# ninja log v(\d+)\n$', header)
|
||||||
|
assert m, "unrecognized ninja log version %r" % header
|
||||||
|
version = int(m.group(1))
|
||||||
|
assert 5 <= version <= 6, "unsupported ninja log version %d" % version
|
||||||
|
if version == 6:
|
||||||
|
# Skip header line
|
||||||
|
next(log)
|
||||||
|
|
||||||
|
targets = {}
|
||||||
|
last_end_seen = 0
|
||||||
|
for line in log:
|
||||||
|
if line.startswith('#'):
|
||||||
|
continue
|
||||||
|
start, end, _, name, cmdhash = line.strip().split('\t') # Ignore restat.
|
||||||
|
if not show_all and int(end) < last_end_seen:
|
||||||
|
# An earlier time stamp means that this step is the first in a new
|
||||||
|
# build, possibly an incremental build. Throw away the previous data
|
||||||
|
# so that this new build will be displayed independently.
|
||||||
|
targets = {}
|
||||||
|
last_end_seen = int(end)
|
||||||
|
targets.setdefault(cmdhash, Target(start, end)).targets.append(name)
|
||||||
|
return sorted(targets.values(), key=lambda job: job.end, reverse=True)
|
||||||
|
|
||||||
|
|
||||||
|
class Threads:
|
||||||
|
"""Tries to reconstruct the parallelism from a .ninja_log"""
|
||||||
|
def __init__(self):
|
||||||
|
self.workers = [] # Maps thread id to time that thread is occupied for.
|
||||||
|
|
||||||
|
def alloc(self, target):
|
||||||
|
"""Places target in an available thread, or adds a new thread."""
|
||||||
|
for worker in range(len(self.workers)):
|
||||||
|
if self.workers[worker] >= target.end:
|
||||||
|
self.workers[worker] = target.start
|
||||||
|
return worker
|
||||||
|
self.workers.append(target.start)
|
||||||
|
return len(self.workers) - 1
|
||||||
|
|
||||||
|
|
||||||
|
def read_events(trace, options):
|
||||||
|
"""Reads all events from time-trace json file |trace|."""
|
||||||
|
trace_data = json.load(trace)
|
||||||
|
|
||||||
|
def include_event(event, options):
|
||||||
|
"""Only include events if they are complete events, are longer than
|
||||||
|
granularity, and are not totals."""
|
||||||
|
return ((event['ph'] == 'X') and
|
||||||
|
(event['dur'] >= options['granularity']) and
|
||||||
|
(not event['name'].startswith('Total')))
|
||||||
|
|
||||||
|
return [x for x in trace_data['traceEvents'] if include_event(x, options)]
|
||||||
|
|
||||||
|
|
||||||
|
def trace_to_dicts(target, trace, options, pid, tid):
|
||||||
|
"""Read a file-like object |trace| containing -ftime-trace data and yields
|
||||||
|
about:tracing dict per eligible event in that log."""
|
||||||
|
ninja_time = (target.end - target.start) * 1000
|
||||||
|
for event in read_events(trace, options):
|
||||||
|
# Check if any event duration is greater than the duration from ninja.
|
||||||
|
if event['dur'] > ninja_time:
|
||||||
|
print("Inconsistent timing found (clang time > ninja time). Please"
|
||||||
|
" ensure that timings are from consistent builds.")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
# Set tid and pid from ninja log.
|
||||||
|
event['pid'] = pid
|
||||||
|
event['tid'] = tid
|
||||||
|
|
||||||
|
# Offset trace time stamp by ninja start time.
|
||||||
|
event['ts'] += (target.start * 1000)
|
||||||
|
|
||||||
|
yield event
|
||||||
|
|
||||||
|
|
||||||
|
def embed_time_trace(ninja_log_dir, target, pid, tid, options):
|
||||||
|
"""Produce time trace output for the specified ninja target. Expects
|
||||||
|
time-trace file to be in .json file named based on .o file."""
|
||||||
|
for t in target.targets:
|
||||||
|
o_path = os.path.join(ninja_log_dir, t)
|
||||||
|
json_trace_path = os.path.splitext(o_path)[0] + '.json'
|
||||||
|
try:
|
||||||
|
with open(json_trace_path, 'r') as trace:
|
||||||
|
for time_trace_event in trace_to_dicts(target, trace, options,
|
||||||
|
pid, tid):
|
||||||
|
yield time_trace_event
|
||||||
|
except IOError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
def log_to_dicts(log, pid, options):
|
||||||
|
"""Reads a file-like object |log| containing a .ninja_log, and yields one
|
||||||
|
about:tracing dict per command found in the log."""
|
||||||
|
threads = Threads()
|
||||||
|
for target in read_targets(log, options['showall']):
|
||||||
|
tid = threads.alloc(target)
|
||||||
|
|
||||||
|
yield {
|
||||||
|
'name': '%0s' % ', '.join(target.targets), 'cat': 'targets',
|
||||||
|
'ph': 'X', 'ts': (target.start * 1000),
|
||||||
|
'dur': ((target.end - target.start) * 1000),
|
||||||
|
'pid': pid, 'tid': tid, 'args': {},
|
||||||
|
}
|
||||||
|
if options.get('embed_time_trace', False):
|
||||||
|
# Add time-trace information into the ninja trace.
|
||||||
|
try:
|
||||||
|
ninja_log_dir = os.path.dirname(log.name)
|
||||||
|
except AttributeError:
|
||||||
|
continue
|
||||||
|
for time_trace in embed_time_trace(ninja_log_dir, target, pid,
|
||||||
|
tid, options):
|
||||||
|
yield time_trace
|
||||||
|
|
||||||
|
|
||||||
|
def main(argv):
|
||||||
|
usage = __doc__
|
||||||
|
parser = optparse.OptionParser(usage)
|
||||||
|
parser.add_option('-a', '--showall', action='store_true', dest='showall',
|
||||||
|
default=False,
|
||||||
|
help='report on last build step for all outputs. Default '
|
||||||
|
'is to report just on the last (possibly incremental) '
|
||||||
|
'build')
|
||||||
|
parser.add_option('-g', '--granularity', type='int', default=50000,
|
||||||
|
dest='granularity',
|
||||||
|
help='minimum length time-trace event to embed in '
|
||||||
|
'microseconds. Default: %default')
|
||||||
|
parser.add_option('-e', '--embed-time-trace', action='store_true',
|
||||||
|
default=False, dest='embed_time_trace',
|
||||||
|
help='embed clang -ftime-trace json file found adjacent '
|
||||||
|
'to a target file')
|
||||||
|
(options, args) = parser.parse_args()
|
||||||
|
|
||||||
|
if len(args) == 0:
|
||||||
|
print('Must specify at least one .ninja_log file')
|
||||||
|
parser.print_help()
|
||||||
|
return 1
|
||||||
|
|
||||||
|
entries = []
|
||||||
|
for pid, log_file in enumerate(args):
|
||||||
|
with open(log_file, 'r') as log:
|
||||||
|
entries += list(log_to_dicts(log, pid, vars(options)))
|
||||||
|
json.dump(entries, sys.stdout)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.exit(main(sys.argv[1:]))
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
# Small leaks that make CI fail, suppress until cause is identified.
|
||||||
|
leak:__cxa_thread_atexit
|
||||||
|
leak:std::string::_Rep::_S_create
|
||||||
|
leak:tsl::detail_robin_hash::robin_hash
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# Copyright Contributors to the Open Shading Language project.
|
||||||
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||||
|
|
||||||
|
# Open a PTX file and:
|
||||||
|
# * add the `.visible` directive to all functions
|
||||||
|
# * add the `.visible` directive to global/constant variables
|
||||||
|
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
|
||||||
|
in_name = sys.argv[1]
|
||||||
|
out_name = sys.argv[2]
|
||||||
|
ptx = ""
|
||||||
|
with open(in_name, 'r') as ptx_in:
|
||||||
|
ptx = ptx_in.read()
|
||||||
|
ptx = re.sub(r'(?m)^(\.const .align)', ".visible .const .align", ptx)
|
||||||
|
ptx = re.sub(r'(?m)^(\.global .align)', ".visible .global .align", ptx)
|
||||||
|
ptx = re.sub(r'(?m)^(\.func)', ".visible .func", ptx)
|
||||||
|
with open(out_name, 'w') as ptx_out:
|
||||||
|
ptx_out.write(ptx)
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
#!/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
|
||||||
|
|
||||||
|
CLANG_FORMAT_EXE=${CLANG_FORMAT_EXE:="clang-format"}
|
||||||
|
echo "Running " `which clang-format` " version " `${CLANG_FORMAT_EXE} --version`
|
||||||
|
|
||||||
|
files=`find ./{src,testsuite} \( -name '*.h' -o -name '*.cpp' -o -name '*.cu' \) -print \
|
||||||
|
| grep -Ev 'testsuite/.*\.h|src/shaders'`
|
||||||
|
|
||||||
|
|
||||||
|
${CLANG_FORMAT_EXE} -i -style=file $files
|
||||||
|
git diff --color
|
||||||
|
THEDIFF=`git diff`
|
||||||
|
if [[ "$THEDIFF" != "" ]] ; then
|
||||||
|
echo "git diff was not empty. Failing clang-format check."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
@@ -1,5 +1,9 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Copyright Contributors to the Open Shading Language project.
|
||||||
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||||
|
|
||||||
# Save the env for use by other stages. Exclude things that we know aren't
|
# Save the env for use by other stages. Exclude things that we know aren't
|
||||||
# needed.
|
# needed.
|
||||||
printenv \
|
printenv \
|
||||||
|
|||||||
@@ -6,8 +6,6 @@
|
|||||||
# Turn an LLVM-compiled bitfile into a C++ source file where the compiled
|
# Turn an LLVM-compiled bitfile into a C++ source file where the compiled
|
||||||
# bitcode is in a huge array.
|
# bitcode is in a huge array.
|
||||||
|
|
||||||
from __future__ import print_function, absolute_import
|
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
in_name = sys.argv[1]
|
in_name = sys.argv[1]
|
||||||
|
|||||||
@@ -7,16 +7,7 @@
|
|||||||
include(CMakeFindDependencyMacro)
|
include(CMakeFindDependencyMacro)
|
||||||
|
|
||||||
# add here all the find_dependency() whenever switching to config based dependencies
|
# add here all the find_dependency() whenever switching to config based dependencies
|
||||||
if (@OpenEXR_VERSION@ VERSION_GREATER_EQUAL 3.0)
|
find_dependency(Imath @Imath_VERSION@)
|
||||||
find_dependency(Imath @Imath_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)
|
find_dependency(OpenImageIO @OpenImageIO_VERSION@ REQUIRED)
|
||||||
|
|
||||||
# Compute the installation prefix relative to this file
|
# Compute the installation prefix relative to this file
|
||||||
|
|||||||
@@ -1,202 +0,0 @@
|
|||||||
# Copyright Contributors to the Open Shading Language project.
|
|
||||||
# SPDX-License-Identifier: BSD-3-Clause
|
|
||||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
|
||||||
|
|
||||||
|
|
||||||
set (REQUIRED_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)")
|
|
||||||
option (ALWAYS_PREFER_CONFIG "Prefer a dependency's exported config file if it's available" OFF)
|
|
||||||
|
|
||||||
|
|
||||||
# Utility function to list the names and values of all variables matching
|
|
||||||
# the pattern (case-insensitive)
|
|
||||||
function (dump_matching_variables pattern)
|
|
||||||
string (TOLOWER ${pattern} _pattern_lower)
|
|
||||||
get_cmake_property(_allvars VARIABLES)
|
|
||||||
list (SORT _allvars)
|
|
||||||
foreach (_var IN LISTS _allvars)
|
|
||||||
string (TOLOWER ${_var} _var_lower)
|
|
||||||
if (_var_lower MATCHES ${_pattern_lower})
|
|
||||||
message (STATUS " ${_var} = ${${_var}}")
|
|
||||||
endif ()
|
|
||||||
endforeach ()
|
|
||||||
endfunction ()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# 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 SETVARIABLES <id>... is a list of CMake variables to set to
|
|
||||||
# TRUE if the package is found (they will not be set or changed if the
|
|
||||||
# package is not 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.
|
|
||||||
# * Optional PREFER_CONFIG, if supplied, tries to use an exported config
|
|
||||||
# file from the package before using a FindPackage.cmake module.
|
|
||||||
# * Optional DEBUG turns on extra debugging information related to how
|
|
||||||
# this package is found.
|
|
||||||
#
|
|
||||||
# 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;PREFER_CONFIG;DEBUG"
|
|
||||||
# singleValueKeywords:
|
|
||||||
"ENABLE;ISDEPOF;VERSION_MIN;VERSION_MAX;RECOMMEND_MIN;RECOMMEND_MIN_REASON"
|
|
||||||
# multiValueKeywords:
|
|
||||||
"DEFINITIONS;PRINT;DEPS;SETVARIABLES"
|
|
||||||
# argsToParse:
|
|
||||||
${ARGN})
|
|
||||||
string (TOLOWER ${pkgname} pkgname_lower)
|
|
||||||
string (TOUPPER ${pkgname} pkgname_upper)
|
|
||||||
set (_pkg_VERBOSE ${VERBOSE})
|
|
||||||
if (_pkg_DEBUG)
|
|
||||||
set (_pkg_VERBOSE ON)
|
|
||||||
endif ()
|
|
||||||
if (NOT _pkg_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 ()
|
|
||||||
set (_config_status "")
|
|
||||||
if (_enable OR _pkg_REQUIRED)
|
|
||||||
if (${pkgname}_FOUND OR ${pkgname_upper}_FOUND)
|
|
||||||
# was already found
|
|
||||||
elseif (_pkg_PREFER_CONFIG OR ALWAYS_PREFER_CONFIG)
|
|
||||||
find_package (${pkgname} CONFIG ${_pkg_UNPARSED_ARGUMENTS})
|
|
||||||
if (${pkgname}_FOUND OR ${pkgname_upper}_FOUND)
|
|
||||||
set (_config_status "from CONFIG")
|
|
||||||
endif ()
|
|
||||||
endif ()
|
|
||||||
if (NOT (${pkgname}_FOUND OR ${pkgname_upper}_FOUND))
|
|
||||||
find_package (${pkgname} ${_pkg_UNPARSED_ARGUMENTS})
|
|
||||||
endif()
|
|
||||||
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} ${_config_status}${ColorReset}")
|
|
||||||
add_definitions (${_pkg_DEFINITIONS})
|
|
||||||
foreach (_v IN LISTS _pkg_SETVARIABLES)
|
|
||||||
set (${_v} TRUE)
|
|
||||||
endforeach ()
|
|
||||||
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()
|
|
||||||
if (_pkg_VERBOSE AND (${pkgname}_FOUND OR ${pkgname_upper}_FOUND OR _pkg_DEBUG))
|
|
||||||
if (_pkg_DEBUG)
|
|
||||||
dump_matching_variables (${pkgname})
|
|
||||||
endif ()
|
|
||||||
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 ()
|
|
||||||
else ()
|
|
||||||
if (NOT _quietskip)
|
|
||||||
message (STATUS "${ColorRed}Not using ${pkgname} -- disabled ${_disablereason} ${ColorReset}")
|
|
||||||
endif ()
|
|
||||||
endif ()
|
|
||||||
endmacro()
|
|
||||||
|
|
||||||
@@ -9,4 +9,9 @@ set (ColorReset "${ColorEsc}[m")
|
|||||||
set (ColorRed "${ColorEsc}[31m")
|
set (ColorRed "${ColorEsc}[31m")
|
||||||
set (ColorGreen "${ColorEsc}[32m")
|
set (ColorGreen "${ColorEsc}[32m")
|
||||||
set (ColorYellow "${ColorEsc}[33m")
|
set (ColorYellow "${ColorEsc}[33m")
|
||||||
|
set (ColorBlue "${ColorEsc}[34m")
|
||||||
|
set (ColorMagenta "${ColorEsc}[35m")
|
||||||
|
set (ColorBoldRed "${ColorEsc}[1;31m")
|
||||||
|
set (ColorBoldGreen "${ColorEsc}[1;32m")
|
||||||
|
set (ColorBoldYellow "${ColorEsc}[1;33m")
|
||||||
set (ColorBoldWhite "${ColorEsc}[1;37m")
|
set (ColorBoldWhite "${ColorEsc}[1;37m")
|
||||||
|
|||||||
@@ -15,25 +15,30 @@
|
|||||||
###########################################################################
|
###########################################################################
|
||||||
# Print some basic status about the system and compiler
|
# Print some basic status about the system and compiler
|
||||||
#
|
#
|
||||||
if (VERBOSE)
|
message (VERBOSE "CMAKE_SYSTEM_NAME = ${CMAKE_SYSTEM_NAME}")
|
||||||
message (STATUS "CMAKE_SYSTEM_NAME = ${CMAKE_SYSTEM_NAME}")
|
message (VERBOSE "CMAKE_SYSTEM_VERSION = ${CMAKE_SYSTEM_VERSION}")
|
||||||
message (STATUS "CMAKE_SYSTEM_VERSION = ${CMAKE_SYSTEM_VERSION}")
|
message (VERBOSE "CMAKE_SYSTEM_PROCESSOR = ${CMAKE_SYSTEM_PROCESSOR}")
|
||||||
message (STATUS "CMAKE_SYSTEM_PROCESSOR = ${CMAKE_SYSTEM_PROCESSOR}")
|
message (STATUS "CMAKE_CXX_COMPILER = ${CMAKE_CXX_COMPILER}")
|
||||||
endif ()
|
message (STATUS "CMAKE_CXX_COMPILER_ID = ${CMAKE_CXX_COMPILER_ID}")
|
||||||
message (STATUS "CMAKE_CXX_COMPILER = ${CMAKE_CXX_COMPILER}")
|
message (VERBOSE "CMAKE_CXX_COMPILE_FEATURES = ${CMAKE_CXX_COMPILE_FEATURES}")
|
||||||
message (STATUS "CMAKE_CXX_COMPILER_ID = ${CMAKE_CXX_COMPILER_ID}")
|
|
||||||
|
|
||||||
|
|
||||||
###########################################################################
|
###########################################################################
|
||||||
# C++ language standard
|
# C++ language standard
|
||||||
#
|
#
|
||||||
set (CMAKE_CXX_STANDARD 14 CACHE STRING
|
set (CMAKE_CXX_MINIMUM 17)
|
||||||
"C++ standard to build with (14, 17, 20, etc.)")
|
set (CMAKE_CXX_STANDARD 17 CACHE STRING
|
||||||
set (DOWNSTREAM_CXX_STANDARD 14 CACHE STRING
|
"C++ standard to build with (17, 20, etc.) Minimum is ${CMAKE_CXX_MINIMUM}.")
|
||||||
|
set (DOWNSTREAM_CXX_STANDARD 17 CACHE STRING
|
||||||
"C++ minimum standard to impose on downstream clients")
|
"C++ minimum standard to impose on downstream clients")
|
||||||
set (CMAKE_CXX_STANDARD_REQUIRED ON)
|
set (CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
set (CMAKE_CXX_EXTENSIONS OFF)
|
set (CMAKE_CXX_EXTENSIONS OFF)
|
||||||
message (STATUS "Building with C++${CMAKE_CXX_STANDARD}, downstream minimum C++${DOWNSTREAM_CXX_STANDARD}")
|
message (STATUS "Building with C++${CMAKE_CXX_STANDARD}, downstream minimum C++${DOWNSTREAM_CXX_STANDARD}")
|
||||||
|
if (CMAKE_CXX_STANDARD VERSION_LESS CMAKE_CXX_MINIMUM)
|
||||||
|
message (FATAL_ERROR "C++${CMAKE_CXX_STANDARD} is not supported, minimum is C++${CMAKE_CXX_MINIMUM}")
|
||||||
|
endif ()
|
||||||
|
# Remember the -std flags we need will be used later for custom Cuda builds
|
||||||
|
set (CSTD_FLAGS "-std=c++${CMAKE_CXX_STANDARD}")
|
||||||
|
|
||||||
|
|
||||||
###########################################################################
|
###########################################################################
|
||||||
@@ -44,8 +49,9 @@ if (CMAKE_COMPILER_IS_GNUCC)
|
|||||||
execute_process (COMMAND ${CMAKE_CXX_COMPILER} -dumpversion
|
execute_process (COMMAND ${CMAKE_CXX_COMPILER} -dumpversion
|
||||||
OUTPUT_VARIABLE GCC_VERSION
|
OUTPUT_VARIABLE GCC_VERSION
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
if (VERBOSE)
|
message (VERBOSE "Using gcc ${GCC_VERSION} as the compiler")
|
||||||
message (STATUS "Using gcc ${GCC_VERSION} as the compiler")
|
if (GCC_VERSION VERSION_LESS 9.0)
|
||||||
|
message (ERROR "gcc minimum version is 9.0")
|
||||||
endif ()
|
endif ()
|
||||||
else ()
|
else ()
|
||||||
set (GCC_VERSION 0)
|
set (GCC_VERSION 0)
|
||||||
@@ -63,26 +69,35 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER MATCHES "[Cc]lan
|
|||||||
set (CMAKE_CXX_COMPILER_ID "AppleClang")
|
set (CMAKE_CXX_COMPILER_ID "AppleClang")
|
||||||
set (CMAKE_COMPILER_IS_APPLECLANG 1)
|
set (CMAKE_COMPILER_IS_APPLECLANG 1)
|
||||||
string (REGEX REPLACE ".* version ([0-9]+\\.[0-9]+).*" "\\1" APPLECLANG_VERSION_STRING ${clang_full_version_string})
|
string (REGEX REPLACE ".* version ([0-9]+\\.[0-9]+).*" "\\1" APPLECLANG_VERSION_STRING ${clang_full_version_string})
|
||||||
if (VERBOSE)
|
set (ANY_CLANG_VERSION_STRING ${APPLECLANG_VERSION_STRING})
|
||||||
message (STATUS "The compiler is Clang: ${CMAKE_CXX_COMPILER_ID} version ${APPLECLANG_VERSION_STRING}")
|
message (VERBOSE "The compiler is Clang: ${CMAKE_CXX_COMPILER_ID} version ${APPLECLANG_VERSION_STRING}")
|
||||||
|
if (APPLECLANG_VERSION_STRING VERSION_LESS 5.0)
|
||||||
|
message (ERROR "Apple clang minimum version is 5.0")
|
||||||
|
elseif (APPLECLANG_VERSION_STRING VERSION_LESS 10.0)
|
||||||
|
message (WARNING "Apple clang minimum version is 10.0. Older versions might work, but we don't test or support them.")
|
||||||
endif ()
|
endif ()
|
||||||
elseif (CMAKE_CXX_COMPILER_ID MATCHES "IntelLLVM")
|
elseif (CMAKE_CXX_COMPILER_ID MATCHES "IntelLLVM")
|
||||||
set (CMAKE_COMPILER_IS_INTELCLANG 1)
|
set (CMAKE_COMPILER_IS_INTELCLANG 1)
|
||||||
string (REGEX MATCH "[0-9]+(\\.[0-9]+)+" INTELCLANG_VERSION_STRING ${clang_full_version_string})
|
string (REGEX MATCH "[0-9]+(\\.[0-9]+)+" INTELCLANG_VERSION_STRING ${clang_full_version_string})
|
||||||
if (VERBOSE)
|
set (ANY_CLANG_VERSION_STRING ${INTELCLANG_VERSION_STRING})
|
||||||
message (STATUS "The compiler is Intel Clang: ${CMAKE_CXX_COMPILER_ID} version ${INTELCLANG_VERSION_STRING}")
|
message (VERBOSE "The compiler is Intel Clang: ${CMAKE_CXX_COMPILER_ID} version ${INTELCLANG_VERSION_STRING}")
|
||||||
endif ()
|
|
||||||
else ()
|
else ()
|
||||||
|
set (CMAKE_COMPILER_IS_GENERICCLANG 1)
|
||||||
string (REGEX REPLACE ".* version ([0-9]+\\.[0-9]+).*" "\\1" CLANG_VERSION_STRING ${clang_full_version_string})
|
string (REGEX REPLACE ".* version ([0-9]+\\.[0-9]+).*" "\\1" CLANG_VERSION_STRING ${clang_full_version_string})
|
||||||
if (VERBOSE)
|
set (ANY_CLANG_VERSION_STRING ${CLANG_VERSION_STRING})
|
||||||
message (STATUS "The compiler is Clang: ${CMAKE_CXX_COMPILER_ID} version ${CLANG_VERSION_STRING}")
|
message (VERBOSE "The compiler is Clang: ${CMAKE_CXX_COMPILER_ID} version ${CLANG_VERSION_STRING}")
|
||||||
|
if (CLANG_VERSION_STRING VERSION_LESS 5.0)
|
||||||
|
message (ERROR "clang minimum version is 5.0")
|
||||||
|
elseif (CLANG_VERSION_STRING VERSION_LESS 10.0)
|
||||||
|
message (WARNING "clang minimum version is 10.0. Older versions might work, but we don't test or support them.")
|
||||||
endif ()
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Intel")
|
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Intel")
|
||||||
set (CMAKE_COMPILER_IS_INTEL 1)
|
set (CMAKE_COMPILER_IS_INTEL 1)
|
||||||
if (VERBOSE)
|
message (VERBOSE "Using Intel as the compiler")
|
||||||
message (STATUS "Using Intel as the compiler")
|
endif ()
|
||||||
endif ()
|
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
|
||||||
|
set (COMPILER_IS_GCC_OR_ANY_CLANG TRUE)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
|
||||||
@@ -100,12 +115,12 @@ else ()
|
|||||||
endif()
|
endif()
|
||||||
option (EXTRA_WARNINGS "Enable lots of extra pedantic warnings" OFF)
|
option (EXTRA_WARNINGS "Enable lots of extra pedantic warnings" OFF)
|
||||||
if (NOT MSVC)
|
if (NOT MSVC)
|
||||||
add_compile_options ("-Wall")
|
add_compile_options (-Wall)
|
||||||
if (EXTRA_WARNINGS)
|
if (EXTRA_WARNINGS)
|
||||||
add_compile_options ("-Wextra")
|
add_compile_options (-Wextra)
|
||||||
endif ()
|
endif ()
|
||||||
if (STOP_ON_WARNING)
|
if (STOP_ON_WARNING)
|
||||||
add_compile_options ("-Werror")
|
add_compile_options (-Werror)
|
||||||
endif ()
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
@@ -121,11 +136,11 @@ endif ()
|
|||||||
# give more fine-grained control for hiding symbols, because sometimes
|
# give more fine-grained control for hiding symbols, because sometimes
|
||||||
# dependent libraries may not be well behaved and need extra hiding.
|
# dependent libraries may not be well behaved and need extra hiding.
|
||||||
#
|
#
|
||||||
set (CXX_VISIBILITY_PRESET "hidden" CACHE STRING "Symbol visibility (hidden or default")
|
set (CMAKE_CXX_VISIBILITY_PRESET "hidden" CACHE STRING "Symbol visibility (hidden or default")
|
||||||
option (VISIBILITY_INLINES_HIDDEN "Hide symbol visibility of inline functions" ON)
|
option (VISIBILITY_INLINES_HIDDEN "Hide symbol visibility of inline functions" ON)
|
||||||
set (VISIBILITY_MAP_FILE "${PROJECT_SOURCE_DIR}/src/build-scripts/hidesymbols.map" CACHE FILEPATH "Visibility map file")
|
set (VISIBILITY_MAP_FILE "${PROJECT_SOURCE_DIR}/src/build-scripts/hidesymbols.map" CACHE FILEPATH "Visibility map file")
|
||||||
set (C_VISIBILITY_PRESET ${CXX_VISIBILITY_PRESET})
|
set (CMAKE_C_VISIBILITY_PRESET ${CMAKE_CXX_VISIBILITY_PRESET})
|
||||||
if (${CXX_VISIBILITY_PRESET} STREQUAL "hidden" AND VISIBILITY_MAP_FILE AND
|
if (${CMAKE_CXX_VISIBILITY_PRESET} STREQUAL "hidden" AND VISIBILITY_MAP_FILE AND
|
||||||
(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG) AND
|
(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG) AND
|
||||||
(CMAKE_SYSTEM_NAME MATCHES "Linux|kFreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "GNU"))
|
(CMAKE_SYSTEM_NAME MATCHES "Linux|kFreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "GNU"))
|
||||||
# Linux/FreeBSD/Hurd: also hide all the symbols of dependent libraries
|
# Linux/FreeBSD/Hurd: also hide all the symbols of dependent libraries
|
||||||
@@ -165,6 +180,7 @@ if (CMAKE_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_APPLECLANG)
|
|||||||
# Suppress warnings about our strategic use of bitwise operations in place
|
# Suppress warnings about our strategic use of bitwise operations in place
|
||||||
# of logical operators to produce branchless code in some places.
|
# of logical operators to produce branchless code in some places.
|
||||||
if (CLANG_VERSION_STRING VERSION_GREATER_EQUAL 14.0
|
if (CLANG_VERSION_STRING VERSION_GREATER_EQUAL 14.0
|
||||||
|
OR APPLECLANG_VERSION_STRING VERSION_GREATER_EQUAL 14.0
|
||||||
OR INTELCLANG_VERSION_STRING VERSION_GREATER_EQUAL 14.0)
|
OR INTELCLANG_VERSION_STRING VERSION_GREATER_EQUAL 14.0)
|
||||||
add_compile_options ("-Wno-bitwise-instead-of-logical")
|
add_compile_options ("-Wno-bitwise-instead-of-logical")
|
||||||
endif ()
|
endif ()
|
||||||
@@ -181,17 +197,15 @@ if (CMAKE_COMPILER_IS_GNUCC AND NOT (CMAKE_COMPILER_IS_CLANG OR CMAKE_COMPILER_I
|
|||||||
add_compile_options ("-Wno-error=strict-overflow")
|
add_compile_options ("-Wno-error=strict-overflow")
|
||||||
add_compile_options ("-Wno-unused-local-typedefs")
|
add_compile_options ("-Wno-unused-local-typedefs")
|
||||||
add_compile_options ("-Wno-unused-result")
|
add_compile_options ("-Wno-unused-result")
|
||||||
if (NOT ${GCC_VERSION} VERSION_LESS 6.0)
|
add_compile_options ("-Wno-error=misleading-indentation")
|
||||||
add_compile_options ("-Wno-error=misleading-indentation")
|
|
||||||
endif ()
|
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
|
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
|
||||||
# Options common to gcc and clang
|
# Options common to gcc and clang
|
||||||
|
|
||||||
# Ensure this macro is set for stdint.h
|
# Ensure this macro is set for stdint.h
|
||||||
add_definitions ("-D__STDC_LIMIT_MACROS")
|
add_compile_definitions (__STDC_LIMIT_MACROS)
|
||||||
add_definitions ("-D__STDC_CONSTANT_MACROS")
|
add_compile_definitions (__STDC_CONSTANT_MACROS)
|
||||||
# this allows native instructions to be used for sqrtf instead of a function call
|
# this allows native instructions to be used for sqrtf instead of a function call
|
||||||
add_compile_options ("-fno-math-errno")
|
add_compile_options ("-fno-math-errno")
|
||||||
endif ()
|
endif ()
|
||||||
@@ -204,11 +218,11 @@ endif ()
|
|||||||
if (MSVC)
|
if (MSVC)
|
||||||
# Microsoft specific options
|
# Microsoft specific options
|
||||||
string (REGEX REPLACE "/W[1-4]" "/W1" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
|
string (REGEX REPLACE "/W[1-4]" "/W1" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
|
||||||
add_definitions (-D_CRT_SECURE_NO_DEPRECATE)
|
add_compile_definitions (_CRT_SECURE_NO_DEPRECATE)
|
||||||
add_definitions (-D_CRT_SECURE_NO_WARNINGS)
|
add_compile_definitions (_CRT_SECURE_NO_WARNINGS)
|
||||||
add_definitions (-D_CRT_NONSTDC_NO_WARNINGS)
|
add_compile_definitions (_CRT_NONSTDC_NO_WARNINGS)
|
||||||
add_definitions (-D_SCL_SECURE_NO_WARNINGS)
|
add_compile_definitions (_SCL_SECURE_NO_WARNINGS)
|
||||||
add_definitions (-DJAS_WIN_MSVC_BUILD)
|
add_compile_definitions (JAS_WIN_MSVC_BUILD)
|
||||||
endif (MSVC)
|
endif (MSVC)
|
||||||
|
|
||||||
if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD"
|
if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD"
|
||||||
@@ -218,18 +232,6 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD"
|
|||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
|
||||||
# Remember the -std flags we need will be used later for custom Cuda builds
|
|
||||||
set (CSTD_FLAGS "")
|
|
||||||
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG OR CMAKE_COMPILER_IS_INTEL)
|
|
||||||
set (CSTD_FLAGS "-std=c++${CMAKE_CXX_STANDARD}")
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# We will use this for ccache and timing
|
|
||||||
set (MY_RULE_LAUNCH "")
|
|
||||||
|
|
||||||
|
|
||||||
###########################################################################
|
###########################################################################
|
||||||
# Use ccache if found
|
# Use ccache if found
|
||||||
#
|
#
|
||||||
@@ -238,12 +240,31 @@ set (MY_RULE_LAUNCH "")
|
|||||||
# logic here makes it work even if the user is unaware of ccache. If it's
|
# 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 silently not used.
|
# not found on the system, it will simply be silently not used.
|
||||||
option (USE_CCACHE "Use ccache if found" ON)
|
option (USE_CCACHE "Use ccache if found" ON)
|
||||||
find_program (CCACHE_FOUND ccache)
|
if (USE_CCACHE)
|
||||||
if (CCACHE_FOUND AND USE_CCACHE)
|
find_program (CCACHE_EXE ccache
|
||||||
if (CMAKE_COMPILER_IS_CLANG AND USE_QT AND (NOT DEFINED ENV{CCACHE_CPP2}))
|
PATHS "${PROJECT_SOURCE_DIR}/ext/dist/"
|
||||||
message (STATUS "Ignoring ccache because clang + Qt + env CCACHE_CPP2 is not set")
|
"${PROJECT_SOURCE_DIR}/ext/dist/bin")
|
||||||
|
if (CCACHE_EXE)
|
||||||
|
if (CMAKE_COMPILER_IS_CLANG AND USE_QT AND (NOT DEFINED ENV{CCACHE_CPP2}))
|
||||||
|
message (STATUS "Ignoring ccache because clang + Qt + env CCACHE_CPP2 is not set")
|
||||||
|
else ()
|
||||||
|
message (STATUS "CMAKE_CXX_COMPILER_LAUNCHER: ${CMAKE_CXX_COMPILER_LAUNCHER}")
|
||||||
|
|
||||||
|
if (NOT CMAKE_CXX_COMPILER_LAUNCHER MATCHES "ccache")
|
||||||
|
set (CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE_EXE})
|
||||||
|
message (STATUS "first if CMAKE_CXX_COMPILER_LAUNCHER: ${CMAKE_CXX_COMPILER_LAUNCHER}")
|
||||||
|
else ()
|
||||||
|
message (STATUS "first else CMAKE_CXX_COMPILER_LAUNCHER: '${CMAKE_CXX_COMPILER_LAUNCHER}'")
|
||||||
|
endif ()
|
||||||
|
if (NOT CMAKE_C_COMPILER_LAUNCHER MATCHES "ccache")
|
||||||
|
set (CMAKE_C_COMPILER_LAUNCHER ${CCACHE_EXE})
|
||||||
|
endif ()
|
||||||
|
message (STATUS "ccache enabled: ${CCACHE_EXE}")
|
||||||
|
message (STATUS "CCACHE_DIR env: $ENV{CCACHE_DIR}")
|
||||||
|
message (STATUS "CMAKE_CXX_COMPILER_LAUNCHER: ${CMAKE_CXX_COMPILER_LAUNCHER}")
|
||||||
|
endif ()
|
||||||
else ()
|
else ()
|
||||||
set (MY_RULE_LAUNCH ccache)
|
message (STATUS "ccache not found")
|
||||||
endif ()
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
@@ -256,14 +277,8 @@ endif ()
|
|||||||
# set `-j 1` or CMAKE_BUILD_PARALLEL_LEVEL to 1.
|
# set `-j 1` or CMAKE_BUILD_PARALLEL_LEVEL to 1.
|
||||||
option (TIME_COMMANDS "Time each compile and link command" OFF)
|
option (TIME_COMMANDS "Time each compile and link command" OFF)
|
||||||
if (TIME_COMMANDS)
|
if (TIME_COMMANDS)
|
||||||
set (MY_RULE_LAUNCH "${CMAKE_COMMAND} -E time ${MY_RULE_LAUNCH}")
|
set (CMAKE_CXX_COMPILER_LAUNCHER ${CMAKE_COMMAND} -E time ${CMAKE_CXX_COMPILER_LAUNCHER})
|
||||||
endif ()
|
set (CMAKE_C_COMPILER_LAUNCHER ${CMAKE_COMMAND} -E time ${CMAKE_C_COMPILER_LAUNCHER})
|
||||||
|
|
||||||
|
|
||||||
# Note: This must be after any option that alters MY_RULE_LAUNCH
|
|
||||||
if (MY_RULE_LAUNCH)
|
|
||||||
set_property (GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${MY_RULE_LAUNCH})
|
|
||||||
set_property (GLOBAL PROPERTY RULE_LAUNCH_LINK ${MY_RULE_LAUNCH})
|
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
|
||||||
@@ -289,10 +304,8 @@ endif ()
|
|||||||
# legit problem later.
|
# legit problem later.
|
||||||
#
|
#
|
||||||
set (GLIBCXX_USE_CXX11_ABI "" CACHE STRING "For gcc, use the new C++11 library ABI (0|1)")
|
set (GLIBCXX_USE_CXX11_ABI "" CACHE STRING "For gcc, use the new C++11 library ABI (0|1)")
|
||||||
if (CMAKE_COMPILER_IS_GNUCC AND ${GCC_VERSION} VERSION_GREATER_EQUAL 5.0)
|
if (CMAKE_COMPILER_IS_GNUCC AND NOT ${GLIBCXX_USE_CXX11_ABI} STREQUAL "")
|
||||||
if (NOT ${GLIBCXX_USE_CXX11_ABI} STREQUAL "")
|
add_compile_definitions (_GLIBCXX_USE_CXX11_ABI=${GLIBCXX_USE_CXX11_ABI})
|
||||||
add_definitions ("-D_GLIBCXX_USE_CXX11_ABI=${GLIBCXX_USE_CXX11_ABI}")
|
|
||||||
endif ()
|
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
|
||||||
@@ -304,22 +317,38 @@ endif ()
|
|||||||
# the proper compiler directives added to generate code for those ISA
|
# the proper compiler directives added to generate code for those ISA
|
||||||
# capabilities.
|
# capabilities.
|
||||||
#
|
#
|
||||||
set (USE_SIMD "" CACHE STRING "Use SIMD directives (0, sse2, sse3, ssse3, sse4.1, sse4.2, avx, avx2, avx512f, f16c, aes)")
|
set_cache (USE_SIMD "" "Use SIMD directives (0, sse2, sse3, ssse3, sse4.1, sse4.2, avx, avx2, avx512f, f16c, aes)")
|
||||||
set (SIMD_COMPILE_FLAGS "")
|
set (SIMD_COMPILE_FLAGS "")
|
||||||
|
message (STATUS "Compiling with SIMD level ${USE_SIMD}")
|
||||||
if (NOT USE_SIMD STREQUAL "")
|
if (NOT USE_SIMD STREQUAL "")
|
||||||
message (STATUS "Compiling with SIMD level ${USE_SIMD}")
|
|
||||||
if (USE_SIMD STREQUAL "0")
|
if (USE_SIMD STREQUAL "0")
|
||||||
set (SIMD_COMPILE_FLAGS ${SIMD_COMPILE_FLAGS} "-DOIIO_NO_SSE=1")
|
set (SIMD_COMPILE_FLAGS ${SIMD_COMPILE_FLAGS} "-DOIIO_NO_SIMD=1")
|
||||||
else ()
|
else ()
|
||||||
string (REPLACE "," ";" SIMD_FEATURE_LIST ${USE_SIMD})
|
set(_highest_msvc_arch 0)
|
||||||
|
string (REPLACE "," ";" SIMD_FEATURE_LIST "${USE_SIMD}")
|
||||||
foreach (feature ${SIMD_FEATURE_LIST})
|
foreach (feature ${SIMD_FEATURE_LIST})
|
||||||
if (VERBOSE)
|
message (VERBOSE "SIMD feature: ${feature}")
|
||||||
message (STATUS "SIMD feature: ${feature}")
|
|
||||||
endif ()
|
|
||||||
if (MSVC OR CMAKE_COMPILER_IS_INTEL)
|
if (MSVC OR CMAKE_COMPILER_IS_INTEL)
|
||||||
set (SIMD_COMPILE_FLAGS ${SIMD_COMPILE_FLAGS} "/arch:${feature}")
|
if (feature STREQUAL "sse2")
|
||||||
|
list (APPEND SIMD_COMPILE_FLAGS "/D__SSE2__")
|
||||||
|
endif ()
|
||||||
|
if (feature STREQUAL "sse4.1")
|
||||||
|
list (APPEND SIMD_COMPILE_FLAGS "/D__SSE2__" "/D__SSE4_1__")
|
||||||
|
endif ()
|
||||||
|
if (feature STREQUAL "sse4.2")
|
||||||
|
list (APPEND SIMD_COMPILE_FLAGS "/D__SSE2__" "/D__SSE4_2__")
|
||||||
|
endif ()
|
||||||
|
if (feature STREQUAL "avx" AND _highest_msvc_arch LESS 1)
|
||||||
|
set(_highest_msvc_arch 1)
|
||||||
|
endif ()
|
||||||
|
if (feature STREQUAL "avx2" AND _highest_msvc_arch LESS 2)
|
||||||
|
set(_highest_msvc_arch 2)
|
||||||
|
endif ()
|
||||||
|
if (feature STREQUAL "avx512f" AND _highest_msvc_arch LESS 3)
|
||||||
|
set(_highest_msvc_arch 3)
|
||||||
|
endif ()
|
||||||
else ()
|
else ()
|
||||||
set (SIMD_COMPILE_FLAGS ${SIMD_COMPILE_FLAGS} "-m${feature}")
|
list (APPEND SIMD_COMPILE_FLAGS "-m${feature}")
|
||||||
endif ()
|
endif ()
|
||||||
if (feature STREQUAL "fma" AND (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG))
|
if (feature STREQUAL "fma" AND (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG))
|
||||||
# If fma is requested, for numerical accuracy sake, turn it
|
# If fma is requested, for numerical accuracy sake, turn it
|
||||||
@@ -329,30 +358,45 @@ if (NOT USE_SIMD STREQUAL "")
|
|||||||
add_compile_options ("-ffp-contract=off")
|
add_compile_options ("-ffp-contract=off")
|
||||||
endif ()
|
endif ()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
|
# Only add a single /arch flag representing the highest level of support.
|
||||||
|
if (MSVC OR CMAKE_COMPILER_IS_INTEL)
|
||||||
|
if (_highest_msvc_arch EQUAL 1)
|
||||||
|
list (APPEND SIMD_COMPILE_FLAGS "/arch:AVX")
|
||||||
|
endif ()
|
||||||
|
if (_highest_msvc_arch EQUAL 2)
|
||||||
|
list (APPEND SIMD_COMPILE_FLAGS "/arch:AVX2")
|
||||||
|
endif ()
|
||||||
|
if (_highest_msvc_arch EQUAL 3)
|
||||||
|
list (APPEND SIMD_COMPILE_FLAGS "/arch:AVX512")
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
|
unset(_highest_msvc_arch)
|
||||||
endif ()
|
endif ()
|
||||||
add_compile_options (${SIMD_COMPILE_FLAGS})
|
add_compile_options (${SIMD_COMPILE_FLAGS})
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
|
||||||
###########################################################################
|
###########################################################################
|
||||||
# Batched SIMD shader execution options.
|
# Batched SIMD shader execution options.
|
||||||
#
|
#
|
||||||
# The USE_BATCHED option may be set to indicate that support for batched
|
# The USE_BATCHED option may be set to indicate that support for batched
|
||||||
# SIMD shader execution be compiled along with targe specific libraries
|
# SIMD shader execution be compiled along with targe specific libraries
|
||||||
set (USE_BATCHED "" CACHE STRING "Build batched SIMD shader execution for (0, b8_AVX, b8_AVX2, b8_AVX2_noFMA, b8_AVX512, b8_AVX512_noFMA, b16_AVX512, b16_AVX512_noFMA)")
|
set_cache (USE_BATCHED "" "Build batched SIMD shader execution for (0, b4_SSE2, b8_AVX, b8_AVX2, b8_AVX2_noFMA, b8_AVX512, b8_AVX512_noFMA, b16_AVX512, b16_AVX512_noFMA)")
|
||||||
option (VEC_REPORT "Enable compiler's reporting system for vectorization" OFF)
|
option (VEC_REPORT "Enable compiler's reporting system for vectorization" OFF)
|
||||||
set (BATCHED_SUPPORT_DEFINES "")
|
set (BATCHED_SUPPORT_DEFINES "")
|
||||||
set (BATCHED_TARGET_LIBS "")
|
set (BATCHED_TARGET_LIBS "")
|
||||||
set (BUILD_BATCHED False)
|
set (OSL_BUILD_BATCHED 0)
|
||||||
if (NOT USE_BATCHED STREQUAL "")
|
if (NOT USE_BATCHED STREQUAL "")
|
||||||
message (STATUS "Compiling with batched SIMD targets ${USE_BATCHED}")
|
message (STATUS "Compiling with batched SIMD targets ${USE_BATCHED}")
|
||||||
if (NOT USE_BATCHED STREQUAL "0")
|
if (NOT USE_BATCHED STREQUAL "0")
|
||||||
set (BUILD_BATCHED 1)
|
set (OSL_BUILD_BATCHED 1)
|
||||||
string (REPLACE "," ";" BATCHED_TARGET_LIST ${USE_BATCHED})
|
string (REPLACE "," ";" BATCHED_TARGET_LIST ${USE_BATCHED})
|
||||||
foreach (batched_target ${BATCHED_TARGET_LIST})
|
foreach (batched_target ${BATCHED_TARGET_LIST})
|
||||||
if (VERBOSE)
|
if (VERBOSE)
|
||||||
message (STATUS "BATCHED target: ${batched_target}")
|
message (STATUS "BATCHED target: ${batched_target}")
|
||||||
endif ()
|
endif ()
|
||||||
set (BATCHED_SUPPORT_DEFINES ${BATCHED_SUPPORT_DEFINES} "__OSL_SUPPORTS_${batched_target}")
|
list (APPEND BATCHED_SUPPORT_DEFINES "__OSL_SUPPORTS_${batched_target}")
|
||||||
endforeach()
|
endforeach()
|
||||||
else ()
|
else ()
|
||||||
message (STATUS "Compiling with NO batched SIMD targets, USE_BATCHED=0")
|
message (STATUS "Compiling with NO batched SIMD targets, USE_BATCHED=0")
|
||||||
@@ -377,15 +421,35 @@ option (CODECOV "Build code coverage tests" OFF)
|
|||||||
if (CODECOV AND (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG))
|
if (CODECOV AND (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG))
|
||||||
message (STATUS "Compiling for code coverage analysis")
|
message (STATUS "Compiling for code coverage analysis")
|
||||||
add_compile_options (-ftest-coverage -fprofile-arcs)
|
add_compile_options (-ftest-coverage -fprofile-arcs)
|
||||||
add_definitions ("-D${PROJ_NAME}_CODE_COVERAGE=1")
|
add_compile_definitions (${PROJ_NAME}_CODE_COVERAGE=1)
|
||||||
link_libraries(gcov)
|
link_libraries(gcov)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
|
||||||
|
###########################################################################
|
||||||
|
# Runtime profiling
|
||||||
|
#
|
||||||
|
set_cache (PROFILER "" "Build executables with profiler support (choices: gperftools)")
|
||||||
|
if (PROFILER STREQUAL "gperftools")
|
||||||
|
find_library(PROFILER_LIBRARIES NAMES profiler)
|
||||||
|
message (STATUS "Compiling for profiling with ${PROFILER}, found ${PROFILER_LIBRARIES}")
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
|
||||||
|
###########################################################################
|
||||||
|
# Build profiling
|
||||||
|
#
|
||||||
|
set_option (${PROJ_NAME}_BUILD_PROFILER "Profile the build process" OFF)
|
||||||
|
if (${PROJ_NAME}_BUILD_PROFILER AND CMAKE_COMPILER_IS_CLANG)
|
||||||
|
add_compile_options (-ftime-trace)
|
||||||
|
message (STATUS "Profiling the build process")
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
|
||||||
###########################################################################
|
###########################################################################
|
||||||
# Sanitizer options
|
# Sanitizer options
|
||||||
#
|
#
|
||||||
set (SANITIZE "" CACHE STRING "Build code using sanitizer (address, thread)")
|
set_cache (SANITIZE "" "Build code using sanitizer (address, thread, undefined)")
|
||||||
if (SANITIZE AND (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG))
|
if (SANITIZE AND (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG))
|
||||||
message (STATUS "Compiling for sanitizer=${SANITIZE}")
|
message (STATUS "Compiling for sanitizer=${SANITIZE}")
|
||||||
string (REPLACE "," ";" SANITIZE_FEATURE_LIST ${SANITIZE})
|
string (REPLACE "," ";" SANITIZE_FEATURE_LIST ${SANITIZE})
|
||||||
@@ -397,9 +461,9 @@ if (SANITIZE AND (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG))
|
|||||||
add_compile_options (-g -fno-omit-frame-pointer)
|
add_compile_options (-g -fno-omit-frame-pointer)
|
||||||
if (CMAKE_COMPILER_IS_GNUCC)
|
if (CMAKE_COMPILER_IS_GNUCC)
|
||||||
# turn on glibcxx extra annotations to find vector writes past end
|
# turn on glibcxx extra annotations to find vector writes past end
|
||||||
add_definitions ("-D_GLIBCXX_SANITIZE_VECTOR=1")
|
add_compile_definitions (_GLIBCXX_SANITIZE_VECTOR=1)
|
||||||
endif ()
|
endif ()
|
||||||
add_definitions ("-D${PROJECT_NAME}_SANITIZE=1")
|
add_compile_definitions (${PROJECT_NAME}_SANITIZE=1)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
|
||||||
@@ -422,10 +486,8 @@ if (CLANG_TIDY)
|
|||||||
find_program(CLANG_TIDY_EXE NAMES "clang-tidy"
|
find_program(CLANG_TIDY_EXE NAMES "clang-tidy"
|
||||||
DOC "Path to clang-tidy executable")
|
DOC "Path to clang-tidy executable")
|
||||||
message (STATUS "CLANG_TIDY_EXE ${CLANG_TIDY_EXE}")
|
message (STATUS "CLANG_TIDY_EXE ${CLANG_TIDY_EXE}")
|
||||||
if (CLANG_TIDY_EXE AND NOT ${CMAKE_VERSION} VERSION_LESS 3.6)
|
if (CLANG_TIDY_EXE)
|
||||||
set (CMAKE_CXX_CLANG_TIDY
|
set (CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_EXE}")
|
||||||
"${CLANG_TIDY_EXE}"
|
|
||||||
)
|
|
||||||
if (CLANG_TIDY_ARGS)
|
if (CLANG_TIDY_ARGS)
|
||||||
list (APPEND CMAKE_CXX_CLANG_TIDY ${CLANG_TIDY_ARGS})
|
list (APPEND CMAKE_CXX_CLANG_TIDY ${CLANG_TIDY_ARGS})
|
||||||
endif ()
|
endif ()
|
||||||
@@ -463,10 +525,6 @@ if (PROJECT_IS_TOP_LEVEL)
|
|||||||
set (CLANG_FORMAT_INCLUDES "src/*.cpp" "src/*.h" "src/*.cu"
|
set (CLANG_FORMAT_INCLUDES "src/*.cpp" "src/*.h" "src/*.cu"
|
||||||
CACHE STRING "Glob patterns to include for clang-format")
|
CACHE STRING "Glob patterns to include for clang-format")
|
||||||
set (CLANG_FORMAT_EXCLUDES
|
set (CLANG_FORMAT_EXCLUDES
|
||||||
# Files "imported and modified" that we don't want to reformat, so
|
|
||||||
# they continue to match their upstream versions.
|
|
||||||
"src/include/OSL/Imathx/*"
|
|
||||||
"src/include/OSL/matrix22.h"
|
|
||||||
# Header files in testsuite are almost certainly osl headers, not C++
|
# Header files in testsuite are almost certainly osl headers, not C++
|
||||||
"testsuite/*.h"
|
"testsuite/*.h"
|
||||||
# Header files in shaders are OSL, not C++
|
# Header files in shaders are OSL, not C++
|
||||||
@@ -505,7 +563,7 @@ endif ()
|
|||||||
set (EXTRA_CPP_ARGS "" CACHE STRING "Extra C++ command line definitions")
|
set (EXTRA_CPP_ARGS "" CACHE STRING "Extra C++ command line definitions")
|
||||||
if (EXTRA_CPP_ARGS)
|
if (EXTRA_CPP_ARGS)
|
||||||
message (STATUS "Extra C++ args: ${EXTRA_CPP_ARGS}")
|
message (STATUS "Extra C++ args: ${EXTRA_CPP_ARGS}")
|
||||||
add_compile_options ("${EXTRA_CPP_ARGS}")
|
add_compile_options (${EXTRA_CPP_ARGS})
|
||||||
endif()
|
endif()
|
||||||
set (EXTRA_DSO_LINK_ARGS "" CACHE STRING "Extra command line definitions when building DSOs")
|
set (EXTRA_DSO_LINK_ARGS "" CACHE STRING "Extra command line definitions when building DSOs")
|
||||||
|
|
||||||
@@ -513,29 +571,27 @@ set (EXTRA_DSO_LINK_ARGS "" CACHE STRING "Extra command line definitions when bu
|
|||||||
###########################################################################
|
###########################################################################
|
||||||
# Set the versioning for shared libraries.
|
# Set the versioning for shared libraries.
|
||||||
#
|
#
|
||||||
if (${PROJECT_NAME}_SUPPORTED_RELEASE)
|
if (${PROJECT_NAME}_SUPPORTED_RELEASE AND NOT SKBUILD)
|
||||||
# Supported releases guarantee ABI back-compatibility within the release
|
# Supported releases guarantee ABI back-compatibility within the release
|
||||||
# family, so SO versioning is major.minor.
|
# family, so SO versioning is major.minor.
|
||||||
set (SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
|
set (SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
|
||||||
CACHE STRING "Set the SO version for dynamic libraries")
|
CACHE STRING "Set the SO version for dynamic libraries")
|
||||||
else ()
|
else ()
|
||||||
# Development master makes no ABI stability guarantee, so we make the
|
# Main development branch makes no ABI stability guarantee, so we make the
|
||||||
# SO naming capture down to the major.minor.patch level.
|
# SO naming capture down to the major.minor.patch level.
|
||||||
set (SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}
|
set (SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}
|
||||||
CACHE STRING "Set the SO version for dynamic libraries")
|
CACHE STRING "Set the SO version for dynamic libraries")
|
||||||
endif ()
|
endif ()
|
||||||
if (VERBOSE)
|
message(VERBOSE "Setting SOVERSION to: ${SOVERSION}")
|
||||||
message(STATUS "Setting SOVERSION to: ${SOVERSION}")
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
|
|
||||||
###########################################################################
|
###########################################################################
|
||||||
# BUILD_SHARED_LIBS, if turned off, will disable building of .so/.dll
|
# BUILD_SHARED_LIBS, if turned off, will disable building of .so/.dll
|
||||||
# dynamic libraries and instead only build static libraries.
|
# dynamic libraries and instead only build static libraries.
|
||||||
#
|
#
|
||||||
option (BUILD_SHARED_LIBS "Build shared libraries (set to OFF to build static libs)" ON)
|
set_option (BUILD_SHARED_LIBS "Build shared libraries (set to OFF to build static libs)" ON)
|
||||||
if (NOT BUILD_SHARED_LIBS)
|
if (NOT BUILD_SHARED_LIBS)
|
||||||
add_definitions (-D${PROJECT_NAME}_STATIC_DEFINE=1)
|
add_compile_definitions (${PROJECT_NAME}_STATIC_DEFINE=1)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
|
||||||
@@ -560,7 +616,7 @@ endif ()
|
|||||||
# We expect our own CI runs to define env variable ${PROJECT_NAME}_CI
|
# We expect our own CI runs to define env variable ${PROJECT_NAME}_CI
|
||||||
#
|
#
|
||||||
if (DEFINED ENV{${PROJECT_NAME}_CI})
|
if (DEFINED ENV{${PROJECT_NAME}_CI})
|
||||||
add_definitions (-D${PROJ_NAME}_CI=1 -DBUILD_CI=1)
|
add_compile_definitions (${PROJ_NAME}_CI=1 BUILD_CI=1)
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
# Keep Mono framework from being incorrectly searched for include
|
# Keep Mono framework from being incorrectly searched for include
|
||||||
# files on GitHub Actions CI.
|
# files on GitHub Actions CI.
|
||||||
@@ -588,9 +644,7 @@ else ()
|
|||||||
# add the automatically determined parts of the RPATH that
|
# add the automatically determined parts of the RPATH that
|
||||||
# point to directories outside the build tree to the install RPATH
|
# point to directories outside the build tree to the install RPATH
|
||||||
set (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
set (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||||
if (VERBOSE)
|
message (VERBOSE "CMAKE_INSTALL_RPATH = ${CMAKE_INSTALL_RPATH}")
|
||||||
message (STATUS "CMAKE_INSTALL_RPATH = ${CMAKE_INSTALL_RPATH}")
|
|
||||||
endif ()
|
|
||||||
endif ()
|
endif ()
|
||||||
# OSL considerations because we run oslc in the course of building:
|
# OSL considerations because we run oslc in the course of building:
|
||||||
# Use (i.e. don't skip) the full RPATH for the build tree
|
# Use (i.e. don't skip) the full RPATH for the build tree
|
||||||
@@ -599,6 +653,11 @@ set (CMAKE_SKIP_BUILD_RPATH FALSE)
|
|||||||
set (CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
|
set (CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
|
||||||
|
|
||||||
|
|
||||||
|
###########################################################################
|
||||||
|
# Generate compile_commands.json for use by editors and tools.
|
||||||
|
set (CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
|
|
||||||
|
|
||||||
###########################################################################
|
###########################################################################
|
||||||
# Macro to install targets to the appropriate locations. Use this instead
|
# Macro to install targets to the appropriate locations. Use this instead
|
||||||
# of the install(TARGETS ...) signature. Note that it adds it to the
|
# of the install(TARGETS ...) signature. Note that it adds it to the
|
||||||
|
|||||||
@@ -3,9 +3,19 @@
|
|||||||
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||||
|
|
||||||
set ($OSL_EXTRA_NVCC_ARGS "" CACHE STRING "Custom args passed to nvcc when compiling CUDA code")
|
set ($OSL_EXTRA_NVCC_ARGS "" CACHE STRING "Custom args passed to nvcc when compiling CUDA code")
|
||||||
|
set (CUDA_OPT_FLAG_NVCC "-O3" CACHE STRING "The optimization level to use when compiling CUDA/C++ files with nvcc")
|
||||||
|
set (CUDA_OPT_FLAG_CLANG "-O3" CACHE STRING "The optimization level to use when compiling CUDA/C++ files with clang")
|
||||||
|
|
||||||
|
# FTZ is enabled by default since it offers the best performance,
|
||||||
|
# but it may be disabled to debug numerical issues, to better match
|
||||||
|
# host behavior, etc.
|
||||||
|
set (CUDA_NO_FTZ OFF CACHE BOOL "Do not enable force-to-zero when compiling for CUDA")
|
||||||
|
if (CUDA_NO_FTZ)
|
||||||
|
add_compile_definitions (DOSL_CUDA_NO_FTZ=1)
|
||||||
|
endif ()
|
||||||
|
|
||||||
# Compile a CUDA file to PTX using NVCC
|
# Compile a CUDA file to PTX using NVCC
|
||||||
function ( NVCC_COMPILE cuda_src extra_headers ptx_generated extra_nvcc_args )
|
function ( NVCC_COMPILE cuda_src extra_headers ptx_generated extra_nvcc_args extra_libs)
|
||||||
get_filename_component ( cuda_src_we ${cuda_src} NAME_WE )
|
get_filename_component ( cuda_src_we ${cuda_src} NAME_WE )
|
||||||
get_filename_component ( cuda_src_dir ${cuda_src} DIRECTORY )
|
get_filename_component ( cuda_src_dir ${cuda_src} DIRECTORY )
|
||||||
set (cuda_ptx "${CMAKE_CURRENT_BINARY_DIR}/${cuda_src_we}.ptx" )
|
set (cuda_ptx "${CMAKE_CURRENT_BINARY_DIR}/${cuda_src_we}.ptx" )
|
||||||
@@ -21,6 +31,18 @@ function ( NVCC_COMPILE cuda_src extra_headers ptx_generated extra_nvcc_args )
|
|||||||
list (TRANSFORM OpenImageIO_INCLUDES PREPEND -I
|
list (TRANSFORM OpenImageIO_INCLUDES PREPEND -I
|
||||||
OUTPUT_VARIABLE ALL_OpenImageIO_INCLUDES)
|
OUTPUT_VARIABLE ALL_OpenImageIO_INCLUDES)
|
||||||
|
|
||||||
|
if (NOT CUDA_NO_FTZ)
|
||||||
|
set (NVCC_FTZ_FLAG "--ftz=true")
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
set (EXTRA_INCLUDES "")
|
||||||
|
foreach (LIB ${extra_libs})
|
||||||
|
get_target_property(INCLUDES ${LIB} INTERFACE_INCLUDE_DIRECTORIES)
|
||||||
|
foreach (INCLUDE_DIR ${INCLUDES})
|
||||||
|
list (APPEND EXTRA_INCLUDES "-I${INCLUDE_DIR}")
|
||||||
|
endforeach()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
add_custom_command ( OUTPUT ${cuda_ptx}
|
add_custom_command ( OUTPUT ${cuda_ptx}
|
||||||
COMMAND ${CUDA_NVCC_EXECUTABLE}
|
COMMAND ${CUDA_NVCC_EXECUTABLE}
|
||||||
"-I${OPTIX_INCLUDES}"
|
"-I${OPTIX_INCLUDES}"
|
||||||
@@ -29,20 +51,21 @@ function ( NVCC_COMPILE cuda_src extra_headers ptx_generated extra_nvcc_args )
|
|||||||
"-I${CMAKE_BINARY_DIR}/include"
|
"-I${CMAKE_BINARY_DIR}/include"
|
||||||
"-I${PROJECT_SOURCE_DIR}/src/include"
|
"-I${PROJECT_SOURCE_DIR}/src/include"
|
||||||
"-I${PROJECT_SOURCE_DIR}/src/cuda_common"
|
"-I${PROJECT_SOURCE_DIR}/src/cuda_common"
|
||||||
|
${EXTRA_INCLUDES}
|
||||||
${ALL_OpenImageIO_INCLUDES}
|
${ALL_OpenImageIO_INCLUDES}
|
||||||
${ALL_IMATH_INCLUDES}
|
${ALL_IMATH_INCLUDES}
|
||||||
${ALL_OPENEXR_INCLUDES}
|
|
||||||
"-I${Boost_INCLUDE_DIRS}"
|
|
||||||
"-DFMT_DEPRECATED=\"\""
|
"-DFMT_DEPRECATED=\"\""
|
||||||
${LLVM_COMPILE_FLAGS}
|
${LLVM_COMPILE_FLAGS}
|
||||||
-DOSL_USE_FAST_MATH=1
|
-DOSL_USE_FAST_MATH=1
|
||||||
-m64 -arch ${CUDA_TARGET_ARCH} -ptx
|
-m64 -arch ${CUDA_TARGET_ARCH} -ptx
|
||||||
--std=c++14 -dc -O3 --use_fast_math --expt-relaxed-constexpr
|
--std=c++${CMAKE_CXX_STANDARD}
|
||||||
|
-dc --use_fast_math ${CUDA_OPT_FLAG_NVCC} ${NVCC_FTZ_FLAG}
|
||||||
|
--expt-relaxed-constexpr
|
||||||
${extra_nvcc_args}
|
${extra_nvcc_args}
|
||||||
${OSL_EXTRA_NVCC_ARGS}
|
${OSL_EXTRA_NVCC_ARGS}
|
||||||
${cuda_src} -o ${cuda_ptx}
|
${cuda_src} -o ${cuda_ptx}
|
||||||
MAIN_DEPENDENCY ${cuda_src}
|
MAIN_DEPENDENCY ${cuda_src}
|
||||||
DEPENDS ${cuda_src} ${cuda_headers} oslexec
|
DEPENDS ${cuda_src} ${cuda_headers} ${extra_libs} oslexec
|
||||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" )
|
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" )
|
||||||
endfunction ()
|
endfunction ()
|
||||||
|
|
||||||
@@ -55,13 +78,11 @@ function ( MAKE_CUDA_BITCODE src suffix generated_bc extra_clang_args )
|
|||||||
|
|
||||||
# Setup the compile flags
|
# Setup the compile flags
|
||||||
get_property (CURRENT_DEFINITIONS DIRECTORY PROPERTY COMPILE_DEFINITIONS)
|
get_property (CURRENT_DEFINITIONS DIRECTORY PROPERTY COMPILE_DEFINITIONS)
|
||||||
if (VERBOSE)
|
message (VERBOSE "Current #defines are ${CURRENT_DEFINITIONS}")
|
||||||
message (STATUS "Current #defines are ${CURRENT_DEFINITIONS}")
|
|
||||||
endif ()
|
|
||||||
foreach (def ${CURRENT_DEFINITIONS})
|
foreach (def ${CURRENT_DEFINITIONS})
|
||||||
set (LLVM_COMPILE_FLAGS ${LLVM_COMPILE_FLAGS} "-D${def}")
|
set (LLVM_COMPILE_FLAGS ${LLVM_COMPILE_FLAGS} "-D${def}")
|
||||||
endforeach()
|
endforeach()
|
||||||
set (LLVM_COMPILE_FLAGS ${LLVM_COMPILE_FLAGS} ${SIMD_COMPILE_FLAGS} ${CSTD_FLAGS})
|
set (LLVM_COMPILE_FLAGS ${LLVM_COMPILE_FLAGS} ${CSTD_FLAGS})
|
||||||
|
|
||||||
# Setup the bitcode generator
|
# Setup the bitcode generator
|
||||||
if (NOT LLVM_BC_GENERATOR)
|
if (NOT LLVM_BC_GENERATOR)
|
||||||
@@ -76,9 +97,7 @@ function ( MAKE_CUDA_BITCODE src suffix generated_bc extra_clang_args )
|
|||||||
if (NOT LLVM_BC_GENERATOR)
|
if (NOT LLVM_BC_GENERATOR)
|
||||||
message (FATAL_ERROR "You must have a valid llvm bitcode generator (clang++) somewhere.")
|
message (FATAL_ERROR "You must have a valid llvm bitcode generator (clang++) somewhere.")
|
||||||
endif ()
|
endif ()
|
||||||
if (VERBOSE)
|
message (VERBOSE "Using LLVM_BC_GENERATOR ${LLVM_BC_GENERATOR} to generate bitcode.")
|
||||||
message (STATUS "Using LLVM_BC_GENERATOR ${LLVM_BC_GENERATOR} to generate bitcode.")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (NOT LLVM_AS_TOOL)
|
if (NOT LLVM_AS_TOOL)
|
||||||
find_program (LLVM_AS_TOOL NAMES "llvm-as"
|
find_program (LLVM_AS_TOOL NAMES "llvm-as"
|
||||||
@@ -94,16 +113,41 @@ function ( MAKE_CUDA_BITCODE src suffix generated_bc extra_clang_args )
|
|||||||
NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_ENVIRONMENT_PATH)
|
NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_ENVIRONMENT_PATH)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
if (NOT LLVM_LLC_TOOL)
|
||||||
# fix compilation error when using MSVC
|
find_program (LLVM_LLC_TOOL NAMES "llc"
|
||||||
set (CLANG_MSVC_FIX "-DBOOST_CONFIG_REQUIRES_THREADS_HPP")
|
PATHS "${LLVM_DIRECTORY}/bin" "${LLVM_DIRECTORY}/tools/llvm"
|
||||||
|
NO_CMAKE_PATH NO_DEFAULT_PATH NO_CMAKE_SYSTEM_PATH
|
||||||
|
NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_ENVIRONMENT_PATH)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
if (NOT LLVM_OPT_TOOL)
|
||||||
|
find_program (LLVM_OPT_TOOL NAMES "opt"
|
||||||
|
PATHS "${LLVM_DIRECTORY}/bin" "${LLVM_DIRECTORY}/tools/llvm"
|
||||||
|
NO_CMAKE_PATH NO_DEFAULT_PATH NO_CMAKE_SYSTEM_PATH
|
||||||
|
NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_ENVIRONMENT_PATH)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
||||||
# these are warnings triggered by the dllimport/export attributes not being supported when
|
# 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
|
# compiling for Cuda. When all 3rd parties have their export macro fixed these warnings
|
||||||
# can be restored.
|
# can be restored.
|
||||||
set (CLANG_MSVC_FIX "${CLANG_MSVC_FIX} -Wno-ignored-attributes -Wno-unknown-attributes")
|
set (CLANG_MSVC_FIX -Wno-ignored-attributes -Wno-unknown-attributes)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
if (NOT CUDA_NO_FTZ)
|
||||||
|
set (CLANG_FTZ_FLAG "-fcuda-flush-denormals-to-zero")
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
if ("${CUDA_VERSION}" VERSION_GREATER_EQUAL "12.0")
|
||||||
|
# The textureReference API was removed in CUDA 12.0, but it's still referenced
|
||||||
|
# in the clang headers, so compilation will fail with 12.0 and newer toolkits
|
||||||
|
# due to the missing definitions.
|
||||||
|
#
|
||||||
|
# We don't actually require any of the clang CUDA texture intrinsics, so we can
|
||||||
|
# side-step the issue by preventing them from being included by the preprocessor.
|
||||||
|
set (CUDA_TEXREF_FIX "-D__CLANG_CUDA_TEXTURE_INTRINSICS_H__")
|
||||||
|
endif()
|
||||||
|
|
||||||
list (TRANSFORM IMATH_INCLUDES PREPEND -I
|
list (TRANSFORM IMATH_INCLUDES PREPEND -I
|
||||||
OUTPUT_VARIABLE ALL_IMATH_INCLUDES)
|
OUTPUT_VARIABLE ALL_IMATH_INCLUDES)
|
||||||
list (TRANSFORM OPENEXR_INCLUDES PREPEND -I
|
list (TRANSFORM OPENEXR_INCLUDES PREPEND -I
|
||||||
@@ -116,18 +160,18 @@ function ( MAKE_CUDA_BITCODE src suffix generated_bc extra_clang_args )
|
|||||||
"-I${OPTIX_INCLUDES}"
|
"-I${OPTIX_INCLUDES}"
|
||||||
"-I${CUDA_INCLUDES}"
|
"-I${CUDA_INCLUDES}"
|
||||||
"-I${CMAKE_CURRENT_SOURCE_DIR}"
|
"-I${CMAKE_CURRENT_SOURCE_DIR}"
|
||||||
|
"-I${CMAKE_SOURCE_DIR}/src/liboslexec"
|
||||||
"-I${CMAKE_BINARY_DIR}/include"
|
"-I${CMAKE_BINARY_DIR}/include"
|
||||||
"-I${PROJECT_SOURCE_DIR}/src/include"
|
"-I${PROJECT_SOURCE_DIR}/src/include"
|
||||||
"-I${PROJECT_SOURCE_DIR}/src/cuda_common"
|
"-I${PROJECT_SOURCE_DIR}/src/cuda_common"
|
||||||
${ALL_OpenImageIO_INCLUDES}
|
${ALL_OpenImageIO_INCLUDES}
|
||||||
${ALL_IMATH_INCLUDES}
|
${ALL_IMATH_INCLUDES}
|
||||||
${ALL_OPENEXR_INCLUDES}
|
${ALL_OPENEXR_INCLUDES}
|
||||||
"-I${Boost_INCLUDE_DIRS}"
|
${LLVM_COMPILE_FLAGS} ${CUDA_LIB_FLAGS} ${CLANG_MSVC_FIX} ${CUDA_TEXREF_FIX}
|
||||||
${LLVM_COMPILE_FLAGS} ${CUDA_LIB_FLAGS} ${CLANG_MSVC_FIX}
|
|
||||||
-D__CUDACC__ -DOSL_COMPILING_TO_BITCODE=1 -DNDEBUG -DOIIO_NO_SSE -D__CUDADEVRT_INTERNAL__
|
-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}
|
--language=cuda --cuda-device-only --cuda-gpu-arch=${CUDA_TARGET_ARCH}
|
||||||
-Wno-deprecated-register -Wno-format-security
|
-Wno-deprecated-register -Wno-format-security
|
||||||
-O3 -fno-math-errno -ffast-math -S -emit-llvm ${extra_clang_args}
|
-fno-math-errno -ffast-math ${CUDA_OPT_FLAG_CLANG} ${CLANG_FTZ_FLAG} -S -emit-llvm ${extra_clang_args}
|
||||||
${src} -o ${asm_cuda}
|
${src} -o ${asm_cuda}
|
||||||
COMMAND ${LLVM_AS_TOOL} -f -o ${bc_cuda} ${asm_cuda}
|
COMMAND ${LLVM_AS_TOOL} -f -o ${bc_cuda} ${asm_cuda}
|
||||||
DEPENDS ${exec_headers} ${PROJECT_PUBLIC_HEADERS} ${src}
|
DEPENDS ${exec_headers} ${PROJECT_PUBLIC_HEADERS} ${src}
|
||||||
@@ -144,8 +188,47 @@ function ( LLVM_COMPILE_CUDA llvm_src headers prefix llvm_bc_cpp_generated extra
|
|||||||
MAKE_CUDA_BITCODE (${llvm_src} "" llvm_bc "${extra_clang_args}")
|
MAKE_CUDA_BITCODE (${llvm_src} "" llvm_bc "${extra_clang_args}")
|
||||||
|
|
||||||
add_custom_command (OUTPUT ${llvm_bc_cpp}
|
add_custom_command (OUTPUT ${llvm_bc_cpp}
|
||||||
COMMAND ${Python_EXECUTABLE} "${CMAKE_SOURCE_DIR}/src/build-scripts/serialize-bc.py" ${llvm_bc} ${llvm_bc_cpp} ${prefix}
|
COMMAND ${Python3_EXECUTABLE} "${CMAKE_SOURCE_DIR}/src/build-scripts/serialize-bc.py" ${llvm_bc} ${llvm_bc_cpp} ${prefix}
|
||||||
MAIN_DEPENDENCY ${llvm_src}
|
MAIN_DEPENDENCY ${llvm_src}
|
||||||
DEPENDS "${CMAKE_SOURCE_DIR}/src/build-scripts/serialize-bc.py" ${llvm_src} ${headers} ${llvm_bc}
|
DEPENDS "${CMAKE_SOURCE_DIR}/src/build-scripts/serialize-bc.py" ${llvm_src} ${headers} ${llvm_bc}
|
||||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" )
|
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" )
|
||||||
endfunction ()
|
endfunction ()
|
||||||
|
|
||||||
|
function ( MAKE_EMBEDDED_CPP symbol_name output_cpp input_file )
|
||||||
|
add_custom_command ( OUTPUT ${output_cpp}
|
||||||
|
COMMAND ${Python3_EXECUTABLE} "${CMAKE_SOURCE_DIR}/src/build-scripts/serialize-bc.py"
|
||||||
|
${input_file} ${output_cpp} "${symbol_name}"
|
||||||
|
|
||||||
|
DEPENDS "${CMAKE_SOURCE_DIR}/src/build-scripts/serialize-bc.py" ${linked_bc}
|
||||||
|
${input_file} ${exec_headers} ${PROJECT_PUBLIC_HEADERS}
|
||||||
|
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" )
|
||||||
|
endfunction ()
|
||||||
|
|
||||||
|
function ( CUDA_SHADEOPS_COMPILE prefix output_bc output_ptx input_srcs headers )
|
||||||
|
set (linked_bc "${CMAKE_CURRENT_BINARY_DIR}/linked_${prefix}.bc")
|
||||||
|
set (linked_ptx "${CMAKE_CURRENT_BINARY_DIR}/${prefix}.ptx")
|
||||||
|
set (${output_bc} ${linked_bc} PARENT_SCOPE )
|
||||||
|
set (${output_ptx} ${linked_ptx} PARENT_SCOPE )
|
||||||
|
|
||||||
|
foreach ( shadeops_src ${input_srcs} )
|
||||||
|
MAKE_CUDA_BITCODE ( ${shadeops_src} "_cuda" shadeops_bc "" )
|
||||||
|
list ( APPEND shadeops_bc_list ${shadeops_bc} )
|
||||||
|
endforeach ()
|
||||||
|
|
||||||
|
# There is no --nvptx-assign-valid-global-names flag for the new
|
||||||
|
# pass manager, but it appears to run this pass by default.
|
||||||
|
string(REPLACE "-O" "O" opt_tool_flags ${CUDA_OPT_FLAG_CLANG})
|
||||||
|
set (opt_tool_flags -passes="default<${opt_tool_flags}>")
|
||||||
|
|
||||||
|
# Link all of the individual LLVM bitcode files, and emit PTX for the linked bitcode
|
||||||
|
add_custom_command ( OUTPUT ${linked_bc} ${linked_ptx}
|
||||||
|
COMMAND ${LLVM_LINK_TOOL} ${shadeops_bc_list} -o ${linked_bc}
|
||||||
|
COMMAND ${LLVM_OPT_TOOL} ${opt_tool_flags} ${linked_bc} -o ${linked_bc}
|
||||||
|
COMMAND ${LLVM_LLC_TOOL} --march=nvptx64 -mcpu=${CUDA_TARGET_ARCH} ${linked_bc} -o ${linked_ptx}
|
||||||
|
# This script converts all of the .weak functions defined in the PTX into .visible functions.
|
||||||
|
COMMAND ${Python3_EXECUTABLE} "${CMAKE_SOURCE_DIR}/src/build-scripts/process-ptx.py"
|
||||||
|
${linked_ptx} ${linked_ptx}
|
||||||
|
DEPENDS ${shadeops_bc_list} ${exec_headers} ${PROJECT_PUBLIC_HEADERS} ${input_srcs} ${headers}
|
||||||
|
"${CMAKE_SOURCE_DIR}/src/build-scripts/process-ptx.py"
|
||||||
|
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" )
|
||||||
|
endfunction ()
|
||||||
|
|||||||
@@ -0,0 +1,815 @@
|
|||||||
|
# Copyright Contributors to the Open Shading Language project.
|
||||||
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
|
||||||
|
|
||||||
|
|
||||||
|
set_cache (${PROJECT_NAME}_REQUIRED_DEPS ""
|
||||||
|
"Additional dependencies to consider required (semicolon-separated list, or ALL)")
|
||||||
|
set_cache (${PROJECT_NAME}_OPTIONAL_DEPS ""
|
||||||
|
"Additional dependencies to consider optional (semicolon-separated list, or ALL)")
|
||||||
|
set_option (${PROJECT_NAME}_ALWAYS_PREFER_CONFIG
|
||||||
|
"Prefer a dependency's exported config file if it's available" OFF)
|
||||||
|
|
||||||
|
set_cache (${PROJECT_NAME}_BUILD_MISSING_DEPS ""
|
||||||
|
"Try to download and build any of these missing dependencies (or 'all' or 'required')")
|
||||||
|
set_cache (${PROJECT_NAME}_BUILD_LOCAL_DEPS ""
|
||||||
|
"Force local builds of these dependencies if possible (or 'all')")
|
||||||
|
|
||||||
|
set_cache (${PROJECT_NAME}_LOCAL_DEPS_ROOT "${PROJECT_BINARY_DIR}/deps"
|
||||||
|
"Directory were we do local builds of dependencies")
|
||||||
|
list (APPEND CMAKE_PREFIX_PATH ${${PROJECT_NAME}_LOCAL_DEPS_ROOT}/dist)
|
||||||
|
include_directories(BEFORE ${${PROJECT_NAME}_LOCAL_DEPS_ROOT}/include)
|
||||||
|
|
||||||
|
# Build type for locally built dependencies. Default to the same build type
|
||||||
|
# as the current project.
|
||||||
|
set_cache (${PROJECT_NAME}_DEPENDENCY_BUILD_TYPE ${CMAKE_BUILD_TYPE}
|
||||||
|
"Build type for locally built dependencies")
|
||||||
|
set_option (${PROJECT_NAME}_DEPENDENCY_BUILD_VERBOSE
|
||||||
|
"Make dependency builds extra verbose" OFF)
|
||||||
|
if (MSVC)
|
||||||
|
# I haven't been able to get Windows local dependency builds to work with
|
||||||
|
# static libraries, so default to shared libraries on Windows until we can
|
||||||
|
# figure it out.
|
||||||
|
set_cache (LOCAL_BUILD_SHARED_LIBS_DEFAULT ON
|
||||||
|
DOC "Should a local dependency build, if necessary, build shared libraries" ADVANCED)
|
||||||
|
else ()
|
||||||
|
# On non-Windows, default to static libraries for local builds.
|
||||||
|
set_cache (LOCAL_BUILD_SHARED_LIBS_DEFAULT OFF
|
||||||
|
DOC "Should a local dependency build, if necessary, build shared libraries" ADVANCED)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
# Search for regular libraries before searching for macOS frameworks.
|
||||||
|
if (APPLE)
|
||||||
|
set_cache (CMAKE_FIND_FRAMEWORK LAST
|
||||||
|
DOC "Set relative priority of finding frameworks vs. regular libraries" ADVANCED)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
set_option (${PROJECT_NAME}_DEPENDENCY_BUILD_ALLOW_UNVERIFIED_TAGS
|
||||||
|
"Allow dependency auto-build to use unverified tags -- Dangerous" OFF)
|
||||||
|
|
||||||
|
|
||||||
|
# Track all build deps we find with checked_find_package
|
||||||
|
set (CFP_ALL_BUILD_DEPS_FOUND "")
|
||||||
|
set (CFP_EXTERNAL_BUILD_DEPS_FOUND "")
|
||||||
|
|
||||||
|
# Track all build deps we failed to find with checked_find_package
|
||||||
|
set (CFP_ALL_BUILD_DEPS_NOTFOUND "")
|
||||||
|
set (CFP_LOCALLY_BUILDABLE_DEPS_NOTFOUND "")
|
||||||
|
|
||||||
|
# Track all build deps we found but were of inadequate version
|
||||||
|
set (CFP_ALL_BUILD_DEPS_BADVERSION "")
|
||||||
|
set (CFP_LOCALLY_BUILDABLE_DEPS_BADVERSION "")
|
||||||
|
|
||||||
|
# Which dependencies did we build locally
|
||||||
|
set (CFP_LOCALLY_BUILT_DEPS "")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Utility function to list the names and values of all variables matching
|
||||||
|
# the pattern (case-insensitive)
|
||||||
|
function (dump_matching_variables pattern)
|
||||||
|
string (TOLOWER ${pattern} _pattern_lower)
|
||||||
|
get_cmake_property(_allvars VARIABLES)
|
||||||
|
list (SORT _allvars)
|
||||||
|
foreach (_var IN LISTS _allvars)
|
||||||
|
string (TOLOWER ${_var} _var_lower)
|
||||||
|
if (_var_lower MATCHES ${_pattern_lower})
|
||||||
|
message (STATUS " ${_var} = ${${_var}}")
|
||||||
|
endif ()
|
||||||
|
endforeach ()
|
||||||
|
endfunction ()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Utility: if `condition` is true, append `addition` to variable `var`
|
||||||
|
macro (string_append_if var condition addition)
|
||||||
|
# message (STATUS "string_append_if ${var} ${condition}='${${condition}}' '${addition}'")
|
||||||
|
if (${condition})
|
||||||
|
string (APPEND ${var} ${addition})
|
||||||
|
endif ()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Helper: Print a report about missing dependencies and give instructions on
|
||||||
|
# how to turn on automatic local dependency building.
|
||||||
|
function (print_package_notfound_report)
|
||||||
|
message (STATUS)
|
||||||
|
message (STATUS "${ColorBoldYellow}=========================================================================${ColorReset}")
|
||||||
|
message (STATUS "${ColorBoldYellow}= Dependency report =${ColorReset}")
|
||||||
|
message (STATUS "${ColorBoldYellow}=========================================================================${ColorReset}")
|
||||||
|
message (STATUS)
|
||||||
|
if (CFP_EXTERNAL_BUILD_DEPS_FOUND)
|
||||||
|
message (STATUS "${ColorBoldWhite}The following dependencies were found externally:${ColorReset}")
|
||||||
|
list (SORT CFP_EXTERNAL_BUILD_DEPS_FOUND CASE INSENSITIVE)
|
||||||
|
list (REMOVE_DUPLICATES CFP_EXTERNAL_BUILD_DEPS_FOUND)
|
||||||
|
foreach (_pkg IN LISTS CFP_EXTERNAL_BUILD_DEPS_FOUND)
|
||||||
|
set (_msg "${_pkg} ${${_pkg}_VERSION} ")
|
||||||
|
string_append_if (_msg ${_pkg}_REQUIRED " (REQUIRED)")
|
||||||
|
message (STATUS " ${_msg}")
|
||||||
|
endforeach ()
|
||||||
|
endif ()
|
||||||
|
if (CFP_ALL_BUILD_DEPS_BADVERSION)
|
||||||
|
message (STATUS "${ColorBoldWhite}The following dependencies were found but were too old:${ColorReset}")
|
||||||
|
list (SORT CFP_ALL_BUILD_DEPS_BADVERSION CASE INSENSITIVE)
|
||||||
|
list (REMOVE_DUPLICATES CFP_ALL_BUILD_DEPS_BADVERSION)
|
||||||
|
foreach (_pkg IN LISTS CFP_ALL_BUILD_DEPS_BADVERSION)
|
||||||
|
set (_msg "${_pkg}")
|
||||||
|
string_append_if (_msg ${_pkg}_REQUIRED " (REQUIRED)")
|
||||||
|
string_append_if (_msg ${_pkg}_NOT_FOUND_EXPLANATION " ${_pkg}_NOT_FOUND_EXPLANATION")
|
||||||
|
if (_pkg IN_LIST CFP_LOCALLY_BUILT_DEPS)
|
||||||
|
string (APPEND _msg " ${ColorMagenta}(${${_pkg}_VERSION} BUILT LOCALLY)${ColorReset} in ${${_pkg}_build_elapsed_time}s)${ColorReset}")
|
||||||
|
endif ()
|
||||||
|
message (STATUS " ${_msg}")
|
||||||
|
endforeach ()
|
||||||
|
endif ()
|
||||||
|
if (CFP_ALL_BUILD_DEPS_NOTFOUND)
|
||||||
|
message (STATUS "${ColorBoldWhite}The following dependencies were not found:${ColorReset}")
|
||||||
|
list (SORT CFP_ALL_BUILD_DEPS_NOTFOUND CASE INSENSITIVE)
|
||||||
|
list (REMOVE_DUPLICATES CFP_ALL_BUILD_DEPS_NOTFOUND)
|
||||||
|
foreach (_pkg IN LISTS CFP_ALL_BUILD_DEPS_NOTFOUND)
|
||||||
|
set (_msg "${_pkg} ${_${_pkg}_version_range}")
|
||||||
|
string_append_if (_msg ${_pkg}_REQUIRED " (REQUIRED)")
|
||||||
|
string_append_if (_msg ${_pkg}_NOT_FOUND_EXPLANATION " ${_pkg}_NOT_FOUND_EXPLANATION")
|
||||||
|
if (_pkg IN_LIST CFP_LOCALLY_BUILT_DEPS)
|
||||||
|
string (APPEND _msg " ${ColorMagenta}(${${_pkg}_VERSION} BUILT LOCALLY in ${${_pkg}_build_elapsed_time}s)${ColorReset}")
|
||||||
|
endif ()
|
||||||
|
message (STATUS " ${_msg}")
|
||||||
|
endforeach ()
|
||||||
|
endif ()
|
||||||
|
if (CFP_LOCALLY_BUILDABLE_DEPS_NOTFOUND OR CFP_LOCALLY_BUILDABLE_DEPS_BADVERSION)
|
||||||
|
message (STATUS)
|
||||||
|
message (STATUS "${ColorBoldWhite}For some of these, we can build them locally:${ColorReset}")
|
||||||
|
foreach (_pkg IN LISTS CFP_LOCALLY_BUILDABLE_DEPS_NOTFOUND CFP_LOCALLY_BUILDABLE_DEPS_BADVERSION)
|
||||||
|
message (STATUS " ${_pkg}")
|
||||||
|
endforeach ()
|
||||||
|
message (STATUS "${ColorBoldWhite}To build them automatically if not found, build again with option:${ColorReset}")
|
||||||
|
message (STATUS " ${ColorBoldGreen}-D${PROJECT_NAME}_BUILD_MISSING_DEPS=required${ColorReset}")
|
||||||
|
message (STATUS " or")
|
||||||
|
message (STATUS " ${ColorBoldGreen}-D${PROJECT_NAME}_BUILD_MISSING_DEPS=all${ColorReset}")
|
||||||
|
endif ()
|
||||||
|
message (STATUS)
|
||||||
|
message (STATUS "${ColorBoldYellow}=========================================================================${ColorReset}")
|
||||||
|
message (STATUS)
|
||||||
|
endfunction ()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Helper: called if a package is not found, print error messages, including
|
||||||
|
# a fatal error if the package was required.
|
||||||
|
function (handle_package_notfound pkgname required)
|
||||||
|
message (STATUS "${ColorRed}${pkgname} library not found ${ColorReset}")
|
||||||
|
if (${pkgname}_ROOT)
|
||||||
|
message (STATUS " ${pkgname}_ROOT was: ${${pkgname}_ROOT}")
|
||||||
|
elseif (DEFINED ENV{${pkgname}_ROOT})
|
||||||
|
message (STATUS " ENV ${pkgname}_ROOT was: $ENV{${pkgname}_ROOT}")
|
||||||
|
else ()
|
||||||
|
message (STATUS " Try setting ${pkgname}_ROOT ?")
|
||||||
|
endif ()
|
||||||
|
if (EXISTS "${PROJECT_SOURCE_DIR}/src/build-scripts/build_${pkgname}.bash")
|
||||||
|
message (STATUS " Maybe this will help: src/build-scripts/build_${pkgname}.bash")
|
||||||
|
elseif (EXISTS "${PROJECT_SOURCE_DIR}/src/build-scripts/build_${pkgname_upper}.bash")
|
||||||
|
message (STATUS " Maybe this will help: src/build-scripts/build_${pkgname_upper}.bash")
|
||||||
|
elseif (EXISTS "${PROJECT_SOURCE_DIR}/src/build-scripts/build_${pkgname_lower}.bash")
|
||||||
|
message (STATUS " Maybe this will help: src/build-scripts/build_${pkgname_lower}.bash")
|
||||||
|
elseif (EXISTS "${PROJECT_SOURCE_DIR}/src/build-scripts/build_lib${pkgname_lower}.bash")
|
||||||
|
message (STATUS " Maybe this will help: src/build-scripts/build_lib${pkgname_lower}.bash")
|
||||||
|
endif ()
|
||||||
|
if (required)
|
||||||
|
print_package_notfound_report()
|
||||||
|
message (FATAL_ERROR "${pkgname} is required, aborting.")
|
||||||
|
endif ()
|
||||||
|
endfunction ()
|
||||||
|
|
||||||
|
|
||||||
|
# Check whether the package's version (in pkgversion) lies within versionmin
|
||||||
|
# and versionmax (inclusive). Store TRUE result variable if the version was in
|
||||||
|
# range, FALSE if it was out of range. If it did not match, clear a bunch of
|
||||||
|
# variables that may have been set by the find_package call (including
|
||||||
|
# clearing the package's FOUND variable).
|
||||||
|
function (reject_out_of_range_versions pkgname pkgversion versionmin versionmax result)
|
||||||
|
set (${result} FALSE PARENT_SCOPE)
|
||||||
|
string (TOUPPER ${pkgname} pkgname_upper)
|
||||||
|
# message (STATUS "roorv: ${pkgname} ${pkgversion} ${versionmin} ${versionmax}")
|
||||||
|
if (NOT ${pkgname}_FOUND AND NOT ${pkgname_upper}_FOUND)
|
||||||
|
message (STATUS "${pkgname} was not found")
|
||||||
|
elseif ("${pkgversion}" STREQUAL "")
|
||||||
|
message (ERROR "${pkgname} found but version was empty")
|
||||||
|
elseif (pkgversion VERSION_LESS versionmin
|
||||||
|
OR pkgversion VERSION_GREATER versionmax)
|
||||||
|
# message (STATUS "${ColorRed}${pkgname} ${pkgversion} is outside the required range ${versionmin}...${versionmax} ${ColorReset}")
|
||||||
|
# list (APPEND CFP_ALL_BUILD_DEPS_BADVERSION ${pkgname})
|
||||||
|
# if (${pkgname}_local_build_script_exists)
|
||||||
|
# list (APPEND CFP_LOCALLY_BUILDABLE_DEPS_BADVERSION ${pkgname})
|
||||||
|
# endif ()
|
||||||
|
if (versionmax VERSION_GREATER_EQUAL 10000)
|
||||||
|
set (${pkgname}_NOT_FOUND_EXPLANATION
|
||||||
|
"(found ${pkgversion}, needed >= ${versionmin})" PARENT_SCOPE)
|
||||||
|
else ()
|
||||||
|
set (${pkgname}_NOT_FOUND_EXPLANATION
|
||||||
|
"(found ${pkgversion}, needed ${versionmin} ... ${versionmax})" PARENT_SCOPE)
|
||||||
|
endif ()
|
||||||
|
unset (${pkgname}_FOUND PARENT_SCOPE)
|
||||||
|
unset (${pkgname}_VERSION PARENT_SCOPE)
|
||||||
|
unset (${pkgname}_INCLUDE PARENT_SCOPE)
|
||||||
|
unset (${pkgname}_INCLUDES PARENT_SCOPE)
|
||||||
|
unset (${pkgname}_LIBRARY PARENT_SCOPE)
|
||||||
|
unset (${pkgname}_LIBRARIES PARENT_SCOPE)
|
||||||
|
unset (${pkgname_upper}_FOUND PARENT_SCOPE)
|
||||||
|
unset (${pkgname_upper}_VERSION PARENT_SCOPE)
|
||||||
|
unset (${pkgname_upper}_INCLUDE PARENT_SCOPE)
|
||||||
|
unset (${pkgname_upper}_INCLUDES PARENT_SCOPE)
|
||||||
|
unset (${pkgname_upper}_LIBRARY PARENT_SCOPE)
|
||||||
|
unset (${pkgname_upper}_LIBRARIES PARENT_SCOPE)
|
||||||
|
else ()
|
||||||
|
# Version matched the range
|
||||||
|
set (${result} TRUE PARENT_SCOPE)
|
||||||
|
# message (STATUS "${pkgname} ${pkgversion} is INSIDE the required range ${versionmin}...${versionmax}")
|
||||||
|
endif ()
|
||||||
|
endfunction ()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# 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_compile_definitions
|
||||||
|
# if the package is found.
|
||||||
|
# * Optional SETVARIABLES <id>... is a list of CMake variables to set to
|
||||||
|
# TRUE if the package is found (they will not be set or changed if the
|
||||||
|
# package is not 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.
|
||||||
|
# * Optional CONFIG, if supplied, only accepts the package from an
|
||||||
|
# exported config and never uses a FindPackage.cmake module.
|
||||||
|
# * Optional PREFER_CONFIG, if supplied, tries to use an exported config
|
||||||
|
# file from the package before using a FindPackage.cmake module.
|
||||||
|
# * Optional DEBUG turns on extra debugging information related to how
|
||||||
|
# this package is found.
|
||||||
|
# * Found package "name version" or "name NONE" are accumulated in the list
|
||||||
|
# CFP_ALL_BUILD_DEPS_FOUND. If the optional NO_RECORD_NOTFOUND is
|
||||||
|
# supplied, un-found packags will not be recorded.
|
||||||
|
# * Optional BUILD_LOCAL, if supplied, if followed by a token that specifies
|
||||||
|
# the conditions under which to build the package locally by including a
|
||||||
|
# script included in src/cmake/build_${pkgname}.cmake. If the condition is
|
||||||
|
# "always", it will attempt to do so unconditionally. If "missing", it
|
||||||
|
# will only do so if the package is not found. Also note that if the
|
||||||
|
# global ${PROJECT_NAME}_BUILD_LOCAL_DEPS contains the package name or
|
||||||
|
# is "all", it will behave as if set to "always", and if the variable
|
||||||
|
# ${PROJECT_NAME}_BUILD_MISSING_DEPS contains the package name or is
|
||||||
|
# "all", it will behave as if set to "missing".
|
||||||
|
# * Optional NO_FP_RANGE_CHECK avoids passing the version range to
|
||||||
|
# find_package itself.
|
||||||
|
#
|
||||||
|
# Explanation about local builds:
|
||||||
|
#
|
||||||
|
# If the package isn't found externally in the usual places or doesn't meet
|
||||||
|
# the version criteria, we check for the existance of a file at
|
||||||
|
# `src/build-scripts/build_<pkgname>.cmake`. If that exists, we include and
|
||||||
|
# execute it. The script can do whatever it wants, but should either (a)
|
||||||
|
# somehow set up the link targets that would have been found had the package
|
||||||
|
# had been found, or (b) set the variable `<pkgname>_REFIND` to a true value
|
||||||
|
# and have done something to ensure that the package will be found if we try a
|
||||||
|
# second time. For (b), typically that might mean downloading the package and
|
||||||
|
# building it locally, and then setting the `<pkgname>_ROOT` to where it's
|
||||||
|
# installed.
|
||||||
|
#
|
||||||
|
# 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)
|
||||||
|
#
|
||||||
|
# Various setup logic
|
||||||
|
#
|
||||||
|
cmake_parse_arguments(_pkg # prefix
|
||||||
|
# noValueKeywords:
|
||||||
|
"REQUIRED;OPTIONAL;CONFIG;PREFER_CONFIG;DEBUG;NO_RECORD_NOTFOUND;NO_FP_RANGE_CHECK"
|
||||||
|
# singleValueKeywords:
|
||||||
|
"ENABLE;ISDEPOF;VERSION_MIN;VERSION_MAX;RECOMMEND_MIN;RECOMMEND_MIN_REASON;BUILD_LOCAL"
|
||||||
|
# multiValueKeywords:
|
||||||
|
"DEFINITIONS;PRINT;DEPS;SETVARIABLES"
|
||||||
|
# argsToParse:
|
||||||
|
${ARGN})
|
||||||
|
string (TOLOWER ${pkgname} pkgname_lower)
|
||||||
|
string (TOUPPER ${pkgname} pkgname_upper)
|
||||||
|
set (_pkg_VERBOSE ${VERBOSE})
|
||||||
|
if (_pkg_DEBUG)
|
||||||
|
set (_pkg_VERBOSE ON)
|
||||||
|
endif ()
|
||||||
|
if (NOT _pkg_VERBOSE)
|
||||||
|
set (${pkgname}_FIND_QUIETLY true)
|
||||||
|
set (${pkgname_upper}_FIND_QUIETLY true)
|
||||||
|
endif ()
|
||||||
|
if ("${pkgname}" IN_LIST ${PROJECT_NAME}_REQUIRED_DEPS
|
||||||
|
OR "ALL" IN_LIST ${PROJECT_NAME}_REQUIRED_DEPS
|
||||||
|
OR "all" IN_LIST ${PROJECT_NAME}_REQUIRED_DEPS)
|
||||||
|
set (_pkg_REQUIRED 1)
|
||||||
|
endif ()
|
||||||
|
if ("${pkgname}" IN_LIST ${PROJECT_NAME}_OPTIONAL_DEPS
|
||||||
|
OR "ALL" IN_LIST ${PROJECT_NAME}_OPTIONAL_DEPS
|
||||||
|
OR "all" IN_LIST ${PROJECT_NAME}_OPTIONAL_DEPS)
|
||||||
|
set (_pkg_REQUIRED 0)
|
||||||
|
set (_pkg_OPTIONAL 1)
|
||||||
|
endif ()
|
||||||
|
# string (TOLOWER "${_pkg_BUILD_LOCAL}" _pkg_BUILD_LOCAL)
|
||||||
|
if ("${pkgname}" IN_LIST ${PROJECT_NAME}_BUILD_LOCAL_DEPS
|
||||||
|
OR ${PROJECT_NAME}_BUILD_LOCAL_DEPS STREQUAL "ALL"
|
||||||
|
OR ${PROJECT_NAME}_BUILD_LOCAL_DEPS STREQUAL "all")
|
||||||
|
set (_pkg_BUILD_LOCAL "always")
|
||||||
|
elseif ("${pkgname}" IN_LIST ${PROJECT_NAME}_BUILD_MISSING_DEPS
|
||||||
|
OR ${PROJECT_NAME}_BUILD_MISSING_DEPS STREQUAL "ALL"
|
||||||
|
OR ${PROJECT_NAME}_BUILD_MISSING_DEPS STREQUAL "all"
|
||||||
|
OR ("required" IN_LIST ${PROJECT_NAME}_BUILD_MISSING_DEPS
|
||||||
|
AND _pkg_REQUIRED))
|
||||||
|
set_if_not (_pkg_BUILD_LOCAL "missing")
|
||||||
|
endif ()
|
||||||
|
set (${pkgname}_local_build_script "${PROJECT_SOURCE_DIR}/src/cmake/build_${pkgname}.cmake")
|
||||||
|
if (EXISTS ${${pkgname}_local_build_script})
|
||||||
|
set (${pkgname}_local_build_script_exists TRUE)
|
||||||
|
endif ()
|
||||||
|
if (_pkg_BUILD_LOCAL AND NOT EXISTS "${${pkgname}_local_build_script}")
|
||||||
|
unset (_pkg_BUILD_LOCAL)
|
||||||
|
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 (NOT _enable)
|
||||||
|
set (_pkg_OPTIONAL 1)
|
||||||
|
set (_pkg_REQUIRED 0)
|
||||||
|
message(STATUS "Forcing optional of disabled ${pkgname}")
|
||||||
|
endif ()
|
||||||
|
set (${pkgname}_REQUIRED ${_pkg_REQUIRED})
|
||||||
|
set (_config_status "")
|
||||||
|
unset (_${pkgname}_version_range)
|
||||||
|
if (_pkg_BUILD_LOCAL AND NOT _pkg_NO_FP_RANGE_CHECK)
|
||||||
|
# SKIP THIS -- I find it unreliable because the package's exported
|
||||||
|
# PKGConfigVersion.cmake has might have arbitrary rules. Use our own
|
||||||
|
# MIN_VERSION and MAX_VERSION parameters to manually check instead.
|
||||||
|
#
|
||||||
|
if (_pkg_VERSION_MIN AND _pkg_VERSION_MAX AND CMAKE_VERSION VERSION_GREATER_EQUAL 3.19)
|
||||||
|
set (_${pkgname}_version_range "${_pkg_VERSION_MIN}...<${_pkg_VERSION_MAX}")
|
||||||
|
elseif (_pkg_VERSION_MIN)
|
||||||
|
set (_${pkgname}_version_range "${_pkg_VERSION_MIN}")
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
|
set_if_not (_pkg_VERSION_MIN "0.0.1")
|
||||||
|
set_if_not (_pkg_VERSION_MAX "10000.0.0")
|
||||||
|
#
|
||||||
|
# Now we try to find or build
|
||||||
|
#
|
||||||
|
set (${pkgname}_FOUND FALSE)
|
||||||
|
set (${pkgname}_LOCAL_BUILD FALSE)
|
||||||
|
if (_enable OR (_pkg_REQUIRED AND NOT _pkg_OPTIONAL))
|
||||||
|
# Unless instructed not to, try to find the package externally
|
||||||
|
# installed.
|
||||||
|
if (${pkgname}_FOUND OR ${pkgname_upper}_FOUND OR _pkg_BUILD_LOCAL STREQUAL "always")
|
||||||
|
# was already found, or we're forcing a local build
|
||||||
|
elseif (_pkg_CONFIG OR _pkg_PREFER_CONFIG OR ${PROJECT_NAME}_ALWAYS_PREFER_CONFIG)
|
||||||
|
find_package (${pkgname} ${_${pkgname}_version_range} CONFIG ${_pkg_UNPARSED_ARGUMENTS})
|
||||||
|
reject_out_of_range_versions (${pkgname} "${${pkgname}_VERSION}"
|
||||||
|
${_pkg_VERSION_MIN} ${_pkg_VERSION_MAX}
|
||||||
|
_pkg_version_in_range)
|
||||||
|
if (${pkgname}_FOUND OR ${pkgname_upper}_FOUND)
|
||||||
|
set (_config_status "from CONFIG")
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
|
if (NOT ${pkgname}_FOUND AND NOT ${pkgname_upper}_FOUND AND NOT _pkg_BUILD_LOCAL STREQUAL "always" AND NOT _pkg_CONFIG)
|
||||||
|
find_package (${pkgname} ${_${pkgname}_version_range} ${_pkg_UNPARSED_ARGUMENTS})
|
||||||
|
endif()
|
||||||
|
if (NOT ${pkgname}_FOUND AND NOT ${pkgname_upper}_FOUND)
|
||||||
|
list (APPEND CFP_ALL_BUILD_DEPS_NOTFOUND ${pkgname})
|
||||||
|
if (${pkgname}_local_build_script_exists)
|
||||||
|
list (APPEND CFP_LOCALLY_BUILDABLE_DEPS_NOTFOUND ${pkgname})
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
|
# Some FindPackage modules set nonstandard variables for the versions
|
||||||
|
if (NOT ${pkgname}_VERSION AND ${pkgname_upper}_VERSION)
|
||||||
|
set (${pkgname}_VERSION ${${pkgname_upper}_VERSION})
|
||||||
|
endif ()
|
||||||
|
if (NOT ${pkgname}_VERSION AND ${pkgname_upper}_VERSION_STRING)
|
||||||
|
set (${pkgname}_VERSION ${${pkgname_upper}_VERSION_STRING})
|
||||||
|
endif ()
|
||||||
|
# If the package was found but the version is outside the required
|
||||||
|
# range, unset the relevant variables so that we can try again fresh.
|
||||||
|
if ((${pkgname}_FOUND OR ${pkgname_upper}_FOUND) AND ${pkgname}_VERSION)
|
||||||
|
reject_out_of_range_versions (${pkgname} ${${pkgname}_VERSION}
|
||||||
|
${_pkg_VERSION_MIN} ${_pkg_VERSION_MAX}
|
||||||
|
_pkg_version_in_range)
|
||||||
|
if (_pkg_version_in_range)
|
||||||
|
list (APPEND CFP_EXTERNAL_BUILD_DEPS_FOUND ${pkgname})
|
||||||
|
else ()
|
||||||
|
message (STATUS "${ColorRed}${pkgname} ${${pkgname}_VERSION} is outside the required range ${_pkg_VERSION_MIN}...${_pkg_VERSION_MAX} ${ColorReset}")
|
||||||
|
list (APPEND CFP_ALL_BUILD_DEPS_BADVERSION ${pkgname})
|
||||||
|
if (${pkgname}_local_build_script_exists)
|
||||||
|
list (APPEND CFP_LOCALLY_BUILDABLE_DEPS_BADVERSION ${pkgname})
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
|
# If we haven't found the package yet and are allowed to build a local
|
||||||
|
# version, and a build_<pkgname>.cmake exists, include it to build the
|
||||||
|
# package locally.
|
||||||
|
if (NOT ${pkgname}_FOUND AND NOT ${pkgname_upper}_FOUND
|
||||||
|
AND (_pkg_BUILD_LOCAL STREQUAL "always" OR _pkg_BUILD_LOCAL STREQUAL "missing")
|
||||||
|
AND EXISTS "${${pkgname}_local_build_script}")
|
||||||
|
message (STATUS "${ColorMagenta}Building package ${pkgname} ${${pkgname}_VERSION} locally${ColorReset}")
|
||||||
|
list(APPEND CMAKE_MESSAGE_INDENT " ")
|
||||||
|
include("${${pkgname}_local_build_script}")
|
||||||
|
list(POP_BACK CMAKE_MESSAGE_INDENT)
|
||||||
|
# set (${pkgname}_FOUND TRUE)
|
||||||
|
set (${pkgname}_LOCAL_BUILD TRUE)
|
||||||
|
list (APPEND CFP_LOCALLY_BUILT_DEPS ${pkgname})
|
||||||
|
list (REMOVE_ITEM CFP_LOCALLY_BUILDABLE_DEPS_NOTFOUND ${pkgname})
|
||||||
|
endif()
|
||||||
|
# If the local build instrctions set <pkgname>_REFIND, then try a find
|
||||||
|
# again to pick up the local one, at which point we can proceed as if
|
||||||
|
# it had been found externally all along. The local build script can
|
||||||
|
# also optionally set the following hints:
|
||||||
|
# ${pkgname}_REFIND_VERSION : the version that was just installed,
|
||||||
|
# to specifically find.
|
||||||
|
# ${pkgname}_REFIND_ARGS : additional arguments to pass to find_package
|
||||||
|
if (${pkgname}_REFIND)
|
||||||
|
message (STATUS "Refinding ${pkgname} with ${pkgname}_ROOT=${${pkgname}_ROOT}")
|
||||||
|
find_package (${pkgname} ${${pkgname}_REFIND_VERSION} REQUIRED ${_pkg_UNPARSED_ARGUMENTS} ${${pkgname}_REFIND_ARGS})
|
||||||
|
unset (${pkgname}_REFIND)
|
||||||
|
endif()
|
||||||
|
# It's all downhill from here: if we found the package, follow the
|
||||||
|
# various instructions we got about variables to set, compile
|
||||||
|
# definitions to add, etc.
|
||||||
|
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} ${_config_status}${ColorReset}")
|
||||||
|
add_compile_definitions (${_pkg_DEFINITIONS})
|
||||||
|
foreach (_v IN LISTS _pkg_SETVARIABLES)
|
||||||
|
set (${_v} TRUE)
|
||||||
|
endforeach ()
|
||||||
|
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 ()
|
||||||
|
string (STRIP "${pkgname} ${${pkgname}_VERSION}" app_)
|
||||||
|
list (APPEND CFP_ALL_BUILD_DEPS_FOUND "${app_}")
|
||||||
|
else ()
|
||||||
|
handle_package_notfound (${pkgname} ${_pkg_REQUIRED})
|
||||||
|
if (NOT _pkg_NO_RECORD_NOTFOUND)
|
||||||
|
list (APPEND CFP_ALL_BUILD_DEPS_FOUND "${pkgname} NONE")
|
||||||
|
endif ()
|
||||||
|
endif()
|
||||||
|
if (_pkg_VERBOSE AND (${pkgname}_FOUND OR ${pkgname_upper}_FOUND OR _pkg_DEBUG))
|
||||||
|
if (_pkg_DEBUG)
|
||||||
|
dump_matching_variables (${pkgname})
|
||||||
|
endif ()
|
||||||
|
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 ()
|
||||||
|
else ()
|
||||||
|
if (NOT _quietskip)
|
||||||
|
message (STATUS "${ColorRed}Not using ${pkgname} -- disabled ${_disablereason} ${ColorReset}")
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
|
# unset (_${pkgname}_version_range)
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Function: remove_prefixes_from_variable
|
||||||
|
# Removes specified directory prefixes from a given environment variable or CMake variable.
|
||||||
|
#
|
||||||
|
# Parameters:
|
||||||
|
# VAR_TYPE - Type of variable to modify:
|
||||||
|
# 'ENV' for environment variables
|
||||||
|
# 'CMAKE' for CMake variables
|
||||||
|
# VAR_NAME - Name of the variable to modify.
|
||||||
|
# PREFIXES - List of directory prefixes to remove from the variable's value.
|
||||||
|
#
|
||||||
|
# Description:
|
||||||
|
# This function updates the specified variable by removing any paths that start
|
||||||
|
# with the given prefixes. It is useful for excluding certain directories
|
||||||
|
# (e.g., Homebrew paths) from environment variables or CMake variables to prevent
|
||||||
|
# unintended dependencies during the build process.
|
||||||
|
#
|
||||||
|
# Usage Example:
|
||||||
|
# remove_prefixes_from_variable(ENV LD_LIBRARY_PATH "/opt/homebrew" "/usr/local")
|
||||||
|
# remove_prefixes_from_variable(CMAKE CMAKE_PREFIX_PATH "${HOMEBREW_PREFIXES}")
|
||||||
|
function(remove_prefixes_from_variable VAR_TYPE VAR_NAME PREFIXES)
|
||||||
|
# Retrieve the original value based on the variable type
|
||||||
|
if(VAR_TYPE STREQUAL "ENV")
|
||||||
|
if(DEFINED ENV{${VAR_NAME}})
|
||||||
|
set(_original_value "$ENV{${VAR_NAME}}")
|
||||||
|
else()
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
elseif(VAR_TYPE STREQUAL "CMAKE")
|
||||||
|
if(DEFINED ${VAR_NAME})
|
||||||
|
set(_original_value "${${VAR_NAME}}")
|
||||||
|
else()
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "Invalid VAR_TYPE: ${VAR_TYPE}. Expected 'ENV' or 'CMAKE'.")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Convert the variable value into a list of paths
|
||||||
|
string(REPLACE ":" ";" _path_list "${_original_value}")
|
||||||
|
|
||||||
|
foreach(_prefix ${PREFIXES})
|
||||||
|
# Normalize the prefix path
|
||||||
|
file(TO_CMAKE_PATH "${_prefix}" _norm_prefix)
|
||||||
|
foreach(_path IN LISTS _path_list)
|
||||||
|
# Normalize paths to avoid issues with different formats
|
||||||
|
file(TO_CMAKE_PATH "${_path}" _norm_path)
|
||||||
|
# Check if the normalized path starts with the normalized prefix
|
||||||
|
string(FIND "${_norm_path}" "${_norm_prefix}" _pos)
|
||||||
|
if(_pos EQUAL 0)
|
||||||
|
list(REMOVE_ITEM _path_list "${_path}")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
# Convert the list back to the appropriate separator
|
||||||
|
string(REPLACE ";" ":" _new_value "${_path_list}")
|
||||||
|
|
||||||
|
# Update the variable based on the variable type
|
||||||
|
if(VAR_TYPE STREQUAL "ENV")
|
||||||
|
set(ENV{${VAR_NAME}} "${_new_value}")
|
||||||
|
message(STATUS "${ColorYellow}Updated environment variable ${VAR_NAME}: ${_new_value}")
|
||||||
|
else()
|
||||||
|
set(${VAR_NAME} "${_new_value}" PARENT_SCOPE)
|
||||||
|
message(STATUS "${ColorYellow}Updated CMake variable ${VAR_NAME}: ${_new_value}")
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
# Helper to build a dependency with CMake. Given a package name, git repo and
|
||||||
|
# tag, and optional cmake args, it will clone the repo into the surrounding
|
||||||
|
# project's build area, configures, and build sit, and installs it into a
|
||||||
|
# special dist area (unless the NOINSTALL option is given).
|
||||||
|
#
|
||||||
|
# After running, it leaves the following variables set:
|
||||||
|
# ${pkgname}_LOCAL_SOURCE_DIR
|
||||||
|
# ${pkgname}_LOCAL_BUILD_DIR
|
||||||
|
# ${pkgname}_LOCAL_INSTALL_DIR
|
||||||
|
#
|
||||||
|
# Unless NOINSTALL is specified, the after the installation step, the
|
||||||
|
# installation directory will be added to the CMAKE_PREFIX_PATH and also will
|
||||||
|
# be stored in the ${pkgname}_ROOT variable.
|
||||||
|
#
|
||||||
|
macro (build_dependency_with_cmake pkgname)
|
||||||
|
cmake_parse_arguments(_pkg # prefix
|
||||||
|
# noValueKeywords:
|
||||||
|
"NOINSTALL"
|
||||||
|
# singleValueKeywords:
|
||||||
|
"GIT_REPOSITORY;GIT_TAG;GIT_COMMIT;VERSION;SOURCE_SUBDIR;QUIET"
|
||||||
|
# multiValueKeywords:
|
||||||
|
"CMAKE_ARGS"
|
||||||
|
# argsToParse:
|
||||||
|
${ARGN})
|
||||||
|
|
||||||
|
message (STATUS "Building local ${pkgname} ${_pkg_VERSION} from ${_pkg_GIT_REPOSITORY}")
|
||||||
|
string (TIMESTAMP ${pkgname}_build_start_time "%s")
|
||||||
|
|
||||||
|
if(DEFINED ${pkgname}_CMAKELISTS_TEMPLATE_PATH AND ${pkgname}_CMAKELISTS_TEMPLATE_PATH)
|
||||||
|
message (STATUS "cmakelist template provided on: ${${pkgname}_CMAKELISTS_TEMPLATE_PATH}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set (${pkgname}_LOCAL_SOURCE_DIR "${${PROJECT_NAME}_LOCAL_DEPS_ROOT}/${pkgname}")
|
||||||
|
set (${pkgname}_LOCAL_BUILD_DIR "${${PROJECT_NAME}_LOCAL_DEPS_ROOT}/${pkgname}-build")
|
||||||
|
set (${pkgname}_LOCAL_INSTALL_DIR "${${PROJECT_NAME}_LOCAL_DEPS_ROOT}/dist")
|
||||||
|
message (STATUS "Downloading local ${_pkg_GIT_REPOSITORY}")
|
||||||
|
|
||||||
|
unset (${pkgname}_GIT_CLONE_ARGS)
|
||||||
|
unset (_pkg_exec_quiet)
|
||||||
|
if (NOT "${_pkg_GIT_TAG}" STREQUAL "")
|
||||||
|
# If a tag or branch is specified, do a shallow clone for efficiency.
|
||||||
|
list (APPEND ${pkgname}_GIT_CLONE_ARGS -b ${_pkg_GIT_TAG} --depth 1)
|
||||||
|
endif ()
|
||||||
|
if (_pkg_QUIET OR "${_pkg_QUIET}" STREQUAL "")
|
||||||
|
list (APPEND ${pkgname}_GIT_CLONE_ARGS -q ERROR_VARIABLE ${pkgname}_clone_errors)
|
||||||
|
set (_pkg_exec_quiet OUTPUT_QUIET)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
# Clone the repo if we don't already have it
|
||||||
|
find_package (Git REQUIRED)
|
||||||
|
if (NOT IS_DIRECTORY ${${pkgname}_LOCAL_SOURCE_DIR})
|
||||||
|
message (STATUS "COMMAND ${GIT_EXECUTABLE} clone ${_pkg_GIT_REPOSITORY} "
|
||||||
|
"${${pkgname}_LOCAL_SOURCE_DIR} "
|
||||||
|
"${${pkgname}_GIT_CLONE_ARGS} "
|
||||||
|
"${_pkg_exec_quiet}")
|
||||||
|
execute_process(COMMAND ${GIT_EXECUTABLE} clone ${_pkg_GIT_REPOSITORY}
|
||||||
|
${${pkgname}_LOCAL_SOURCE_DIR}
|
||||||
|
${${pkgname}_GIT_CLONE_ARGS}
|
||||||
|
${_pkg_exec_quiet})
|
||||||
|
if (NOT IS_DIRECTORY ${${pkgname}_LOCAL_SOURCE_DIR})
|
||||||
|
message (FATAL_ERROR "Could not download ${_pkg_GIT_REPOSITORY}")
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
|
# Checkout and verify the source against the expected commit hash to
|
||||||
|
# guard against tag tampering in upstream repositories.
|
||||||
|
if (${PROJECT_NAME}_DEPENDENCY_BUILD_ALLOW_UNVERIFIED_TAGS
|
||||||
|
AND NOT "${_pkg_GIT_TAG}" STREQUAL "")
|
||||||
|
# Special case for CI bleeding edge test, which sets
|
||||||
|
# ${PROJECT_NAME}_DEPENDENCY_BUILD_ALLOW_UNVERIFIED_TAGS to force
|
||||||
|
# the unsafe practice of allowing main/master testing.
|
||||||
|
execute_process(COMMAND ${GIT_EXECUTABLE} checkout ${_pkg_GIT_TAG}
|
||||||
|
WORKING_DIRECTORY ${${pkgname}_LOCAL_SOURCE_DIR}
|
||||||
|
${_pkg_exec_quiet})
|
||||||
|
elseif (NOT "${_pkg_GIT_TAG}" STREQUAL "" AND NOT "${_pkg_GIT_COMMIT}" STREQUAL "")
|
||||||
|
# Both tag and commit: checkout tag, verify it matches expected commit.
|
||||||
|
execute_process(COMMAND ${GIT_EXECUTABLE} checkout ${_pkg_GIT_TAG}
|
||||||
|
WORKING_DIRECTORY ${${pkgname}_LOCAL_SOURCE_DIR}
|
||||||
|
${_pkg_exec_quiet})
|
||||||
|
execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
|
||||||
|
WORKING_DIRECTORY ${${pkgname}_LOCAL_SOURCE_DIR}
|
||||||
|
OUTPUT_VARIABLE _pkg_actual_commit
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
if (NOT "${_pkg_actual_commit}" STREQUAL "${_pkg_GIT_COMMIT}")
|
||||||
|
message (FATAL_ERROR
|
||||||
|
"${pkgname}: Tag ${_pkg_GIT_TAG} resolved to commit "
|
||||||
|
"${_pkg_actual_commit}, but expected ${_pkg_GIT_COMMIT}. "
|
||||||
|
"This may indicate the tag was tampered with or moved.")
|
||||||
|
endif ()
|
||||||
|
elseif (NOT "${_pkg_GIT_COMMIT}" STREQUAL "")
|
||||||
|
# Only commit hash specified: checkout that commit directly.
|
||||||
|
execute_process(COMMAND ${GIT_EXECUTABLE} checkout ${_pkg_GIT_COMMIT}
|
||||||
|
WORKING_DIRECTORY ${${pkgname}_LOCAL_SOURCE_DIR}
|
||||||
|
${_pkg_exec_quiet})
|
||||||
|
elseif (NOT "${_pkg_GIT_TAG}" STREQUAL "")
|
||||||
|
# Only tag, no commit pin — warn about missing verification.
|
||||||
|
message (WARNING
|
||||||
|
"${pkgname}: No GIT_COMMIT specified to verify tag ${_pkg_GIT_TAG}. "
|
||||||
|
"Consider pinning a commit hash for supply chain security.")
|
||||||
|
execute_process(COMMAND ${GIT_EXECUTABLE} checkout ${_pkg_GIT_TAG}
|
||||||
|
WORKING_DIRECTORY ${${pkgname}_LOCAL_SOURCE_DIR}
|
||||||
|
${_pkg_exec_quiet})
|
||||||
|
else ()
|
||||||
|
message (FATAL_ERROR
|
||||||
|
"${pkgname}: Neither GIT_TAG nor GIT_COMMIT was specified.")
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
# Configure the package
|
||||||
|
if (${PROJECT_NAME}_DEPENDENCY_BUILD_VERBOSE)
|
||||||
|
set (_pkg_cmake_verbose -DCMAKE_VERBOSE_MAKEFILE=ON
|
||||||
|
-DCMAKE_MESSAGE_LOG_LEVEL=VERBOSE
|
||||||
|
-DCMAKE_RULE_MESSAGES=ON
|
||||||
|
)
|
||||||
|
else ()
|
||||||
|
set (_pkg_cmake_verbose -DCMAKE_VERBOSE_MAKEFILE=OFF
|
||||||
|
-DCMAKE_MESSAGE_LOG_LEVEL=ERROR
|
||||||
|
-DCMAKE_RULE_MESSAGES=OFF
|
||||||
|
-Wno-dev
|
||||||
|
)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
|
||||||
|
# if a CMakeLists.txt path is specified, add it to the repository. This will replace existing ones
|
||||||
|
# this should be set before calling the macro
|
||||||
|
if(DEFINED ${pkgname}_CMAKELISTS_TEMPLATE_PATH AND NOT "${${pkgname}_CMAKELISTS_TEMPLATE_PATH}" STREQUAL "")
|
||||||
|
message(STATUS "Adding custom CMakeLists.txt for ${pkgname}")
|
||||||
|
configure_file("${${pkgname}_CMAKELISTS_TEMPLATE_PATH}"
|
||||||
|
"${${pkgname}_LOCAL_SOURCE_DIR}/${_pkg_SOURCE_SUBDIR}/CMakeLists.txt"
|
||||||
|
@ONLY)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Make sure to inherit CMAKE_IGNORE_PATH
|
||||||
|
set(_pkg_CMAKE_ARGS ${_pkg_CMAKE_ARGS} ${_pkg_CMAKE_ARGS})
|
||||||
|
if (CMAKE_IGNORE_PATH)
|
||||||
|
string(REPLACE ";" "\\;" CMAKE_IGNORE_PATH_ESCAPED "${CMAKE_IGNORE_PATH}")
|
||||||
|
list(APPEND _pkg_CMAKE_ARGS "-DCMAKE_IGNORE_PATH=${CMAKE_IGNORE_PATH_ESCAPED}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Pass along any CMAKE_MSVC_RUNTIME_LIBRARY
|
||||||
|
if (WIN32 AND CMAKE_MSVC_RUNTIME_LIBRARY)
|
||||||
|
list (APPEND _pkg_CMAKE_ARGS -DCMAKE_MSVC_RUNTIME_LIBRARY=${CMAKE_MSVC_RUNTIME_LIBRARY})
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
execute_process (COMMAND
|
||||||
|
${CMAKE_COMMAND}
|
||||||
|
# Put things in our special local build areas
|
||||||
|
-S ${${pkgname}_LOCAL_SOURCE_DIR}/${_pkg_SOURCE_SUBDIR}
|
||||||
|
-B ${${pkgname}_LOCAL_BUILD_DIR}
|
||||||
|
-DCMAKE_INSTALL_PREFIX=${${pkgname}_LOCAL_INSTALL_DIR}
|
||||||
|
# Same build type as us
|
||||||
|
-DCMAKE_BUILD_TYPE=${${PROJECT_NAME}_DEPENDENCY_BUILD_TYPE}
|
||||||
|
-DCMAKE_CXX_COMPILER_LAUNCHER=${CMAKE_CXX_COMPILER_LAUNCHER}
|
||||||
|
-DCMAKE_C_COMPILER_LAUNCHER=${CMAKE_C_COMPILER_LAUNCHER}
|
||||||
|
# Shhhh
|
||||||
|
-DCMAKE_MESSAGE_INDENT=" "
|
||||||
|
-DCMAKE_COMPILE_WARNING_AS_ERROR=OFF
|
||||||
|
${_pkg_cmake_verbose}
|
||||||
|
# Build args passed by caller
|
||||||
|
${_pkg_CMAKE_ARGS}
|
||||||
|
${_pkg_exec_quiet}
|
||||||
|
)
|
||||||
|
|
||||||
|
# Build the package
|
||||||
|
execute_process (COMMAND ${CMAKE_COMMAND}
|
||||||
|
--build ${${pkgname}_LOCAL_BUILD_DIR}
|
||||||
|
--config ${${PROJECT_NAME}_DEPENDENCY_BUILD_TYPE}
|
||||||
|
${_pkg_exec_quiet}
|
||||||
|
)
|
||||||
|
|
||||||
|
# Install the project, unless instructed not to do so
|
||||||
|
if (NOT _pkg_NOINSTALL)
|
||||||
|
execute_process (COMMAND ${CMAKE_COMMAND}
|
||||||
|
--build ${${pkgname}_LOCAL_BUILD_DIR}
|
||||||
|
--config ${${PROJECT_NAME}_DEPENDENCY_BUILD_TYPE}
|
||||||
|
--target install
|
||||||
|
${_pkg_exec_quiet}
|
||||||
|
)
|
||||||
|
set (${pkgname}_ROOT ${${pkgname}_LOCAL_INSTALL_DIR})
|
||||||
|
list (APPEND CMAKE_PREFIX_PATH ${${pkgname}_LOCAL_INSTALL_DIR})
|
||||||
|
endif ()
|
||||||
|
string (TIMESTAMP ${pkgname}_build_end_time "%s")
|
||||||
|
math (EXPR ${pkgname}_build_elapsed_time "${${pkgname}_build_end_time} - ${${pkgname}_build_start_time}")
|
||||||
|
# message (STATUS "Build time of ${${pkgname}_build_elapsed_time}s")
|
||||||
|
endmacro ()
|
||||||
|
|
||||||
|
|
||||||
|
# Copy libraries from a locally-built dependency into our own install area.
|
||||||
|
# This is useful for dynamic libraries that we need to be part of our own
|
||||||
|
# installation.
|
||||||
|
macro (install_local_dependency_libs pkgname libname)
|
||||||
|
# We need to include the Imath dynamic libraries in our own install.
|
||||||
|
# get_target_property(_lib_files Imath::Imath INTERFACE_LINK_LIBRARIES)
|
||||||
|
set (patterns ${ARGN})
|
||||||
|
file (GLOB _lib_files
|
||||||
|
"${${pkgname}_LOCAL_INSTALL_DIR}/lib/*${libname}*"
|
||||||
|
"${${pkgname}_LOCAL_INSTALL_DIR}/lib/${${PROJECT_NAME}_DEPENDENCY_BUILD_TYPE}/*${libname}*"
|
||||||
|
)
|
||||||
|
install (FILES ${_lib_files} TYPE LIB COMPONENT user)
|
||||||
|
# message("${pkgname}_LOCAL_INSTALL_DIR = ${${pkgname}_LOCAL_INSTALL_DIR}")
|
||||||
|
# message(" lib files = ${_lib_files}")
|
||||||
|
if (WIN32)
|
||||||
|
# On Windows, check for DLLs, which go in the bin directory
|
||||||
|
file (GLOB _lib_files
|
||||||
|
"${${pkgname}_LOCAL_INSTALL_DIR}/bin/*${libname}*.dll"
|
||||||
|
"${${pkgname}_LOCAL_INSTALL_DIR}/bin/${${PROJECT_NAME}_DEPENDENCY_BUILD_TYPE}/*${libname}*.dll"
|
||||||
|
)
|
||||||
|
# message(" dll files = ${_lib_files}")
|
||||||
|
install (FILES ${_lib_files} TYPE BIN COMPONENT user)
|
||||||
|
endif ()
|
||||||
|
unset (_lib_files)
|
||||||
|
endmacro ()
|
||||||
|
|
||||||
|
|
||||||
|
# If the target `newalias` doesn't yet exist but `realtarget` does, create an
|
||||||
|
# alias for `newalias` to mean the real target.
|
||||||
|
macro (alias_library_if_not_exists newalias realtarget)
|
||||||
|
if (NOT TARGET ${newalias} AND TARGET ${realtarget})
|
||||||
|
add_library(${newalias} ALIAS ${realtarget})
|
||||||
|
endif ()
|
||||||
|
endmacro ()
|
||||||
@@ -33,80 +33,23 @@ include (ExternalProject)
|
|||||||
|
|
||||||
option (BUILD_MISSING_DEPS "Try to download and build any missing dependencies" OFF)
|
option (BUILD_MISSING_DEPS "Try to download and build any missing dependencies" OFF)
|
||||||
|
|
||||||
|
|
||||||
###########################################################################
|
|
||||||
# Boost setup
|
|
||||||
if (LINKSTATIC)
|
|
||||||
set (Boost_USE_STATIC_LIBS ON)
|
|
||||||
else ()
|
|
||||||
if (MSVC)
|
|
||||||
add_definitions (-DBOOST_ALL_DYN_LINK=1)
|
|
||||||
endif ()
|
|
||||||
endif ()
|
|
||||||
if (BOOST_CUSTOM)
|
|
||||||
set (Boost_FOUND true)
|
|
||||||
# N.B. For a custom version, the caller had better set up the variables
|
|
||||||
# Boost_VERSION, Boost_INCLUDE_DIRS, Boost_LIBRARY_DIRS, Boost_LIBRARIES.
|
|
||||||
else ()
|
|
||||||
set (Boost_COMPONENTS filesystem system thread)
|
|
||||||
# The FindBoost.cmake interface is broken if it uses boost's installed
|
|
||||||
# cmake output (e.g. boost 1.70.0, cmake <= 3.14). Specifically it fails
|
|
||||||
# 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 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 ()
|
|
||||||
|
|
||||||
# On Linux, Boost 1.55 and higher seems to need to link against -lrt
|
|
||||||
if (CMAKE_SYSTEM_NAME MATCHES "Linux"
|
|
||||||
AND ${Boost_VERSION} VERSION_GREATER_EQUAL 105500)
|
|
||||||
list (APPEND Boost_LIBRARIES "rt")
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
include_directories (SYSTEM "${Boost_INCLUDE_DIRS}")
|
|
||||||
link_directories ("${Boost_LIBRARY_DIRS}")
|
|
||||||
|
|
||||||
# end Boost setup
|
|
||||||
###########################################################################
|
|
||||||
|
|
||||||
|
|
||||||
checked_find_package (ZLIB REQUIRED) # Needed by several packages
|
checked_find_package (ZLIB REQUIRED) # Needed by several packages
|
||||||
|
|
||||||
# IlmBase & OpenEXR
|
# IlmBase & OpenEXR
|
||||||
checked_find_package (OpenEXR REQUIRED
|
checked_find_package (Imath REQUIRED
|
||||||
VERSION_MIN 2.3
|
VERSION_MIN 3.1
|
||||||
RECOMMEND_MIN 2.4
|
PRINT IMATH_INCLUDES Imath_VERSION
|
||||||
RECOMMEND_MIN_REASON
|
|
||||||
"Even extremely critical patches are no longer supplied to < 2.4"
|
|
||||||
PRINT IMATH_INCLUDES
|
|
||||||
)
|
)
|
||||||
# Force Imath includes to be before everything else to ensure that we have
|
# 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
|
# the right Imath version, not some older version in the system library.
|
||||||
# library. This shouldn'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})
|
include_directories(BEFORE ${IMATH_INCLUDES})
|
||||||
if (MSVC AND NOT LINKSTATIC)
|
set (OSL_USING_IMATH 3)
|
||||||
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
|
# OpenImageIO
|
||||||
checked_find_package (OpenImageIO REQUIRED
|
checked_find_package (OpenImageIO REQUIRED
|
||||||
VERSION_MIN 2.3.17
|
VERSION_MIN 3.0
|
||||||
DEFINITIONS -DOIIO_HIDE_FORMAT=1)
|
DEFINITIONS OIIO_HIDE_FORMAT=1)
|
||||||
|
|
||||||
checked_find_package (pugixml REQUIRED
|
checked_find_package (pugixml REQUIRED
|
||||||
VERSION_MIN 1.8)
|
VERSION_MIN 1.8)
|
||||||
@@ -114,97 +57,116 @@ checked_find_package (pugixml REQUIRED
|
|||||||
|
|
||||||
# LLVM library setup
|
# LLVM library setup
|
||||||
checked_find_package (LLVM REQUIRED
|
checked_find_package (LLVM REQUIRED
|
||||||
VERSION_MIN 9.0
|
VERSION_MIN 14.0
|
||||||
PRINT LLVM_SYSTEM_LIBRARIES CLANG_LIBRARIES)
|
VERSION_MAX 22.9
|
||||||
|
PRINT LLVM_SYSTEM_LIBRARIES CLANG_LIBRARIES
|
||||||
|
LLVM_SHARED_MODE)
|
||||||
# ensure include directory is added (in case of non-standard locations
|
# ensure include directory is added (in case of non-standard locations
|
||||||
include_directories (BEFORE SYSTEM "${LLVM_INCLUDES}")
|
include_directories (BEFORE SYSTEM "${LLVM_INCLUDES}")
|
||||||
link_directories ("${LLVM_LIB_DIR}")
|
link_directories ("${LLVM_LIB_DIR}")
|
||||||
# Extract and concatenate major & minor, remove wayward patches,
|
# Extract and concatenate major & minor, remove wayward patches,
|
||||||
# dots, and "svn" or other suffixes.
|
# dots, and "svn" or other suffixes.
|
||||||
string (REGEX REPLACE "([0-9]+)\\.([0-9]+).*" "\\1\\2" OSL_LLVM_VERSION ${LLVM_VERSION})
|
string (REGEX REPLACE "([0-9]+)\\.([0-9]+).*" "\\1\\2" OSL_LLVM_VERSION ${LLVM_VERSION})
|
||||||
add_definitions (-DOSL_LLVM_VERSION=${OSL_LLVM_VERSION})
|
add_compile_definitions (OSL_LLVM_VERSION=${OSL_LLVM_VERSION})
|
||||||
add_definitions (-DOSL_LLVM_FULL_VERSION="${LLVM_VERSION}")
|
add_compile_definitions (OSL_LLVM_FULL_VERSION="${LLVM_VERSION}")
|
||||||
if (LLVM_NAMESPACE)
|
if (LLVM_NAMESPACE)
|
||||||
add_definitions ("-DLLVM_NAMESPACE=${LLVM_NAMESPACE}")
|
add_compile_definitions (LLVM_NAMESPACE=${LLVM_NAMESPACE})
|
||||||
endif ()
|
endif ()
|
||||||
if (APPLE AND LLVM_VERSION VERSION_EQUAL 10.0.1 AND EXISTS "/usr/local/Cellar/llvm")
|
if (LLVM_VERSION VERSION_GREATER_EQUAL 15.0 AND CMAKE_COMPILER_IS_CLANG
|
||||||
message (WARNING
|
AND ANY_CLANG_VERSION_STRING VERSION_LESS 15.0)
|
||||||
"${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 upgrading to a newer LLVM: \n"
|
|
||||||
" brew upgrade llvm \n"
|
|
||||||
"${ColorReset}\n")
|
|
||||||
endif ()
|
|
||||||
if (LLVM_VERSION VERSION_GREATER_EQUAL 15.0
|
|
||||||
AND ( (CMAKE_COMPILER_IS_APPLECLANG AND APPLECLANG_VERSION_STRING VERSION_LESS 15.0)
|
|
||||||
OR (CMAKE_COMPILER_IS_CLANG AND CLANG_VERSION_STRING VERSION_LESS 15.0)))
|
|
||||||
message (WARNING
|
message (WARNING
|
||||||
"${ColorYellow}"
|
"${ColorYellow}"
|
||||||
"If you are using LLVM 15 or higher, you should also use clang version "
|
"If you are using LLVM 15 or higher, you should also use clang version "
|
||||||
"15 or higher, or you may get build errors.${ColorReset}\n")
|
"15 or higher, or you may get build errors.${ColorReset}\n")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
checked_find_package (partio)
|
checked_find_package (partio)
|
||||||
|
|
||||||
|
|
||||||
# From pythonutils.cmake
|
# From pythonutils.cmake
|
||||||
find_python ()
|
find_python ()
|
||||||
|
if (USE_PYTHON)
|
||||||
|
checked_find_package (pybind11 REQUIRED VERSION_MIN 2.7)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
|
||||||
# Qt -- used for osltoy
|
# Qt -- used for osltoy
|
||||||
set (qt5_modules Core Gui Widgets)
|
|
||||||
if (OPENGL_FOUND)
|
|
||||||
list (APPEND qt5_modules OpenGL)
|
|
||||||
endif ()
|
|
||||||
option (USE_QT "Use Qt if found" ON)
|
option (USE_QT "Use Qt if found" ON)
|
||||||
checked_find_package (Qt5 COMPONENTS ${qt5_modules})
|
if (USE_QT)
|
||||||
if (USE_QT AND NOT Qt5_FOUND AND APPLE)
|
checked_find_package (Qt6 COMPONENTS Core Gui Widgets OpenGLWidgets)
|
||||||
message (STATUS " If you think you installed qt5 with Homebrew and it still doesn't work,")
|
if (NOT Qt6_FOUND)
|
||||||
message (STATUS " try: export PATH=/usr/local/opt/qt5/bin:$PATH")
|
checked_find_package (Qt5 COMPONENTS Core Gui Widgets OpenGL)
|
||||||
|
endif ()
|
||||||
|
if (NOT Qt5_FOUND AND NOT Qt6_FOUND AND APPLE)
|
||||||
|
message (STATUS " If you think you installed qt with Homebrew and it still doesn't work,")
|
||||||
|
message (STATUS " try: export PATH=/usr/local/opt/qt/bin:$PATH")
|
||||||
|
endif ()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
|
||||||
# CUDA setup
|
# CUDA setup
|
||||||
if (USE_CUDA OR USE_OPTIX)
|
option (CUDA_PREFER_STATIC_LIBS "Prefer static CUDA libraries" OFF)
|
||||||
if (NOT CUDA_TOOLKIT_ROOT_DIR AND NOT $ENV{CUDA_TOOLKIT_ROOT_DIR} STREQUAL "")
|
if (OSL_USE_OPTIX)
|
||||||
set (CUDA_TOOLKIT_ROOT_DIR $ENV{CUDA_TOOLKIT_ROOT_DIR})
|
if (USE_LLVM_BITCODE)
|
||||||
endif ()
|
if (NOT CUDA_TOOLKIT_ROOT_DIR AND NOT $ENV{CUDA_TOOLKIT_ROOT_DIR} STREQUAL "")
|
||||||
|
set (CUDA_TOOLKIT_ROOT_DIR $ENV{CUDA_TOOLKIT_ROOT_DIR})
|
||||||
|
endif ()
|
||||||
|
|
||||||
if (NOT CUDA_FIND_QUIETLY OR NOT OptiX_FIND_QUIETLY)
|
if (NOT CUDA_FIND_QUIETLY OR NOT OptiX_FIND_QUIETLY)
|
||||||
message (STATUS "CUDA_TOOLKIT_ROOT_DIR = ${CUDA_TOOLKIT_ROOT_DIR}")
|
message (STATUS "CUDA_TOOLKIT_ROOT_DIR = ${CUDA_TOOLKIT_ROOT_DIR}")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
checked_find_package (CUDA REQUIRED
|
checked_find_package (CUDA REQUIRED
|
||||||
VERSION_MIN 8.0
|
VERSION_MIN 9.0
|
||||||
PRINT CUDA_INCLUDES)
|
RECOMMEND_MIN 11.0
|
||||||
set (CUDA_INCLUDES ${CUDA_TOOLKIT_ROOT_DIR}/include)
|
RECOMMEND_MIN_REASON
|
||||||
include_directories (BEFORE "${CUDA_INCLUDES}")
|
"We don't actively test CUDA older than 11"
|
||||||
|
PRINT CUDA_INCLUDES)
|
||||||
|
set (CUDA_INCLUDES ${CUDA_TOOLKIT_ROOT_DIR}/include)
|
||||||
|
include_directories (BEFORE "${CUDA_INCLUDES}")
|
||||||
|
|
||||||
STRING (FIND ${LLVM_TARGETS} "NVPTX" nvptx_index)
|
STRING (FIND ${LLVM_TARGETS} "NVPTX" nvptx_index)
|
||||||
if (NOT ${nvptx_index} GREATER -1)
|
if (NOT ${nvptx_index} GREATER -1)
|
||||||
message (FATAL_ERROR "NVPTX target is not available in the provided LLVM build")
|
message (FATAL_ERROR "NVPTX target is not available in the provided LLVM build")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set (CUDA_LIB_FLAGS "--cuda-path=${CUDA_TOOLKIT_ROOT_DIR}")
|
# CUDA 13.2+ requires LLVM 22.1.2+ for the _NV_RSQRT_SPECIFIER fix.
|
||||||
|
# See: https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/issues/2129
|
||||||
|
if (CUDA_VERSION VERSION_GREATER_EQUAL "13.2" AND LLVM_VERSION VERSION_LESS "22.1.2")
|
||||||
|
message (FATAL_ERROR
|
||||||
|
"${ColorRed}CUDA ${CUDA_VERSION} requires LLVM 22.1.2 or newer "
|
||||||
|
"(you have LLVM ${LLVM_VERSION}). CUDA 13.2+ needs the "
|
||||||
|
"_NV_RSQRT_SPECIFIER fix from llvm-project commit c1c833734cf0, "
|
||||||
|
"first shipped in LLVM 22.1.2. Either upgrade LLVM or downgrade CUDA.${ColorReset}")
|
||||||
|
endif ()
|
||||||
|
|
||||||
find_library(cuda_lib NAMES cudart
|
set (CUDA_LIB_FLAGS "--cuda-path=${CUDA_TOOLKIT_ROOT_DIR}")
|
||||||
PATHS "${CUDA_TOOLKIT_ROOT_DIR}/lib64" "${CUDA_TOOLKIT_ROOT_DIR}/x64"
|
|
||||||
REQUIRED)
|
|
||||||
set(CUDA_LIBRARIES ${cuda_lib})
|
|
||||||
|
|
||||||
# testrender & testshade need libnvrtc
|
# If the user wants, try to use static libs here to putting static lib
|
||||||
if ("${CUDA_VERSION}" VERSION_GREATER_EQUAL "10.0")
|
# suffixes earlier in the suffix list. Don't forget to restore after
|
||||||
find_library(nvrtc_lib NAMES nvrtc
|
# so that this only applies to these library searches right here.
|
||||||
PATHS "${CUDA_TOOLKIT_ROOT_DIR}/lib64" "${CUDA_TOOLKIT_ROOT_DIR}/x64"
|
set (save_lib_path ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||||
REQUIRED)
|
if (CUDA_PREFER_STATIC_LIBS)
|
||||||
set(CUDA_LIBRARIES ${CUDA_LIBRARIES} ${nvrtc_lib})
|
set (CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||||
|
find_library(cudart_lib REQUIRED
|
||||||
set(CUDA_EXTRA_LIBS ${CUDA_EXTRA_LIBS} dl)
|
NAMES cudart_static cudart
|
||||||
|
PATHS "${CUDA_TOOLKIT_ROOT_DIR}/lib64" "${CUDA_TOOLKIT_ROOT_DIR}/x64" "${CUDA_TOOLKIT_ROOT_DIR}/lib/x64")
|
||||||
|
else ()
|
||||||
|
find_library(cudart_lib REQUIRED
|
||||||
|
NAMES cudart
|
||||||
|
PATHS "${CUDA_TOOLKIT_ROOT_DIR}/lib64" "${CUDA_TOOLKIT_ROOT_DIR}/x64" "${CUDA_TOOLKIT_ROOT_DIR}/lib/x64")
|
||||||
|
endif ()
|
||||||
|
# Is it really a good idea to completely reset CUDA_LIBRARIES here?
|
||||||
|
set(CUDA_LIBRARIES ${cudart_lib})
|
||||||
|
set(CUDA_EXTRA_LIBS ${CUDA_EXTRA_LIBS} dl rt)
|
||||||
|
set (CMAKE_FIND_LIBRARY_SUFFIXES ${save_lib_path})
|
||||||
|
unset (save_lib_path)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# OptiX setup
|
# OptiX setup
|
||||||
if (USE_OPTIX)
|
if (OSL_USE_OPTIX AND OSL_BUILD_TESTS)
|
||||||
checked_find_package (OptiX REQUIRED
|
checked_find_package (OptiX REQUIRED
|
||||||
VERSION_MIN 7.0)
|
VERSION_MIN 7.0)
|
||||||
include_directories (BEFORE "${OPTIX_INCLUDES}")
|
include_directories (BEFORE "${OPTIX_INCLUDES}")
|
||||||
@@ -216,11 +178,53 @@ if (USE_CUDA OR USE_OPTIX)
|
|||||||
function (osl_optix_target TARGET)
|
function (osl_optix_target TARGET)
|
||||||
target_include_directories (${TARGET} BEFORE PRIVATE ${CUDA_INCLUDES} ${OPTIX_INCLUDES})
|
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 ?
|
## 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_compile_definitions (${TARGET} PRIVATE PTX_PATH="${OSL_PTX_INSTALL_DIR}")
|
||||||
target_link_libraries (${TARGET} PRIVATE ${CUDA_LIBRARIES} ${CUDA_EXTRA_LIBS} ${OPTIX_LIBRARIES} ${OPTIX_EXTRA_LIBS})
|
target_link_libraries (${TARGET} PRIVATE ${CUDA_LIBRARIES} ${CUDA_EXTRA_LIBS} ${OPTIX_LIBRARIES} ${OPTIX_EXTRA_LIBS})
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
else ()
|
else ()
|
||||||
|
message(STATUS "CUDA/OptiX support disabled")
|
||||||
function (osl_optix_target TARGET)
|
function (osl_optix_target TARGET)
|
||||||
endfunction()
|
endfunction()
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
|
||||||
|
###########################################################################
|
||||||
|
# Tessil/robin-map
|
||||||
|
|
||||||
|
option (BUILD_ROBINMAP_FORCE "Force local download/build of robin-map even if installed" OFF)
|
||||||
|
option (BUILD_MISSING_ROBINMAP "Local download/build of robin-map if not installed" ON)
|
||||||
|
set (BUILD_ROBINMAP_VERSION "v0.6.2" CACHE STRING "Preferred Tessil/robin-map version, of downloading/building our own")
|
||||||
|
|
||||||
|
macro (find_or_download_robin_map)
|
||||||
|
# If we weren't told to force our own download/build of robin-map, look
|
||||||
|
# for an installed version. Still prefer a copy that seems to be
|
||||||
|
# locally installed in this tree.
|
||||||
|
if (NOT BUILD_ROBINMAP_FORCE)
|
||||||
|
find_package (Robinmap QUIET)
|
||||||
|
endif ()
|
||||||
|
# If an external copy wasn't found and we requested that missing
|
||||||
|
# packages be built, or we we are forcing a local copy to be built, then
|
||||||
|
# download and build it.
|
||||||
|
# Download the headers from github
|
||||||
|
if ((BUILD_MISSING_ROBINMAP AND NOT ROBINMAP_FOUND) OR BUILD_ROBINMAP_FORCE)
|
||||||
|
message (STATUS "Downloading local Tessil/robin-map")
|
||||||
|
set (ROBINMAP_INSTALL_DIR "${PROJECT_SOURCE_DIR}/ext/robin-map")
|
||||||
|
set (ROBINMAP_GIT_REPOSITORY "https://github.com/Tessil/robin-map")
|
||||||
|
if (NOT IS_DIRECTORY ${ROBINMAP_INSTALL_DIR}/include/tsl)
|
||||||
|
find_package (Git REQUIRED)
|
||||||
|
execute_process(COMMAND ${GIT_EXECUTABLE} clone ${ROBINMAP_GIT_REPOSITORY} -n ${ROBINMAP_INSTALL_DIR})
|
||||||
|
execute_process(COMMAND ${GIT_EXECUTABLE} checkout ${BUILD_ROBINMAP_VERSION}
|
||||||
|
WORKING_DIRECTORY ${ROBINMAP_INSTALL_DIR})
|
||||||
|
if (IS_DIRECTORY ${ROBINMAP_INSTALL_DIR}/include/tsl)
|
||||||
|
message (STATUS "DOWNLOADED Tessil/robin-map to ${ROBINMAP_INSTALL_DIR}.\n"
|
||||||
|
"Remove that dir to get rid of it.")
|
||||||
|
else ()
|
||||||
|
message (FATAL_ERROR "Could not download Tessil/robin-map")
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
|
set (ROBINMAP_INCLUDE_DIR "${ROBINMAP_INSTALL_DIR}/include")
|
||||||
|
endif ()
|
||||||
|
checked_find_package (Robinmap REQUIRED)
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
find_or_download_robin_map ()
|
||||||
|
|||||||