Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] CGAL compilation with mingw64: it works!

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] CGAL compilation with mingw64: it works!


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] CGAL compilation with mingw64: it works!
  • Date: Fri, 28 Oct 2011 10:03:41 +0200

Thanks for sharing Bruno.

Sebastien.

Bruno Dutailly wrote:
Dear all,

I recently discovered CGAL, and I plan to use it in my software (Linux/windows QT4).

I managed to compile CGAL with mingw64. This can help someone:

Info: I use the sezero personal build of mingw64.
Info: path to bin folder containing gcc, g++, mingw32-make, etc binaries must be referenced in your path variable environment.

1) download boost sources and compile it (I use boost 1.47.0):
a) generate b2.exe (jam) by typing in a console "bootstrap.bat mingw"
b) type in a console: b2.exe --prefix=<absolute_path_to_boost64> toolset=gcc address-model=64 variant=debug,release link=static,shared threading=multi install
Before, I tried an external version of boost-jam like described here:
http://sourceforge.net/apps/trac/mingw-w64/wiki/Building%20Boost
but bjam.exe failed to build boost.

2) build CGAL libraries (I use cgal 3.9):
a) Use cmake-gui
b) before configuring, setup the BOOST_ROOT path variable to you BOOST directory.
c) optional (this doesn't work for me): setup the Boost_LIBRARYDIR to your boost\lib dir
d) configure
e) optional: check demos and examples and configure again
f) generate
g) type in a console mingw32-make
h) if you have troubles with emmintrin.h and intrin.h, you must add a "#include <windows.h>" at the top of the file "all_files.cpp" in the src/ImageIO directory generated by cmake

3) build demos and examples (if checked in cmake):
- type mingw32-make demos
for me, it doesn't link with boost (even with the 2)c) option), so demos generation failed. I didn't try examples, but I manualy compile an example: circulator
I used those commands:
g++ -c circulator_prog1.cpp -frounding-math -I../../include -I../../build/include -I../../../../boost_1_47_0/mingw64/include/boost-1_47 -o circulator_prog1.o
g++ circulator_prog1.o -L../../build/lib -lCGAL -L../../../../boost_1_47_0/mingw64/lib -lboost_thread-mgw44-mt-1_47 -o circulator_prog1.exe
where /build is the build folder "where to build binaries" for cmake.

yours

bruno





Archive powered by MHonArc 2.6.16.

Top of Page