chrisidefix / cgal-bindings

Automatically exported from code.google.com/p/cgal-bindings
Boost Software License 1.0
0 stars 0 forks source link

Fails to build on OS X #12

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Trying to build python bindings on OS X, and get various compilation failures.  
Building java bindings seems to fail the same way.   

Here is output of my cmake, followed by output of compilation.

Patricks-MacBook-Pro:CGAL-3.9_release pds$ cmake 
-DCGAL_DIR=/Users/pds/tools/CGAL-3.9 -DBUILD_PYTHON=ON -DBUILD_JAVA=OFF ../..
-- Build type: Release
-- USING CXXFLAGS = ' -O3 -DNDEBUG'
-- USING EXEFLAGS = '  
-Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries
/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/li
bGL.dylib '
-- Targetting Unix Makefiles
-- Using /usr/bin/c++ compiler.
-- DARWIN_VERSION=11
-- Mac Leopard detected
-- BUILD_JAVA is set to OFF: no CGAL-bindings for Java will be generated.
-- Found Python libs.
-- CGAL-SWIG Python files and libraries will be written in 
/Users/pds/tools/cgal-bindings/build/CGAL-3.9_release/build-python/CGAL.
-- Found JNI: JNI include dirs 
/System/Library/Frameworks/JavaVM.framework/Headers 
/System/Library/Frameworks/JavaVM.framework/Headers.
-- CGAL-SWIG Java libraries and files will be respectively written in 
/Users/pds/tools/cgal-bindings/build/CGAL-3.9_release/build-java/lib and 
/Users/pds/tools/cgal-bindings/build/CGAL-3.9_release/build-java/CGAL.
-- Configuring done
-- Generating done
-- Build files have been written to: 
/Users/pds/tools/cgal-bindings/build/CGAL-3.9_release

Here is the compilation failure, doesn't like something with the Line_3_def.h:

Patricks-MacBook-Pro:CGAL-3.9_release pds$ make
Scanning dependencies of target CGAL_Kernel_cpp
[  2%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Point_2.cpp.o
[  4%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Weighted_point_2.cpp.o
[  6%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Segment_2.cpp.o
[  8%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Triangle_2.cpp.o
[ 10%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Ray_2.cpp.o
[ 12%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Direction_2.cpp.o
[ 14%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Line_2.cpp.o
[ 16%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Vector_2.cpp.o
[ 18%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Polygon_2.cpp.o
[ 20%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Point_3.cpp.o
[ 22%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Weighted_point_3.cpp.o
[ 24%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Sphere_3.cpp.o
[ 26%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Plane_3.cpp.o
[ 28%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Segment_3.cpp.o
[ 30%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Line_3.cpp.o
In file included from 
/Users/pds/tools/cgal-bindings/SWIG_CGAL/Kernel/Line_3.cpp:10:
In file included from 
/Users/pds/tools/cgal-bindings/SWIG_CGAL/Kernel/Line_3.h:12:
/Users/pds/tools/cgal-bindings/SWIG_CGAL/Kernel/Line_3_impl.h:15:42: error: 
      lookup of 'Line_3' in member access expression is ambiguous
SWIG_CGAL_FORWARD_CALL_AND_REF_1(Plane_3,Line_3::perpendicular_plane,Point_3)
                                         ^
/Users/pds/tools/cgal-bindings/SWIG_CGAL/Common/Macros.h:189:51: note: expanded
      from macro 'SWIG_CGAL_FORWARD_CALL_AND_REF_1'
  SWIG_CGAL_FORWARD_CALL_AND_REF_SCOPE_1(RET,NAME,NAME,IN_TYPE)
                                                  ^
/Users/pds/tools/cgal-bindings/SWIG_CGAL/Common/Macros.h:183:43: note: expanded
      from macro 'SWIG_CGAL_FORWARD_CALL_AND_REF_SCOPE_1'
  SWIG_CGAL_FORWARD_CALL_SCOPE_1(RET,NAME,INAME,IN_TYPE) \
                                          ^
/Users/pds/tools/cgal-bindings/SWIG_CGAL/Common/Macros.h:171:57: note: expanded
      from macro 'SWIG_CGAL_FORWARD_CALL_SCOPE_1'
    return RET(SWIG_CGAL_extract_data(this->get_data()).INAME(...
                                                        ^
/opt/local/include/CGAL/Line_3.h:37:7: note: lookup in the object type
      'CGAL::Line_3<CGAL::Epick>' refers here
class Line_3 : public R_::Kernel_base::Line_3
      ^
/Users/pds/tools/cgal-bindings/SWIG_CGAL/Kernel/Line_3_def.h:22:29: note: 
      lookup from the current scope refers here
class SWIG_CGAL_KERNEL_DECL Line_3{
                            ^
In file included from 
/Users/pds/tools/cgal-bindings/SWIG_CGAL/Kernel/Line_3.cpp:10:
In file included from 
/Users/pds/tools/cgal-bindings/SWIG_CGAL/Kernel/Line_3.h:12:
/Users/pds/tools/cgal-bindings/SWIG_CGAL/Kernel/Line_3_impl.h:15:42: error: 
      lookup of 'Line_3' in member access expression is ambiguous
SWIG_CGAL_FORWARD_CALL_AND_REF_1(Plane_3,Line_3::perpendicular_plane,Point_3)
                                         ^
/Users/pds/tools/cgal-bindings/SWIG_CGAL/Common/Macros.h:189:51: note: expanded
      from macro 'SWIG_CGAL_FORWARD_CALL_AND_REF_1'
  SWIG_CGAL_FORWARD_CALL_AND_REF_SCOPE_1(RET,NAME,NAME,IN_TYPE)
                                                  ^
/Users/pds/tools/cgal-bindings/SWIG_CGAL/Common/Macros.h:185:56: note: expanded
      from macro 'SWIG_CGAL_FORWARD_CALL_AND_REF_SCOPE_1'
    ret = RET(SWIG_CGAL_extract_data(this->get_data()).INAME(...
                                                       ^
/opt/local/include/CGAL/Line_3.h:37:7: note: lookup in the object type
      'CGAL::Line_3<CGAL::Epick>' refers here
class Line_3 : public R_::Kernel_base::Line_3
      ^
/Users/pds/tools/cgal-bindings/SWIG_CGAL/Kernel/Line_3_def.h:22:29: note: 
      lookup from the current scope refers here
class SWIG_CGAL_KERNEL_DECL Line_3{
                            ^
2 errors generated.
make[2]: *** [SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Line_3.cpp.o] 
Error 1
make[1]: *** [SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/all] Error 2
make: *** [all] Error 2
Patricks-MacBook-Pro:CGAL-3.9_release pds$ 

Original issue reported on code.google.com by Patrick....@gmail.com on 5 May 2012 at 10:53

GoogleCodeExporter commented 9 years ago
I can get it a bit farther if I switch to llvm-g++ compiler, and turn off 
variadic templates, but still get a failure further on in SWIG generated code.  
Interestingly(?) I get that same failure with the original compiler (clang++) 
if I comment out the failing references to Line_3.  

Patricks-MacBook-Pro:cgal-bindings pds$ CC=llvm-gcc CXX=llvm-g++ cmake 
-DCGAL_DIR=/Users/pds/tools/CGAL-4.0 -DBUILD_PYTHON=ON -DBUILD_JAVA=OFF 
-DCGAL_CXX_FLAGS=-DCGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES .
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Check for working C compiler: /usr/bin/llvm-gcc
-- Check for working C compiler: /usr/bin/llvm-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Check for working CXX compiler: /usr/bin/llvm-g++
-- Check for working CXX compiler: /usr/bin/llvm-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found SWIG: /opt/local/bin/swig (found version "2.0.6")
-- Build type: Release
-- USING CXXFLAGS = ' -DCGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES -O3 -DNDEBUG'
-- USING EXEFLAGS = '  
-Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries
/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/li
bGL.dylib '
-- Targetting Unix Makefiles
-- Using /usr/bin/llvm-g++ compiler.
-- DARWIN_VERSION=11
-- Mac Leopard detected
-- Release mode with g++: using -fno-strict-aliasing flags
-- Found PythonLibs: /usr/lib/libpython2.7.dylib 
-- BUILD_JAVA is set to OFF: no CGAL-bindings for Java will be generated.
-- Found Python libs.
-- CGAL-SWIG Python files and libraries will be written in 
/Users/pds/tools/cgal-bindings/build-python/CGAL.
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/pds/tools/cgal-bindings
Patricks-MacBook-Pro:cgal-bindings pds$ make
[  2%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Point_2.cpp.o
[  4%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Weighted_point_2.cpp.o
[  6%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Segment_2.cpp.o
[  8%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Triangle_2.cpp.o
[ 10%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Ray_2.cpp.o
[ 12%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Direction_2.cpp.o
[ 14%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Line_2.cpp.o
[ 16%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Vector_2.cpp.o
[ 18%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Polygon_2.cpp.o
[ 20%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Point_3.cpp.o
[ 22%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Weighted_point_3.cpp.o
[ 24%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Sphere_3.cpp.o
[ 26%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Plane_3.cpp.o
[ 28%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Segment_3.cpp.o
[ 30%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Line_3.cpp.o
[ 32%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Triangle_3.cpp.o
[ 34%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Tetrahedron_3.cpp.o
[ 36%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Direction_3.cpp.o
[ 38%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Ray_3.cpp.o
[ 40%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Vector_3.cpp.o
[ 42%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Object.cpp.o
[ 44%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/global_functions.cpp.o
Linking CXX shared library ../../lib/libCGAL_Kernel_cpp.dylib
[ 44%] Built target CGAL_Kernel_cpp
[ 46%] Swig source
/opt/local/share/swig/2.0.6/std/std_basic_string.i:48: Warning 490: Fragment 
'StdTraits' not found.
Scanning dependencies of target _CGAL_Kernel
[ 48%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/_CGAL_Kernel.dir/CGAL_KernelPYTHON_wrap.cxx.o
/Users/pds/tools/cgal-bindings/SWIG_CGAL/Kernel/CGAL_KernelPYTHON_wrap.cxx:3138:
 error: ‘traits’ is not a template
/Users/pds/tools/cgal-bindings/SWIG_CGAL/Kernel/CGAL_KernelPYTHON_wrap.cxx:3138:
 error: explicit specialization of non-template ‘swig::traits’
/Users/pds/tools/cgal-bindings/SWIG_CGAL/Kernel/CGAL_KernelPYTHON_wrap.cxx:3139:
 error: ‘pointer_category’ does not name a type
make[2]: *** 
[SWIG_CGAL/Kernel/CMakeFiles/_CGAL_Kernel.dir/CGAL_KernelPYTHON_wrap.cxx.o] 
Error 1
make[1]: *** [SWIG_CGAL/Kernel/CMakeFiles/_CGAL_Kernel.dir/all] Error 2
make: *** [all] Error 2
Patricks-MacBook-Pro:cgal-bindings pds$ 

The code it doesn't like is the 'namespace swig' block from 
CGAL_KernelPYTHON_wrap.cxx highlighted below between my vvvvv / ^^^^^:

...

SWIGINTERNINLINE PyObject *
SWIG_From_size_t  (size_t value)
{    
  return SWIG_From_unsigned_SS_long  (static_cast< unsigned long >(value));
}

vvvvvvvvvvvvvvvvvvvvv

  namespace swig {
    template <>  struct traits<char > {
      typedef pointer_category category;
      static const char* type_name() { return"char"; }
    };
  }

^^^^^^^^^^^^^^^^

SWIGINTERN swig_type_info*
SWIG_pchar_descriptor(void)
{
  static int init = 0;
  static swig_type_info* info = 0;
  if (!init) {
    info = SWIG_TypeQuery("_p_char");
    init = 1;
  }
  return info;
}
...

Original comment by Patrick....@gmail.com on 5 May 2012 at 11:25

GoogleCodeExporter commented 9 years ago
Sorry, this can be closed due to some form of user error.  My swig2.0.6 was 
installed via macports (sudo port install swig followed by sudo port install 
swig-python), but seemed to be broken somehow.  I uninstalled and built swig 
from source, and now am able to build the swig bindings (still not with clang, 
but with llvm-g++) like so:

CC=llvm-gcc CXX=llvm-g++ cmake -DCGAL_DIR=/Users/pds/tools/CGAL-4.0 
-DBUILD_PYTHON=ON -DBUILD_JAVA=OFF 
-DCGAL_CXX_FLAGS=-DCGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES .

Original comment by Patrick....@gmail.com on 5 May 2012 at 4:11

GoogleCodeExporter commented 9 years ago

Original comment by sloriot...@gmail.com on 9 May 2012 at 5:56

GoogleCodeExporter commented 9 years ago
hi , I encounter the same situation here,
I first run CMake:
[ josh I-Chaoteki-MacBook-Air ~/Desktop/cgal-bindings/build/CGAL-4.0_release ] 
CC=llvm-gcc CXX=llvm-g++ cmake -DCGAL_DIR=/usr/local/lib/CGAL -DBUILD_PYTHON=ON 
-DBUILD_JAVA=OFF -DCGAL_CXX_FLAGS=-DCGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES ../..
/opt/local/bin/swig
-- Build type: Release
-- USING CXXFLAGS = ' -DCGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES -O3 -DNDEBUG'
-- USING EXEFLAGS = '  
-Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries
/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/li
bGL.dylib '
-- Targetting Unix Makefiles
-- Using /usr/bin/c++ compiler.
-- DARWIN_VERSION=11
-- Mac Leopard detected
-- BUILD_JAVA is set to OFF: no CGAL-bindings for Java will be generated.
-- Found Python libs.
-- CGAL-SWIG Python files and libraries will be written in 
/Users/josh/Desktop/cgal-bindings/build/CGAL-4.0_release/build-python/CGAL.
-- Found JNI: JNI include dirs 
/System/Library/Frameworks/JavaVM.framework/Headers 
/System/Library/Frameworks/JavaVM.framework/Headers.
-- CGAL-SWIG Java libraries and files will be respectively written in 
/Users/josh/Desktop/cgal-bindings/examples/java/lib and 
/Users/josh/Desktop/cgal-bindings/examples/java/CGAL.
-- Configuring done
-- Generating done
-- Build files have been written to: 
/Users/josh/Desktop/cgal-bindings/build/CGAL-4.0_release

and make
[  2%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Point_2.cpp.o
[  4%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Weighted_point_2.cpp.o
[  6%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Segment_2.cpp.o
[  8%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Triangle_2.cpp.o
[ 10%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Ray_2.cpp.o
[ 12%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Direction_2.cpp.o
[ 14%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Line_2.cpp.o
[ 16%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Vector_2.cpp.o
[ 18%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Polygon_2.cpp.o
[ 20%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Point_3.cpp.o
[ 22%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Weighted_point_3.cpp.o
[ 24%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Sphere_3.cpp.o
[ 26%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Plane_3.cpp.o
[ 28%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Segment_3.cpp.o
[ 30%] Building CXX object 
SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Line_3.cpp.o
In file included from 
/Users/josh/Desktop/cgal-bindings/SWIG_CGAL/Kernel/Line_3.cpp:10:
In file included from 
/Users/josh/Desktop/cgal-bindings/SWIG_CGAL/Kernel/Line_3.h:12:
/Users/josh/Desktop/cgal-bindings/SWIG_CGAL/Kernel/Line_3_impl.h:15:42: error: 
lookup of 'Line_3' in member access expression is ambiguous
SWIG_CGAL_FORWARD_CALL_AND_REF_1(Plane_3,Line_3::perpendicular_plane,Point_3)
                                         ^
/Users/josh/Desktop/cgal-bindings/SWIG_CGAL/Common/Macros.h:189:51: note: 
expanded from macro 'SWIG_CGAL_FORWARD_CALL_AND_REF_1'
  SWIG_CGAL_FORWARD_CALL_AND_REF_SCOPE_1(RET,NAME,NAME,IN_TYPE)
                                                  ^
/Users/josh/Desktop/cgal-bindings/SWIG_CGAL/Common/Macros.h:183:43: note: 
expanded from macro 'SWIG_CGAL_FORWARD_CALL_AND_REF_SCOPE_1'
  SWIG_CGAL_FORWARD_CALL_SCOPE_1(RET,NAME,INAME,IN_TYPE) \
                                          ^
/Users/josh/Desktop/cgal-bindings/SWIG_CGAL/Common/Macros.h:171:57: note: 
expanded from macro 'SWIG_CGAL_FORWARD_CALL_SCOPE_1'
    return RET(SWIG_CGAL_extract_data(this->get_data()).INAME(internal::Converter<IN_TYPE>::convert(c)));\
                                                        ^
/usr/local/include/CGAL/Line_3.h:37:7: note: lookup in the object type 
'CGAL::Line_3<CGAL::Epick>' refers here
class Line_3 : public R_::Kernel_base::Line_3
      ^
/Users/josh/Desktop/cgal-bindings/SWIG_CGAL/Kernel/Line_3_def.h:22:29: note: 
lookup from the current scope refers here
class SWIG_CGAL_KERNEL_DECL Line_3{
                            ^
In file included from 
/Users/josh/Desktop/cgal-bindings/SWIG_CGAL/Kernel/Line_3.cpp:10:
In file included from 
/Users/josh/Desktop/cgal-bindings/SWIG_CGAL/Kernel/Line_3.h:12:
/Users/josh/Desktop/cgal-bindings/SWIG_CGAL/Kernel/Line_3_impl.h:15:42: error: 
lookup of 'Line_3' in member access expression is ambiguous
SWIG_CGAL_FORWARD_CALL_AND_REF_1(Plane_3,Line_3::perpendicular_plane,Point_3)
                                         ^
/Users/josh/Desktop/cgal-bindings/SWIG_CGAL/Common/Macros.h:189:51: note: 
expanded from macro 'SWIG_CGAL_FORWARD_CALL_AND_REF_1'
  SWIG_CGAL_FORWARD_CALL_AND_REF_SCOPE_1(RET,NAME,NAME,IN_TYPE)
                                                  ^
/Users/josh/Desktop/cgal-bindings/SWIG_CGAL/Common/Macros.h:185:56: note: 
expanded from macro 'SWIG_CGAL_FORWARD_CALL_AND_REF_SCOPE_1'
    ret = RET(SWIG_CGAL_extract_data(this->get_data()).INAME(internal::Converter<IN_TYPE>::convert(c)));\
                                                       ^
/usr/local/include/CGAL/Line_3.h:37:7: note: lookup in the object type 
'CGAL::Line_3<CGAL::Epick>' refers here
class Line_3 : public R_::Kernel_base::Line_3
      ^
/Users/josh/Desktop/cgal-bindings/SWIG_CGAL/Kernel/Line_3_def.h:22:29: note: 
lookup from the current scope refers here
class SWIG_CGAL_KERNEL_DECL Line_3{
                            ^
2 errors generated.
make[2]: *** [SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/Line_3.cpp.o] 
Error 1
make[1]: *** [SWIG_CGAL/Kernel/CMakeFiles/CGAL_Kernel_cpp.dir/all] Error 2
make: *** [all] Error 2

I dont know why the compilation cant pass..
Can someone help me about it?

Original comment by jdilys...@gmail.com on 20 Jun 2012 at 10:06

GoogleCodeExporter commented 9 years ago
Have you tried compiling swig yourself as Patrick did?

Original comment by sloriot...@gmail.com on 20 Jun 2012 at 10:14

GoogleCodeExporter commented 9 years ago
I have built it from source, but when I set the FindSWIG.cmake to find the 
self-compiled swig,
I got the following error:

[ josh I-Chaoteki-MacBook-Air ~/Desktop/cgal-bindings/build/CGAL-4.0_release ] 
CC=llvm-gcc CXX=llvm-g++ cmake -DCGAL_DIR=/usr/local/lib/CGAL -DBUILD_PYTHON=ON 
-DBUILD_JAVA=OFF -DCGAL_CXX_FLAGS=-DCGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES ../..
/usr/local/bin
CMake Error at /opt/local/share/cmake-2.8/Modules/FindSWIG.cmake:41 (MESSAGE):
  Command "/usr/local/bin -swiglib" failed with output:

Call Stack (most recent call first):
  CMakeLists.txt:13 (find_package)

-- Found SWIG: /usr/local/bin (found version "2.0.7") 
-- Build type: Release
-- USING CXXFLAGS = ' -DCGAL_CFG_NO_CPP0X_VARIADIC_TEMPLATES -O3 -DNDEBUG'
-- USING EXEFLAGS = '  
-Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries
/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/li
bGL.dylib '
-- Targetting Unix Makefiles
-- Using /usr/bin/c++ compiler.
-- DARWIN_VERSION=11
-- Mac Leopard detected
CMake Error at CMakeLists.txt:31 (INCLUDE):
  include called with wrong number of arguments.  Include only takes one
  file.

-- BUILD_JAVA is set to OFF: no CGAL-bindings for Java will be generated.
-- Found Python libs.
-- CGAL-SWIG Python files and libraries will be written in 
/Users/josh/Desktop/cgal-bindings/build/CGAL-4.0_release/build-python/CGAL.
-- Found JNI: JNI include dirs 
/System/Library/Frameworks/JavaVM.framework/Headers 
/System/Library/Frameworks/JavaVM.framework/Headers.
-- CGAL-SWIG Java libraries and files will be respectively written in 
/Users/josh/Desktop/cgal-bindings/examples/java/lib and 
/Users/josh/Desktop/cgal-bindings/examples/java/CGAL.
CMake Error at cmake/Modules/SWIG_CGAL_Macros.cmake:69 (SWIG_ADD_MODULE):
  Unknown CMake command "SWIG_ADD_MODULE".
Call Stack (most recent call first):
  SWIG_CGAL/Kernel/CMakeLists.txt:6 (ADD_SWIG_CGAL_PYTHON_MODULE)

-- Configuring incomplete, errors occurred!

Original comment by jdilys...@gmail.com on 20 Jun 2012 at 10:46

GoogleCodeExporter commented 9 years ago
The following line:
  Command "/usr/local/bin -swiglib" failed with output:
suggests that you didn't pass swig executable but the directory containing it.

Original comment by sloriot...@gmail.com on 20 Jun 2012 at 11:38

GoogleCodeExporter commented 9 years ago
I think maybe you need to wipe out your cmake-generated stuff (I think anything 
like cmake-cache or cmakefiles, just leave cmakelists.txt), and retry.  From 
the output of your initial compile I don't think it is really using the llvm 
compiler, despite the env vars you specified:

Your output shows:

-- Using /usr/bin/c++ compiler.

While mine eventually had:

-- Using /usr/bin/llvm-g++ compiler.

Original comment by Patrick....@gmail.com on 20 Jun 2012 at 12:45

GoogleCodeExporter commented 9 years ago
Thanks you for ur kindly help, 
I finally successfully pass the make procedure
But when I run the example, I encounter the version mismatch problem..
I use python 2.7, are u guys using 2.6??

Original comment by jdilys...@gmail.com on 20 Jun 2012 at 4:31

GoogleCodeExporter commented 9 years ago
Did you use the same version of the library (to compile) and of python to run 
the example?

Original comment by sloriot...@gmail.com on 21 Jun 2012 at 6:07