Subject: CGAL users discussion list
List archive
- From: "Sebastien Loriot (GeometryFactory)" <>
- To:
- Subject: Re: [cgal-discuss] Getting started with CGAL on a mac OS X
- Date: Mon, 03 Jan 2011 16:20:37 +0100
Dror Atariah wrote:
First, in 4.2 there are two variants (with or without a value of DCGAL_DIRDepends if you defined CGAL_DIR as an environment variable.
given). Which one is the right one?
Indeed. I guess this is working with Xcode?
I did not try anything without CGAL. How should I check my cmake installation?
Let me remind that "cmake -GXcode ." worked for the example "Voronoi_diag_2". Is it a
sign that "cmake" is properly installed?
The cmake error message may be indicating that you are missing
building tools available from your terminal.
S.
On Jan 3, 2011, at 15:16 PM, Sebastien Loriot (GeometryFactory) wrote:
4th attempt 2) was the correct one.
It seems that your cmake is not correctly install/configured.
Have you tried a simple example without CGAL to see if the
problem comes from your cmake installation?
S.
Dror Atariah wrote:
I am new to CGAL and having problems setting up basic programs. First I'll--
try to describe my system setting. I'm using mac os X (10.6.5). As far as I
know, the compiler I have is g++.
I managed to run the example Voronoi_diag_2. For that I first ran cmake
-GXcode . in the project's directory, and then I was able to run it from
XCode.
Next, I tried to compile and run the following example (taken from the
manual):
#include <iostream> #include
<CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/convex_hull_2.h>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef
K::Point_2 Point_2;
int main() {
Point_2 points[5] = { Point_2(0,0), Point_2(10,0), Point_2(10,10),
Point_2(6,5), Point_2(4,1) };
Point_2 result[5];
Point_2 *ptr = CGAL::convex_hull_2( points, points+5, result );
std::cout
<< ptr - result << " points on the convex hull" <<
std::endl; return 0;
}
Here I tried the following options, neither produced the desired results.
1st attempt:
This is the most naive approach, which I was expecting not to work:
g++ array_convex_hull_2.cpp
The output was:
array_convex_hull_2.cpp:2:64: error:
CGAL/Exact_predicates_inexact_constructions_kernel.h: No such file or
directory
array_convex_hull_2.cpp:3:32: error: CGAL/convex_hull_2.h: No such file or
directory
array_convex_hull_2.cpp:4: error: ‘CGAL’ has not been declared
array_convex_hull_2.cpp:4: error: expected initializer before ‘K’
array_convex_hull_2.cpp:5: error: ‘K’ has not been declared
array_convex_hull_2.cpp:5: error: expected initializer before ‘Point_2’
array_convex_hull_2.cpp: In function ‘int main()’:
array_convex_hull_2.cpp:7: error: ‘Point_2’ was not declared in this scope
array_convex_hull_2.cpp:7: error: expected `;' before ‘points’
array_convex_hull_2.cpp:8: error: expected `;' before ‘result’
array_convex_hull_2.cpp:9: error: ‘ptr’ was not declared in this scope
array_convex_hull_2.cpp:9: error: ‘CGAL’ has not been declared
array_convex_hull_2.cpp:9: error: ‘points’ was not declared in this scope
array_convex_hull_2.cpp:9: error: ‘result’ was not declared in this scope
2nd attempt:
In the terminal I ran in the directory where the file was:
cmake .
The output was:
CMake Error: The source directory
"/Users/drorata/Documents/academics/programing/CGAL/examples and
tests/testProject" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
3rd attempt:
Again, in the directory where the source is, I ran:
cmake -DCGAL_DIR=/opt/local/lib/CGAL/CGALConfig.cmake .
Here the output was again:
CMake Error: The source directory
"/Users/drorata/Documents/academics/programing/CGAL/examples and
tests/testProject" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
4th attempt:
I ran the script cgal_create_cmake_script, producing the output: created
CMakeLists.txt in
/Users/drorata/Documents/academics/programing/CGAL/examples and
tests/testProject ...
Then I did one of the following:
1) Simply make. This returned make: *** No targets specified and no makefile
found. Stop.
2) Then I ran either cmake . or cmake
-DCGAL_DIR=/opt/local/lib/CGAL/CGALConfig.cmake ., In both cases the output
was:
CMake Error: Error required internal CMake variable not set, cmake may be
not be built correctly.
Missing variable is:
CMAKE_and_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be
not be built correctly.
Missing variable is:
CMAKE_and_COMPILER
CMake Error: Could not find cmake module
file:/Users/drorata/Documents/academics/programing/CGAL/examples and
tests/testProject/CMakeFiles/CMakeandCompiler.cmake
CMake Error: Error required internal CMake variable not set, cmake may be
not be built correctly.
Missing variable is:
CMAKE_testProject_example_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be
not be built correctly.
Missing variable is:
CMAKE_testProject_example_COMPILER
CMake Error: Could not find cmake module
file:/Users/drorata/Documents/academics/programing/CGAL/examples and
tests/testProject/CMakeFiles/CMaketestProject_exampleCompiler.cmake
CMake Error: Could not find cmake module file:CMakeandInformation.cmake
CMake Error: Could not find cmake module
file:CMaketestProject_exampleInformation.cmake
CMake Error: CMAKE_and_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_testProject_example_COMPILER not set, after
EnableLanguage
-- Build type: Release
-- USING CXXFLAGS = '-pipe -O2 -arch x86_64 -frounding-math
-fno-strict-aliasing -O3 -DNDEBUG'
-- USING EXEFLAGS = '-L/opt/local/lib -arch x86_64
-Wl,-dylib_file,/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
'
-- Targetting Unix Makefiles
-- Using compiler.
-- DARWIN_VERSION=10
-- Mac Leopard detected
-- Configuring incomplete, errors occurred!
Maybe I should add that, I installed CGAL using macports.
I tried to consult the manual, but I couldn't figure out what should I do.
Can someone help me with the first initialization of a small project?
Actually, any help would be appreciated!
Thanks in advance,
Dror
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss
Dror Atariah
Freie Universität Berlin
----------------------------------------------
Landline: +49-30-83875166
Mobile: +49-176-67116376
http://page.mi.fu-berlin.de/atariah/
- [cgal-discuss] Getting started with CGAL on a mac OS X, Dror Atariah, 01/03/2011
- Re: [cgal-discuss] Getting started with CGAL on a mac OS X, Sebastien Loriot (GeometryFactory), 01/03/2011
- Re: [cgal-discuss] Getting started with CGAL on a mac OS X, Dror Atariah, 01/03/2011
- Re: [cgal-discuss] Getting started with CGAL on a mac OS X, Sebastien Loriot (GeometryFactory), 01/03/2011
- Re: [cgal-discuss] Getting started with CGAL on a mac OS X, Dror Atariah, 01/03/2011
- Re: [cgal-discuss] Getting started with CGAL on a mac OS X, Sebastien Loriot (GeometryFactory), 01/03/2011
- Re: [cgal-discuss] Getting started with CGAL on a mac OS X, Dror Atariah, 01/03/2011
- Re: [cgal-discuss] Getting started with CGAL on a mac OS X, Laurent Rineau (GeometryFactory), 01/03/2011
- Re: [cgal-discuss] Getting started with CGAL on a mac OS X, Dror Atariah, 01/03/2011
- Re: [cgal-discuss] Getting started with CGAL on a mac OS X, Sebastien Loriot (GeometryFactory), 01/03/2011
Archive powered by MHonArc 2.6.16.