stdosl.h is not included anymore in some cycle shaders #49071

Closed
opened 2016-08-10 23:31:20 +02:00 by T Reepleks · 14 comments

I have an OSL compilation error on

blender/intern/cycles/kernel/shaders/node_rgb_curves.osl

It looks like the refactoring in commit ea2ebf7a00 (Cycles: constant folding for RGB/Vector Curves and Color Ramp) replaced the inclusion of "stdosl.h" by the new "node_ramp_util.h" but this new include file relies on the "clamp" function and does not include "stdosl.h" that defines it.

Likely solution: #include "stdosl.h" in "node_ramp_util.h".

Strangely, when I do this, oslc still complains wqith a warning

blender/intern/cycles/kernel/shaders/node_rgb_curves.osl:0: warning: Unable to find "stdosl.h"

but the compilation succeeds (for this file and for blender overall).

Could it be possible I have a bad "oslc" ?
Sorry if this is the case.

I have an OSL compilation error on ``` blender/intern/cycles/kernel/shaders/node_rgb_curves.osl ``` It looks like the refactoring in commit ea2ebf7a00f9adef9c14aaa24b79532b44043eba (Cycles: constant folding for RGB/Vector Curves and Color Ramp) replaced the inclusion of "stdosl.h" by the new "node_ramp_util.h" but this new include file relies on the "clamp" function and does not include "stdosl.h" that defines it. Likely solution: #include "stdosl.h" in "node_ramp_util.h". Strangely, when I do this, oslc still complains wqith a warning ``` blender/intern/cycles/kernel/shaders/node_rgb_curves.osl:0: warning: Unable to find "stdosl.h" ``` but the compilation succeeds (for this file and for blender overall). Could it be possible I have a bad "oslc" ? Sorry if this is the case.
Alexander Gavrilov was assigned by T Reepleks 2016-08-10 23:31:20 +02:00
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @treepleks

Added subscriber: @treepleks
Member

Added subscribers: @Sergey, @brecht

Added subscribers: @Sergey, @brecht
Alexander Gavrilov was unassigned by Brecht Van Lommel 2016-08-11 01:25:19 +02:00
Brecht Van Lommel self-assigned this 2016-08-11 01:25:19 +02:00

Added subscriber: @angavrilov

Added subscriber: @angavrilov

Which platform are you building on? Did you svn update the lib/ directory to the latest version?

The buildbot seems to be building ok on all platforms.

Ideally we shouldn't be including stdosl.h at all, we originally did it to solve some path issues. Maybe now it's possible to remove such includes entirely but will need to check.

Which platform are you building on? Did you svn update the lib/ directory to the latest version? The buildbot seems to be building ok on all platforms. Ideally we shouldn't be including stdosl.h at all, we originally did it to solve some path issues. Maybe now it's possible to remove such includes entirely but will need to check.

Added subscriber: @ideasman42

Added subscriber: @ideasman42

I ran into this some days ago (possibly the same bug?)

Using Arch Linux
For some reason oslc 1.7.2 wasn't finding its own include path.

For a temporary workaround, making this symlink resolved the issue.

  ln -s /usr/share/OSL /usr/lib/osl/include

Of course it should be resolved upstream.

Using prefix the oslc command with strace to see search paths which are searched.

I ran into this some days ago (possibly the same bug?) Using Arch Linux For some reason `oslc` 1.7.2 wasn't finding its own include path. For a temporary workaround, making this symlink resolved the issue. ``` ln -s /usr/share/OSL /usr/lib/osl/include ``` Of course it should be resolved upstream. Using prefix the `oslc` command with `strace` to see search paths which are searched.
Author

I'm the person that maintains the main Ubuntu PPA for blender (during week-ends - have a full time job otherwise).

This new compilation issue shows up on all distribs from Vivid to Xenial (so Debian too probably).

The strace shows that oslc does not search in the suitable paths:

stat("/usr/lib/osl/include", 0x7ffd67d4f6d0) = -1 ENOENT (No such file or directory)
stat("/usr/shaders", 0x7ffd67d4f6d0) = -1 ENOENT (No such file or directory)

since stdosl.h is either in pwd or in /usr/share/OSL-1.7.

I'm also providing OSL in my PPA, so it may be a compilation option I'm lacking when compiling OSL. I'm using OSL 1.7.1 for now.

The strace shows that "ln -s /usr/share/OSL-1.7 /usr/lib/osl/include" would work. I used a quilt patch that includes stdosl.h explicitely for now.

Thanks for the quick feedback and sorry for the disturbance.

I'm the person that maintains the main Ubuntu PPA for blender (during week-ends - have a full time job otherwise). This new compilation issue shows up on all distribs from Vivid to Xenial (so Debian too probably). The strace shows that oslc does not search in the suitable paths: stat("/usr/lib/osl/include", 0x7ffd67d4f6d0) = -1 ENOENT (No such file or directory) stat("/usr/shaders", 0x7ffd67d4f6d0) = -1 ENOENT (No such file or directory) since stdosl.h is either in `pwd` or in /usr/share/OSL-1.7. I'm also providing OSL in my PPA, so it may be a compilation option I'm lacking when compiling OSL. I'm using OSL 1.7.1 for now. The strace shows that "ln -s /usr/share/OSL-1.7 /usr/lib/osl/include" would work. I used a quilt patch that includes stdosl.h explicitely for now. Thanks for the quick feedback and sorry for the disturbance.

Ok, it seems like the deeper issue is that OSL doesn't support having the include directory where Linux distributions like to place it. That shouldn't be too hard to fix but needs to be done upstream in OSL.

If building Blender worked before then I should be able to make that work again though.

Ok, it seems like the deeper issue is that OSL doesn't support having the include directory where Linux distributions like to place it. That shouldn't be too hard to fix but needs to be done upstream in OSL. If building Blender worked before then I should be able to make that work again though.

This issue was referenced by blender/cycles@6784e249d7

This issue was referenced by blender/cycles@6784e249d70bb300cf58345d86aa46de07921f9f

This issue was referenced by f3bff6a1a1

This issue was referenced by f3bff6a1a1cb05bcc6a540461f7a282da7bb3dae

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Added subscriber: @IPv6

Added subscriber: @IPv6

This comment was removed by @IPv6

*This comment was removed by @IPv6*
Sign in to join this conversation.
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
6 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#49071
No description provided.