Cycles OSL - compiling shaders failing due "\" and "n" symbols combination inside include paths - Needs OSL update #83631

Closed
opened 2020-12-10 14:35:02 +01:00 by Nikita Sirgienko · 24 comments

System Information
Operating system: Windows 10 Enterprise 1909 18363.1198
Graphics card: Intel(R) UHD Graphics 620
OSL Compiler version: 1.10.10

Blender Version
Broken: 46e66d154c

Short description of error
During building OSL shaders a compiler reports errors like this:

C:\Users\nsirgien\Documents\>C:\Users\nsirgien\Documents\Intel\lib\win64_vc15\osl\bin\oslc.exe -q -O2 -I"C:/Users/nsirgien/Documents/Intel/blender/intern/cycles/kernel/shaders" -I"C:/Users/nsirgien/Documents/Intel/blender/../lib/win64_vc15/osl/shaders" -o C:/Users/nsirgien/Documents/Intel/winbuild/intern/cycles/kernel/shaders/node_rgb_to_bw.oso C:/Users/nsirgien/Documents/Intel/blender/intern/cycles/kernel/shaders/node_rgb_to_bw.osl
C:/Users/nsirgien/Documents/Intel/blender/intern/cycles/kernel/shaders/node_rgb_to_bw.osl:1: error: error: could not find include file: C:\Users
sirgien\Documents\Intel\lib\win64_vc15\osl/shaders/stdosl.h
FAILED C:/Users/nsirgien/Documents/Intel/blender/intern/cycles/kernel/shaders/node_rgb_to_bw.osl

The problem is, that "" and "n" symbol combinations, which naturally appears in file paths, handled as new line, which cause fail of the file including.

Exact steps for others to reproduce the error
Based on the default startup or an attached .blend file (as simple as possible).

  1. Make a directory with "\n"
  2. Download blender and blender dependencies in this directory
  3. Try to build blender with WITH_CYCLES_OSL=ON

P.S. Is it upstream problem and should be reported to OSL compiler tracker?

**System Information** Operating system: Windows 10 Enterprise 1909 18363.1198 Graphics card: Intel(R) UHD Graphics 620 OSL Compiler version: 1.10.10 **Blender Version** Broken: 46e66d154c9a1d2b25128cbcd3445148df34a581 **Short description of error** During building OSL shaders a compiler reports errors like this: ``` C:\Users\nsirgien\Documents\>C:\Users\nsirgien\Documents\Intel\lib\win64_vc15\osl\bin\oslc.exe -q -O2 -I"C:/Users/nsirgien/Documents/Intel/blender/intern/cycles/kernel/shaders" -I"C:/Users/nsirgien/Documents/Intel/blender/../lib/win64_vc15/osl/shaders" -o C:/Users/nsirgien/Documents/Intel/winbuild/intern/cycles/kernel/shaders/node_rgb_to_bw.oso C:/Users/nsirgien/Documents/Intel/blender/intern/cycles/kernel/shaders/node_rgb_to_bw.osl C:/Users/nsirgien/Documents/Intel/blender/intern/cycles/kernel/shaders/node_rgb_to_bw.osl:1: error: error: could not find include file: C:\Users sirgien\Documents\Intel\lib\win64_vc15\osl/shaders/stdosl.h FAILED C:/Users/nsirgien/Documents/Intel/blender/intern/cycles/kernel/shaders/node_rgb_to_bw.osl ``` The problem is, that "\" and "n" symbol combinations, which naturally appears in file paths, handled as new line, which cause fail of the file including. **Exact steps for others to reproduce the error** Based on the default startup or an attached .blend file (as simple as possible). 1) Make a directory with "\n" 2) Download blender and blender dependencies in this directory 3) Try to build blender with WITH_CYCLES_OSL=ON P.S. Is it upstream problem and should be reported to OSL compiler tracker?
Author
Member

Added subscriber: @Sirgienko

Added subscriber: @Sirgienko
Author
Member

Added subscriber: @maxim_d33

Added subscriber: @maxim_d33
Author
Member
CC: @maxim_d33
Member

Added subscribers: @LazyDodo, @EAW

Added subscribers: @LazyDodo, @EAW
Member

Researching this, it looks like this was fixed upstream already, fixed in Blender, then broken again? I'll have to test.

  1. @LazyDodo reported it here: https://github.com/imageworks/OpenShadingLanguage/issues/866 in Feb 2018.
  2. Pull Request here: https://github.com/imageworks/OpenShadingLanguage/pull/1101. It was merged upstream in January.
  3. Merge into Blender Feb 8 b9c9b00171
  4. A related stdosl.h issue fixed in a commit Feb 11 D6812: Fix: OSL warnings during build df1e9b662b
  5. 8d60e6fa38 Fixed on Feb 17 see #73830 (Blender complains that it cannot find "stdosl.h", despite it existing at "/usr/share/OSL/shaders/stdosl.h") for further details.

@LazyDodo Is a pair of parenthesis missing in a CMake file? Did fixing Linux break Windows perhaps?

Researching this, it looks like this was fixed upstream already, fixed in Blender, then broken again? I'll have to test. 1. @LazyDodo reported it here: https://github.com/imageworks/OpenShadingLanguage/issues/866 in Feb 2018. 2. Pull Request here: https://github.com/imageworks/OpenShadingLanguage/pull/1101. It was merged upstream in January. 3. Merge into Blender Feb 8 b9c9b00171 4. A related `stdosl.h` issue fixed in a commit Feb 11 [D6812: Fix: OSL warnings during build](https://archive.blender.org/developer/D6812) df1e9b662b 5. 8d60e6fa38 Fixed on Feb 17 see #73830 (Blender complains that it cannot find "stdosl.h", despite it existing at "/usr/share/OSL/shaders/stdosl.h") for further details. @LazyDodo Is a pair of parenthesis missing in a CMake file? Did fixing Linux break Windows perhaps?
Member

No this is an issue in oslc nothing we do on the blender side can fix/unfix this behavior.

i'd have to test with the latest osl to see if the issue has been fixed already and if not report it upstream.

No this is an issue in oslc nothing we do on the blender side can fix/unfix this behavior. i'd have to test with the latest osl to see if the issue has been fixed already and if not report it upstream.
Ray molenkamp self-assigned this 2020-12-10 17:13:02 +01:00
Member

Added subscriber: @brecht

Added subscriber: @brecht
Member

The bug was fixed in the clang code path in #1101, but the boost_wave codepath above it still has the issue which sadly is the current path our libraries take.

couple of options here

  1. rebuild the libs and force it to take the fixed codepath by disabling whatever enabled the WITH_BOOST_WAVE define
  2. patch OSL and fix the bug (I have no CLA on record so I cannot upstream, also see point 3)
  3. the broken codepath seems to be gone completely in v1.11.10.0 so we could probably just bump the osl version, but I'm unsure if there's any re-integration work associated with that and if @brecht has time for that

@brecht thoughts?

The bug was fixed in the clang code path in [#1101](https:*github.com/imageworks/OpenShadingLanguage/pull/1101), but the boost_wave codepath above it [still has the issue](https:*github.com/imageworks/OpenShadingLanguage/blob/RB-1.10/src/liboslcomp/oslcomp.cpp#L195) which sadly is the current path our libraries take. couple of options here 1) rebuild the libs and force it to take the fixed codepath by disabling whatever enabled the WITH_BOOST_WAVE define 2) patch OSL and fix the bug (I have no CLA on record so I cannot upstream, also see point 3) 3) the broken codepath seems to be gone completely in v1.11.10.0 so we could probably just bump the osl version, but I'm unsure if there's any re-integration work associated with that and if @brecht has time for that @brecht thoughts?

I wouldn't mind upgrading to 1.11. I already did adjustments for API changes a bit before the release, hopefully it will just build and work as is. But if note I can update the code.

I wouldn't mind upgrading to 1.11. I already did adjustments for API changes a bit before the release, hopefully it will just build and work as is. But if note I can update the code.

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Member

I managed to build 1.11, passes all tests without any modifications in blender (and fixes this issue). The deps builder for osl needed some more substantial changes and cleanup, i'll try to get that polished up in the next couple of days.

I managed to build 1.11, passes all tests without any modifications in blender (and fixes this issue). The deps builder for osl needed some more substantial changes and cleanup, i'll try to get that polished up in the next couple of days.

Thanks!

Thanks!
Bastien Montagne changed title from Cycles OSL - compiling shaders failing due "\" and "n" symbols combination inside include paths to Cycles OSL - compiling shaders failing due "\" and "n" symbols combination inside include paths - Needs OSL update 2021-02-03 16:25:36 +01:00

This issue was referenced by blender/cycles@5fe5537a34

This issue was referenced by blender/cycles@5fe5537a344e5e20e9a370e5a3b51ae3a4232aab

This issue was referenced by 4fb0c83c1c

This issue was referenced by 4fb0c83c1c8529b61d38d8a409caf58d05a53bd9

Added subscriber: @hargettp

Added subscriber: @hargettp

FYI, the commit in D10212 broke builds on Mac OS X Big Sur (Apple M1 Mac / darwin arm64).

The error after running make is:

-- Could NOT find Clang (missing: _CLANG_LIBRARIES) 
CMake Error at build_files/cmake/platform/platform_apple.cmake:339 (message):
  Clang not found.
Call Stack (most recent call first):
  CMakeLists.txt:916 (include)

The contents of CMakeError.log are:

Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc 
Build flags: 
Id flags:  

The output was:
1
ld: library not found for -lSystem
clang: error: linker command failed with exit code 1 (use -v to see invocation)


Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
Compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ 
Build flags: 
Id flags:  

The output was:
1
ld: library not found for -lc++
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The commit just before this one still builds just fine.

FYI, the commit in [D10212](https://archive.blender.org/developer/D10212) broke builds on Mac OS X Big Sur (Apple M1 Mac / darwin arm64). The error after running `make` is: ``` -- Could NOT find Clang (missing: _CLANG_LIBRARIES) CMake Error at build_files/cmake/platform/platform_apple.cmake:339 (message): Clang not found. Call Stack (most recent call first): CMakeLists.txt:916 (include) ``` The contents of CMakeError.log are: ``` Compiling the C compiler identification source file "CMakeCCompilerId.c" failed. Compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc Build flags: Id flags: The output was: 1 ld: library not found for -lSystem clang: error: linker command failed with exit code 1 (use -v to see invocation) Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed. Compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ Build flags: Id flags: The output was: 1 ld: library not found for -lc++ clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` The commit just before this one still builds just fine.
Member

Update your svn libs, @sebbas was on that yesterday, i assume that was completed?

Update your svn libs, @sebbas was on that yesterday, i assume that was completed?
Member

Added subscriber: @sebbas

Added subscriber: @sebbas

I see you're on Apple M1. @hargettp the libs still have to be updated for that, so far the changes only considered x86.

As soon as I have access to an M1 machine again, I'll make the lib update.

@LazyDodo Yeah, I think it's time to make Apple arm a hard requirement for lib updates.

I see you're on Apple M1. @hargettp the libs still have to be updated for that, so far the changes only considered x86. As soon as I have access to an M1 machine again, I'll make the lib update. @LazyDodo Yeah, I think it's time to make Apple arm a hard requirement for lib updates.

Ah this makes sense @sebbas ; I ran make update before doing a fresh build, so missing ARM libraries would certainly do it.

Ah this makes sense @sebbas ; I ran `make update` before doing a fresh build, so missing ARM libraries would certainly do it.

@hargettp ARM libraries have been updated, so after make update builds should work again!

@hargettp ARM libraries have been updated, so after `make update` builds should work again!

Worked like a charm and running again on Apple M1--thx @sebbas !

Worked like a charm and running again on Apple M1--thx @sebbas !

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'

Great, let's consider this resolved then.

Great, let's consider this resolved then.
Thomas Dinges added this to the 2.93 LTS milestone 2023-02-07 18:46:38 +01:00
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
7 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#83631
No description provided.