Building cycles standalone not working for me.?

If you’re gonna require all of blender anyhow, just write out a .gltf file, and call the stock blender to render it, no need to drag cycles standalone into it.

OK, I can try this, but a question beforehand:
Is Blender gltf support absolutely exhaustive compared to Cycles capabilities, including PBR material, glass material (KHR_materials_transmission extension), IBL (BIT_scene_background extension), sun/sky lighting and so on?

Unsure on the exact support matrix, but even if it doesn’t, you can always use it to get the geometry in and use a python script to create custom materials.

What it is, this should be an alternative to photoview360. You make a cool CAD design press render and you got a nice render to share with your customer or social-media. The latter is also important atm since Freecad needs all the attention it gets. People are already saying it is Blender before 2.8. And it only needs a little push. If we can show awesome renders in Freecad and how easy it is to do this it would surely get lots of attention.

Now I am planning to install Linux on my pc so I at least can play around with it! But still especially for CAD most users use Windows so I feel that this is very important!

Poing-pong between Blender and Freecad is not really a nice solutions. Definitely wouldn’t help the idea of Freecad not being user friendly.

Blender and Freecad should make-out more. :relaxed: :heart_eyes:

I’d prefer a solution where we are not responsible for freecad’s end users, surely someone at freecad can step up to the plate and provide windows builds? Happy to talk that person though the build process if required.

I can try it, not sure what level of competence you are asking?

Fair enough.

The Cycles stand alone website says use the pre-build libs and provides the svn command to get said libs.
It says: “The easiest way to build on macOS, Linux and Windows is to use the Blender precompiled libraries.” and “Checkout the folder for your platform”.

It assumes the reader knows what “platform” refers to. The list of things at “https://svn.blender.org/svnroot/bf-blender/trunk/lib” isn’t particularly obvious. Do I want benchmarks (what platform is that?), darwin?, etc. Maybe there is context I’m missing?

I’d guess since I’m dealing with Ubuntu I’d choose “linux_centos7_x86_64”. And this is what I checked out.

Unfortunately, following the rest of the instructions results in errors about can’t find the libs…

I believe it is noted in this thread that indeed the svn command provided refers to a version of the libs that the standalone Cycles code has not been updated to use.
this maybe right? “https://svn.blender.org/svnroot/bf-blender/tags/blender-2.92-release/lib/

I haven’t had a chance to try it since it wouldn’t build for me the other day.

Again, fair enough.

But, is this really a FreeCAD issue?

As I detailed in my other post the instructions on the “Cycles standalone” website don’t seem to be correct. (I forgot to post which website in the other post: “https://developer.blender.org/diffusion/C/” )

Don’t take me wrong.

I’m happy to be talked through this and I will create a wiki page with the details and link from the FreeCAD Render workbench wiki to my details.

Think the context that you’re missing is familiarity with the blender build process, we have scripts there that will automatically grab the right set of libs for you, so devs are at least somewhat familiar with what libs they need even if they don’t grab the libs manually normally

If you only want to build cycles standalone the only folders that matter are

all other folders in /lib are blender related can be ignored, if you craft your directory structure like this

image

cycles build process should automatically pick up on them, they sit one directory up from where your git clone of the cycles repo is.

give it a whirl, and if you run into issues, just holler and i’ll help you out

I’ll give it go tomorrow…but, that’s exactly the structure I had, with cycles and lib on the same level…as noted on the webpage I linked.

Well, it’s tomorrow and I started from scratch:

CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
Could NOT find OpenImageIO (missing: OPENIMAGEIO_LIBRARY
OPENIMAGEIO_INCLUDE_DIR)
Call Stack (most recent call first):
/usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
src/cmake/Modules/FindOpenImageIO.cmake:63 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
src/cmake/external_libs.cmake:231 (find_package)
CMakeLists.txt:101 (include)

CMake 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:
GLUT_INCLUDE_DIR (ADVANCED)
used as include directory in directory /home/mac/cycles-git/cycles
used as include directory in directory /home/mac/cycles-git/cycles

– Configuring incomplete, errors occurred!
See also “/home/mac/cycles-git/cycles/bin-opt/CMakeFiles/CMakeOutput.log”.
See also “/home/mac/cycles-git/cycles/bin-opt/CMakeFiles/CMakeError.log”.
make: *** [Makefile:13: release] Error 1

then you should be off to the races, building blender really isn’t that hard given you use our libs (use the links I gave in my last post though, so you’ll end up with a compatible set of libs, do not use the libs from trunk)

That doesn’t look good, hopefully @LazyDodo can help!

As a newbie I also just installed Visual studio with linux toolset. How hard can it be…

That’s not windows for which I am the maintainer for, so i’m not sure how much assistance i can offer here, I notified someone more familiar with mac to this thread though.

umm…it’s ubuntu

mac is the user name

can’t seem to repro that behavior on my debian in WSL just to confirm you have the right folder layout here’s my setup:

root@SRV:/mnt/k/cycles-git# ls -al
total 0
drwxrwxrwx 1 root root 512 Mar 24 18:50 .
drwxrwxrwx 1 root root 512 Mar 23 17:22 ..
drwxrwxrwx 1 root root 512 Mar 24 19:10 cycles
lrwxrwxrwx 1 root root  26 Mar 23 17:23 lib -> /mnt/k/blendergit/libs_292
root@SRV:/mnt/k/cycles-git# cd lib
root@SRV:/mnt/k/cycles-git/lib# ls -al
total 0
drwxrwxrwx 1 root root 512 Mar 24 19:07 .
drwxrwxrwx 1 root root 512 Mar 24 18:17 ..
drwxrwxrwx 1 root root 512 Mar 24 18:17 .svn
drwxrwxrwx 1 root root 512 Mar 24 18:45 darwin
drwxrwxrwx 1 root root 512 Mar 24 19:07 linux_centos7_x86_64
drwxrwxrwx 1 root root 512 Mar 24 18:30 resources
drwxrwxrwx 1 root root 512 Mar 24 18:29 tests
drwxrwxrwx 1 root root 512 Mar 24 19:14 win64_vc15
root@SRV:/mnt/k/cycles-git/lib# cd ../cycles
root@SRV:/mnt/k/cycles-git/cycles# make
mkdir -p bin-opt
cd bin-opt && cmake  -DCMAKE_BUILD_TYPE=Release ../ && make
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- 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/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so
-- Found GLUT: /usr/lib/x86_64-linux-gnu/libglut.so
-- Found ZLIB: /mnt/k/cycles-git/lib/linux_centos7_x86_64/zlib/lib/libz.a (found version "1.2.11")
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found OpenImageIO: /mnt/k/cycles-git/lib/linux_centos7_x86_64/openimageio/lib/libOpenImageIO.a
-- Found PugiXML: /mnt/k/cycles-git/lib/linux_centos7_x86_64/pugixml/lib/libpugixml.a
-- Found JPEG: /mnt/k/cycles-git/lib/linux_centos7_x86_64/jpeg/lib/libjpeg.a (found version "80")
-- Found OpenJPEG: /mnt/k/cycles-git/lib/linux_centos7_x86_64/openjpeg/lib/libopenjp2.a
-- Found TIFF: /mnt/k/cycles-git/lib/linux_centos7_x86_64/tiff/lib/libtiff.a (found version "4.1.0")
-- Found PNG: /mnt/k/cycles-git/lib/linux_centos7_x86_64/png/lib/libpng16.a (found version "1.6.37")
....

This should not happen if other libs are found. You can add some message statements to see whether the *_ROOT_DIR is correct and the lib exists at that location.

See _set_default(OPENIMAGEIO_ROOT_DIR "${_cycles_lib_dir}/openimageio") in src/cmake/external_libs.cmake

See if updating CMake helps.

Proposed a patch to fix that.

Ok I have set my dirs correctly and got the lib files from Blende repo, I also had that openimage missing but that was fixed after setting the correct folder structure. So I think I am on the correct way.
I got now the following error:

Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.18363.
Found Boost 1.70.0 at H:/freecad/cyckes/lib/win64_vc15/boost/lib/cmake/Boost-1.70.0
  Requested configuration: QUIET REQUIRED COMPONENTS filesystem;regex;system;thread;date_time;wave
Found boost_headers 1.70.0 at H:/freecad/cyckes/lib/win64_vc15/boost/lib/cmake/boost_headers-1.70.0
Found boost_filesystem 1.70.0 at H:/freecad/cyckes/lib/win64_vc15/boost/lib/cmake/boost_filesystem-1.70.0
No suitable boost_filesystem variant has been identified!
  libboost_filesystem-vc141-mt-gd-x64-1_70.lib (vc141, detected vc142, set Boost_COMPILER to override)
  libboost_filesystem-vc141-mt-x64-1_70.lib (vc141, detected vc142, set Boost_COMPILER to override)
CMake Error at H:/freecad/cyckes/lib/win64_vc15/boost/lib/cmake/Boost-1.70.0/BoostConfig.cmake:95 (find_package):
  Found package configuration file:

    H:/freecad/cyckes/lib/win64_vc15/boost/lib/cmake/boost_filesystem-1.70.0/boost_filesystem-config.cmake

  but it set boost_filesystem_FOUND to FALSE so package "boost_filesystem" is
  considered to be NOT FOUND.  Reason given by package:

  No suitable build variant has been found.

Call Stack (most recent call first):
  H:/freecad/cyckes/lib/win64_vc15/boost/lib/cmake/Boost-1.70.0/BoostConfig.cmake:124 (boost_find_dependency)
  C:/Program Files/CMake/share/cmake-3.20/Modules/FindBoost.cmake:594 (find_package)
  src/cmake/external_libs.cmake:377 (find_package)
  CMakeLists.txt:101 (include)


Configuring incomplete, errors occurred!
See also "H:/freecad/cyckes/build/CMakeFiles/CMakeOutput.log".

I am running Cmake gui version 3.20
Edit did some googling and I had to set: -DBoost_NO_BOOST_CMAKE=ON
results:
Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.18363.
Looking for pthread.h
Looking for pthread.h - not found
Found Threads: TRUE
Found Boost: H:/freecad/cyckes/lib/win64_vc15/boost/include (found suitable version “1.70.0”, minimum required is “1.48”) found components: filesystem regex system thread date_time wave chrono atomic serialization
Found Embree: optimized;H:/freecad/cyckes/cycles/…/lib/win64_vc15/embree/lib/embree3.lib;debug;H:/freecad/cyckes/cycles/…/lib/win64_vc15/embree/lib/embree3_d.lib;optimized;H:/freecad/cyckes/cycles/…/lib/win64_vc15/embree/lib/embree_avx.lib;debug;H:/freecad/cyckes/cycles/…/lib/win64_vc15/embree/lib/embree_avx_d.lib;optimized;H:/freecad/cyckes/cycles/…/lib/win64_vc15/embree/lib/embree_avx2.lib;debug;H:/freecad/cyckes/cycles/…/lib/win64_vc15/embree/lib/embree_avx2_d.lib;optimized;H:/freecad/cyckes/cycles/…/lib/win64_vc15/embree/lib/embree_sse42.lib;debug;H:/freecad/cyckes/cycles/…/lib/win64_vc15/embree/lib/embree_sse42_d.lib;optimized;H:/freecad/cyckes/cycles/…/lib/win64_vc15/embree/lib/lexers.lib;debug;H:/freecad/cyckes/cycles/…/lib/win64_vc15/embree/lib/lexers_d.lib;optimized;H:/freecad/cyckes/cycles/…/lib/win64_vc15/embree/lib/math.lib;debug;H:/freecad/cyckes/cycles/…/lib/win64_vc15/embree/lib/math_d.lib;optimized;H:/freecad/cyckes/cycles/…/lib/win64_vc15/embree/lib/simd.lib;debug;H:/freecad/cyckes/cycles/…/lib/win64_vc15/embree/lib/simd_d.lib;optimized;H:/freecad/cyckes/cycles/…/lib/win64_vc15/embree/lib/sys.lib;debug;H:/freecad/cyckes/cycles/…/lib/win64_vc15/embree/lib/sys_d.lib;optimized;H:/freecad/cyckes/cycles/…/lib/win64_vc15/embree/lib/tasking.lib;debug;H:/freecad/cyckes/cycles/…/lib/win64_vc15/embree/lib/tasking_d.lib (Required is at least version “3.8.0”)
Found OpenSubdiv: H:/freecad/cyckes/lib/win64_vc15/opensubdiv/lib/osdGPU.lib;H:/freecad/cyckes/lib/win64_vc15/opensubdiv/lib/osdCPU.lib
Found OpenMP_C: -openmp (found version “2.0”)
Found OpenMP_CXX: -openmp (found version “2.0”)
Found OpenMP: TRUE (found version “2.0”)
Found OpenVDB: optimized;H:/freecad/cyckes/cycles/…/lib/win64_vc15/openvdb/lib/openvdb.lib;debug;H:/freecad/cyckes/cycles/…/lib/win64_vc15/openvdb/lib/openvdb_d.lib
Found Blosc: optimized;H:/freecad/cyckes/cycles/…/lib/win64_vc15/blosc/lib/libblosc.lib;debug;H:/freecad/cyckes/cycles/…/lib/win64_vc15/blosc/lib/libblosc_d.lib
Found OpenImageDenoise: H:/freecad/cyckes/lib/win64_vc15/openimagedenoise/lib/openimagedenoise.lib
Found TBB: optimized;H:/freecad/cyckes/cycles/…/lib/win64_vc15/tbb/lib/tbb.lib;debug;H:/freecad/cyckes/cycles/…/lib/win64_vc15/tbb/lib/debug/tbb_debug.lib
Found GLEW: H:/freecad/cyckes/cycles/…/lib/win64_vc15/opengl/lib/glew.lib
Configuring done
Generating done

Got it to work, just pressed build in Visual basic and got an exe file then ! had to move 2 dll files from the lib directories to make it work. And I still get an error when exiting, but it works!
Bedankt allemaal! Thank you! Hopefully we get the Linux version also up and running!
afbeelding

I can confirm this file exists, so I’m guessing the structure is the same

../cycles-git/lib/linux_centos7_x86_64/openimageio/lib/libOpenImageIO.a

I have now installed freeglut3-dev and mesa-common-dev and the error now is:

-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
  Could NOT find OpenImageIO (missing: OPENIMAGEIO_LIBRARY
  OPENIMAGEIO_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
  src/cmake/Modules/FindOpenImageIO.cmake:63 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  src/cmake/external_libs.cmake:231 (find_package)
  CMakeLists.txt:101 (include)


-- Configuring incomplete, errors occurred!
See also "/home/mac/cycles-git/cycles/bin-opt/CMakeFiles/CMakeOutput.log".
See also "/home/mac/cycles-git/cycles/bin-opt/CMakeFiles/CMakeError.log".
make: *** [Makefile:13: release] Error 1

see my other response as to the current error message.

It appears to me there is a list of dependencies that are not met by the pre-compiled libs as described in the Cycles web page describing how to build this. (Maybe the list is different on Ubuntu 20.04 compared to CentOS?)