Skip to Content.
Sympa Menu

cgal-discuss - Re:[cgal-discuss]

Subject: CGAL users discussion list

List archive

Re:[cgal-discuss]


Chronological Thread 
  • From: Daniel Duque <>
  • To: cgal-discuss <>
  • Subject: Re:[cgal-discuss]
  • Date: Mon, 2 Nov 2015 12:26:18 +0100
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:nnjxER0aeJAwl9rcsmDT+DRfVm0co7zxezQtwd8ZsegeKPad9pjvdHbS+e9qxAeQG96LtrQe1qGM6+jJYi8p39WoiDg6aptCVhsI2409vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6kO74TNaIBjjLw09fr2zQd6PyZ7qnLrqs7ToICx2xxOFKYtoKxu3qQiD/uI3uqBFbpgL9x3Sv3FTcP5Xz247bXianhL7+9vitMU7q3cY6Lod8JtLXqz+Oqg5VrdFFy9uZ2s67cmuuRjYRhaU/VMdVH8Xm1xGGV6W1hziWobNtX72v+x81S3cMdDvUL0cRCynqapwGzHyjyJSGzc/8WzTwuBtlb9W6Eatrhp+zoqSbJyMKfdWY7vYO94BEzkSFv1NXjBMV9vvJ7AECPAMaL5V

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,

Daniel

CMakeFiles/main.dir/main.cpp.o: In function `Eigen::CholmodBase<Eigen::SparseMatrix<double, 0, int>, 1, Eigen::CholmodSupern
odalLLT<Eigen::SparseMatrix<double, 0, int>, 1> >::~CholmodBase()':
main.cpp:(.text._ZN5Eigen11CholmodBaseINS_12SparseMatrixIdLi0EiEELi1ENS_20CholmodSupernodalLLTIS2_Li1EEEED2Ev[_ZN5Eigen11Cho
lmodBaseINS_12SparseMatrixIdLi0EiEELi1ENS_20CholmodSupernodalLLTIS2_Li1EEEED5Ev]+0x19): undefined reference to `cholmod_free
_factor'
main.cpp:(.text._ZN5Eigen11CholmodBaseINS_12SparseMatrixIdLi0EiEELi1ENS_20CholmodSupernodalLLTIS2_Li1EEEED2Ev[_ZN5Eigen11Cho
lmodBaseINS_12SparseMatrixIdLi0EiEELi1ENS_20CholmodSupernodalLLTIS2_Li1EEEED5Ev]+0x22): undefined reference to `cholmod_fini
sh'
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, i
nt>, 1> >, Eigen::Matrix<double, -1, 1, 0, -1, 1> > >(Eigen::ReturnByValue<Eigen::internal::solve_retval_base<Eigen::Cholmod
Base<Eigen::SparseMatrix<double, 0, int>, 1, Eigen::CholmodSupernodalLLT<Eigen::SparseMatrix<double, 0, int>, 1> >, Eigen::M
atrix<double, -1, 1, 0, -1, 1> > > const&)':
linear.cpp:(.text._ZN5Eigen6MatrixIdLin1ELi1ELi0ELin1ELi1EEC2INS_8internal17solve_retval_baseINS_11CholmodBaseINS_12SparseMa
trixIdLi0EiEELi1ENS_20CholmodSupernodalLLTIS7_Li1EEEEES1_EEEERKNS_13ReturnByValueIT_EE[_ZN5Eigen6MatrixIdLin1ELi1ELi0ELin1EL
i1EEC5INS_8internal17solve_retval_baseINS_11CholmodBaseINS_12SparseMatrixIdLi0EiEELi1ENS_20CholmodSupernodalLLTIS7_Li1EEEEES
1_EEEERKNS_13ReturnByValueIT_EE]+0xbf): undefined reference to `cholmod_solve'
linear.cpp:(.text._ZN5Eigen6MatrixIdLin1ELi1ELi0ELin1ELi1EEC2INS_8internal17solve_retval_baseINS_11CholmodBaseINS_12SparseMa
trixIdLi0EiEELi1ENS_20CholmodSupernodalLLTIS7_Li1EEEEES1_EEEERKNS_13ReturnByValueIT_EE[_ZN5Eigen6MatrixIdLin1ELi1ELi0ELin1EL
i1EEC5INS_8internal17solve_retval_baseINS_11CholmodBaseINS_12SparseMatrixIdLi0EiEELi1ENS_20CholmodSupernodalLLTIS7_Li1EEEEES
1_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::CholmodSupe
rnodalLLT<Eigen::SparseMatrix<double, 0, int>, 1> >::analyzePattern(Eigen::SparseMatrix<double, 0, int> const&)':
linear.cpp:(.text._ZN5Eigen11CholmodBaseINS_12SparseMatrixIdLi0EiEELi1ENS_20CholmodSupernodalLLTIS2_Li1EEEE14analyzePatternE
RKS2_[_ZN5Eigen11CholmodBaseINS_12SparseMatrixIdLi0EiEELi1ENS_20CholmodSupernodalLLTIS2_Li1EEEE14analyzePatternERKS2_]+0x23)
: undefined reference to `cholmod_free_factor'
linear.cpp:(.text._ZN5Eigen11CholmodBaseINS_12SparseMatrixIdLi0EiEELi1ENS_20CholmodSupernodalLLTIS2_Li1EEEE14analyzePatternE
RKS2_[_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::CholmodSupe
rnodalLLT<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): undefined
 reference to `cholmod_factorize_p'
collect2: error: ld returned 1 exit status
make[2]: *** [main] Error 1
make[1]: *** [CMakeFiles/main.dir/all] Error 2
make: *** [all] Error 2



On 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 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