[CMake] cmake ld fails

Eric Noulard eric.noulard at gmail.com
Wed May 19 03:51:06 EDT 2010


2010/5/18 R. Bryn Fenwick <robert.fenwick at irbbarcelona.org>:
> Hi,
>
> I have received some code that works on one system, but is failing to work
> for me. Any suggestions how to debug this would be greatly appreciated.
>
> I think that I am setting everything up correctly however it appears to need
> some hacks.

[...]

> ../libscimap.a(densematrix.cpp.o): In function
> `DenseMatrix::largest_eigenvectors(int&, DenseMatrix&, double*, int*)':
> densematrix.cpp:(.text+0x3784): undefined reference to `dgemv_'
> densematrix.cpp:(.text+0x3849): undefined reference to `dgemv_'
> densematrix.cpp:(.text+0x3a6a): undefined reference to `dgemm_'
> ../../../ARPACK/libparpack.a(pdseupd.o): In function `pdseupd_':
> pdseupd.f:(.text+0x70c): undefined reference to `dcopy_'
>
> many more similar errors follow including these for lapack itself...
>
> /home/fenwick/opt/lapack-3.2.1/SRC/dlarfg.f:116: undefined reference to
> `dnrm2_'
> /home/fenwick/opt/lapack-3.2.1/SRC/dlarfg.f:120: undefined reference to
> `dscal_'

[...]

All missing symbols are "BLAS" library symbols, so why ....[see below]

> I am trying to use lapack though in the CmakeLists file there is no mention
> of a fortran compiler
>
> project(SCIMAP CXX C)
> cmake_minimum_required(VERSION 2.6)
[...]

...why did you comment out the find_package(BLAS   REQUIRED) ?

This question may be silly because LAPACK already depends on BLAS
so I guess find_package(LAPACK) will look for BLAS too...


> find_package(LAPACK REQUIRED)
> #find_package(BLAS   REQUIRED)
> find_package(ARPACK REQUIRED)
> include_directories(${ZLIB_INCLUDE_DIR} ${MPI_INCLUDE_PATH})
> add_definitions(${MPI_COMPILE_FLAGS})
> set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${MPI_LINK_FLAGS}")
> set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}
> ${MPI_LINK_FLAGS}")
>
> add_subdirectory(src)

Concerning the Fortran language thing may be its enabled somewhere in FindXXXX.
I saw you asked for cmake_minimum_required(VERSION 2.6)
may you shoudl even cmake_minimum_required(VERSION 2.8)
because I think CMake 2.8.x solves issues with Fortran/C integration with CMake,
I'm not a specialist here so may be you should search the ML archive for Fortran
related topics.

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


More information about the CMake mailing list