Anyone that could enlighten me? :) Den man. 15. jun. 2020 kl. 11.20 skrev Nick Papior <nickpap...@gmail.com>:
> Hi OIIO-devs, > > I am trying to build OIIO and have been partly successful, bottom line of > this is that I think the linker lines are having the wrong order. Objects > comes _after_ external libraries which may be problematic. > > I am building with the below flags; note that all libraries are installed > in non-standard locations. Also, ffmpeg has only static libraries. > > LDFLAGS="-L<path-to ffmpeg> -Wl,-rpath=<path-to ffmpeg> $(pkg-config > --libs libavcodec libavutil libavformat libswscale) $LDFLAGS" \ > CXXFLAGS="<same as LDFLAGS> $CXXFLAGS" \ > CFLAGS="<same as LDFLAGS> $CFLAGS" \ > cmake -DCMAKE_INSTALL_PREFIX=<prefix> \ > -DBOOST_ROOT=<path to boost> \ > -DOPENEXR_ROOT=<path to openexr> \ > -DOPENEXR_LIBRARIES="-L<path to openexr> -Wl,-rpath=<path to openexr> > $(pkg-config --libs IlmBase OpenEXR)" \ > -DHDF5_ROOT=<path to hdf5> \ > -DFFMPEG_INCLUDE_DIR=<path to ffmpeg>/include \ > -DFFMPEG_LIBRARIES="<same as LDFLAGS>" \ > -DUSE_PYTHON=0 \ > .. > make VERBOSE=1 2>&1 | tee build.log > > I have the following questions/problems > > 1. I can't figure out why I needed to explicitly append stuff to > `LDFLAGS`, if I didn't the linking would crash, it seems FFMPEG_LIBRARIES > isn't passed down to all submodules? If need be I can create the build.log > for this? > > 2. The above fails when trying to build the executables (tests) with the > following error (see attached build.log). > I manually fixed some of them and found problems in: > - strutil_test > - simd_test > - filter_test > - paramlist_test > - imagecache_test > - imagebufalgo_test > - <then I stopped fixing stuff... > > > 3. The problem is because ffmpeg libraries are put before objects. > If I simply re-order libraries so ffmpeg libraries are in the end, all is > fine! (no surprise in this ;)) > I have attached link.txt_buggy and link.txt_fixed (for simd_test). > Note that this is also related to libOpenImageIO.so linking where the > ffmpeg symbols are not added to the library. Again the order of libraries > is not consistent. This of course isn't seen at that linking point since it > is shared, but if I were to build it static I guess I would experience the > same. > > It seems to me that all problems would be solved if libOpenImageIO.so gets > the correct symbols embedded from the static ffmpeg libraries, but in any > case it makes sense to have external libraries at the end of the linker > line. > > 4. Now if this was autotools I would probably have a better chance at > helping. While cmake is great when stuff works, I still struggle debugging > and figuring out _how_ to fix stuff in it. I have tried to search in > *.cmake files for LIBS/LDFLAGS/FFMPEG* etc. and where to adjust to get > correct linker order. But I simply cannot figure out where these rules are > defined... :( > > If you need any other input, please let me know! > > -- > Kind regards Nick > > > -- > Kind regards Nick > -- Kind regards Nick
_______________________________________________ Oiio-dev mailing list Oiio-dev@lists.openimageio.org http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org