Hi!

I encountered some problems while building OSG using mingw.

1) can't build osgwrappers. on 32 bit windows, ld goes up to about 2GB
mem usage and then aborts. Cross-compiling on 64 bit linux, it went up
to a whopping 5GB after 10 minutes, at which point I had to kill it as
I only have 3GB ram and it was swapping like crazy. I might try to
abuse one of our servers with 16GB ram later, just to see whether it
finishes eventually :)

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
22624 hcs       20   0 5472m 2.8g  540 D   11 93.8  10:00.29 ld

$ /usr/i586-mingw32msvc/bin/ld --version
GNU ld (GNU Binutils) 2.18.50.20080109

Native linux builds fine (uses about 800MB)

2) None of the OPENTHREADS_ATOMIC_USE flags work. I assume either gcc
or win32 interlocked would be the right choice. As I am using gcc, I
went for the GCC builtins first, but I get errors:

CMakeFiles/OpenThreads.dir/__/common/Atomic.cpp.obj:Atomic.cpp:(.text+0x3b):
undefined reference to `___sync_bool_compare_and_swap_4'
CMakeFiles/OpenThreads.dir/__/common/Atomic.cpp.obj:Atomic.cpp:(.text+0xa5):
undefined reference to `___sync_sub_and_fetch_4'
CMakeFiles/OpenThreads.dir/__/common/Atomic.cpp.obj:Atomic.cpp:(.text+0xc5):
undefined reference to `___sync_add_and_fetch_4'
CMakeFiles/OpenThreads.dir/__/common/Atomic.cpp.obj:Atomic.cpp:(.text+0x61):
undefined reference to `___sync_fetch_and_xor_4'
CMakeFiles/OpenThreads.dir/__/common/Atomic.cpp.obj:Atomic.cpp:(.text+0x71):
undefined reference to `___sync_fetch_and_or_4'
CMakeFiles/OpenThreads.dir/__/common/Atomic.cpp.obj:Atomic.cpp:(.text+0x81):
undefined reference to `___sync_fetch_and_and_4'
collect2: ld returned 1 exit status
make[2]: *** [bin/libOpenThreads.dll] Error 1

The single thing I found using google about this was that gcc seems to
think these intrisics are not supported.
Next I tried win32 interlocked, but apparently that relies on msvc instrinics:

OpenThreads/common/Atomic.cpp:18:20: error: intrin.h: No such file or directory
OpenThreads/common/Atomic.cpp: In member function 'unsigned int
OpenThreads::Atomic::operator++()':
OpenThreads/common/Atomic.cpp:46: error: invalid conversion from
'volatile long int*' to 'long int*'
OpenThreads/common/Atomic.cpp:46: error:   initializing argument 1 of
'LONG InterlockedIncrement(long int*)'
OpenThreads/common/Atomic.cpp: In member function 'unsigned int
OpenThreads::Atomic::operator--()':
OpenThreads/common/Atomic.cpp:60: error: invalid conversion from
'volatile long int*' to 'long int*'
OpenThreads/common/Atomic.cpp:60: error:   initializing argument 1 of
'LONG InterlockedDecrement(long int*)'
OpenThreads/common/Atomic.cpp: In member function 'unsigned int
OpenThreads::Atomic::AND(unsigned int)':
OpenThreads/common/Atomic.cpp:74: error: '_InterlockedAnd' was not
declared in this scope
OpenThreads/common/Atomic.cpp: In member function 'unsigned int
OpenThreads::Atomic::OR(unsigned int)':
OpenThreads/common/Atomic.cpp:88: error: '_InterlockedOr' was not
declared in this scope
OpenThreads/common/Atomic.cpp: In member function 'unsigned int
OpenThreads::Atomic::XOR(unsigned int)':
OpenThreads/common/Atomic.cpp:102: error: '_InterlockedXor' was not
declared in this scope
OpenThreads/common/Atomic.cpp: In member function 'unsigned int
OpenThreads::Atomic::exchange(unsigned int)':
OpenThreads/common/Atomic.cpp:117: error: invalid conversion from
'volatile long int*' to 'long int*'
OpenThreads/common/Atomic.cpp:117: error:   initializing argument 1 of
'LONG InterlockedExchange(long int*, LONG)'
OpenThreads/common/Atomic.cpp: In member function
'OpenThreads::Atomic::operator unsigned int() const':
OpenThreads/common/Atomic.cpp:132: error: 'MemoryBarrier' was not
declared in this scope
OpenThreads/common/Atomic.cpp:133: error: invalid static_cast from
type 'const volatile long int' to type 'const volatile unsigned int&'
OpenThreads/common/Atomic.cpp: In member function 'void*
OpenThreads::AtomicPtr::get() const':
OpenThreads/common/Atomic.cpp:163: error: 'MemoryBarrier' was not
declared in this scope
make[2]: *** 
[src/OpenThreads/win32/CMakeFiles/OpenThreads.dir/__/common/Atomic.cpp.obj]
Error 1
make[1]: *** [src/OpenThreads/win32/CMakeFiles/OpenThreads.dir/all] Error 2
make: *** [all] Error 2

(msdn says these come from winbase.h, so I removed the intrin.h
reference, but still no luck)
Note, I get a working OSG with the fall-back implementation, but I
assume that is suboptimal in terms of performance.

3) the libtiff I use (version 3.8.2) depends on libjpeg and zlib (just
like libpng depends on zlib). Cmake doesn't handle this. How can I
pass this information to the build process?

-- 
Thanks,
Csaba
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to