Subject: CGAL users discussion list
List archive
- From: Daniel Duque <>
- To: cgal-discuss <>
- Subject: Re:[cgal-discuss]
- Date: Mon, 2 Nov 2015 12:56:58 +0100
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
- Ironport-phdr: 9a23:C22Bfh9j/USSNP9uRHKM819IXTAuvvDOBiVQ1KB92+gcTK2v8tzYMVDF4r011RmSDdidsa8P0bKempujcFJDyK7JiGoFfp1IWk1NouQttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXsq3G/pQQfBg/4fVIsYL+lR8iI0o/tj6ibwN76XUZhvHKFe7R8LRG7/036l/I9ps9cEJs30QbDuXBSeu5blitCLFOXmAvgtI/rpMYwu3cYh/V0/MFJVeD2fr8zUKdDRGAtPGkxocHqrhLeVhCn530GU2xQnAAeUDLI9BXrYpCkviL8t+d5niWHJND7Za0sXHKv9PRFUhjt3QsOMT809Cn7l9VtgeoPrBunphF7hYLJeZyYHOdme+XQZoVJFiJ6Qs9NWnkZUcuHZIwVAr9ZMA==
Hello again.
Sorry for bothering everyone, I have finally been able to compile and like by fiddling around with CMakeLists.txt . For the record, I attach the final, working version of it. I hope this may be useful to someone in the future. The command I run is "cmake -DCGAL_DIR=$HOME/CGAL-4.6.3 -DCMAKE_BUILD_TYPE=Release ." .
Best,
Daniel
# 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()
find_package( Cholmod )
include_directories( ${CHOLMOD_INCLUDES})
include( CGAL_CreateSingleSourceCGALProgram )
create_single_source_cgal_program("main.cpp" "linear.cpp" "gradient.cpp" "nabla.cpp" "quad_coeffs.cpp" "periodic.cpp" "fields.cpp" "Delta.cpp" "move.cpp" "draw.cpp" "onto_from_mesh.cpp" )
target_link_libraries (main ${CHOLMOD_LIBRARIES})
On Mon, Nov 2, 2015 at 12:26 PM, Daniel Duque <> wrote:
Hi everyone.Update: I just installed the metis version of suitesparse (libsuitesparse-metis-dev on ubuntu) and now cmake seems to work (I really don't know why). I says:-- Found CHOLMOD: /usr/include/suitesparse... but still the compilation fails to find cholmod.h. If I manually change the include line to "#include <suitesparse/cholmod.h>", compilation works but linking returns lots of errors. I include them, since it seems this is the step that fails.Thanks,DanielCMakeFiles/main.dir/main.cpp.o: In function `Eigen::CholmodBase<Eigen::SparseMatrix<double, 0, int>, 1, Eigen::CholmodSupernodalLLT<Eigen::SparseMatrix<double, 0, int>, 1> >::~CholmodBase()':main.cpp:(.text._ZN5Eigen11CholmodBaseINS_12SparseMatrixIdLi0EiEELi1ENS_20CholmodSupernodalLLTIS2_Li1EEEED2Ev[_ZN5Eigen11CholmodBaseINS_12SparseMatrixIdLi0EiEELi1ENS_20CholmodSupernodalLLTIS2_Li1EEEED5Ev]+0x19): undefined reference to `cholmod_free_factor'main.cpp:(.text._ZN5Eigen11CholmodBaseINS_12SparseMatrixIdLi0EiEELi1ENS_20CholmodSupernodalLLTIS2_Li1EEEED2Ev[_ZN5Eigen11CholmodBaseINS_12SparseMatrixIdLi0EiEELi1ENS_20CholmodSupernodalLLTIS2_Li1EEEED5Ev]+0x22): undefined reference to `cholmod_finish'CMakeFiles/main.dir/main.cpp.o: In function `linear::~linear()':main.cpp:(.text._ZN6linearD2Ev[_ZN6linearD5Ev]+0x25): undefined reference to `cholmod_free_factor'main.cpp:(.text._ZN6linearD2Ev[_ZN6linearD5Ev]+0x2d): undefined reference to `cholmod_finish'main.cpp:(.text._ZN6linearD2Ev[_ZN6linearD5Ev]+0x4d): undefined reference to `cholmod_free_factor'main.cpp:(.text._ZN6linearD2Ev[_ZN6linearD5Ev]+0x55): undefined reference to `cholmod_finish'main.cpp:(.text._ZN6linearD2Ev[_ZN6linearD5Ev]+0x75): undefined reference to `cholmod_free_factor'main.cpp:(.text._ZN6linearD2Ev[_ZN6linearD5Ev]+0x7d): undefined reference to `cholmod_finish'CMakeFiles/main.dir/main.cpp.o: In function `main':main.cpp:(.text.startup+0x568): undefined reference to `cholmod_start'main.cpp:(.text.startup+0x5c2): undefined reference to `cholmod_start'main.cpp:(.text.startup+0x61c): undefined reference to `cholmod_start'CMakeFiles/main.dir/linear.cpp.o: In function `linear::laplace_div(kind::f, kind::f, kind::f)':linear.cpp:(.text+0x207c): undefined reference to `cholmod_solve'linear.cpp:(.text+0x2107): undefined reference to `cholmod_free_dense'CMakeFiles/main.dir/linear.cpp.o: In function `linear::mass_v(kind::f)':linear.cpp:(.text+0x2914): undefined reference to `cholmod_solve'linear.cpp:(.text+0x2968): undefined reference to `cholmod_free_dense'linear.cpp:(.text+0x2ab8): undefined reference to `cholmod_solve'linear.cpp:(.text+0x2b0c): undefined reference to `cholmod_free_dense'CMakeFiles/main.dir/linear.cpp.o: In function `linear::mass_s(kind::f)':linear.cpp:(.text+0x2f19): undefined reference to `cholmod_solve'linear.cpp:(.text+0x2f6d): undefined reference to `cholmod_free_dense'CMakeFiles/main.dir/linear.cpp.o: In function `linear::fill_mas()':linear.cpp:(.text+0x38fb): undefined reference to `cholmod_free_factor'linear.cpp:(.text+0x3add): undefined reference to `cholmod_analyze'linear.cpp:(.text+0x3cee): undefined reference to `cholmod_factorize_p'CMakeFiles/main.dir/linear.cpp.o: In function `linear::ustar_inv(kind::f, double, kind::f, bool)':linear.cpp:(.text+0x47e9): undefined reference to `cholmod_solve'linear.cpp:(.text+0x4860): undefined reference to `cholmod_free_dense'CMakeFiles/main.dir/linear.cpp.o: In function `Eigen::Matrix<double, -1, 1, 0, -1, 1>::Matrix<Eigen::internal::solve_retval_base<Eigen::CholmodBase<Eigen::SparseMatrix<double, 0, int>, 1, Eigen::CholmodSupernodalLLT<Eigen::SparseMatrix<double, 0, int>, 1> >, Eigen::Matrix<double, -1, 1, 0, -1, 1> > >(Eigen::ReturnByValue<Eigen::internal::solve_retval_base<Eigen::CholmodBase<Eigen::SparseMatrix<double, 0, int>, 1, Eigen::CholmodSupernodalLLT<Eigen::SparseMatrix<double, 0, int>, 1> >, Eigen::Matrix<double, -1, 1, 0, -1, 1> > > const&)':linear.cpp:(.text._ZN5Eigen6MatrixIdLin1ELi1ELi0ELin1ELi1EEC2INS_8internal17solve_retval_baseINS_11CholmodBaseINS_12SparseMatrixIdLi0EiEELi1ENS_20CholmodSupernodalLLTIS7_Li1EEEEES1_EEEERKNS_13ReturnByValueIT_EE[_ZN5Eigen6MatrixIdLin1ELi1ELi0ELin1ELi1EEC5INS_8internal17solve_retval_baseINS_11CholmodBaseINS_12SparseMatrixIdLi0EiEELi1ENS_20CholmodSupernodalLLTIS7_Li1EEEEES1_EEEERKNS_13ReturnByValueIT_EE]+0xbf): undefined reference to `cholmod_solve'linear.cpp:(.text._ZN5Eigen6MatrixIdLin1ELi1ELi0ELin1ELi1EEC2INS_8internal17solve_retval_baseINS_11CholmodBaseINS_12SparseMatrixIdLi0EiEELi1ENS_20CholmodSupernodalLLTIS7_Li1EEEEES1_EEEERKNS_13ReturnByValueIT_EE[_ZN5Eigen6MatrixIdLin1ELi1ELi0ELin1ELi1EEC5INS_8internal17solve_retval_baseINS_11CholmodBaseINS_12SparseMatrixIdLi0EiEELi1ENS_20CholmodSupernodalLLTIS7_Li1EEEEES1_EEEERKNS_13ReturnByValueIT_EE]+0x105): undefined reference to `cholmod_free_dense'CMakeFiles/main.dir/linear.cpp.o: In function `Eigen::CholmodBase<Eigen::SparseMatrix<double, 0, int>, 1, Eigen::CholmodSupernodalLLT<Eigen::SparseMatrix<double, 0, int>, 1> >::analyzePattern(Eigen::SparseMatrix<double, 0, int> const&)':linear.cpp:(.text._ZN5Eigen11CholmodBaseINS_12SparseMatrixIdLi0EiEELi1ENS_20CholmodSupernodalLLTIS2_Li1EEEE14analyzePatternERKS2_[_ZN5Eigen11CholmodBaseINS_12SparseMatrixIdLi0EiEELi1ENS_20CholmodSupernodalLLTIS2_Li1EEEE14analyzePatternERKS2_]+0x23): undefined reference to `cholmod_free_factor'linear.cpp:(.text._ZN5Eigen11CholmodBaseINS_12SparseMatrixIdLi0EiEELi1ENS_20CholmodSupernodalLLTIS2_Li1EEEE14analyzePatternERKS2_[_ZN5Eigen11CholmodBaseINS_12SparseMatrixIdLi0EiEELi1ENS_20CholmodSupernodalLLTIS2_Li1EEEE14analyzePatternERKS2_]+0x1f5): undefined reference to `cholmod_analyze'CMakeFiles/main.dir/linear.cpp.o: In function `Eigen::CholmodBase<Eigen::SparseMatrix<double, 0, int>, 1, Eigen::CholmodSupernodalLLT<Eigen::SparseMatrix<double, 0, int>, 1> >::factorize(Eigen::SparseMatrix<double, 0, int> const&)':linear.cpp:(.text._ZN5Eigen11CholmodBaseINS_12SparseMatrixIdLi0EiEELi1ENS_20CholmodSupernodalLLTIS2_Li1EEEE9factorizeERKS2_[_ZN5Eigen11CholmodBaseINS_12SparseMatrixIdLi0EiEELi1ENS_20CholmodSupernodalLLTIS2_Li1EEEE9factorizeERKS2_]+0x1e0): undefinedreference to `cholmod_factorize_p'collect2: error: ld returned 1 exit statusmake[2]: *** [main] Error 1make[1]: *** [CMakeFiles/main.dir/all] Error 2make: *** [all] Error 2On Mon, Nov 2, 2015 at 9:49 AM, Daniel Duque <> wrote: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 runcmake -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/embeddedSo 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/embeddedScanning dependencies of target main[ 9%] Building CXX object CMakeFiles/main.dir/main.cpp.oIn 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 1make[1]: *** [CMakeFiles/main.dir/all] Error 2make: *** [all] Error 2The 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,DanielThe 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" "fields.cpp" "Delta.cpp" "move.cpp" "draw.cpp" "onto_from_mesh.cpp" )
- [cgal-discuss], Daniel Duque, 11/02/2015
- Re:[cgal-discuss], Daniel Duque, 11/02/2015
- Re:[cgal-discuss], Daniel Duque, 11/02/2015
- Re:[cgal-discuss], Daniel Duque, 11/02/2015
Archive powered by MHonArc 2.6.18.