Re: [osg-users] mingw build problems

2008-10-31 Thread Alberto Luaces
Hi Csaba,

thank you very much for the pointers. As you said, activating the reports on 
cmake generates the DartConfiguration.tcl. Now I'm wrestling with some issues 
that I think are Cygwin specific. Hope to be a new neighbour soon :)


El Jueves 30 Octubre 2008ES 14:26:07 Csaba Halász escribió:
 On Thu, Oct 30, 2008 at 9:38 AM, Alberto Luaces [EMAIL PROTECTED] wrote:
  Hi Csaba,
 
  Out of curiosity, are you jester?

 Hi Alberto,
 Yes that's me :)

  If that were your machine, how did you manage to install Dart with Mingw?
  I am be interested in doing the same with a Cygwin build.

 I built tcl and installed Dart. But it didn't work properly, and later
 I found out you *don't* need dart/tcl at all.
 Current cmake has a ctest module that does everything. Somebody should
 put this in big fat letters somewhere :)
 So just enable the dart stuff in the config and you are done. (It will
 still use DartConfiguration.tcl, don't be surprised by that)


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] mingw build problems

2008-10-30 Thread Csaba Halász
On Thu, Oct 30, 2008 at 9:38 AM, Alberto Luaces [EMAIL PROTECTED] wrote:
 Hi Csaba,

 Out of curiosity, are you jester?

Hi Alberto,
Yes that's me :)

 If that were your machine, how did you manage to install Dart with Mingw? I am
 be interested in doing the same with a Cygwin build.

I built tcl and installed Dart. But it didn't work properly, and later
I found out you *don't* need dart/tcl at all.
Current cmake has a ctest module that does everything. Somebody should
put this in big fat letters somewhere :)
So just enable the dart stuff in the config and you are done. (It will
still use DartConfiguration.tcl, don't be surprised by that)

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


[osg-users] mingw build problems

2008-10-29 Thread Csaba Halász
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 %MEMTIME+  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


Re: [osg-users] mingw build problems

2008-10-29 Thread Jean-Sébastien Guay

Hi Csaba,


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:


Matthias will give you the complete answer, but I think the gcc builtins 
need a recent gcc (4.x+), whereas I think MinGW is stuck at gcc 3.x...


And for the win32 interlocked, you need to be compiling with VC++ (which 
you can do with makefiles by calling cc.exe, but the CMake generated 
makefiles for MinGW surely use gcc only, so it won't be an option for you).


Sorry, but I don't think you'll be able to use anything other than the 
mutex fallback on MinGW unless you modify the MinGW CMake files to 
generate makefiles that use cc.exe - and install Visual Studio...


J-S
--
__
Jean-Sebastien Guay[EMAIL PROTECTED]
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] mingw build problems

2008-10-29 Thread Csaba Halász
On Wed, Oct 29, 2008 at 9:05 PM, Jean-Sébastien Guay
[EMAIL PROTECTED] wrote:
 Hi Csaba,

 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:

 Matthias will give you the complete answer, but I think the gcc builtins
 need a recent gcc (4.x+), whereas I think MinGW is stuck at gcc 3.x...

Hi J-S,
I have a recent gcc:

$ i586-mingw32msvc-gcc --version
i586-mingw32msvc-gcc (GCC) 4.2.1-sjlj (mingw32-2)

 And for the win32 interlocked, you need to be compiling with VC++ (which you
 can do with makefiles by calling cc.exe, but the CMake generated makefiles
 for MinGW surely use gcc only, so it won't be an option for you).

Yeah, that's what I figured too. So I guess I have to get the gcc
builtins to work if possible.

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


Re: [osg-users] mingw build problems

2008-10-29 Thread Csaba Halász
On Wed, Oct 29, 2008 at 11:15 PM, Csaba Halász [EMAIL PROTECTED] wrote:

 Yeah, that's what I figured too. So I guess I have to get the gcc
 builtins to work if possible.

Ok, you can strike this from the list.
I used  -DCMAKE_CXX_FLAGS_RELEASE=-O2 -march=i686 and that just got
added as a variable but did not get used. Apparently I have to specify
it is a STRING, so  -DCMAKE_CXX_FLAGS_RELEASE:STRING=-O2 -march=i686
works fine.

For the tiff issue, I have compiled a libtiff without jpeg or zlib
support, but that isn't really an acceptable solution.

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


Re: [osg-users] mingw build problems

2008-10-29 Thread Csaba Halász
Have run into another trouble, I had to add OSGSHADOW_EXPORT to each
of the embedded protected ViewData struct's in the osgShadow lib,
otherwise I get linking errors with the osgshadow example.
If it doesn't break other platforms, can they be added in svn?

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