Cycles build wrong with cannot find -lX11 in ubuntu

why I build the cycles master branch in ubuntu will stop with error at last step ?
anybody the same?

[ 99%] Linking CXX shared library hdCycles.so
/usr/bin/ld: cannot find -lX11
collect2: error: ld returned 1 exit status
make[3]: *** [src/hydra/CMakeFiles/hdCycles.dir/build.make:283: src/hydra/hdCycles.so] Error 1
make[3]: Leaving directory '/project/cycles/build'
make[2]: *** [CMakeFiles/Makefile2:847: src/hydra/CMakeFiles/hdCycles.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs....
/usr/bin/ld: cannot find -lX11
/usr/bin/ld: cannot find -lX11
collect2: error: ld returned 1 exit status
make[3]: *** [src/app/CMakeFiles/cycles.dir/build.make:485: bin/cycles] Error 1
make[3]: Leaving directory '/project/cycles/build'
make[2]: *** [CMakeFiles/Makefile2:513: src/app/CMakeFiles/cycles.dir/all] Error 2
make[2]: Leaving directory '/project/cycles/build'
make[1]: *** [Makefile:130: all] Error 2
make[1]: Leaving directory '/project/cycles/build'
make: *** [GNUmakefile:35: release] Error 2

Try apt install libx11-dev, there is a dependency on X11 because of USD.

1 Like

thank you, brecht ! and I am fresh in this project , do you recommend using cycles project do some render task in server side ? or just use blender main project ?

Either is possible, using Blender is generally going to be easier since it comes with a Python API and all the Blender functionality to import or create scenes.

1 Like

thanks for your advice, lead me to the right way to going on ~

thank you, brecht ! I try your cmd and success build.

apt install libx11-dev

use the cmd next and success render a monkey img !

./cycles --samples 10 --output ./image01.png ../examples/scene_monkey.xml

I wonder , does it support usd file rendering ? like bellow

./cycles --samples 100 --output ./image02.png ../examples/ufo.usdc
./cycles --samples 100 --output ./image02.png ../examples/ufo.usd

and it work ! the usdc file export from blender