RenderKit / ospray

An Open, Scalable, Portable, Ray Tracing Based Rendering Engine for High-Fidelity Visualization
http://ospray.org
Apache License 2.0
982 stars 178 forks source link

ospray 2.10.0 build failure #539

Closed chenrui333 closed 1 year ago

chenrui333 commented 1 year ago

👋 trying to build the latest release, but run into some build issue. The error log is as below:

build error ``` /tmp/ospray--openvkl-20220716-69335-o0xg9s/openvkl-1.3.0/openvkl/devices/cpu/volume/amr/AMR.ih:7:10: fatal error: cannot open file '/tmp/ospray--openvkl-20220716-69335-o0xg9s/openvkl-1.3.0/openvkl/devices/cpu/volume/amr/rkcommon/math/box.ih': No such file or directory #include "rkcommon/math/box.ih" ^ In file included from /tmp/ospray--openvkl-20220716-69335-o0xg9s/openvkl-1.3.0/openvkl/devices/cpu/iterator/DefaultIterator.ispc:5: /tmp/ospray--openvkl-20220716-69335-o0xg9s/openvkl-1.3.0/openvkl/devices/cpu/iterator/../math/box_utility.ih:6:10: fatal error: cannot open file '/tmp/ospray--openvkl-20220716-69335-o0xg9s/openvkl-1.3.0/openvkl/devices/cpu/iterator/../math/rkcommon/math/box.ih': No such file or directory #include "rkcommon/math/box.ih" ^ In file included from /tmp/ospray--openvkl-20220716-69335-o0xg9s/openvkl-1.3.0/openvkl/devices/cpu/volume/amr/method_octant.ispc:4: In file included from /tmp/ospray--openvkl-20220716-69335-o0xg9s/openvkl-1.3.0/openvkl/devices/cpu/volume/amr/AMRVolume.ih:6: /tmp/ospray--openvkl-20220716-69335-o0xg9s/openvkl-1.3.0/openvkl/devices/cpu/volume/amr/../Volume.ih:6:10: fatal error: cannot open file '/tmp/ospray--openvkl-20220716-69335-o0xg9s/openvkl-1.3.0/openvkl/devices/cpu/volume/amr/../rkcommon/math/vec.ih': No such file or directory #include "rkcommon/math/vec.ih" ^ In file included from /tmp/ospray--openvkl-20220716-69335-o0xg9s/openvkl-1.3.0/openvkl/devices/cpu/volume/amr/AMRVolume.ispc:7: In file included from /tmp/ospray--openvkl-20220716-69335-o0xg9s/openvkl-1.3.0/openvkl/devices/cpu/volume/amr/../UnstructuredSamplerBase.ih:4: /tmp/ospray--openvkl-20220716-69335-o0xg9s/openvkl-1.3.0/openvkl/devices/cpu/volume/amr/../../sampler/Sampler.ih:6:10: fatal error: cannot open file '/tmp/ospray--openvkl-20220716-69335-o0xg9s/openvkl-1.3.0/openvkl/devices/cpu/volume/amr/../../sampler/openvkl/VKLFilter.h': No such file or directory #include "openvkl/VKLFilter.h" ^ In file included from /tmp/ospray--openvkl-20220716-69335-o0xg9s/openvkl-1.3.0/openvkl/devices/cpu/volume/amr/CellRef.ispc:4: In file included from /tmp/ospray--openvkl-20220716-69335-o0xg9s/openvkl-1.3.0/openvkl/devices/cpu/volume/amr/CellRef.ih:7: /tmp/ospray--openvkl-20220716-69335-o0xg9s/openvkl-1.3.0/openvkl/devices/cpu/volume/amr/AMR.ih:7:10: fatal error: cannot open file '/tmp/ospray--openvkl-20220716-69335-o0xg9s/openvkl-1.3.0/openvkl/devices/cpu/volume/amr/rkcommon/math/box.ih': No such file or directory #include "rkcommon/math/box.ih" ^ make[2]: *** [openvkl/devices/cpu/ispc_neon-i32x4/local_volume/amr/DualCell.dev.o] Error 1 ```

full build log, https://github.com/Homebrew/homebrew-core/runs/7371813071 relates to Homebrew/homebrew-core#104141

Twinklebear commented 1 year ago

Hi @chenrui333 ,

The build log seems a bit odd to me, was this build working before for earlier versions of OSPRay? I guess i'd kind of assume so since it looks like your PR is to just bump the versions, but it'd be interesting to see it.

It looks like it builds rkcommon here and installs it in the Homebrew install area (?): https://github.com/Homebrew/homebrew-core/runs/7371813095?check_suite_focus=true#step:6:118 under /usr/local/Cellar/ospray/2.10.0/ . This seems fine.

But here when the OpenVKL build is run it tries to look for rkcommon/math/vec.ih under /tmp/ospray--openvkl-20220716-35706-hwr350/openvkl-1.3.0/openvkl/devices/cpu/volume/amr/../rkcommon/math/vec.ih https://github.com/Homebrew/homebrew-core/runs/7371813123?check_suite_focus=true#step:6:305

  In file included from /tmp/ospray--openvkl-20220716-99022-1y5yhp0/openvkl-1.3.0/openvkl/devices/cpu/volume/amr/method_octant.ispc:4:
  In file included from /tmp/ospray--openvkl-20220716-99022-1y5yhp0/openvkl-1.3.0/openvkl/devices/cpu/volume/amr/AMRVolume.ih:6:
  /tmp/ospray--openvkl-20220716-99022-1y5yhp0/openvkl-1.3.0/openvkl/devices/cpu/volume/amr/../Volume.ih:6:10: fatal error: cannot open file '/tmp/ospray--openvkl-20220716-99022-1y5yhp0/openvkl-1.3.0/openvkl/devices/cpu/volume/amr/../rkcommon/math/vec.ih': No such file or directory
  #include "rkcommon/math/vec.ih"

when processing the include here https://github.com/openvkl/openvkl/blob/master/openvkl/devices/cpu/volume/Volume.ih#L6 which is wrong, it should be looking at the rkcommon install done earlier: https://github.com/Homebrew/homebrew-core/runs/7371813095?check_suite_focus=true#step:6:308 . And looking at the compile line for that file (method_octant.ispc which includes AMRVolume.ih which includes Volume.ih), it has the include path specified for -I /usr/local/Cellar/ospray/2.10.0/include ( https://github.com/Homebrew/homebrew-core/runs/7371813123?check_suite_focus=true#step:6:302 ) (added line breaks for legibility)

  cd /tmp/ospray--openvkl-20220716-99022-1y5yhp0/openvkl-1.3.0/build/openvkl/devices/cpu && /usr/local/bin/ispc -DVKL_TARGET_WIDTH=16 \
  -I /tmp/ospray--openvkl-20220716-99022-1y5yhp0/openvkl-1.3.0/openvkl/devices/cpu \
  -I /tmp/ospray--openvkl-20220716-99022-1y5yhp0/openvkl-1.3.0/build/openvkl/include \
  -I /tmp/ospray--openvkl-20220716-99022-1y5yhp0/openvkl-1.3.0/openvkl/include \
  -I /usr/local/Cellar/ospray/2.10.0/include \
  --arch=x86-64 --addressing=32 -O3 --target=avx512skx-i32x16,sse2 --wno-perf \
  --pic --opt=disable-assertions \
  -h /tmp/ospray--openvkl-20220716-99022-1y5yhp0/openvkl-1.3.0/build/openvkl/devices/cpu/ispc_avx512skx-i32x16sse2/method_octant_ispc.h \
  -MMM /tmp/ospray--openvkl-20220716-99022-1y5yhp0/openvkl-1.3.0/build/openvkl/devices/cpu/ispc_avx512skx-i32x16sse2/local_volume/amr/method_octant.dev.idep \
  -o /tmp/ospray--openvkl-20220716-99022-1y5yhp0/openvkl-1.3.0/build/openvkl/devices/cpu/ispc_avx512skx-i32x16sse2/local_volume/amr/method_octant.dev.o \
   /tmp/ospray--openvkl-20220716-99022-1y5yhp0/openvkl-1.3.0/openvkl/devices/cpu/volume/amr/method_octant.ispc

and the file was installed under that path as seen earlier in the log: https://github.com/Homebrew/homebrew-core/runs/7371813123?check_suite_focus=true#step:6:143

  -- Installing: /usr/local/Cellar/ospray/2.10.0/include/rkcommon/math/vec.ih

One possible interpretation is that it's not finding the rkcommon that was installed under usr/local/Cellar/ospray/2.10.0/include/rkcommon/math/vec.ih and so instead is trying to find it relative to the Volume.ih file that's including it. Then I guess it would try to look for /tmp/ospray--openvkl-20220716-99022-1y5yhp0/openvkl-1.3.0/openvkl/devices/cpu/volume/amr/../rkcommon/math/vec.ih since that's relative to Volume.ih.

It's also very strange to see it failing to include its own file https://github.com/Homebrew/homebrew-core/runs/7371813123?check_suite_focus=true#step:6:313 when processing https://github.com/openvkl/openvkl/blob/master/openvkl/devices/cpu/sampler/Sampler.ih#L6 which will be set in its include path by CMake to find the include file here

What version of ISPC is installed by Homebrew? We do need 1.18 for OSPRay 2.10: https://github.com/ospray/ospray/releases/tag/v2.10.0 , but I don't know if having 1.17 would result in these strange include issues.

chenrui333 commented 1 year ago

What version of ISPC is installed by Homebrew? We do need 1.18 for OSPRay 2.10:

yeah, we are using the latest (v1.18)

chenrui333 commented 1 year ago

any update?

Twinklebear commented 1 year ago

Hi @chenrui333 , this isn't something we were able to reproduce internally on our regular macOS builds, though I'm not as familiar w/ the Homebrew build environment. It looks like the build process is the same though, so it's quite odd.

One thing that you could check is if something strange is going on with the file permissions during the build there, maybe it's unable to read the files it installed? That seems like a really strange issue to occur, but the issue itself is quite strange. Is it possible to try having it build in a local directory under the home directory instead of under /tmp/? Or to dig into the runner configuration a bit more? Maybe some files are being removed or not being resolved properly during the build? E.g. add a step that does an ls -l /usr/local/Cellar/ospray/2.10.0/ to see what's going on there?

I tried reproducing the build & install configuration in the Homebrew CI runner that was failing and wasn't able to reproduce the issue, so I wonder if there's something odd going on in the runner environment.

chenrui333 commented 1 year ago

let me give another spin again

chenrui333 commented 1 year ago

The build is good now, just upgraded on the homebrew side, thus closing this issue. Thanks @Twinklebear!