Troubles building Blender on 32bit Linux with cmake

Hi,
I’m trying to build Blender trunk with cmake and it fails returning quite a few libavcodec/libavformat errors.
The thing is that I do have the latest ffmpeg version installed on my system. How can this happen?
Any ideas?

System: Kubuntu 12.10


...
[ 95%] Built target makesrna
[ 98%] Built target bf_rna
[100%] Built target bf_intern_cycles
Scanning dependencies of target blender
[100%] Building C object source/creator/CMakeFiles/blender.dir/buildinfo.c.o
Linking CXX executable ../../bin/blender
/usr/local/lib/libavcodec.a(libfaac.o): In function `Faac_encode_frame':
../ffmpeg/libavcodec/libfaac.c:194: undefined reference to `faacEncEncode'
/usr/local/lib/libavcodec.a(libfaac.o): In function `Faac_encode_close':
../ffmpeg/libavcodec/libfaac.c:55: undefined reference to `faacEncClose'
/usr/local/lib/libavcodec.a(libfaac.o): In function `Faac_encode_init':
../ffmpeg/libavcodec/libfaac.c:81: undefined reference to `faacEncOpen'
../ffmpeg/libavcodec/libfaac.c:91: undefined reference to `faacEncGetCurrentConfiguration'
../ffmpeg/libavcodec/libfaac.c:150: undefined reference to `faacEncGetDecoderSpecificInfo'
../ffmpeg/libavcodec/libfaac.c:166: undefined reference to `faacEncSetConfiguration'
/usr/local/lib/libavcodec.a(libfdk-aacenc.o): In function `aac_encode_close':
../ffmpeg/libavcodec/libfdk-aacenc.c:99: undefined reference to `aacEncClose'
/usr/local/lib/libavcodec.a(libfdk-aacenc.o): In function `aac_encode_frame':
../ffmpeg/libavcodec/libfdk-aacenc.c:354: undefined reference to `aacEncEncode'
/usr/local/lib/libavcodec.a(libfdk-aacenc.o): In function `aac_encode_init':
../ffmpeg/libavcodec/libfdk-aacenc.c:119: undefined reference to `aacEncOpen'
../ffmpeg/libavcodec/libfdk-aacenc.c:128: undefined reference to `aacEncoder_SetParam'
../ffmpeg/libavcodec/libfdk-aacenc.c:135: undefined reference to `aacEncoder_SetParam'
../ffmpeg/libavcodec/libfdk-aacenc.c:143: undefined reference to `aacEncoder_SetParam'
../ffmpeg/libavcodec/libfdk-aacenc.c:163: undefined reference to `aacEncoder_SetParam'
../ffmpeg/libavcodec/libfdk-aacenc.c:170: undefined reference to `aacEncoder_SetParam'
/usr/local/lib/libavcodec.a(libfdk-aacenc.o):../ffmpeg/libavcodec/libfdk-aacenc.c:188: more undefined references to `aacEncoder_SetParam' follow
/usr/local/lib/libavcodec.a(libfdk-aacenc.o): In function `aac_encode_init':
../ffmpeg/libavcodec/libfdk-aacenc.c:266: undefined reference to `aacEncEncode'
../ffmpeg/libavcodec/libfdk-aacenc.c:272: undefined reference to `aacEncInfo'
/usr/local/lib/libavcodec.a(libopencore-amr.o): In function `amr_wb_decode_close':
../ffmpeg/libavcodec/libopencore-amr.c:375: undefined reference to `D_IF_exit'
/usr/local/lib/libavcodec.a(libopencore-amr.o): In function `amr_wb_decode_frame':
../ffmpeg/libavcodec/libopencore-amr.c:363: undefined reference to `D_IF_decode'
/usr/local/lib/libavcodec.a(libopencore-amr.o): In function `amr_nb_decode_frame':
../ffmpeg/libavcodec/libopencore-amr.c:170: undefined reference to `Decoder_Interface_Decode'
/usr/local/lib/libavcodec.a(libopencore-amr.o): In function `amr_nb_encode_frame':
../ffmpeg/libavcodec/libopencore-amr.c:278: undefined reference to `Encoder_Interface_Encode'
/usr/local/lib/libavcodec.a(libopencore-amr.o): In function `amr_nb_encode_close':
../ffmpeg/libavcodec/libopencore-amr.c:230: undefined reference to `Encoder_Interface_exit'
/usr/local/lib/libavcodec.a(libopencore-amr.o): In function `amr_nb_decode_close':
../ffmpeg/libavcodec/libopencore-amr.c:133: undefined reference to `Decoder_Interface_exit'
/usr/local/lib/libavcodec.a(libopencore-amr.o): In function `amr_wb_decode_init':
../ffmpeg/libavcodec/libopencore-amr.c:329: undefined reference to `D_IF_init'
/usr/local/lib/libavcodec.a(libopencore-amr.o): In function `amr_nb_encode_init':
../ffmpeg/libavcodec/libopencore-amr.c:213: undefined reference to `Encoder_Interface_init'
/usr/local/lib/libavcodec.a(libopencore-amr.o): In function `amr_nb_decode_init':
../ffmpeg/libavcodec/libopencore-amr.c:117: undefined reference to `Decoder_Interface_init'
/usr/local/lib/libavcodec.a(libx264.o): In function `X264_init':
../ffmpeg/libavcodec/libx264.c:533: undefined reference to `x264_encoder_open_123'
/usr/local/lib/libavdevice.a(lavfi.o): In function `lavfi_read_packet':
../ffmpeg/libavdevice/lavfi.c:328: undefined reference to `av_buffersink_get_buffer_ref'
../ffmpeg/libavdevice/lavfi.c:349: undefined reference to `av_buffersink_get_buffer_ref'
../ffmpeg/libavdevice/lavfi.c:397: undefined reference to `avfilter_unref_buffer'
/usr/local/lib/libavdevice.a(lavfi.o): In function `lavfi_read_close':
../ffmpeg/libavdevice/lavfi.c:85: undefined reference to `avfilter_graph_free'
/usr/local/lib/libavdevice.a(lavfi.o): In function `lavfi_read_header':
../ffmpeg/libavdevice/lavfi.c:104: undefined reference to `avfilter_register_all'
../ffmpeg/libavdevice/lavfi.c:106: undefined reference to `avfilter_get_by_name'
../ffmpeg/libavdevice/lavfi.c:107: undefined reference to `avfilter_get_by_name'
../ffmpeg/libavdevice/lavfi.c:139: undefined reference to `avfilter_graph_alloc'
../ffmpeg/libavdevice/lavfi.c:142: undefined reference to `avfilter_graph_parse'
../ffmpeg/libavdevice/lavfi.c:228: undefined reference to `av_buffersink_params_alloc'
../ffmpeg/libavdevice/lavfi.c:231: undefined reference to `avfilter_graph_create_filter'
../ffmpeg/libavdevice/lavfi.c:244: undefined reference to `av_abuffersink_params_alloc'
../ffmpeg/libavdevice/lavfi.c:247: undefined reference to `avfilter_graph_create_filter'
../ffmpeg/libavdevice/lavfi.c:256: undefined reference to `avfilter_link'
../ffmpeg/libavdevice/lavfi.c:261: undefined reference to `avfilter_graph_config'
../ffmpeg/libavdevice/lavfi.c:265: undefined reference to `avfilter_graph_dump'
../ffmpeg/libavdevice/lavfi.c:301: undefined reference to `avfilter_inout_free'
../ffmpeg/libavdevice/lavfi.c:302: undefined reference to `avfilter_inout_free'
../../lib/libbf_imbuf.a(anim_movie.c.o): In function `IMB_anim_absolute':
anim_movie.c:(.text+0x137d): undefined reference to `av_update_cur_dts'
/usr/local/lib/libavformat.a(librtmp.o): In function `rtmp_read_seek':
../ffmpeg/libavformat/librtmp.c:180: undefined reference to `RTMP_SendSeek'
/usr/local/lib/libavformat.a(librtmp.o): In function `rtmp_read_pause':
../ffmpeg/libavformat/librtmp.c:161: undefined reference to `RTMP_Pause'
/usr/local/lib/libavformat.a(librtmp.o): In function `rtmp_close':
../ffmpeg/libavformat/librtmp.c:64: undefined reference to `RTMP_Close'
/usr/local/lib/libavformat.a(librtmp.o): In function `rtmp_open':
../ffmpeg/libavformat/librtmp.c:96: undefined reference to `RTMP_LogSetLevel'
../ffmpeg/libavformat/librtmp.c:97: undefined reference to `RTMP_LogSetCallback'
../ffmpeg/libavformat/librtmp.c:118: undefined reference to `RTMP_Init'
../ffmpeg/libavformat/librtmp.c:119: undefined reference to `RTMP_SetupURL'
../ffmpeg/libavformat/librtmp.c:127: undefined reference to `RTMP_Connect'
../ffmpeg/libavformat/librtmp.c:127: undefined reference to `RTMP_ConnectStream'
../ffmpeg/libavformat/librtmp.c:125: undefined reference to `RTMP_EnableWrite'
/usr/local/lib/libavformat.a(librtmp.o): In function `rtmp_get_file_handle':
../ffmpeg/libavformat/librtmp.c:190: undefined reference to `RTMP_Socket'
/usr/local/lib/libavformat.a(librtmp.o): In function `rtmp_write':
../ffmpeg/libavformat/librtmp.c:145: undefined reference to `RTMP_Write'
/usr/local/lib/libavformat.a(librtmp.o): In function `rtmp_read':
../ffmpeg/libavformat/librtmp.c:153: undefined reference to `RTMP_Read'
/usr/local/lib/libavcodec.a(vaapi.o): In function `commit_slices':
../ffmpeg/libavcodec/vaapi.c:97: undefined reference to `vaCreateBuffer'
../ffmpeg/libavcodec/vaapi.c:106: undefined reference to `vaCreateBuffer'
/usr/local/lib/libavcodec.a(vaapi.o): In function `alloc_buffer':
../ffmpeg/libavcodec/vaapi.c:125: undefined reference to `vaCreateBuffer'
../ffmpeg/libavcodec/vaapi.c:127: undefined reference to `vaMapBuffer'
../ffmpeg/libavcodec/vaapi.c:125: undefined reference to `vaCreateBuffer'
../ffmpeg/libavcodec/vaapi.c:127: undefined reference to `vaMapBuffer'
../ffmpeg/libavcodec/vaapi.c:125: undefined reference to `vaCreateBuffer'
../ffmpeg/libavcodec/vaapi.c:127: undefined reference to `vaMapBuffer'
/usr/local/lib/libavcodec.a(vaapi.o): In function `destroy_buffers':
../ffmpeg/libavcodec/vaapi.c:37: undefined reference to `vaDestroyBuffer'
../ffmpeg/libavcodec/vaapi.c:37: undefined reference to `vaDestroyBuffer'
../ffmpeg/libavcodec/vaapi.c:37: undefined reference to `vaDestroyBuffer'
../ffmpeg/libavcodec/vaapi.c:37: undefined reference to `vaDestroyBuffer'
/usr/local/lib/libavcodec.a(vaapi.o): In function `render_picture':
../ffmpeg/libavcodec/vaapi.c:48: undefined reference to `vaUnmapBuffer'
../ffmpeg/libavcodec/vaapi.c:61: undefined reference to `vaBeginPicture'
../ffmpeg/libavcodec/vaapi.c:65: undefined reference to `vaRenderPicture'
../ffmpeg/libavcodec/vaapi.c:69: undefined reference to `vaRenderPicture'
../ffmpeg/libavcodec/vaapi.c:74: undefined reference to `vaEndPicture'
../ffmpeg/libavcodec/vaapi.c:57: undefined reference to `vaUnmapBuffer'
../ffmpeg/libavcodec/vaapi.c:52: undefined reference to `vaUnmapBuffer'
collect2: error: ld returned 1 exit status
make[3]: *** [bin/blender] Error 1
make[2]: *** [source/creator/CMakeFiles/blender.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [all] Error 2



  

Now, this is a new one!
While trying to update the latest libs I get this error:
“The requested URL /svnroot/bf-blender/trunk/lib/linux was not found on this server.”

Looks like the libs directory is wiped out or what?

I was informed on the blendercoders irc channel that the linux static libs have been removed in favor of the new

install_deps.sh script!!!

Haven’t been paying close attention to the trunk log lately, where it is mentioned. I’m sure there are good reasons for switching, but any documentation on this would be more than welcome.

Naturally, the script needlessly recompiles stuff that is already up to date (say ffmpeg) and fails big time while building OpenColorIO.

So, officially, I doubt it that one can build blender on ubuntu 12.10 starting from scratch.
ATM, building blender is a big royal mess! :frowning:

Dependency building fails in building OpenImageIO:


[ 79%] Building CXX object libOpenImageIO/CMakeFiles/OpenImageIO.dir/__/socket.imageio/socketoutput.cpp.o                                                                                           
[ 79%] Building CXX object libOpenImageIO/CMakeFiles/OpenImageIO.dir/__/socket.imageio/socket_pvt.cpp.o                                                                                             
Linking CXX shared library libOpenImageIO.so
make[3]: Leaving directory `../blender-svn/src/blender-deps/OpenImageIO-1.1.0/build/linux'
[ 79%] Built target OpenImageIO
make[3]: Entering directory `../blender-svn/src/blender-deps/OpenImageIO-1.1.0/build/linux'
Scanning dependencies of target atomic_test
make[3]: Leaving directory `../blender-svn/src/blender-deps/OpenImageIO-1.1.0/build/linux'
make[3]: Entering directory `../blender-svn/src/blender-deps/OpenImageIO-1.1.0/build/linux'
[ 79%] Building CXX object libOpenImageIO/CMakeFiles/atomic_test.dir/atomic_test.cpp.o
Linking CXX executable atomic_test
libOpenImageIO.so.1.1.0: undefined reference to `OpenImageIO::v1_1::CSHA1::Update(unsigned char const*, unsigned int)'
collect2: error: ld returned 1 exit status
make[3]: *** [libOpenImageIO/atomic_test] Error 1
make[3]: Leaving directory `../blender-svn/src/blender-deps/OpenImageIO-1.1.0/build/linux'
make[2]: *** [libOpenImageIO/CMakeFiles/atomic_test.dir/all] Error 2
make[2]: Leaving directory `../blender-svn/src/blender-deps/OpenImageIO-1.1.0/build/linux'
make[1]: *** [all] Error 2
make[1]: Leaving directory `../blender-svn/src/blender-deps/OpenImageIO-1.1.0/build/linux'
make: *** [cmake] Error 2

Hi i just run that install_deps.sh script on my Xubuntu12.04 x64 and try to build my Blender. But i have bad filings about that… I haved configured 5 branches and trunk, now i must start all again. And Cmake just have some problems with that on my OS.
But thanks for that “post”, i just lost my hope, when my libs was delated from my hd when i was updating them via svn…
Minus of that script you mentioned and this solution of developing blender is that i have now 1/2 of my 1,6GB free space on my Linux HD that left me… So many thinks you can compile on your self in linux, that sometimes lets you out of control when you install dependencies libs…
Well sorry for this long statement…
That script just finished his work, and i have broken links to (oiio and osl)… Maybe this is problem why you have error in your build.
I will try mine…
Regards

Update: problem solved, courtesy of Sergey on blendercoders irc channel! :slight_smile:
So, officially, it is possible to build blender from scratch using the new install_deps script. Got Blender svn working again after struggling with build errors for 4 days! What a relief!

Sergey pinpointed the problem and updated in trunk one of the OpenImageIO scripts that was causing problems --on my system at least. AFAIK, other users are still experiencing problems building blender.
So the solution for Ubuntu/Kubuntu 12.10 is as follows:

#1. run install_deps.sh script (located on: /blender-svn/blender/build_files/build_environment/
If all goes well, it should build all required libs without returning errors.

#2. build Blender using cmake (run make on /blender-svn/blender/)

You might want to edit CMakeLists.txt to enable e.g. the blender player and configure other parameters.

In the (very likely) event that something fails (or brakes), Sergey said that users could solicit help directly via the blendercoders irc channel.

I’d truly recommend to refrain from building svn for the next few days unless you really have to, at least until all this dependency stuff is worked out for all distros and OSes.

Many thanx to Sergey and Mont29 for providing (almost) real time help! :slight_smile:

…and had all the problems and found this page and ran the script with:

sh install_deps.sh

in that ~/blender-svn/blender/build_files/build_environment/ folder and got this error:

~/blender-svn/blender/build_files/build_environment $ sh install_deps.sh
install_deps.sh: 98: install_deps.sh: Syntax error: “(” unexpected (expecting “}”)

… so I had a look at the offending code - attached is a piccie with the syntax colours. It’s about a closing curly-bracket being not in the right place???


So, not really solved?

I know the last post is a bit old, but I had the same error. I was trying to run install_deps.sh with “sh” before. I have the same error, but in different line. So, I run without “sh” before and, now, it is downloading dependencies and compiling… Compiling with 4 CPUs at 100%… it smells something burning…