Subject: CGAL users discussion list
List archive
- From: xantares 09 <>
- To: "" <>
- Subject: RE: [cgal-discuss] mingw64|win32 issues
- Date: Fri, 11 Apr 2014 14:01:25 +0000
- Importance: Normal
> From:
> To:
> Date: Fri, 11 Apr 2014 15:23:05 +0200
> Subject: Re: [cgal-discuss] mingw64|win32 issues
>
> Le Thursday 10 April 2014 08:38:59 xantares 09 a écrit :
> > I compiled cgal with mingw64 from linux and there are a few issues:
>
> Indeed, that platform in not yet supported by the CGAL project.
>
> > 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()
>
> Which Linux distribution are you using? On Fedora, the mingw32 version of
> libboost_thread is named libboost_thread-mt.dll.a. If on your distribution it
> is named differently, you should discuss with the packagers of the mingw32
> boost packages, to find out a solution.
Archlinux, i'll ask the mingw-boost maintainer.
> > 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
>
> As I said, that compiler is not supported. But maybe that is easy. In the file
> <CGAL/sse2.h>, please try to replace the line:
>
> #if defined ( _MSC_VER )
>
> by:
>
> #if defined( _MSC_VER ) || defined(__MINGW32__)
>
> Maybe that is sufficient.
>
>
> Edit: ... I see that below you propose something. Your solution is good too:
Ok, is there a public git repo ?
> > 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 :]
>
> In the code of <CGAL/double.h> and <CGAL/sse2.h>, we implicitly supposed that
> all MSVC-compatible compilers define _MSC_VER.
>
> > 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:
>
> Which CGALConfig.cmake are you talking about. There are two:
> - one that must be used when one want to use compiled libraries within the
> compilation tree,
> - one that must be used when the CGAL libraries are installed by 'make
> install'.
>
> > set(CGAL_LIBRARY "/usr/i686-w64-mingw32/lib/libCGAL.dll")
>
> That seems to be the CGALConfig.cmake that will be installed.
Yes, I tried to compile an external example and it failed to link using a cmake script like this one:
By the way it is installed under /usr/i686-w64-mingw32/lib/CGAL/CGALConfig.cmake, usually cmake config files are installed in a cmake subdir like /usr/i686-w64-mingw32/lib/cmake/CGAL/CGALConfig.cmake
>
> --
> You are currently subscribed to cgal-discuss.
> To unsubscribe or access the archives, go to
> https://sympa.inria.fr/sympa/info/cgal-discuss
>
>
> To:
> Date: Fri, 11 Apr 2014 15:23:05 +0200
> Subject: Re: [cgal-discuss] mingw64|win32 issues
>
> Le Thursday 10 April 2014 08:38:59 xantares 09 a écrit :
> > I compiled cgal with mingw64 from linux and there are a few issues:
>
> Indeed, that platform in not yet supported by the CGAL project.
>
> > 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()
>
> Which Linux distribution are you using? On Fedora, the mingw32 version of
> libboost_thread is named libboost_thread-mt.dll.a. If on your distribution it
> is named differently, you should discuss with the packagers of the mingw32
> boost packages, to find out a solution.
Archlinux, i'll ask the mingw-boost maintainer.
> > 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
>
> As I said, that compiler is not supported. But maybe that is easy. In the file
> <CGAL/sse2.h>, please try to replace the line:
>
> #if defined ( _MSC_VER )
>
> by:
>
> #if defined( _MSC_VER ) || defined(__MINGW32__)
>
> Maybe that is sufficient.
>
>
> Edit: ... I see that below you propose something. Your solution is good too:
Ok, is there a public git repo ?
> > 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 :]
>
> In the code of <CGAL/double.h> and <CGAL/sse2.h>, we implicitly supposed that
> all MSVC-compatible compilers define _MSC_VER.
>
> > 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:
>
> Which CGALConfig.cmake are you talking about. There are two:
> - one that must be used when one want to use compiled libraries within the
> compilation tree,
> - one that must be used when the CGAL libraries are installed by 'make
> install'.
>
> > set(CGAL_LIBRARY "/usr/i686-w64-mingw32/lib/libCGAL.dll")
>
> That seems to be the CGALConfig.cmake that will be installed.
Yes, I tried to compile an external example and it failed to link using a cmake script like this one:
find_package ( CGAL NO_MODULE )
include(${CGAL_USE_FILE})
add_executable ( t_cgal t_cgal.cxx )
target_link_libraries(t_cgal ${CGAL_LIBRARIES})
target_link_libraries(t_cgal ${CGAL_LIBRARIES})
By the way it is installed under /usr/i686-w64-mingw32/lib/CGAL/CGALConfig.cmake, usually cmake config files are installed in a cmake subdir like /usr/i686-w64-mingw32/lib/cmake/CGAL/CGALConfig.cmake
>
> --
> You are currently subscribed to cgal-discuss.
> To unsubscribe or access the archives, go to
> https://sympa.inria.fr/sympa/info/cgal-discuss
>
>
- [cgal-discuss] mingw64|win32 issues, xantares 09, 04/10/2014
- Re: [cgal-discuss] mingw64|win32 issues, Laurent Rineau (CGAL/GeometryFactory), 04/11/2014
- RE: [cgal-discuss] mingw64|win32 issues, xantares 09, 04/11/2014
- Re: [cgal-discuss] mingw64|win32 issues, Laurent Rineau (CGAL/GeometryFactory), 04/11/2014
- RE: [cgal-discuss] mingw64|win32 issues, xantares 09, 04/11/2014
- Re: [cgal-discuss] mingw64|win32 issues, Laurent Rineau (CGAL/GeometryFactory), 04/11/2014
- Re: [cgal-discuss] mingw64|win32 issues, Laurent Rineau (CGAL/GeometryFactory), 04/11/2014
Archive powered by MHonArc 2.6.18.