chrisidefix / cgal-bindings

Automatically exported from code.google.com/p/cgal-bindings
Boost Software License 1.0
0 stars 0 forks source link

Building on Windows #4

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Has this been built on a windows machine?

Following the installation instructions, I get:

c:\Program Files (x86)\CGAL-3.9\cgal-bindings>cmake .

-- 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 /fp:strict /fp:except- /MD /O2/Ob2 /D NDEBUG'
-- USING EXEFLAGS = ' /STACK:10000000 /machine:X86  /INCREMENTAL:NO'
-- Targetting Visual Studio 10
-- Target build enviroment supports auto-linking
-- Using VC10 compiler.
-- Generator uses intermediate configuration directory: $(Configuration)
Release mode: using -fno-strict-aliasing flags
-- Could NOT find PythonLibs (missing:  PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS)
CMake Warning at CMakeLists.txt:37 (message):
  Python has not been found, CGAL-bindings for Python will not be generated.

-- Could NOT find JNI (missing:  JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY 
JAVA_INCLUDE_PATH JAVA_INCLUDE_PA
TH2 JAVA_AWT_INCLUDE_PATH)
CMake Warning at CMakeLists.txt:45 (message):
  JNI has not been found, CGAL-bindings for Java will not be generated.

-- Configuring done
-- Generating done
-- Build files have been written to: C:/Program Files 
(x86)/CGAL-3.9/cgal-bindings

Even if I set PYTHON_INCLUDE_DIRS etc, I get the same errors. 

Original issue reported on code.google.com by kej...@gmail.com on 17 Jan 2012 at 4:16

GoogleCodeExporter commented 9 years ago
Yes this has been tested on windows. If Java is not available on your machine 
you need to set cmake variable BUILD_JAVA to OFF. 
For Python you need to set PYTHON_LIBRARIES (path to the python library) and
PYTHON_INCLUDE_DIRS (path to where Python.h is found).

Original comment by sloriot...@gmail.com on 17 Jan 2012 at 4:37

GoogleCodeExporter commented 9 years ago
Adding -DPYTHON_LIBRARIES etc doesn't seem to make a difference:

c:\Program Files (x86)\CGAL-3.9\cgal-bindings>cmake 
-DPYTHON_LIBRARIES="c:\python27" -DPYTHON_INCLUDE_DIRS="c:\Python27\include" 
-DBUILD_JAVA=OFF
-- 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 /fp:strict /fp:except- /MD /O2/Ob2 /D NDEBUG'
-- USING EXEFLAGS = ' /STACK:10000000 /machine:X86  /INCREMENTAL:NO'
-- Targetting Visual Studio 10
-- Target build enviroment supports auto-linking
-- Using VC10 compiler.
-- Generator uses intermediate configuration directory: $(Configuration)
Release mode: using -fno-strict-aliasing flags
-- Could NOT find PythonLibs (missing:  PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS)
CMake Warning at CMakeLists.txt:37 (message):
  Python has not been found, CGAL-bindings for Python will not be generated.

-- BUILD_JAVA is set to OFF: no CGAL-bindings for Java will be generated.
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Program Files 
(x86)/CGAL-3.9/cgal-bindings

Probably this is something trivial regarding cmake, but I'm unable to correct 
it myself, and hopefully this helps getting trough for people with similar 
non-experience as me.

Original comment by kej...@gmail.com on 17 Jan 2012 at 4:53

GoogleCodeExporter commented 9 years ago
Try setting PYTHON_LIBRARY to the full path to the (including the .lib file)

Original comment by sloriot...@gmail.com on 17 Jan 2012 at 5:22

GoogleCodeExporter commented 9 years ago
Same error:

c:\Program Files (x86)\CGAL-3.9\cgal-bindings>dir c:\Python27\libs
 Volume in drive C has no label.
 Volume Serial Number is DCD2-DF20

 Directory of c:\Python27\libs

09/01/2012  17:30    <DIR>          .
09/01/2012  17:30    <DIR>          ..
12/06/2011  14:24             1,648 bz2.lib
12/06/2011  14:24             1,716 pyexpat.lib
12/06/2011  14:24           225,208 python27.lib
12/06/2011  14:24             1,700 select.lib
12/06/2011  14:24             1,784 unicodedata.lib
12/06/2011  14:24             1,734 winsound.lib
12/06/2011  14:25             1,884 _bsddb.lib
12/06/2011  14:24             1,716 _ctypes.lib
12/06/2011  14:24            20,844 _ctypes_test.lib
12/06/2011  14:24             1,880 _elementtree.lib
12/06/2011  14:24             1,734 _hashlib.lib
12/06/2011  14:24             1,666 _msi.lib
12/06/2011  14:24             1,952 _multiprocessing.lib
12/06/2011  14:24             1,916 _socket.lib
12/06/2011  14:24             1,734 _sqlite3.lib
12/06/2011  14:26             1,666 _ssl.lib
12/06/2011  14:24             1,750 _testcapi.lib
12/06/2011  14:24             1,734 _tkinter.lib
              18 File(s)        274,266 bytes
               2 Dir(s)  355,130,769,408 bytes free

c:\Program Files (x86)\CGAL-3.9\cgal-bindings>cmake 
-DPYTHON_LIBRARIES="c:\python27" -DPYTHON_INCLUDE_DIRS="c:\Python27\include" 
-DBUILD_JAVA=OFF -DPYTHON_LIBRARY="c:\Python27\libs"
-- 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 /fp:strict /fp:except- /MD /O2 /Ob2 /D NDEBUG'
-- USING EXEFLAGS = ' /STACK:10000000 /machine:X86  /INCREMENTAL:NO'
-- Targetting Visual Studio 10
-- Target build enviroment supports auto-linking
-- Using VC10 compiler.
-- Generator uses intermediate configuration directory: $(Configuration)
Release mode: using -fno-strict-aliasing flags
-- Could NOT find PythonLibs (missing:  PYTHON_INCLUDE_DIRS)
CMake Warning at CMakeLists.txt:37 (message):
  Python has not been found, CGAL-bindings for Python will not be generated.

-- BUILD_JAVA is set to OFF: no CGAL-bindings for Java will be generated.
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Program Files 
(x86)/CGAL-3.9/cgal-bindings

Original comment by kej...@gmail.com on 17 Jan 2012 at 5:27

GoogleCodeExporter commented 9 years ago
I meant -DPYTHON_LIBRARY="c:\Python27\libs\python27.lib"

Original comment by sloriot...@gmail.com on 17 Jan 2012 at 5:32

GoogleCodeExporter commented 9 years ago
Ok, tried that but I get the exact same error.
Is there a way to flush the cmake config or something like that? It seems to 
ignore the -D flags, on the other hand, it adheres to -DBUILD_JAVA=OFF

Original comment by kej...@gmail.com on 17 Jan 2012 at 5:37

GoogleCodeExporter commented 9 years ago
Ok, I found the error. My python installation was 64-bit. After installing the 
32-bit version, it finds it with the options given above.

Original comment by kej...@gmail.com on 17 Jan 2012 at 5:46

GoogleCodeExporter commented 9 years ago
In the last error message you posted (comment 4), it complains only that 
PYTHON_INCLUDE_DIRS is missing.

Original comment by sloriot...@gmail.com on 17 Jan 2012 at 5:56

GoogleCodeExporter commented 9 years ago

Original comment by sloriot...@gmail.com on 17 Jan 2012 at 6:03

GoogleCodeExporter commented 9 years ago
After I getting cmake to run and generate the proper .sln for both Java and 
Python generation, I still struggle to get Visual Studio 2010 to link the 
libraries.
Is it possible to give an example of the workflow on Windows, as you for Linux 
on the installation page?

I'm happy doing it, but I'm afraid I'm as of yet too far from getting it to 
link.
It is quite difficult to find the errors because of the heavy use of templating 
inside CGAL.

For example:

2>CGAL_AABB_treePYTHON_wrap.obj : error LNK2019: unresolved external symbol 
"__declspec(dllimport) public: __thiscall Object::~Object(void)" 
(__imp_??1Object@@QAE@XZ) referenced in function "public: void * __thiscall 
Object::`scalar deleting destructor'(unsigned int)" (??_GObject@@QAEPAXI@Z)

Any help or pointers is appreciated.

Original comment by kej...@gmail.com on 19 Jan 2012 at 2:44

GoogleCodeExporter commented 9 years ago

Original comment by sloriot...@gmail.com on 24 Jan 2012 at 2:47