This bugzilla service is closed. All entries have been migrated to

Bug 542

Summary: Cmake script cannot recognize mingw
Product: Eigen Reporter: Vasileios Anagnostopoulos <fithis2001>
Component: Core - generalAssignee: Nobody <eigen.nobody>
Severity: major CC: gael.guennebaud, jacob.benoit.1, jitseniesen
Priority: Normal    
Version: 3.1   
Hardware: x86 - 32-bit   
OS: Windows   
Bug Depends on:    
Bug Blocks: 387    

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.
Comment 5 Nobody 2019-12-04 12:01:11 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: