Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] mingw64|win32 issues

Subject: CGAL users discussion list

List archive

[cgal-discuss] mingw64|win32 issues


Chronological Thread 
  • From: xantares 09 <>
  • To: "" <>
  • Subject: [cgal-discuss] mingw64|win32 issues
  • Date: Thu, 10 Apr 2014 08:38:59 +0000
  • Importance: Normal

Hi,


I compiled cgal with mingw64 from linux and there are a few issues:


1. In cmake/modules/CGAL_SetupBoost.cmake, the boost thread component is misnamed for windows platforms:
find_package( Boost 1.33.1 REQUIRED thread system )
should be replaced by:
if (WIN32)
  find_package( Boost 1.33.1 REQUIRED thread_win32 system )
else ()
  find_package( Boost 1.33.1 REQUIRED thread system )
endif()


2. There's a compilation error with the x86_64 target:
Scanning dependencies of target CGAL
mingw-w64-cgal/src/CGAL-4.4/include/CGAL/double.h: In function 'double CGAL::sse2fabs(double)':
mingw-w64-cgal/src/CGAL-4.4/include/CGAL/double.h:132:10: error: 'CGAL_ALIGN_16' does not name a type
   static CGAL_ALIGN_16 const union{
          ^
mingw-w64-cgal/src/CGAL-4.4/include/CGAL/double.h:135:5: error: 'absMask' was not declared in this scope
   } absMask = {0x7fffffffffffffff, 0x7fffffffffffffff};
     ^
mingw-w64-cgal/src/CGAL-4.4/include/CGAL/double.h:135:54: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 [enabled by default]
   } absMask = {0x7fffffffffffffff, 0x7fffffffffffffff};
                                                      ^
src/CGAL/CMakeFiles/CGAL.dir/build.make:58: recipe for target 'src/CGAL/CMakeFiles/CGAL.dir/all_files.cpp.obj' failed

But if I replace _MSC_VER by _WIN32 in include/CGAL/sse2.h, both i686 and x86_64 targets are fine
#if defined ( _WIN32 )
#define CGAL_ALIGN_16  __declspec(align(16))
#elif defined( __GNU__ )
#define  CGAL_ALIGN_16 __attribute__((aligned(16)))
#endif
But I don't really know what I'm doing for this one :]


3. Export libraries (.dll) are properly installed to <PREFIX>/bin and import libraries (.dll.a) to <PREFIX>/lib.
But in the CGALConfig.cmake file, the CGAL*_LIBRARY vars refer to the export library name in <PREFIX>/lib:
set(CGAL_LIBRARY         "/usr/i686-w64-mingw32/lib/libCGAL.dll")
it should simply be:
set(CGAL_LIBRARY         "CGAL")
as CGAL_LIBRARY_DIRS is used by UseCGAL, which is also a lot cleaner.
Same for other CGAL*_LIBRARY vars.

Regards,
xan.





Archive powered by MHonArc 2.6.18.

Top of Page