Comments (23)
In the CMAKE_CXX_FLAGS
for Clang
?
# Line 13 of ext/openexr/CMakeLists.txt
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-switch -Wno-tautological-compare -Wno-deprecated-register")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-switch -Wno-tautological-compare -Wno-deprecated-register -fno-stack-check")
from mitsuba2.
Then lldb -- mitsuba sph.xml
, run
, and bt
.
from mitsuba2.
In the
CMAKE_CXX_FLAGS
forClang
?# Line 13 of ext/openexr/CMakeLists.txt - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-switch -Wno-tautological-compare -Wno-deprecated-register") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-switch -Wno-tautological-compare -Wno-deprecated-register -fno-stack-check")
yes - that's where I put it
from mitsuba2.
Works just as well on a Release build (i.e. without -DCMAKE_BUILD_TYPE=Debug
, where Release
gets picked as the default).
I'll conclude that upgrading XCode via the App Store and reaching a state where
$ xcodebuild -version
Xcode 11.3.1
Build version 11C504
seems to have solved it. I also had to run XCode (the GUI app) and let it install some "tools" (it prompted be on the first run after the upgrade and I allowed it. Don't remember the exact wording of that prompted message box). After XCode installed its tools, I could see my clang was upgraded as well (compare with the version in which the build failed):
$ clang --version
Apple clang version 11.0.0 (clang-1100.0.33.17)
Target: x86_64-apple-darwin19.0.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
No additional code changes (such as adding -fno-stack-check
) were required.
Closing this as solved. Thanks!!!
from mitsuba2.
Sorry to bring this up again: I got the same issue upon upgrading to XCode 11.4. I rolled back to 11.3.1 and it works fine again.
from mitsuba2.
I confirm that Xcode 11.4 upgrade works with the proposed addition of fno-stack-check
flag
from mitsuba2.
That's very strange. What kind of processor architecture / Linux version is this running on? What compiler version did you use?
from mitsuba2.
Hi @wjakob - that's on OSX, not Linux. My clang[++]
versions are Apple clang version 11.0.0 (clang-1100.0.33.12)
.
$ clang --version # output for `clang++ --version` is identical
Apple clang version 11.0.0 (clang-1100.0.33.12)
Target: x86_64-apple-darwin19.0.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
from mitsuba2.
In case it's useful as a sanity check, I've successfully built and run scenes on Mojave (10.14.3) with an older version of clang (clang-1000.11.45.5).
Running ext_build/openexr/OpenEXR/IlmImf/./dwaLookups directly completes successfully.
Seems like it's an OpenEXR issue. Maybe try downloading that and compiling directly as a cross check?
from mitsuba2.
Super weird. Can you build in debug mode & attach LLDB to the crashing dwaLookups
? Maybe a backtrace will shed light on what's going on here.
from mitsuba2.
I just had this issue, LLDB throws "libdyld.dylib`stack_not_16_byte_aligned_error", which led me to this post:
Homebrew/homebrew-core#44776 (comment)
Apparently it's xcode 11 specific. Passing -fno-stack-check appears to resolve the issue.
from mitsuba2.
Amazing, thank you for the detective work! Does this only happen when building in debug mode, or also release mode? It would be a piece of cake to just always provide this parameter to the recursive OpenEXR build.
from mitsuba2.
It happens in both as far as I can tell. I put the parameter directly into ext/openexr/CMakeLists.txt, but that homebrew thread makes it sounds like passing it by default globally should be ok.
from mitsuba2.
@nmatsuda sounds good! So if compilation is done by
$ mkdir build
$ cd build
$ cmake -GNinja ..
$ ninja
where does the -fno-stack-check
?
$ ninja -fno-stack-check # here?
$ cmake -GNinja -fno-stack-check # or here?
Or otherwise - where do I add it in ext/openexr/CMakeLists.txt
?
Thanks!
from mitsuba2.
The build now passes and mitsuba
can be executed (after source setpath.sh
). Sadly, the exr
stage seems to cause trouble. Here's what I get when I try to render a sphere (XML taken from here):
# Taken from https://mitsuba2.readthedocs.io/en/latest/src/getting_started/file_format/#scene-file-format
$ cat sph.xml
<scene version="2.0.0">
<shape type="sphere">
<float name="radius" value="10"/>
</shape>
</scene>
$ mitsuba sph.xml
2020-03-12 01:04:14 INFO main [mitsuba.cpp:194] Mitsuba version 2.0.0 (master[d30def81], Mac OS, 64bit, 8 threads, 8-wide SIMD)
2020-03-12 01:04:14 INFO main [mitsuba.cpp:195] Copyright 2019, Realistic Graphics Lab, EPFL
2020-03-12 01:04:14 INFO main [mitsuba.cpp:196] Enabled processor features: avx2 avx fma f16c sse4.2 x86_64
2020-03-12 01:04:14 INFO main [mitsuba.cpp:197] Using mode "packet_rgb"
2020-03-12 01:04:14 INFO main [xml.cpp:1117] Loading XML file "sph.xml" ..
2020-03-12 01:04:14 INFO main [PluginManager] Loading plugin "plugins/sphere.dylib" ..
2020-03-12 01:04:14 INFO main [PluginManager] Loading plugin "plugins/diffuse.dylib" ..
2020-03-12 01:04:14 INFO main [PluginManager] Loading plugin "plugins/uniform.dylib" ..
2020-03-12 01:04:14 WARN main [Scene] No sensors found! Instantiating a perspective camera..
2020-03-12 01:04:14 INFO main [PluginManager] Loading plugin "plugins/perspective.dylib" ..
2020-03-12 01:04:14 INFO main [PluginManager] Loading plugin "plugins/hdrfilm.dylib" ..
2020-03-12 01:04:14 INFO main [PluginManager] Loading plugin "plugins/gaussian.dylib" ..
2020-03-12 01:04:14 INFO main [PluginManager] Loading plugin "plugins/independent.dylib" ..
2020-03-12 01:04:14 WARN main [Scene] No integrator found! Instantiating a path tracer..
2020-03-12 01:04:14 INFO main [PluginManager] Loading plugin "plugins/path.dylib" ..
2020-03-12 01:04:14 INFO main [ShapeKDTree] Building a SAH kd-tree (1 primitives) ..
2020-03-12 01:04:14 INFO main [ShapeKDTree] Finished. (12 B of storage, took 0ms)
2020-03-12 01:04:14 INFO main [SamplingIntegrator] Starting render job (768x576, 4 samples, 8 threads)
Rendering [===============================================================================================] (82ms, ETA: 0ms)
2020-03-12 01:04:14 INFO main [SamplingIntegrator] Rendering finished. (took 82ms)
2020-03-12 01:04:14 INFO main [HDRFilm] ✔ Developing "sph.exr" ..
Segmentation fault: 11
from mitsuba2.
Interesting that OpenEXR is causing so much trouble (working perfectly fine here on MacOS / Mojave). Could you make a debug build, attach via LLDB, and get a backtrace?
from mitsuba2.
I'm on 10.15 (Catalina not Mojave).
Sure, how? Do I rm -rf *
inside build
, then this?
$ cmake -DCMAKE_BUILD_TYPE=Debug -GNinja ..
$ ninja
And afterwards lldb mitsuba sph.xml
? Or do I need more flags for lldb
?
from mitsuba2.
BTW since xcode has been mentioned as a culprit by @nmatsuda , I'm with 11.2.1:
$ xcodebuild -version
Xcode 11.2.1
Build version 11B500
This is not the latest - I can upgrade to 11.3.1 from the App Store.
from mitsuba2.
You can easily toggle the build mode using a tool like "ccmake" or "cmake-gui", then simply run "ninja" once more.
from mitsuba2.
Thanks for the lldb
instructions! I thought the cmake part is as easy as this. I'll try with the cmake tools you mentioned.
from mitsuba2.
BTW since xcode has been mentioned as a culprit by @nmatsuda , I'm with 11.2.1:
$ xcodebuild -version Xcode 11.2.1 Build version 11B500This is not the latest - I can upgrade to 11.3.1 from the App Store.
I'm on 11.3.1 and unfortunately the issue is still present - I think 11.0 through 11.3 all use the same version of clang. But no issues so far after adding the compiler flag (I think the segfault you got at runtime might have been from one of your previous builds)
from mitsuba2.
OK now:
- I upgraded XCode via the App store, now
$ xcodebuild -version
Xcode 11.3.1
Build version 11C504
-
I reset my git completely, including the
-fno-stack-check
change because I didn't want to skip a check in the build but then get a segfault during runtime. -
I ran
cmake -DCMAKE_BUILD_TYPE=Debug -GNinja .. && ninja
.
Now (after source setpath.sh
of course) - mitsuba sph.xml
generates a proper sph.exr
file!
Likewise cd resources/data/scenes && mitsuba hello.xml
gives me the hello.exr
with the famous teapot.
Thanks @nmatsuda and @wjakob !
I'll delete everything under build
and will retry without the Debug
flag. (@nmatsuda : I always do that, this is why I don't think the previous builds affected me as I always start with the build
dir empty, correct me if I'm wrong about this please!).
from mitsuba2.
Hello @nmatsuda and @wjakob,
I got a similar issue during my compilation. Please help me out.
System information:
Ubuntu 16.04
cmake 3.13.4
ninja 1.5.1
clang-10
python 3.6.12
cuda-10.1
NVIDIA driver 418.87.00
Below is returned by cmake -GNinja .. -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc
-- The C compiler identification is Clang 10.0.1
-- The CXX compiler identification is Clang 10.0.1
-- Check for working C compiler: /usr/bin/clang-10
-- Check for working C compiler: /usr/bin/clang-10 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/clang++-10
-- Check for working CXX compiler: /usr/bin/clang++-10 -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found PythonInterp: /home/user/anaconda3/envs/stylegan2/bin/python3.6 (found version "3.6.12")
-- Found PythonLibs: /home/user/anaconda3/envs/stylegan2/lib/libpython3.6m.so
-- Building the following variants of Mitsuba:
-- * scalar_rgb
-- * gpu_autodiff_rgb
-- Setting build type to 'Release' as none was specified.
-- Mitsuba: using libc++.
-- Mitsuba: building the Python plugin.
-- The CUDA compiler identification is NVIDIA 10.1.243
-- Check for working CUDA compiler: /usr/local/cuda/bin/nvcc
-- Check for working CUDA compiler: /usr/local/cuda/bin/nvcc -- works
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Enoki: building the CUDA backend.
-- Enoki: building the autodiff backend.
-- Enoki: building the Python plugin.
-- pybind11 v2.4.dev4
-- LTO enabled
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11")
-- Found PNG: /usr/lib/x86_64-linux-gnu/libpng.so (found version "1.2.54")
-- Found JPEG: /usr/lib/x86_64-linux-gnu/libjpeg.so (found version "80")
-- TBB: using libc++.
-- Mitsuba: using builtin implementation for CPU ray tracing.
-- Mitsuba: using OptiX for GPU ray tracing.
-- Mitsuba: LTO support enabled.
-- Check if the system is big endian
-- Searching 16 bit integer
-- Using unsigned short
-- Check if the system is big endian - little endian
-- Mitsuba: sampling profiler enabled.
-- Found Sphinx: /home/user/anaconda3/envs/stylegan2/bin/sphinx-build
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/software/mitsuba2/build
And the error return by ninja
:
[121/684] Building CXX object ext_build/openexr/OpenEXR/IlmImf/CMakeFiles/IlmImf-obj.dir/ImfConvert.cpp.o
../ext/openexr/OpenEXR/IlmImf/ImfConvert.cpp:110:31: warning: implicit conversion from 'unsigned int' to 'float' changes value from 4294967295 to 4294967296 [-Wimplicit-int-float-conversion]
if (isInfinity (f) || f > UINT_MAX)
~ ^~~~~~~~
/usr/lib/llvm-10/lib/clang/10.0.1/include/limits.h:56:37: note: expanded from macro 'UINT_MAX'
#define UINT_MAX (__INT_MAX__ *2U +1U)
~~~~~~~~~~~~~~~~~^~~
1 warning generated.
[200/684] Generating dwaLookups.h
FAILED: cd /home/user/software/mitsuba2/build/ext_build/openexr/OpenEXR/IlmImf && /home/user/software/mitsuba2/build/ext_build/openexr/OpenEXR/IlmImf/./dwaLookups > /home/user/software/mitsuba2/build/ext_build/openexr/OpenEXR/IlmImf/dwaLookups.h
/home/user/software/mitsuba2/build/ext_build/openexr/OpenEXR/IlmImf/./dwaLookups: symbol lookup error: /home/user/software/mitsuba2/build/ext_build/openexr/OpenEXR/IlmImf/./dwaLookups: undefined symbol: _ZTIN9IlmThread6ThreadE
[200/684] Building CXX object ext_build/enoki/CMakeFiles/enoki-python-cuda-autodiff.dir/src/python/cuda_autodiff_matrix.cpp.o
ninja: build stopped: subcommand failed.
from mitsuba2.
Related Issues (20)
- [🔨 compilation issue] 'cmake -GNinja' step HOT 3
- [❔ other question] How to convert/extract enoki.autodiff_cuda.Float32 type array from Bitmap class? HOT 4
- [❔ other question]runtime API error = 0719 HOT 1
- [🐛 bug report] importing Pytorch after mitsuba => Segmentation fault (core dumped) HOT 1
- [❔ other question] Performance on Windows much lower than Linux? HOT 5
- [🐛 bug report] hdrfilm.cpp: duplicate channel detection HOT 3
- [❔ other question] how to uninstall mitsuba2 in linux? HOT 4
- The examples of Differentiable rendering applications HOT 2
- [🐛 bug report] OptiX "arithmetic involving uninitialized variable!" with Certain Scenes HOT 1
- [✨ feature request] Tutorial on differential rendering material acquisition HOT 1
- Something about code HOT 1
- Caught a critical exception: main [properties.cpp:401] └1∩Æ∞☺
- [✨ feature request] Does the mitsuba2 support bsdf for cloth model? HOT 1
- 用java或C++用物件導向的概念設計程式解下面的問題:讀取一組時間,計算出時針與分針的夾角,時間的格式是0:00到12:00,小時數可能為1或2位數,分鐘數總是2位數,00到59之間。輸出腳讀為0到180之間的值,角度的精確度到千分之一。例如9:00是90.000度,不是-90,也不是270,2:00則是60 HOT 1
- Rendered polarized images' intensity doesn't change according to the change of polarization angle- [❔ other question] HOT 1
- [❔ other question] setting the variant("llvm_spectral_polarized"), the code didn't work HOT 2
- [❔ other question]How can we output UV map in python? HOT 1
- - [❔ other question] I want to optimize the values in the transform component of my sensor plugin HOT 1
- Unable to compile: Windows 10: Visual Studio Community 2022 HOT 1
- White noise in spectral rendering - [❔ other question] HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mitsuba2.