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 != InterlockedCompareExchange(&value, 1, 0))
return EXIT_FAILURE;
if (ptr != InterlockedCompareExchangePointer((PVOID volatile*)&ptr, (PVOID)ptr, (PVOID)ptr))
return EXIT_FAILURE;
return EXIT_SUCCESS;
}
" _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED)
IF(NOT _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS AND NOT _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS AND NOT _OPENTHREADS_ATOMIC_USE_SUN AND NOT _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED)
SET(_OPENTHREADS_ATOMIC_USE_MUTEX 1)
ENDIF(NOT _OPENTHREADS_ATOMIC_USE_GCC_BUILTINS AND NOT _OPENTHREADS_ATOMIC_USE_MIPOSPRO_BUILTINS AND NOT _OPENTHREADS_ATOMIC_USE_SUN AND NOT _OPENTHREADS_ATOMIC_USE_WIN32_INTERLOCKED)
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org