[CMake] Issue using cmake with mingw

Eric Noulard eric.noulard at gmail.com
Wed May 11 02:10:57 EDT 2011


2011/5/11 AMARNATH, Balachandar <BALACHANDAR.AMARNATH at airbus.com>:
> Hi,
>
>
> I am trying to compile (cross) a library in linux (debian) under mingw. I
> have installed the mingw packages for debian (gcc-mingw32, mingw32-binutils,
> mingw32-runtime) and have specified i586-mingw32-gcc, i586-mingw32-c++ and
> i586-mingw32-gfortran as my c, cxx and fortran compiler (present in
> /usr/bin). My software also uses blas, lapack and openmpi library which i
> have installed in /usr location.  While configuring, i get this following
> error
>
>
> CMake Error at /usr/share/cmake-2.8/Modules/FindBLAS.cmake:456 (message):
> A required library with BLAS API not found. Please specify library location
> Call Stack (most recent call first):
> CMakeLists.txt:46 (FIND_PACKAGE).
>
>
> I do have libblas.so in my /usr/lib but still it throws me this error.

It looks like the library you have installed is for your host system
(Debian i386)
whereas the library for you target (Windows with mingw) is not found.

When cross-compiling you need the libraries for the target system not the host.
Is it your first cross-compiling experience?

> Further, if i don’t use mingw environment and specify /usr/bin/gcc,
> /usr/bin/c++ and /usr/bin/gfortran as my compiler options, i don’t get this
> error.

Yes because in this case your are not cross-compiling.

> Any clue on this would be great help

You should read this page thoroughly:
http://www.cmake.org/Wiki/CMake_Cross_Compiling


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


More information about the CMake mailing list