Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] From installation to that first example on the MAC

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] From installation to that first example on the MAC


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] From installation to that first example on the MAC
  • Date: Wed, 24 Feb 2016 12:45:33 +0100
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:S+QkCR9a73K6D/9uRHKM819IXTAuvvDOBiVQ1KB91e4cTK2v8tzYMVDF4r011RmSDdqdtqIP0LGempujcFJDyK7JiGoFfp1IWk1NouQttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXsq3G/pQQfBg/4fVIsYL+lRciP34/sjKibwN76XUZhvHKFe7R8LRG7/036l/I9ps9cEJs30QbDuXBSeu5blitCLFOXmAvgtI/rpMYwu3cYh/V0/MFJVeD2fr8zUKdDJDUgKWE8osPx5jfZSg7arEARWGwNjhtFBUDh6wv7WYu58gT3se9wxDOLE8T9UbcuSHXop/NwTBjyiSAbcTs92G7Sg810yqlcpUTy9FRE34fIbdTNZ7JFdaTHcIZCSA==
  • Organization: GeometryFactory

On 02/24/2016 12:07 PM, John Doe wrote:
Dear All

Other MAC users will likely encounter my problems. So for
posterity (anyone facing this)


"CGAL developers are not involved in the creation of the macport or
homebrew packages"

Love it. It sounds like "We don't wan' yo' kind round here" :-)
but I am thankful for the info given to me. I can see that

Not at all, it means I don't know who is making the package so I have no idea if the examples are distributed with the package.

CGAL is primarly aimed for Linux.


Not at all. CGAL is using cmake. So it is compatible with linux, mac os and windows. Your problem was that you probably don't know how to use cmake.

Sebastien.

From the MAC to that first example:

Thanks to info gleaned from various sources on the web
especially David Dumas.

My comments and actions are marked with ->

-> Installation:

-> From http://doc.cgal.org/latest/Manual/installation.html#title3

sudo port install cgal

sudo port install cgal +qt5 +universal +demos

-> From the forum, I found out that this download applies to the MAC as
well as Linux:
-> I created documents/CGAL where I put CGAL-4.7.tar.gz

cd Documents/CGAL
tar xzf CGAL-4.7.tar.gz

-> From http://doc.cgal.org/latest/Manual/installation.html

-> My MAC already had cmake

-> The following are commands I tentatively tried that were accepted:

cd Documents/CGAL
cd CGAL-4.7

cmake -gui
# Note the space before the -gui
cmake .
make

make examples
make demos

-> Then I moved to my first example:

cd examples/Convex_hull_2

-> It took a lot of other people's pain to figure to compile
-> and link the compiled code to the appropriate libraries

->
http://stackoverflow.com/questions/8404968/compiling-a-basic-cgal-program-in-c-on-mac-os-x-10-7-2

->
http://stackoverflow.com/questions/24395068/compiling-cgal-programs-on-mac-installed-using-macports

g++ -L/opt/local/lib -lcgal -I/opt/local/include/ -lgmp
ch_from_cin_to_cout.cpp

-> The above worked. To run the code: follow MCS 481 David Dumas

->
http://homepages.math.uic.edu/~ddumas/teaching/2014/spring/mcs481/cgal-example/

./a.out < ch_from_cin_to_cout.cin > hull.txt

-> I installed gnuplot with macports

gnuplot

set term png
set output "input.png"
set title "Points"
set size square
set key off
set xrange [-1000:9000]
set yrange [-1000:9000]
plot "ch_from_cin_to_cout.cin" w p ps 0.25

exit gnuplot

cp hull.txt hull_closed.txt
head -1 hull.txt >> hull_closed.txt

gnuplot

set term png
set output "output.png"
set title "Convex Hull"
set size square
set key off
set xrange [-1000:9000]
set yrange [-1000:9000]
plot "ch_from_cin_to_cout.cin" w p ps 0.25, \
"hull_closed.txt" w p ls 3, \
"" w l

exit gnuplot
====

So finally I get input.png and output.png which shows the convex hull
(convex envelope) around the data points in "ch_from_cin_to_cout.cin".


I could use some advice w.r.t. getting Scilab to work with CGAL
on the MAC. Apparently this can be done.

best wishes

Tony





Archive powered by MHonArc 2.6.18.

Top of Page