andrewhwood / alembic

Automatically exported from code.google.com/p/alembic
Other
0 stars 0 forks source link

Cannot build shared libs with Alembic 1.0 #214

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Shared libraries for AlembicAbc cannot be built due to clashing symbols 
(specifically, all the __test methods).  Had to rename these to get the library 
to compile.

To replicate, use SET(BUILD_SHARED_LIBS TRUE) in your CMakeList.txt.

CMakeFiles/AlembicAbc.dir/ITypedScalarProperty.cpp.o: In function
`Alembic::Abc::v1::__test(Alembic::Abc::v1::IObject&)':
ITypedScalarProperty.cpp:(.text+0x100): multiple definition of
`Alembic::Abc::v1::__test(Alembic::Abc::v1::IObject&)'
CMakeFiles/AlembicAbc.dir/ITypedArrayProperty.cpp.o:ITypedArrayProperty.cpp:(.te
xt+0x100):
first defined here
/usr/bin/ld: Warning: size of symbol
`Alembic::Abc::v1::__test(Alembic::Abc::v1::IObject&)' changed from
3292 in CMakeFiles/AlembicAbc.dir/ITypedArrayProperty.cpp.o to 2713 in
CMakeFiles/AlembicAbc.dir/ITypedScalarProperty.cpp.o
collect2: ld returned 1 exit status

Using Alembic 1.0 2011080800, gcc 412 20080704.

Original issue reported on code.google.com by phunter...@gmail.com on 23 Aug 2011 at 4:28

GoogleCodeExporter commented 9 years ago
This has been fixed in my clone by moving these test compile functions to their 
own unit tests.

Original comment by miller.lucas on 23 Aug 2011 at 4:41

GoogleCodeExporter commented 9 years ago

Original comment by ble...@gmail.com on 27 Aug 2011 at 12:01

GoogleCodeExporter commented 9 years ago

Original comment by miller.lucas on 29 Aug 2011 at 5:04

GoogleCodeExporter commented 9 years ago
Issue 221 has been merged into this issue.

Original comment by miller.lucas on 31 Aug 2011 at 7:49

GoogleCodeExporter commented 9 years ago
Has anyone tried this on OS X?

It worked fine for me on Linux, but on Mac the build falls over at about 20% 
with...
______________________________________

Linking CXX shared library libAlembicAbcCoreAbstract.dylib
cd 
/Users/simon/work/thirdparty/Alembic/alembic_build/lib/Alembic/AbcCoreAbstract 
&& "/Applications/CMake 2.8-5.app/Contents/bin/cmake" -E cmake_link_script 
CMakeFiles/AlembicAbcCoreAbstract.dir/link.txt --verbose=1
/usr/bin/c++  -O3 -DNDEBUG -dynamiclib -Wl,-headerpad_max_install_names   -o 
libAlembicAbcCoreAbstract.dylib -install_name 
/Users/simon/work/thirdparty/Alembic/alembic_build/lib/Alembic/AbcCoreAbstract/l
ibAlembicAbcCoreAbstract.dylib 
CMakeFiles/AlembicAbcCoreAbstract.dir/Foundation.cpp.o 
CMakeFiles/AlembicAbcCoreAbstract.dir/TimeSampling.cpp.o 
CMakeFiles/AlembicAbcCoreAbstract.dir/TimeSamplingType.cpp.o 
CMakeFiles/AlembicAbcCoreAbstract.dir/ArraySample.cpp.o 
CMakeFiles/AlembicAbcCoreAbstract.dir/ReadArraySampleCache.cpp.o 
CMakeFiles/AlembicAbcCoreAbstract.dir/ScalarSample.cpp.o 
CMakeFiles/AlembicAbcCoreAbstract.dir/BasePropertyWriter.cpp.o 
CMakeFiles/AlembicAbcCoreAbstract.dir/ScalarPropertyWriter.cpp.o 
CMakeFiles/AlembicAbcCoreAbstract.dir/ArrayPropertyWriter.cpp.o 
CMakeFiles/AlembicAbcCoreAbstract.dir/CompoundPropertyWriter.cpp.o 
CMakeFiles/AlembicAbcCoreAbstract.dir/ObjectWriter.cpp.o 
CMakeFiles/AlembicAbcCoreAbstract.dir/ArchiveWriter.cpp.o 
CMakeFiles/AlembicAbcCoreAbstract.dir/BasePropertyReader.cpp.o 
CMakeFiles/AlembicAbcCoreAbstract.dir/ScalarPropertyReader.cpp.o 
CMakeFiles/AlembicAbcCoreAbstract.dir/ArrayPropertyReader.cpp.o 
CMakeFiles/AlembicAbcCoreAbstract.dir/CompoundPropertyReader.cpp.o 
CMakeFiles/AlembicAbcCoreAbstract.dir/ObjectReader.cpp.o 
CMakeFiles/AlembicAbcCoreAbstract.dir/ArchiveReader.cpp.o 
Undefined symbols:
  "half::_toFloat", referenced from:
      Alembic::AbcCoreAbstract::v1::TypedScalarSampleData<half>::equalEpsilon(void const*, double) constin ScalarSample.cpp.o
      Alembic::AbcCoreAbstract::v1::TypedScalarSampleData<half>::equalTo(void const*) constin ScalarSample.cpp.o
      Alembic::AbcCoreAbstract::v1::TypedScalarSampleData<half>::lessThan(void const*) constin ScalarSample.cpp.o
  "Alembic::Util::v1::MurmurHash3_x64_128(void const*, unsigned long, unsigned long, void*)", referenced from:
      Alembic::AbcCoreAbstract::v1::ArraySample::getKey() constin ArraySample.cpp.o
      Alembic::AbcCoreAbstract::v1::ArraySample::getKey() constin ArraySample.cpp.o
      Alembic::AbcCoreAbstract::v1::ArraySample::getKey() constin ArraySample.cpp.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[2]: *** [lib/Alembic/AbcCoreAbstract/libAlembicAbcCoreAbstract.dylib] 
Error 1
make[1]: *** 
[lib/Alembic/AbcCoreAbstract/CMakeFiles/AlembicAbcCoreAbstract.dir/all] Error 2
make: *** [all] Error 2
______________________________________

I would have expected the link command to reference the IlmBase libs, but it 
only lists the Alembic object files.

I was able to do a static build OK, but I'd rather have a dynamic one.

Anyone have any ideas, please?

Original comment by simone...@gmail.com on 14 Sep 2011 at 3:45

GoogleCodeExporter commented 9 years ago
Comment 4 has been moved to it's own ticket.
http://code.google.com/p/alembic/issues/detail?id=231

Original comment by miller.lucas on 14 Sep 2011 at 4:28

GoogleCodeExporter commented 9 years ago

Original comment by miller.lucas on 19 Sep 2011 at 9:33