boberfly / GafferCycles

Cycles for Gaffer
BSD 3-Clause "New" or "Revised" License
84 stars 10 forks source link

Embree ISA issue on OSX #47

Open melMass opened 4 years ago

melMass commented 4 years ago

Hi,

I'm planning to use Cycles in Gaffer next week so I want to try and build a version at home first and l'll report my issues here.

Issue 01 - Multiple ISAs not allowed in Clang

I think the most portable way to deal with it is to use embree's instructions detection by using:

-D EMBREE_MAX_ISA=DEFAULT

This detects the current CPU's instruction technology and only build that one. It might be an issue in CI and Docker but I think it's cross platform for the rest.

Error

But different instructions are requested later on in the build resulting in the following errors:

Make Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
EMBREE_EMBREE_AVX2_LIBRARY (ADVANCED)
    linked by target "GafferCycles" in directory /Users/joedoe/gits/contribs/GafferCycles
    linked by target "cycles" in directory /Users/joedoe/gits/contribs/GafferCycles/cycles/src/app
    linked by target "cycles_bvh" in directory /Users/joedoe/gits/contribs/GafferCycles/cycles/src/bvh
EMBREE_EMBREE_AVX_LIBRARY (ADVANCED)
    linked by target "GafferCycles" in directory /Users/joedoe/gits/contribs/GafferCycles
    linked by target "cycles" in directory /Users/joedoe/gits/contribs/GafferCycles/cycles/src/app
    linked by target "cycles_bvh" in directory /Users/joedoe/gits/contribs/GafferCycles/cycles/src/bvh
EMBREE_EMBREE_SSE42_LIBRARY (ADVANCED)
    linked by target "GafferCycles" in directory /Users/joedoe/gits/contribs/GafferCycles
    linked by target "cycles" in directory /Users/joedoe/gits/contribs/GafferCycles/cycles/src/app
    linked by target "cycles_bvh" in directory /Users/joedoe/gits/contribs/GafferCycles/cycles/src/bvh

I'm still debugging it but if you have an idea :)

Thanks

boberfly commented 4 years ago

Hi @melMass

Recently the Cycles standalone introduced their own FindEmbree.cmake which might not be smart enough to have any custom cmake-related flags/defines over the one which is generated by Embree itself. What I'd try is deleting the one which comes with Cycles and make it use the one that Embree builds and see what happens.

I am guessing you are building on macOS, let me know how that goes as I've never tried.

Cheers