neoragex2015 / nvidia-texture-tools

Automatically exported from code.google.com/p/nvidia-texture-tools
Other
0 stars 0 forks source link

SimdVector_SSE not inlined on gcc 4.6.3 #186

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Ubuntu 12.04 LTS
GCC 4.6.3

What steps will reproduce the problem?
1. make

CMakeFiles/nvtt.dir/CompressorDX9.cpp.o: In function 
`nv::operator+(nv::SimdVector const&, nv::SimdVector const&)':
CompressorDX9.cpp:(.text+0x840): multiple definition of 
`nv::operator+(nv::SimdVector const&, nv::SimdVector const&)'
CMakeFiles/nvtt.dir/ClusterFit.cpp.o:ClusterFit.cpp:(.text+0x0): first defined 
here
CMakeFiles/nvtt.dir/CompressorDX9.cpp.o: In function 
`nv::operator-(nv::SimdVector const&, nv::SimdVector const&)':
CompressorDX9.cpp:(.text+0x850): multiple definition of 
`nv::operator-(nv::SimdVector const&, nv::SimdVector const&)'
CMakeFiles/nvtt.dir/ClusterFit.cpp.o:ClusterFit.cpp:(.text+0x10): first defined 
here
CMakeFiles/nvtt.dir/CompressorDX9.cpp.o: In function 
`nv::operator*(nv::SimdVector const&, nv::SimdVector const&)':
CompressorDX9.cpp:(.text+0x860): multiple definition of 
`nv::operator*(nv::SimdVector const&, nv::SimdVector const&)'
CMakeFiles/nvtt.dir/ClusterFit.cpp.o:ClusterFit.cpp:(.text+0x20): first defined 
here
CMakeFiles/nvtt.dir/CompressorDX9.cpp.o: In function `nv::min(nv::SimdVector 
const&, nv::SimdVector const&)':
CompressorDX9.cpp:(.text+0x870): multiple definition of `nv::min(nv::SimdVector 
const&, nv::SimdVector const&)'
CMakeFiles/nvtt.dir/ClusterFit.cpp.o:ClusterFit.cpp:(.text+0x30): first defined 
here
CMakeFiles/nvtt.dir/CompressorDX9.cpp.o: In function `nv::max(nv::SimdVector 
const&, nv::SimdVector const&)':
CompressorDX9.cpp:(.text+0x880): multiple definition of `nv::max(nv::SimdVector 
const&, nv::SimdVector const&)'
CMakeFiles/nvtt.dir/ClusterFit.cpp.o:ClusterFit.cpp:(.text+0x40): first defined 
here
CMakeFiles/nvtt.dir/CompressorDX9.cpp.o: In function 
`nv::compareEqual(nv::SimdVector const&, nv::SimdVector const&)':
CompressorDX9.cpp:(.text+0x890): multiple definition of 
`nv::compareEqual(nv::SimdVector const&, nv::SimdVector const&)'
CMakeFiles/nvtt.dir/ClusterFit.cpp.o:ClusterFit.cpp:(.text+0x50): first defined 
here

What is the expected output? What do you see instead?
No error

Please use labels and text to provide additional information.

There is a need to include inline as part of the hint to the compiler to inline 
the function

Original issue reported on code.google.com by jernk...@gmail.com on 5 Feb 2013 at 3:47

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by jernk...@gmail.com on 5 Feb 2013 at 3:58

GoogleCodeExporter commented 9 years ago
Thanks, this should be fixed defining NV_FORCEINLINE appropriately. Looks like 
in certain gcc versions it should be defined as:

#define NV_FORCEINLINE  inline __attribute__((always_inline))

but I think I've also seen compilers that complained about the double inline 
(clang I think). I'll add the inline back for now.

Original comment by cast...@gmail.com on 5 Feb 2013 at 7:34

GoogleCodeExporter commented 9 years ago
This is weird. The missing inline comes from our private branch, which we build 
on OSX. I believe it was causing compiler errors, but I'll double check. Maybe 
the inline is required with gcc, but not with clang. Thanks for the heads up!

Original comment by cast...@gmail.com on 5 Feb 2013 at 5:57

GoogleCodeExporter commented 9 years ago
OK, this should be fixed now. I confirmed the patch does indeed work fine under 
cmake, not sure what I was seeing the last time.

Original comment by cast...@gmail.com on 5 Feb 2013 at 6:40

GoogleCodeExporter commented 9 years ago
s/cmake/clang/

Original comment by cast...@gmail.com on 5 Feb 2013 at 6:40