Yes, you need to recompile your dependencies (Boost, etc.) using -fPIC.

-Nathan



From: [email protected] 
Sent: Friday, April 03, 2015 3:18 PM
To: [email protected] 
Subject: Re: [Oiio-dev] a couple linux build related questions

Ok, I found out it was my fault the BUILDSTATIC and LINKSTATIC variables were 
being ignored. I can now use BUILDSTATIC but can't use LINKSTATIC... I don't 
mind using OpenImageIO library as a shared library I am more worried about the 
external dependencies like Boost and ILMBase/OpenEXR. Am I correct in thinking 
that is what LINKSTATIC is for?

I used CMake to create a make file in a separate directory. This is 
BUILDSTATIC=0 and LINKSTATIC=1

[root@linux01 oiio-RB-1.5_build]# make
Scanning dependencies of target OpenImageIO_Util
[  1%] Building CXX object 
src/libutil/CMakeFiles/OpenImageIO_Util.dir/argparse.cpp.o
[  1%] Building CXX object 
src/libutil/CMakeFiles/OpenImageIO_Util.dir/errorhandler.cpp.o
[  2%] Building CXX object 
src/libutil/CMakeFiles/OpenImageIO_Util.dir/filesystem.cpp.o
[  3%] Building CXX object 
src/libutil/CMakeFiles/OpenImageIO_Util.dir/filter.cpp.o
[  3%] Building CXX object 
src/libutil/CMakeFiles/OpenImageIO_Util.dir/hashes.cpp.o
[  4%] Building CXX object 
src/libutil/CMakeFiles/OpenImageIO_Util.dir/paramlist.cpp.o
[  5%] Building CXX object 
src/libutil/CMakeFiles/OpenImageIO_Util.dir/plugin.cpp.o
[  5%] Building CXX object 
src/libutil/CMakeFiles/OpenImageIO_Util.dir/SHA1.cpp.o
[  6%] Building CXX object 
src/libutil/CMakeFiles/OpenImageIO_Util.dir/strutil.cpp.o
[  7%] Building CXX object 
src/libutil/CMakeFiles/OpenImageIO_Util.dir/sysutil.cpp.o
[  7%] Building CXX object 
src/libutil/CMakeFiles/OpenImageIO_Util.dir/timer.cpp.o
[  8%] Building CXX object 
src/libutil/CMakeFiles/OpenImageIO_Util.dir/typedesc.cpp.o
[  9%] Building CXX object 
src/libutil/CMakeFiles/OpenImageIO_Util.dir/ustring.cpp.o
Linking CXX shared library libOpenImageIO_Util.so
/usr/bin/ld: /usr/local/lib/libboost_filesystem.a(operations.o): relocation 
R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared 
object; recompile with -fPIC
/usr/local/lib/libboost_filesystem.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: *** [src/libutil/libOpenImageIO_Util.so.1.5.14] Error 1
make[1]: *** [src/libutil/CMakeFiles/OpenImageIO_Util.dir/all] Error 2
make: *** [all] Error 2

It mentions I need to recompile with -fPIC... does it mean Boost or OIIO? I 
build Boost from src using...

./bootstrap.sh --prefix=/usr/local./b2 install --with=all--------- Original 
Message --------- 
  Subject: [Oiio-dev] a couple linux build related questions
  From: [email protected]
  Date: 4/1/15 12:07 pm
  To: [email protected]


  Hey Gang,

  Our studio is switching from Windows to Linux and I am happy to report 
building on Linux is indeed significantly easier than on Windows! I am a little 
new to this but I enabled BUILDSTATIC and LINKSTATIC in the CMake gui but when 
I launch oiiotool, it is not able to find the libraries it needs. Should I be 
able to build oiiotool with all of its dependencies statically linked? Is there 
some exception which would cause the two static flags to be ignored?

  As a workaround I am adding some extra linker flags... 
-Wl,-R,'$ORIGIN/../lib' this at least allows a relative path to be used for run 
time loading of libraries. And I can put all the libraries in one directory on 
the network and have oiiotool find them.

  Thanks,
  Steven
  _______________________________________________ Oiio-dev mailing list 
[email protected] 
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org


--------------------------------------------------------------------------------
_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

Reply via email to