Subject: CGAL users discussion list
List archive
- From: "Sebastien Loriot (GeometryFactory)" <>
- To:
- Subject: Re: [cgal-discuss] Cross-compiling CGAL 4.1 - issue detecting GMP
- Date: Wed, 21 Nov 2012 10:05:23 +0100
- Organization: GeometryFactory
Looking here [1], you should have all you need to specify were your gmp is.
Sebastien.
[1] http://www.cgal.org/Manual/latest/doc_html/installation_manual/Chapter_installation_manual.html#Subsection_16.4
On 11/17/2012 02:22 AM,
wrote:
I am trying to cross-compile CGAL 4.1 on amd64 Linux to ARM Linux.
As per the CMake documentation, I pass these arguments: -D
CMAKE_SYSTEM_NAME=Linux -D CMAKE_C_COMPILER=$CC -D
CMAKE_CXX_COMPILER=$CXX. (Where CC and CXX point to the cross-compiler.)
The problem I am experiencing is due to CGAL trying to determine the
version of GMP on my system. Here's the log:
-------------------------------- start log ----------------------------
Run Build Command:/usr/bin/gmake "cmTryCompileExec/fast"
/usr/bin/gmake -f CMakeFiles/cmTryCompileExec.dir/build.make
CMakeFiles/cmTryCompileExec.dir/build
gmake[1]: Entering directory
`/home/pmw/Software-Engineering/SW_Tools/CGAL-4.1/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report
/home/pmw/Software-Engineering/SW_Tools/CGAL-4.1/CMakeFiles/CMakeTmp/CMakeFiles
1
Building CXX object CMakeFiles/cmTryCompileExec.dir/print_GMP_version.cpp.o
/opt/Rockwell/ArmTools_GCC435_GLIBC_Q3_2011/bin/arm-rc-linux-gnueabi-g++
-I/home/pmw/Software-Engineering/build/Lib/mpir-2.6.0/arm/include -o
CMakeFiles/cmTryCompileExec.dir/print_GMP_version.cpp.o -c
/home/pmw/Software-Engineering/SW_Tools/CGAL-4.1/config/support/print_GMP_version.cpp
Linking CXX executable cmTryCompileExec
/usr/bin/cmake -E cmake_link_script
CMakeFiles/cmTryCompileExec.dir/link.txt --verbose=1
/opt/Rockwell/ArmTools_GCC435_GLIBC_Q3_2011/bin/arm-rc-linux-gnueabi-g++
-fPIC CMakeFiles/cmTryCompileExec.dir/print_GMP_version.cpp.o -o
cmTryCompileExec -rdynamic
/home/pmw/Software-Engineering/build/Lib/mpir-2.6.0/arm/lib/libgmp.a
gmake[1]: Leaving directory
`/home/pmw/Software-Engineering/SW_Tools/CGAL-4.1/CMakeFiles/CMakeTmp'
/home/pmw/Software-Engineering/SW_Tools/CGAL-4.1/CMakeFiles/CMakeTmp/cmTryCompileExec:
/home/pmw/Software-Engineering/SW_Tools/CGAL-4.1/CMakeFiles/CMakeTmp/cmTryCompileExec:
cannot execute binary file
-- USING GMP_VERSION = 'unknown'
-------------------------------- finish log ----------------------------
CGAL uses the get_dependency_version macro (in
cmake/modules/CGAL_Macros.cmake) to try to find the version. That macro
doesn't explicitly accommodate cross-compiling. It calls try_run.
First, I am suspicious that I didn't do enough to put CMake into
cross-compilation mode. Some online searching indicates that CMake is
expected to print this: "CMake Error: TRY_RUN() invoked in
cross-compiling mode, please set the following cache variables
appropriately." But I don't see that in my run. I tried defining
CMAKE_CROSSCOMPILING, but that didn't change anything.
My online research points to this as the best solution:
http://www.cmake.org/Wiki/CMake_Cross_Compiling#Using_executables_in_the_build_created_during_the_build
But as I understand the solution, this is something to be fixed in
CGAL's CMake files rather than something for me configure. Am I correct?
Alternately, it seems that I can create my own .cmake file where I
define GMP_VERSION, and pass that cmake file using the -C argument. I
got this idea from here:
http://www.cmake.org/Wiki/BuildingPythonWithCMake#Cross_compiling_Python_for_another_platform
Is this the way to go? Or is there an even better way of solving this
problem?
Also, please consider this a bug report / enhancement request. I'd like
if it was possible to specify the GMP (and MPFR, etc.) version as -D
arguments to CMake. Maybe you can make these valid only when in
cross-compilation mode.
Thanks.
--
Philip
- [cgal-discuss] Cross-compiling CGAL 4.1 - issue detecting GMP, pmwhite, 11/17/2012
- Re: [cgal-discuss] Cross-compiling CGAL 4.1 - issue detecting GMP, Sebastien Loriot (GeometryFactory), 11/21/2012
Archive powered by MHonArc 2.6.18.