Blender complains that it cannot find "stdosl.h", despite it existing at "/usr/share/OSL/shaders/stdosl.h" #73830
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#73830
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Operating system: Arch Linux
Graphics card: RX 580
Blender Version
Broken:
df1e9b662b
, "Cleanup: Fix build warnings from OSL shader compilation"Worked:
6a28d14f72
, "Fix #73740: Auto-key "Only Available" de-selects f-curves"Short description of error
Blender cannot find "stdosl.h", even though it exists.
Exact steps for others to reproduce the error
On Arch Linux, install openshadinglanguage, and then attempt to compile Blender master.
Other
Related: https://developer.blender.org/D6812
Upon examining the borked commit, I noticed this comment:
Unfortunately, there is no provided CMake option allowing a custom OSL_SHADER_DIR location to be set, as the current assumptions don't account for where packagers may place system files. In Arch Linux, the compiler is here, "/usr/bin/oslc", while the shader directory is here, "/usr/share/OSL/shaders".
Added subscriber: @KyleDeVir
Added subscribers: @LazyDodo, @brecht
@LazyDodo, probably we should improve
FindOpenShadingLanguage.cmake
to find the shaders directory.I'm not on linux so i can't really test this but can anyone give this a whirl?
CMake doesn't like it:
Syntax error in cmake code at
/tmp/makepkg/blender-git/src/blender/build_files/cmake/Modules/FindOpenShadingLanguage.cmake:93
when parsing string
${ENV{OSLHOME}}
Invalid character ('{') in a variable name: 'ENV'
build_files/cmake/platform/platform_unix.cmake:71 (find_package)
build_files/cmake/platform/platform_unix.cmake:248 (find_package_wrapper)
CMakeLists.txt:801 (include)
toss that one line for now then, just to see if it picks up your headers in /usr/share
Added subscriber: @grosgood
This bit me. Gentoo Linux here, with ##media-libs/osl-1.10.5## providing shaders in system folder ##/usr/include/OSL/shaders##
For what it is worth, my workaround:
- Define in build directory ##CMakeCache.txt## the symbol ## OSL_SHADER_DIR:PATH=/usr/include/OSL/shaders##
- Modified blender/intern/cycles/kernel/shaders/CMakeLists.txt:
TL;DR I added a second include directive so that the OSL compiler looks in the installed OSL shader directory as well as the specific blender build directory.
Haven't tested if this approach works beyond my peculiar little world. Hope it helps point the way to a more general solution.
[edit]
@KyleDeVir
Try: ##cmake ../blender -D OSL_SHADER_DIR:PATH=/usr/share/OSL/shaders##
Maybe substitute ##../blender## with the path to your blender source tree. In my case, the build directory is a co-directory of the source directory.
Your patch fails, sadly.
@LazyDodo It would probably be a good idea to allow packagers to set the
OSL_SHADER_DIR
variable themselves, as the comment in the OP states.Yet, I think you may have simply forgotten to offer that as a CMake option, as there's currently zero way to set it.
@LazyDodo Ah, I see... your patch had
/usr/share/osl
, when it should be/usr/share/OSL
, as most Linux filesystems are distinguish between lower and uppercase.Actually, no, nevermind, that fails, too...
Hmmmmm......
@KyleDeVir
Note that my workaround is peculiar to a Gentoo linux box; the steps need a certain amount of remapping to work on other distros. Fortunately, Arch is not that far removed from Gentoo.
In your case, introduce a CMake symbol via
Patch ##/intern/cycles/kernel/shaders/CMakeLists.txt## as indicated in my first comment
Probably be a good idea to create a working branch first to keep your git repository tidy
Then patch ##CMakeLists.txt##
This is just a Linux-centric workaround. Unfortunately, various Linux distros put the shader directory in various places. Witness Gentoo: ##/usr/include/OSL/shaders## vs. Arch: ##/usr/share/OSL/shaders##. It's an all-around PITA to deal with this. Probably, to duck this issue, is why blender developers from ages ago made their private copies, the issue that the good, brave @LazyDodo is trying to address.
Huh ~ it works, if I symlink
/usr/share/OSL/shaders
to/usr/shaders
. That's... something. Not what's needed, anyhow. :|@grosgood
Thanks! Will give it a try.
Yeah, your solution works. Cheers. :)
Great! Don't forget this is a hack - unofficial, unsupported, probably radioactive. If you've followed my suggestion of creating a local git branch ##osl_fix## to contain the patch, and you sit on the ##osl_fix## branch to do your builds, then you've got (just a little) extra work to keep ##osl_fix## aligned with ##master## whenever you perform ##make update##. See Creating Patches from Local Git Branches . The gist of it is: from ##osl_fix##: ##git checkout master##, ##make update##, ##git checkout osl_fix##, ##git rebase master##. When the fix for this lands in master, you can just checkout master and do the update, then abandon ##osl_fix:## ##git branch -D osl_fix##.
I manged to test some of this out on WSL , can you guys test the patch in D6865 ? i included both the arch and gentoo search paths so it should work out of the box now.
Yep - but not now. up to neck in alligators again. Never can tell what comes out of a Brooklyn sewer. Late this evening probably; post results in the wee hours Monday (-5 UTC, less wee +1 UTC).
Thanks thee, for the rapid turnaround!
Wait, what?! The 'again' is troublesome since it seems to indicate that this is a common occurrence....
Different, unrelated alligators. These are pink. Alligators related to build systems are putrid green, have warts, big teeth. Pink ones have been dispatched now. Starting cleanup...
@LazyDodo
D6865 plays fine here. Completely uneventful. Ran a couple of builds, one Release and one Debug from empty build directories. Deleted ##CMakeCache.txt## to make sure no strange symbols were floating around. Running ctest now; nothing out of the ordinary there either, up to now.
Current to: version: 2.83 (sub 3), branch: osl_rayfix, commit date: 2020-02-16 22:53, hash: f1a13b1ab8d6, type: Release
Thanks! Will test. :)
This comment was removed by @KyleDeVir
Changed status from 'Needs Triage' to: 'Resolved'
This completely resolves the issue! Thanks. :)