Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss]

Subject: CGAL users discussion list

List archive

[cgal-discuss]


Chronological Thread 
  • From: Daniel Duque <>
  • To: cgal-discuss <>
  • Subject: [cgal-discuss]
  • Date: Mon, 2 Nov 2015 09:49:55 +0100
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:sYa7bxFiNzyY+sI3P1IO/J1GYnF86YWxBRYc798ds5kLTJ74p8+wAkXT6L1XgUPTWs2DsrQf27eQ6fyrADxcqb+681k8M7V0HycfjssXmwFySOWkMmbcaMDQUiohAc5ZX0Vk9XzoeWJcGcL5ekGA6ibqtW1aJBzzOEJPK/jvHcaK1oLsh730ocGYOlUUzBOGIppMbzyO5T3LsccXhYYwYo0Q8TDu5kVyRuJN2GlzLkiSlRuvru25/Zpk7jgC86l5r50IfKDiY7VwVqFSDjktLyh1vZWq5lH/Sl6E6XIYF2kXiRFVGBONuBr1V5O0virhvfdmwwGbO9f3RPY6Q2Lx1apzTA7Uj3ILPjg4/WWRhtFpka9zvQqk4RFkkKDOZ4TAGPN4f67ZNf8HXHdMFpJdXipAD4f6Y5YWEucpIP5d6YTm8Qhd5SCiDBWhUbu8ggRDgWX7iPRi3g==

Hi everyone,

I never understood how cmake works, but up to this day I have been able to hack the CMakeLists.txt file created by the CGAL scripts. I was even able to compile against the Eigen libs even if cmake compiler complained about not finding them. The .h files where found at the compiling step nevertheless.

Right now, I am trying to include the cholmod part of the suitesparse package. In the process, I have learned to include the eigen3 libs, but I am still unable to compile. I include the CMakeLists.txt file below. I run

cmake -DCGAL_DIR=$HOME/CGAL-4.6.3 -DCMAKE_BUILD_TYPE=Release -DEIGEN3_INCLUDE_DIR=/usr/local/include/eigen-eigen-1306d75b4a21/  .

And I get

-- Build type: Release
-- USING CXXFLAGS = ' -frounding-math -O3 -DNDEBUG'
-- USING EXEFLAGS = '  '
-- Targetting Unix Makefiles
-- Using /usr/bin/c++ compiler.
-- Requested component: Core
-- Requested component: MPFR
-- Requested component: GMP
-- Found Eigen3: /usr/local/include/eigen-eigen-1306d75b4a21/ (found suitable version "3.2.2", minimum required is "3.1.0") 
-- Could NOT find CHOLMOD (missing:  CHOLMOD_LIBRARIES) 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/daniel/fem/embedded


So that when running make I get

-- Build type: Release
-- USING CXXFLAGS = ' -frounding-math -O3 -DNDEBUG'
-- USING EXEFLAGS = '  '
-- Targetting Unix Makefiles
-- Using /usr/bin/c++ compiler.
-- Requested component: Core
-- Requested component: MPFR
-- Requested component: GMP
-- Configuring done
-- Generating done
-- Build files have been written to: /home/daniel/fem/embedded
Scanning dependencies of target main
[  9%] Building CXX object CMakeFiles/main.dir/main.cpp.o
In file included from /home/daniel/fem/embedded/linear.h:4:0,
                 from /home/daniel/fem/embedded/main.cpp:11:
/usr/local/include/eigen-eigen-1306d75b4a21/Eigen/CholmodSupport:9:23: fatal error: cholmod.h: No such file or directory
   #include <cholmod.h>
                       ^
compilation terminated.
make[2]: *** [CMakeFiles/main.dir/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/main.dir/all] Error 2
make: *** [all] Error 2


The cholmod.h file is at /use/include/suitesparse, so that changing that line to #include <suitesparse/cholmod.h> leads to a successful compilation... but then linking fails.

I realize this is really not a CGAL topic, but I am sure there are people here who know about cmake.

Thanks very much in advance,

Daniel


The file:

# Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application.

project( embedded_ )

cmake_minimum_required(VERSION 2.6.2)
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_GREATER 2.6)
  if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_GREATER 2.8.3)
    cmake_policy(VERSION 2.8.4)
  else()
    cmake_policy(VERSION 2.6)
  endif()
endif()

# These don't work ...
#set(CGAL_DIR "${HOME}/CGAL-4.6.3")
#set(CMAKE_BUILD_TYPE "Release")

find_package(CGAL QUIET COMPONENTS Core )

include( ${CGAL_USE_FILE} )

set(EIGEN3_INCLUDE_DIR "/usr/local/include/eigen-eigen-1306d75b4a21/")

find_package(Eigen3)
if(EIGEN3_FOUND)
   include( ${EIGEN3_USE_FILE} )
else()
   message(STATUS "NOTICE: Eigen library is not found.")
endif()

set(CMAKE_MODULE_PATH "/usr/local/include/eigen-eigen-1306d75b4a21/cmake;${CMAKE_MODULE_PATH}")
set(CHOLMOD_LIBRARIES "/usr/include/suitesparse/")

find_package( Cholmod )

include( CGAL_CreateSingleSourceCGALProgram )

create_single_source_cgal_program("main.cpp" "linear.cpp"   "gradient.cpp"  "nabla.cpp" "quad_coeffs.cpp" "periodic.cpp" "fi
elds.cpp" "Delta.cpp" "move.cpp" "draw.cpp" "onto_from_mesh.cpp" )



Archive powered by MHonArc 2.6.18.

Top of Page