On Fri, Dec 4, 2015 at 10:15 PM, Shane Ambler <[email protected]> wrote:

> On 05/12/2015 04:42, Larry Gritz wrote:
>
>> I think it should be as simple as
>>
>> CXX=clang cmake ~/git/oiio && make
>>
>> See if that works?
>>
>>
>> On Dec 4, 2015, at 8:13 AM, Richard Shaw <[email protected]>
>>> wrote:
>>>
>>> I'm playing around with clang but I'm not very familiar how to do
>>> that with cmake... I told cmake to to use the clang complier but do
>>> I need to tell it anything about linking?
>>>
>>> $ cmake -DCMAKE_C_COMPILER=/usr/bin/clang
>>> -DCMAKE_CXX_COMPILER=/usr/bin/clang ~/git/oiio/
>>>
>>
> CMAKE_CXX_COMPILER should be clang++ ??


clang++ is a symbolic link to clang... I think it knows how to compile it
based on the extension.



> The first time it tries to link I get this:
>>>
>>> [  8%] Linking CXX executable array_view_test cd
>>> /home/build/build/OpenImageIO/src/libutil && /usr/bin/cmake -E
>>> cmake_link_script CMakeFiles/array_view_test.dir/link.txt
>>> --verbose=1 /usr/bin/clang   -O3 -DNDEBUG
>>> CMakeFiles/array_view_test.dir/array_view_test.cpp.o  -o
>>> array_view_test -rdynamic libOpenImageIO_Util.so.1.6.6
>>> -lboost_filesystem -lboost_regex -lboost_system -lboost_thread -lrt
>>> -ldl -lHalf -lIex -lImath -lIlmThread -lpthread
>>> -Wl,-rpath,/home/build/build/OpenImageIO/src/libutil /usr/bin/ld:
>>> CMakeFiles/array_view_test.dir/array_view_test.cpp.o: undefined
>>> reference to symbol '_ZNSo9_M_insertIdEERSoT_@@GLIBCXX_3.4.9'
>>> /usr/lib64/libstdc++.so.6: error adding symbols: DSO missing from
>>> command line clang: error: linker command failed with exit code 1
>>> (use -v to see invocation)
>>>
>>
> "undefined reference to GLIBCXX_3.4.9" which it is trying to load from
> /usr/lib64/libstdc++.so.6 - try setting LD_LIBRARY_PATH in your
> environment to point at a newer gcc build so it can find an updated
> libstdc++ before the older system one.


I'm doing everything with system installed packages so I'm not sure what to
do.

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

Reply via email to