Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Spatial Searching: How to cope with duplicate points?

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Spatial Searching: How to cope with duplicate points?


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] Spatial Searching: How to cope with duplicate points?
  • Date: Thu, 21 Oct 2010 10:12:19 +0200

I tried on 32 and 64 bits machine and it's working without assertion failure.

I got an AMD64 at home, I can make a try on this machine but I doubt
the problem is coming from the architecture.

S.

Sebastian Kapfer wrote:
Hello!

You are wrong. With gcc-4.2, for example, CGAL cmake scripts adds the compilation flag -fno-strict-aliasing, because the aliasing features of that version of gcc have bugs.

Okay...

Please note that I have tried to compile the demo with CMake, only it
didn't help... GCC 4.4 doesn't help either... probably I'm doing
something wrong.

My 387 vs. SSE conjecture wasn't the whole truth either, however. It
helped with the demo I posted earlier, but not with my actual code. I
have created a new demo (with different point data), which fails to
work, even in 387 mode.

Please get the new files from here:

http://www.theorie1.physik.uni-erlangen.de/people/skapfer/points_in_new_searchtree.txt
http://www.theorie1.physik.uni-erlangen.de/people/skapfer/distance_browsing.cpp

$ g++ -fno-strict-aliasing -frounding-math -O2 -g -lCGAL \
distance_browsing.cpp -o distance_browsing
$ ./distance_browsing
terminate called after throwing an instance of
'CGAL::Assertion_exception'
what(): CGAL ERROR: assertion violation!
Expr: new_rd >= copy_rd
File:

/opt/cgal/3.7_boost1.40/include/CGAL/Orthogonal_incremental_neighbor_search.h
Line: 267

Here with CMake:

sk@noether(~/spielwiese/fast_thicken/MinimalExample)>
ll
total 4.3M
-rw-r--r--+ 1 sk mitabyter 1.4K 2010-10-20 16:47 distance_browsing.cpp
-rw-r--r--+ 1 sk mitabyter 3.6M 2010-10-20 15:56 points_in_new_searchtree.txt
-rw-r--r--+ 1 sk mitabyter 627K 2010-10-19 12:21 points_in_searchtree.txt
drwxr-xr-x+ 2 sk mitabyter 103 2010-10-20 14:27 TRASH/
sk@noether(~/spielwiese/fast_thicken/MinimalExample)> cgal_create_cmake_script created CMakeLists.txt in /home/sk/spielwiese/fast_thicken/MinimalExample ...
sk@noether(~/spielwiese/fast_thicken/MinimalExample)>
cmake .
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Build type: Release
-- USING CXXFLAGS = ' -frounding-math -fno-strict-aliasing -O3 -DNDEBUG'
-- USING EXEFLAGS = ' '
-- Targetting Unix Makefiles
-- Using /usr/bin/c++ compiler.
-- Configuring done
-- Generating done
-- Build files have been written to:
/home/sk/spielwiese/fast_thicken/MinimalExample
sk@noether(~/spielwiese/fast_thicken/MinimalExample)>
make distance_browsing
Scanning dependencies of target distance_browsing
[100%] Building CXX object
CMakeFiles/distance_browsing.dir/distance_browsing.o
Linking CXX executable distance_browsing
[100%] Built target distance_browsing
sk@noether(~/spielwiese/fast_thicken/MinimalExample)> ./distance_browsing sk@noether(~/spielwiese/fast_thicken/MinimalExample)>

works -- release build, of course it does.

now with debugging

sk@noether(~/spielwiese/fast_thicken/MinimalExample)>
cmake -D CMAKE_BUILD_TYPE=Debug .
-- Build type: Debug
-- USING CXXFLAGS = ' -frounding-math -fno-strict-aliasing -g'
-- USING EXEFLAGS = ' '
-- Targetting Unix Makefiles
-- Using /usr/bin/c++ compiler.
-- Configuring done
-- Generating done
-- Build files have been written to:
/home/sk/spielwiese/fast_thicken/MinimalExample
sk@noether(~/spielwiese/fast_thicken/MinimalExample)>
make clean; make distance_browsing
[100%] Building CXX object
CMakeFiles/distance_browsing.dir/distance_browsing.o
Linking CXX executable distance_browsing
[100%] Built target distance_browsing
sk@noether(~/spielwiese/fast_thicken/MinimalExample)> ./distance_browsing terminate called after throwing an instance of 'CGAL::Assertion_exception'
what(): CGAL ERROR: assertion violation!
Expr: new_rd >= copy_rd
File:
/opt/cgal/3.7_boost1.40/include/CGAL/Orthogonal_incremental_neighbor_search.h
Line: 267
Aborted

Crashes.


No. CGAL is tested on different platforms, including of course 32 and 64 bits one. The error comes probably from something else. You compiled your programs without using CMake. What header <CGAL/compiler_config.h> is found when g++ is

That one:

sk@noether(~/spielwiese/fast_thicken/MinimalExample)> cat test.cpp #include <CGAL/compiler_config.h>
sk@noether(~/spielwiese/fast_thicken/MinimalExample)> g++ -E test.cpp # 1 "test.cpp"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "test.cpp"
# 1 "/opt/cgal/3.7_boost1.40/include/CGAL/compiler_config.h" 1 3
# 1 "test.cpp" 2


called without -I flags? Does this header correspond to the same version of CGAL as the libCGAL.so that is found by the linker without -L flags? It seems your CGAL installation is in /opt/cgal/3.7_boost1.40/. How comes that your compiler can found its headers and library without -I and -L flags?

sk@noether(~/spielwiese/fast_thicken/MinimalExample)>
echo $CPLUS_INCLUDE_PATH
/opt/cgal/3.7_boost1.40/include:/opt/boost/1_40_0/include

Similar things are in LIBRARY_PATH and LD_LIBRARY_PATH. Am I missing
something?





Archive powered by MHonArc 2.6.16.

Top of Page