Re: [osg-users] The story continues: osgthirdpersonview crashes on Linux

2008-07-01 Thread Mario Valle

Last SVN checkout works perfectly!

Now I have only to understand why the GCC builtins are not configured on my 
system.

You say I'm forced to define the environment variable CXXFLAGS to -march=i686 before 
running ccmake . ? It is not possible to define CMAKE_CXX_FLAGS and CMAKE_C_FLAGS inside 
Cmake?


Thanks!
mario



Mathias Fröhlich wrote:

Hi,

On Monday 30 June 2008 15:51, Mario Valle wrote:

Hope this helps you. Ciao!


Yep this helps, thanks.
The fix needs to look somehow different, but I will provide a full submission 
to Robert ...


Greetings

Mathais



--
Ing. Mario Valle
Data Analysis and Visualization Services | http://www.cscs.ch/~mvalle
Swiss National Supercomputing Centre (CSCS)  | Tel:  +41 (91) 610.82.60
v. Cantonale Galleria 2, 6928 Manno, Switzerland | Fax:  +41 (91) 610.82.82
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] The story continues: osgthirdpersonview crashes on Linux

2008-07-01 Thread Mathias Fröhlich

Hi,

On Tuesday 01 July 2008 13:14, Mario Valle wrote:
 Last SVN checkout works perfectly!
Good to hear.

 Now I have only to understand why the GCC builtins are not configured on my
 system.

 You say I'm forced to define the environment variable CXXFLAGS to
 -march=i686 before running ccmake . ? It is not possible to define
 CMAKE_CXX_FLAGS and CMAKE_C_FLAGS inside Cmake? 
And don't forget to switch on optimizations of your choice, since this might 
override the release C*FLAGS settings ...

Greetings

Mathias

-- 
Dr. Mathias Fröhlich, science + computing ag, Software Solutions
Hagellocher Weg 71-75, D-72070 Tuebingen, Germany
Phone: +49 7071 9457-268, Fax: +49 7071 9457-511
-- 
Vorstand/Board of Management:
Dr. Bernd Finkbeiner, Dr. Florian Geyer,
Dr. Roland Niemeier, Dr. Arno Steitz, Dr. Ingrid Zech
Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Prof. Dr. Hanns Ruder
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196 


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


[osg-users] The story continues: osgthirdpersonview crashes on Linux

2008-06-30 Thread Mario Valle

Dear all,
After a fresh SVN checkout osgthirdpersonview continues crashing and the generated 
Configure header continues to have all its entries commented out.


As per various suggestions I defined the following entries in Cmake:

CMAKE_CXX_FLAGS  -march=i686
CMAKE_C_FLAGS-march=i686

But nothing changes and even in CMakeFiles/CMakeError.log I found the following entry for 
which no sign of the above flags appears:


Performing C++ SOURCE FILE Test _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS failed with the 
following output:
/usr/bin/gmake -f CMakeFiles/cmTryCompileExec.dir/build.make 
CMakeFiles/cmTryCompileExec.dir/build

gmake[1]: Entering directory `/local/OSG/OpenSceneGraph/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report 
/local/OSG/OpenSceneGraph/CMakeFiles/CMakeTmp/CMakeFiles 1

Building CXX object CMakeFiles/cmTryCompileExec.dir/src.o
/usr/bin/c++   -D_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS   -o 
CMakeFiles/cmTryCompileExec.dir/src.o -c

/local/OSG/OpenSceneGraph/CMakeFiles/CMakeTmp/src.cxx
Linking CXX executable cmTryCompileExec
/usr/bin/cmake -P CMakeFiles/cmTryCompileExec.dir/cmake_clean_target.cmake
/usr/bin/c++   -D_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS  -fPIC 
CMakeFiles/cmTryCompileExec.dir/src.o   -o cmTryCompileExec -rdynamic

CMakeFiles/cmTryCompileExec.dir/src.o: In function `main':
src.cxx:(.text+0x43): undefined reference to `__sync_bool_compare_and_swap_4'
src.cxx:(.text+0x6e): undefined reference to `__sync_bool_compare_and_swap_4'
collect2: ld returned 1 exit status
gmake[1]: *** [cmTryCompileExec] Error 1
gmake[1]: Leaving directory `/local/OSG/OpenSceneGraph/CMakeFiles/CMakeTmp'
gmake: *** [cmTryCompileExec/fast] Error 2

Another piece of the puzzle that could be of interest: I have trouble also with the build 
of the FOX toolkit: seems like the configure process is configuring capabilities that are 
not there... Bho?


Confused
mario
--
Ing. Mario Valle
Data Analysis and Visualization Services | http://www.cscs.ch/~mvalle
Swiss National Supercomputing Centre (CSCS)  | Tel:  +41 (91) 610.82.60
v. Cantonale Galleria 2, 6928 Manno, Switzerland | Fax:  +41 (91) 610.82.82
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] The story continues: osgthirdpersonview crashes on Linux

2008-06-30 Thread Mathias Fröhlich
On Monday 30 June 2008 13:41, Mario Valle wrote:
 Dear all,
 After a fresh SVN checkout osgthirdpersonview continues crashing and the
 generated Configure header continues to have all its entries commented out.

 As per various suggestions I defined the following entries in Cmake:

 CMAKE_CXX_FLAGS  -march=i686
 CMAKE_C_FLAGS-march=i686

 But nothing changes and even in CMakeFiles/CMakeError.log I found the
 following entry for which no sign of the above flags appears:

 Performing C++ SOURCE FILE Test _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS failed
 with the following output:
 /usr/bin/gmake -f CMakeFiles/cmTryCompileExec.dir/build.make
 CMakeFiles/cmTryCompileExec.dir/build
 gmake[1]: Entering directory
 `/local/OSG/OpenSceneGraph/CMakeFiles/CMakeTmp' /usr/bin/cmake -E
 cmake_progress_report
 /local/OSG/OpenSceneGraph/CMakeFiles/CMakeTmp/CMakeFiles 1
 Building CXX object CMakeFiles/cmTryCompileExec.dir/src.o
 /usr/bin/c++   -D_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS   -o
 CMakeFiles/cmTryCompileExec.dir/src.o -c
 /local/OSG/OpenSceneGraph/CMakeFiles/CMakeTmp/src.cxx
 Linking CXX executable cmTryCompileExec
 /usr/bin/cmake -P CMakeFiles/cmTryCompileExec.dir/cmake_clean_target.cmake
 /usr/bin/c++   -D_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS  -fPIC
 CMakeFiles/cmTryCompileExec.dir/src.o   -o cmTryCompileExec -rdynamic
 CMakeFiles/cmTryCompileExec.dir/src.o: In function `main':
 src.cxx:(.text+0x43): undefined reference to
 `__sync_bool_compare_and_swap_4' src.cxx:(.text+0x6e): undefined reference
 to `__sync_bool_compare_and_swap_4' collect2: ld returned 1 exit status
 gmake[1]: *** [cmTryCompileExec] Error 1
 gmake[1]: Leaving directory `/local/OSG/OpenSceneGraph/CMakeFiles/CMakeTmp'
 gmake: *** [cmTryCompileExec/fast] Error 2

 Another piece of the puzzle that could be of interest: I have trouble also
 with the build of the FOX toolkit: seems like the configure process is
 configuring capabilities that are not there... Bho?

-- 
Dr. Mathias Fröhlich, science + computing ag, Software Solutions
Hagellocher Weg 71-75, D-72070 Tuebingen, Germany
Phone: +49 7071 9457-268, Fax: +49 7071 9457-511
-- 
Vorstand/Board of Management:
Dr. Bernd Finkbeiner, Dr. Florian Geyer,
Dr. Roland Niemeier, Dr. Arno Steitz, Dr. Ingrid Zech
Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Prof. Dr. Hanns Ruder
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196 


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


Re: [osg-users] The story continues: osgthirdpersonview crashes on Linux

2008-06-30 Thread Mathias Fröhlich

Sorry for the noise ...
Hit the send button by accident ...

On Monday 30 June 2008 13:41, Mario Valle wrote:
 Dear all,
 After a fresh SVN checkout osgthirdpersonview continues crashing and the
 generated Configure header continues to have all its entries commented out.

 As per various suggestions I defined the following entries in Cmake:

 CMAKE_CXX_FLAGS  -march=i686
 CMAKE_C_FLAGS-march=i686

 But nothing changes and even in CMakeFiles/CMakeError.log I found the
 following entry for which no sign of the above flags appears:

 Performing C++ SOURCE FILE Test _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS failed
 with the following output:
 /usr/bin/gmake -f CMakeFiles/cmTryCompileExec.dir/build.make
 CMakeFiles/cmTryCompileExec.dir/build
 gmake[1]: Entering directory
 `/local/OSG/OpenSceneGraph/CMakeFiles/CMakeTmp' /usr/bin/cmake -E
 cmake_progress_report
 /local/OSG/OpenSceneGraph/CMakeFiles/CMakeTmp/CMakeFiles 1
 Building CXX object CMakeFiles/cmTryCompileExec.dir/src.o
 /usr/bin/c++   -D_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS   -o
 CMakeFiles/cmTryCompileExec.dir/src.o -c
 /local/OSG/OpenSceneGraph/CMakeFiles/CMakeTmp/src.cxx
 Linking CXX executable cmTryCompileExec
 /usr/bin/cmake -P CMakeFiles/cmTryCompileExec.dir/cmake_clean_target.cmake
 /usr/bin/c++   -D_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS  -fPIC
 CMakeFiles/cmTryCompileExec.dir/src.o   -o cmTryCompileExec -rdynamic
 CMakeFiles/cmTryCompileExec.dir/src.o: In function `main':
 src.cxx:(.text+0x43): undefined reference to
 `__sync_bool_compare_and_swap_4' src.cxx:(.text+0x6e): undefined reference
 to `__sync_bool_compare_and_swap_4' collect2: ld returned 1 exit status
 gmake[1]: *** [cmTryCompileExec] Error 1
 gmake[1]: Leaving directory `/local/OSG/OpenSceneGraph/CMakeFiles/CMakeTmp'
 gmake: *** [cmTryCompileExec/fast] Error 2

 Another piece of the puzzle that could be of interest: I have trouble also
 with the build of the FOX toolkit: seems like the configure process is
 configuring capabilities that are not there... Bho?

Ok, the cflags did not reach the compiler command line. Therefore you do not 
get atomics. It's beyond my cmake knowledge when which cmake variable is 
used.
I usually set CFLAGS and CXXFLAGS in the environment where I run cmake. That 
appears to work for me ...

Hmm, I wonder why your previous post tells that none of the OpeThreads Config 
variables are defined. At least the MUTEX one should be ...

Can you replace the CheckAtomicOps.cmake file with the one I have attached and 
retest please? Note that I am interrested in the fallback path with the 
mutex, so please do not change eny cflags or whatever wrt the previous run 
that did not work ...
Thanks!

Greetings

Mathias

-- 
Dr. Mathias Fröhlich, science + computing ag, Software Solutions
Hagellocher Weg 71-75, D-72070 Tuebingen, Germany
Phone: +49 7071 9457-268, Fax: +49 7071 9457-511
-- 
Vorstand/Board of Management:
Dr. Bernd Finkbeiner, Dr. Florian Geyer,
Dr. Roland Niemeier, Dr. Arno Steitz, Dr. Ingrid Zech
Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Prof. Dr. Hanns Ruder
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196 

# Check for availability of atomic operations 
# This module defines
# OPENTHREADS_HAVE_ATOMIC_OPS

INCLUDE(CheckCXXSourceRuns)

# Do step by step checking, 
CHECK_CXX_SOURCE_RUNS(
#include cstdlib

int main()
{
   unsigned value = 0;
   void* ptr = value;
   __sync_add_and_fetch(value, 1);
   __sync_synchronize();
   __sync_sub_and_fetch(value, 1);
   if (!__sync_bool_compare_and_swap(value, 0, 1))
  return EXIT_FAILURE;
   
   if (!__sync_bool_compare_and_swap(ptr, ptr, ptr))
  return EXIT_FAILURE;

   return EXIT_SUCCESS;
}
 _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS)

CHECK_CXX_SOURCE_RUNS(
#include stdlib.h

int main(int, const char**)
{
   unsigned value = 0;
   void* ptr = value;
   __add_and_fetch(value, 1);
   __synchronize(value);
   __sub_and_fetch(value, 1);
   if (!__compare_and_swap(value, 0, 1))
  return EXIT_FAILURE;
   
   if (!__compare_and_swap((unsigned long*)ptr, (unsigned long)ptr, (unsigned long)ptr))
  return EXIT_FAILURE;

   return EXIT_SUCCESS;
}
 _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS)

CHECK_CXX_SOURCE_RUNS(
#include atomic.h
#include cstdlib

int main(int, const char**)
{
   uint_t value = 0;
   void* ptr = value;
   atomic_inc_uint_nv(value);
   membar_consumer();
   atomic_dec_uint_nv(value);
   if (0 != atomic_cas_uint(value, 0, 1))
  return EXIT_FAILURE;
   
   if (ptr != atomic_cas_ptr(ptr, ptr, ptr))
  return EXIT_FAILURE;

   return EXIT_SUCCESS;
}
 _OPENTHREADS_ATOMIC_USE_SUN)

CHECK_CXX_SOURCE_RUNS(
#include windows.h
#include cstdlib

int main(int, const char**)
{
   volatile long value = 0;
   long data = 0;
   long* volatile ptr = data;

   InterlockedIncrement(value);
   MemoryBarrier();
   InterlockedDecrement(value);

   if (0 != 

Re: [osg-users] The story continues: osgthirdpersonview crashes on Linux

2008-06-30 Thread Mario Valle

Thanks a lot Mathias!
Adding your file, deleting the cache and starting over:
- Confing now has #define _OPENTHREADS_ATOMIC_USE_MUTEX
- But the build fails when compiling Referenced.cpp

/local/OSG/OpenSceneGraph/src/osg/Referenced.cpp:85: error: qualified name does not name a 
class before '{' token

gmake[2]: *** [src/osg/CMakeFiles/osg.dir/Referenced.o] Error 1
gmake[2]: *** Waiting for unfinished jobs
gmake[1]: *** [src/osg/CMakeFiles/osg.dir/all] Error 2
gmake: *** [all] Error 2

Seems like _OSG_REFERENCED_USE_ATOMIC_OPERATIONS is not defined.
So I added to Config header the line:
#define _OSG_REFERENCED_USE_ATOMIC_OPERATIONS

And voila', everything works, no more crashes in osgthirdpersonview !
Hope this helps you. Ciao!
mario

Mathias Fröhlich wrote:

Sorry for the noise ...
Hit the send button by accident ...

On Monday 30 June 2008 13:41, Mario Valle wrote:

Dear all,
After a fresh SVN checkout osgthirdpersonview continues crashing and the
generated Configure header continues to have all its entries commented out.

As per various suggestions I defined the following entries in Cmake:

CMAKE_CXX_FLAGS  -march=i686
CMAKE_C_FLAGS-march=i686

But nothing changes and even in CMakeFiles/CMakeError.log I found the
following entry for which no sign of the above flags appears:

Performing C++ SOURCE FILE Test _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS failed
with the following output:
/usr/bin/gmake -f CMakeFiles/cmTryCompileExec.dir/build.make
CMakeFiles/cmTryCompileExec.dir/build
gmake[1]: Entering directory
`/local/OSG/OpenSceneGraph/CMakeFiles/CMakeTmp' /usr/bin/cmake -E
cmake_progress_report
/local/OSG/OpenSceneGraph/CMakeFiles/CMakeTmp/CMakeFiles 1
Building CXX object CMakeFiles/cmTryCompileExec.dir/src.o
/usr/bin/c++   -D_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS   -o
CMakeFiles/cmTryCompileExec.dir/src.o -c
/local/OSG/OpenSceneGraph/CMakeFiles/CMakeTmp/src.cxx
Linking CXX executable cmTryCompileExec
/usr/bin/cmake -P CMakeFiles/cmTryCompileExec.dir/cmake_clean_target.cmake
/usr/bin/c++   -D_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS  -fPIC
CMakeFiles/cmTryCompileExec.dir/src.o   -o cmTryCompileExec -rdynamic
CMakeFiles/cmTryCompileExec.dir/src.o: In function `main':
src.cxx:(.text+0x43): undefined reference to
`__sync_bool_compare_and_swap_4' src.cxx:(.text+0x6e): undefined reference
to `__sync_bool_compare_and_swap_4' collect2: ld returned 1 exit status
gmake[1]: *** [cmTryCompileExec] Error 1
gmake[1]: Leaving directory `/local/OSG/OpenSceneGraph/CMakeFiles/CMakeTmp'
gmake: *** [cmTryCompileExec/fast] Error 2

Another piece of the puzzle that could be of interest: I have trouble also
with the build of the FOX toolkit: seems like the configure process is
configuring capabilities that are not there... Bho?


Ok, the cflags did not reach the compiler command line. Therefore you do not 
get atomics. It's beyond my cmake knowledge when which cmake variable is 
used.
I usually set CFLAGS and CXXFLAGS in the environment where I run cmake. That 
appears to work for me ...


Hmm, I wonder why your previous post tells that none of the OpeThreads Config 
variables are defined. At least the MUTEX one should be ...


Can you replace the CheckAtomicOps.cmake file with the one I have attached and 
retest please? Note that I am interrested in the fallback path with the 
mutex, so please do not change eny cflags or whatever wrt the previous run 
that did not work ...

Thanks!

Greetings

Mathias





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


--
Ing. Mario Valle
Data Analysis and Visualization Services | http://www.cscs.ch/~mvalle
Swiss National Supercomputing Centre (CSCS)  | Tel:  +41 (91) 610.82.60
v. Cantonale Galleria 2, 6928 Manno, Switzerland | Fax:  +41 (91) 610.82.82
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] The story continues: osgthirdpersonview crashes on Linux

2008-06-30 Thread Mathias Fröhlich

Hi,

On Monday 30 June 2008 15:51, Mario Valle wrote:
 Hope this helps you. Ciao!

Yep this helps, thanks.
The fix needs to look somehow different, but I will provide a full submission 
to Robert ...

Greetings

Mathais

-- 
Dr. Mathias Fröhlich, science + computing ag, Software Solutions
Hagellocher Weg 71-75, D-72070 Tuebingen, Germany
Phone: +49 7071 9457-268, Fax: +49 7071 9457-511
-- 
Vorstand/Board of Management:
Dr. Bernd Finkbeiner, Dr. Florian Geyer,
Dr. Roland Niemeier, Dr. Arno Steitz, Dr. Ingrid Zech
Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Prof. Dr. Hanns Ruder
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196 


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