New user self-registration is disabled due to spam. Please email eigen-core-team @ if you need an account.
Before reporting a bug, please make sure that your Eigen version is up-to-date!
Bug 542 - Cmake script cannot recognize mingw
Summary: Cmake script cannot recognize mingw
Alias: None
Product: Eigen
Classification: Unclassified
Component: Core - general (show other bugs)
Version: 3.1
Hardware: x86 - 32-bit Windows
: Normal major
Assignee: Nobody
Depends on:
Blocks: 3.2
  Show dependency treegraph
Reported: 2013-01-15 15:59 UTC by Vasileios Anagnostopoulos
Modified: 2013-06-18 17:26 UTC (History)
3 users (show)


Description Vasileios Anagnostopoulos 2013-01-15 15:59:40 UTC
I used x32-4.7.2-release-posix-sjlj-rev6 under windows 7 x86
I used cmake

Error by cmake gui

CMake Error at cmake/EigenTesting.cmake:321 (ei_get_compilerver_from_cxx_version_string):
  ei_get_compilerver_from_cxx_version_string Macro invoked with incorrect
  arguments for macro named: ei_get_compilerver_from_cxx_version_string
Call Stack (most recent call first):
  cmake/EigenTesting.cmake:411 (ei_get_compilerver)
  cmake/EigenConfigureTesting.cmake:8 (ei_set_build_string)
  CMakeLists.txt:310 (include)

The result

It does not allow me to generate
Comment 1 Jitse Niesen 2013-06-17 23:31:21 UTC
Looking at the cmake code, may it be a possibility that  eigen_cxx_compiler_version_string is empty when ei_get_compilerver_from_cxx_version_string is called? Perhaps mingw does not include the "head" command? If I replace "head" by "hed", which is a non-existing command on my system, I get the same error message.

I'm hoping that somebody with more cmake knowledge can fix this.
Comment 2 Gael Guennebaud 2013-06-18 00:23:50 UTC
What about replacing the head command that is not available with windows shell with this cmake command:

string(REGEX REPLACE "[\n\r].*"  ""  eigen_cxx_compiler_version_string  ${eigen_cxx_compiler_version_string})

Works for me on OSX/Linux.
Comment 3 Jitse Niesen 2013-06-18 15:56:13 UTC
I guess we need somebody with mingw to test whether this really fixes the issue, though this seems a good idea anyway.
Comment 4 Gael Guennebaud 2013-06-18 17:26:53 UTC
works for us with mingw. I still kept the head command when this one is available, less risky.
Changeset:   6607f616792c
User:        ggael
Date:        2013-06-18 17:25:37
Summary:     Fix bug 542: fix detection of compiler version on systems without the head command.

Note You need to log in before you can comment on or make changes to this bug.