Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] <DKIM> Example Compiling Issue

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] <DKIM> Example Compiling Issue


Chronological Thread 
  • From: Laurent Saboret <>
  • To:
  • Subject: Re: [cgal-discuss] <DKIM> Example Compiling Issue
  • Date: Mon, 01 Dec 2014 15:19:13 +0100

Hi Hardik,

I guess you miss GMP and CORE libraries. Please add -lgmp -lcore to LIBPATH.

Best regards,
Laurent


Le 30/11/2014 23:18, hardik kabaria a écrit :
Dear Laurent, 

I have included the Poisson_reconstruction_function as a member of 
my class. 

However, when I try to compile a drive based off the class. I get compiling error: 

I have my makefile as following:

CC = g++
INCPATH = -I $(UMDIR)include/ -I /opt/local/include/
CFLAGS = -g 
LIBPATH = -L$(UMDIR)lib/ -L/opt/local/lib -lCurveGeom -lIBMesher3D -lAnn -lgsl -lgslcblas -lnlopt -lm -lCGAL -lCGAL_Core -lboost_system-mt -lboost_thread-mt

compactsurfmesh: compactsurfmesh.cpp
$(CC) $(INCPATH) $(LIBPATH) $(CFLAGS) $< -o $@

I have CGAL include files in the path (/opt/local/include) 
as well as the dylibs are inlcuded.
lrwxr-xr-x  1 hardik  wheel       42 Nov 30 13:06 libCGAL.dylib -> /usr/local/soft/CGAL-4.2/lib/libCGAL.dylib
lrwxr-xr-x  1 hardik  wheel       47 Nov 30 13:06 libCGAL_Core.dylib -> /usr/local/soft/CGAL-4.2/lib/libCGAL_Core.dylib
lrwxr-xr-x  1 hardik  wheel       50 Nov 30 13:06 libCGAL_ImageIO.dylib -> /usr/local/soft/CGAL-4.2/lib/libCGAL_ImageIO.dylib

Error:
  "___gmpq_add", referenced from:
      CGAL::Gmpq::operator+=(CGAL::Gmpq const&) in libCurveGeom.a(PoissonRecSurface.o)
  "___gmpq_clear", referenced from:
      CGAL::Gmpq_rep::~Gmpq_rep() in libCurveGeom.a(PoissonRecSurface.o)
  "___gmpq_cmp", referenced from:

Could you point me what am I missing ?

Thanks!

Hardik


On Fri, Nov 21, 2014 at 4:49 AM, Laurent Saboret <> wrote:
Dear Hardik,

My guess is that your problem comes from the compilation options, probably related to the linear solver (Eigen by default).

If you use CMake, make sure that your CMakeLists.txt looks like poisson_reconstruction_example.cpp example's CMakeLists.txt.
If you do not use CMake, I recommend you to recompile poisson_reconstruction_example.cpp and to cut and paste the compilation options generated by CMake into your own makefile.

Good luck,

Laurent Saboret


Le 19/11/2014 18:55, hardik kabaria a écrit :
Hi Laurent, 

Yes that's true. It is same as 
poisson_reconstruction_example.cpp example.

I am able to compile the example in the directory
examples/Surface_reconstruction_points_3/ however
I am interested in using these function in my own code and 
when I try to compile there it gives the following error. 

Any suggestions towards diagnosing the issue ?

Thanks, 
Hardik Kabaria

On Wed, Nov 19, 2014 at 5:00 AM, Laurent Saboret <> wrote:
Dear Hardik,

The code below seems a cut and paste of CGAL's poisson_reconstruction_example.cpp example.
Does poisson_reconstruction_example.cpp compile properly on your machine?

Best regards,
Laurent Saboret



Le 18/11/2014 20:18, hardik kabaria a écrit :
Hello, 

I am having some issues compiling an example from Surface reconstruction 
part. It'd be great if someone can point out what could be the issue. 

I am using Mac OS 10.8 and cgal 4.4
dn525jo5:poisson_rec hardik$ port list cgal
Warning: port definitions are more than two weeks old, consider updating them by running 'port selfupdate'.
cgal                           @4.4            gis/cgal


Compiling error: 
/usr/local/soft/UM++/hardik/3Dexamples/FromTrianles/brain/cowBrainModel/poisson_rec/poisson_reconstruction_withUMesh.cpp:64:21: error: no matching member function for call
      to 'compute_implicit_function'
    if ( ! function.compute_implicit_function() ) 
           ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/include/CGAL/Poisson_reconstruction_function.h:375:8: note: candidate function template not viable: requires at least 2 arguments, but 0 were provided
  bool compute_implicit_function(
       ^
/opt/local/include/CGAL/Poisson_reconstruction_function.h:528:8: note: candidate function template not viable: requires at least argument 'solver', but no arguments were
      provided
  bool compute_implicit_function(SparseLinearAlgebraTraits_d solver, bool smoother_hole_filling = false)
       ^


Excerpt from the .cpp

  PointList points;
    std::ifstream stream("data/kitten.xyz");
    if (!stream ||
        !CGAL::read_xyz_points_and_normals(
                              stream,
                              std::back_inserter(points),
                              CGAL::make_normal_of_point_with_normal_pmap(PointList::value_type())))
    {
      std::cerr << "Error: cannot read file data/kitten.xyz" << std::endl;
      return EXIT_FAILURE;
    }

    // Creates implicit function from the read points using the default solver.

    // Note: this method requires an iterator over points
    // + property maps to access each point's position and normal.
    // The position property map can be omitted here as we use iterators over Point_3 elements.
    Poisson_reconstruction_function function(points.begin(), points.end(),
                                             CGAL::make_normal_of_point_with_normal_pmap(PointList::value_type()) );

    // Computes the Poisson indicator function f()
    // at each vertex of the triangulation.
    if ( ! function.compute_implicit_function() ) 
      return EXIT_FAILURE;




Thanks!
Hardik Kabaria


--
Hardik Kabaria
Ph.D. Candidate
Department of Mechanical Engineering
Stanford University






--
Hardik Kabaria
Ph.D. Candidate
Department of Mechanical Engineering
Stanford University






--
hardik kabaria




  • Re: [cgal-discuss] <DKIM> Example Compiling Issue, Laurent Saboret, 12/01/2014

Archive powered by MHonArc 2.6.18.

Top of Page