Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] compile an example code on win32 to produce

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] compile an example code on win32 to produce


Chronological Thread 
  • From: Qianqian Fang <>
  • To:
  • Subject: Re: [cgal-discuss] compile an example code on win32 to produce
  • Date: Wed, 4 Feb 2009 12:42:08 -0500
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=FGU9mA1/NtUm4qfDE9xfOkLJPvu4Hjt5wDNEuWYP0MuJOu0621ef5YDc9RgFjg0p+e qQcG+b8N+D6kwwBPLK6MY01Xh35zIBF0iWlinYO6/GAU1EojI/7DimczJNo6fTglAVpN lYp0qG6FBxC+5Rfs0OavbDIOT52nwiBBRaRjk=

just realized that the my original thread was hijacked by this new thread.

Anyway, let me make it easier for people to find my original question, attached is the code I am trying to compile, you can simply save it to CGAL-3.4-beta1\examples\Surface_mesher\, and I appreciate if anyone can send me the compiled binary (with cgal 3.4beta) for windows.



On Wed, Feb 4, 2009 at 12:03 PM, Qianqian Fang <> wrote:
I am using "Microsoft Visual C++ 2005 Express Edition", and things are almost fine for 3.3 (not the static linking bit), but I am trying to compile my code against 3.4 beta, which I can not even set up the makefiles.

I am still hoping that someone who had set up 3.4 on a windows machine can help me compile a binary; but if I have to set up my own copy, the following is my "cmake ." output, all default installation, seems a bunch of libraries are missing and I don't know how to do with them (I don't know where to find boost_thread; GMP and MPFR are underCGAL-3.4-beta1\auxiliary, but cmake could not find them; where can I download zlib and what should I do to let cmake know where to find?)


C:\Program Files\CGAL-3.4-beta1>cmake .
-- CGAL_MAJOR_VERSION=3
-- CGAL_MINOR_VERSION=4
-- CGAL_BUILD_VERSION=
-- CGAL_SONAME_VERSION=3
-- CGAL_SOVERSION     =3.0.0
-- CGAL_REFERENCE_CACHE_DIR=
-- Building static libraries
-- Targetting Visual Studio 8 2005
-- Target build enviroment supports auto-linking
-- Using VC80 compiler.
-- Generator uses intermediate configuration directory: $(OutDir)
-- USING CMake version: 2.6.2
-- System: Windows
-- Build type: Release
-- USING CXXFLAGS = ' /DWIN32 /D_WINDOWS /W3 /Zm1000 /EHsc /GR -D_CRT_SECURE_NO_
DEPRECATE -D_SCL_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_
WARNINGS /MD /O2 /Ob2 /D NDEBUG -D_SECURE_SCL=0'
-- USING LDFLAGS = ' '
-- Could NOT find GMP
-- Could NOT find MPFR
CMake Error at cmake/modules/FindBoost.cmake:613 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.37.0

  Boost include path: D:/Download/boost/boost_1_37_0

  The following Boost libraries could not be found:

          boost_thread

  No Boost libraries were found.  You may need to set Boost_LIBRARYDIR to the
  directory containing Boost libraries or BOOST_ROOT to the location of
  Boost.
Call Stack (most recent call first):
  cmake/modules/CGAL_SetupBoost.cmake:12 (find_package)
  cmake/modules/CGAL_SetupDependencies.cmake:17 (include)
  CMakeLists.txt:201 (include)


-- Boost include:     D:/Download/boost/boost_1_37_0
-- Boost libraries:
-- Boost definitions:
-- USING BOOST_VERSION = '1.37.0'
-- CMAKE_INSTALL_PREFIX=C:/Program Files/CGAL
-- CGAL_Core needs GMP, cannot be configured.
-- Could NOT find ZLIB  (missing:  ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
-- OpenGL include:
-- OpenGL libraries:   glu32;opengl32
-- NOTICE: CGAL_ImageIO needs ZLib to read compressed files. That feature will n
ot be activated.
-- CGAL_Qt3 needs Qt3, cannot be configured.
-- CGAL_Qt4 needs Qt4, cannot be configured.
-- Configuring incomplete, errors occurred!




On Tue, Feb 3, 2009 at 12:44 PM, Laurent Rineau (GeometryFactory) <> wrote:
On Tuesday 03 February 2009 18:29:49 Qianqian Fang wrote:
> Indeed, I was able to compile CGAL 3.3.1 on windows. Your question is
> related to
> compilation configurations. If you open CGAL80.sln with VC2005, you can
> find 4 configurations from the "Configuration Manager", each of them maps
> to a string in the compiled library file. If your code complains about a
> missing CGAL
> lib, make sure you compile for that configuration first.
>
> However, for 3.4beta, I was not even able to create the sln files. Cmake
> complained
> that GMP and MPFR are missing, even they do exist in the auxilary
> directory.

If your first mail of the current thread, you forgot to tell us an interesting
information: your compiler name and version¹. You say your are using VC2005.
Have you tried both Debug and Release configurations? Have you installed the
service pack 1 of VC2005?

¹) See http://www.cgal.org/bug_report.html


Actually maybe there is a problem using CGAL libraries with a static runtime.
That setup has not been really tested on Windows, as far as I know.

--
Laurent Rineau, PhD
Engineer at GeometryFactory
http://www.geometryfactory.com/

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss


#include <CGAL/Surface_mesh_default_triangulation_3.h>
#include <CGAL/Surface_mesh_default_criteria_3.h>
#include <CGAL/Complex_2_in_triangulation_3.h>
#include <CGAL/IO/Complex_2_in_triangulation_3_file_writer.h>
#include <fstream>
#include <CGAL/make_surface_mesh.h>
#include <CGAL/Gray_level_image_3.h>
#include <CGAL/Implicit_surface_3.h>

// default triangulation for Surface_mesher
typedef CGAL::Surface_mesh_default_triangulation_3 Tr;

// c2t3
typedef CGAL::Complex_2_in_triangulation_3<Tr> C2t3;

typedef Tr::Geom_traits GT;
typedef CGAL::Gray_level_image_3<GT::FT, GT::Point_3> Gray_level_image;
typedef CGAL::Implicit_surface_3<GT, Gray_level_image> Surface_3;

int main(int argc, char** argv) {
Tr tr; // 3D-Delaunay triangulation
C2t3 c2t3 (tr); // 2D-complex in 3D-Delaunay triangulation

// the 'function' is a 3D gray level image
if(argc!=11){
printf("command options:\n cgalsurf.mexglx inrfile thres x0 y0 z0 r2
ang br bd outputoff\nFor example:\n\
./cgalsurf.mexglx data/skull_2.9.inr 2.9 122. 102. 117. 80000 30 5. 5.
out.off\n");
exit(1);
}

Gray_level_image image(argv[1], atof(argv[2]));

// Carefully choosen bounding sphere: the center must be inside the
// surface defined by 'image' and the radius must be high enough so that
// the sphere actually bounds the whole image.
GT::Point_3 bounding_sphere_center(atof(argv[3]), atof(argv[4]),
atof(argv[5]));
GT::FT bounding_sphere_squared_radius = atof(argv[6]);
GT::Sphere_3 bounding_sphere(bounding_sphere_center,
bounding_sphere_squared_radius);

// definition of the surface, with 10^-5 as relative precision
Surface_3 surface(image, bounding_sphere, 1e-5);

// defining meshing criteria
CGAL::Surface_mesh_default_criteria_3<Tr> criteria(atof(argv[7]),
atof(argv[8]),
atof(argv[9]));

// meshing surface, with the "manifold without boundary" algorithm
CGAL::make_surface_mesh(c2t3, surface, criteria, CGAL::Manifold_tag());
std::ofstream out(argv[10]);
CGAL::output_surface_facets_to_off (out, c2t3);
std::cout << "Final number of points: " << tr.number_of_vertices() << "\n";
}



Archive powered by MHonArc 2.6.16.

Top of Page