[CMake] MSYS Generator with Visual Studio compilers

2014-12-10 Thread Ben Robinson
Hello,

Due to the relative slowness of mingw32-make.exe (MinGW) compared to
make.exe (MSYS) I set out to convert a working MinGW generator project over
to MSYS.  The project uses Visual Studio CXX and Intel Fortran.  Is this
even possible?

My approach was to treat the toolchain like a cross compile, since MSYS
assumes GCC and GFortran.  I printed the relevant toolchain variables from
the working MinGW build, and set them in the MSYS build before the project
statement.  The statements are:

set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_C_COMPILER C:/Program Files (x86)/Microsoft Visual Studio
12.0/VC/bin/amd64/cl.exe)
set(CMAKE_C_COMPILER_ID MSVC)
set(CMAKE_CXX_COMPILER C:/Program Files (x86)/Microsoft Visual Studio
12.0/VC/bin/amd64/cl.exe)
set(CMAKE_CXX_COMPILER_ID MSVC)
set(CMAKE_Fortran_COMPILER C:/Program Files (x86)/Intel/Composer XE
2015/bin/intel64/ifort.exe)
set(CMAKE_Fortran_COMPILER_ID Intel)
set(CMAKE_AR C:/Program Files (x86)/Microsoft Visual Studio
12.0/VC/bin/amd64/lib.exe CACHE FILEPATH Archiver)

However, when I perform the initial cmake specifying the MSYS Makefiles
generator I get the following error:

-- The CXX compiler identification is MSVC 18.0.31101.0
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual
Studio 12.0/VC/bin/amd64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual
Studio 12.0/VC/bin/amd64/cl.exe -- broken
CMake Error at c:/Program Files
(x86)/CMake/share/cmake-3.0/Modules/CMakeTestCXXCompiler.cmake:54 (message):
  The C++ compiler C:/Program Files (x86)/Microsoft Visual Studio
  12.0/VC/bin/amd64/cl.exe is not able to compile a simple test program.

  It fails with the following output:

   Change Dir: F:/P4V/brobins_sim_DEV/build_msys/Release/CMakeFiles/CMakeTmp

  Run Build Command:c:/opt/gnuwin32/bin/make.exe
  cmTryCompileExec3536241854/fast

  c:/opt/gnuwin32/bin/make.exe -f
  CMakeFiles/cmTryCompileExec3536241854.dir/build.make
  CMakeFiles/cmTryCompileExec3536241854.dir/build

  make.exe[1]: Entering directory
  `F:/P4V/brobins_sim_DEV/build_msys/Release/CMakeFiles/CMakeTmp'

  /c/Program Files (x86)/CMake/bin/cmake.exe -E cmake_progress_report
  /F/P4V/brobins_sim_DEV/build_msys/Release/CMakeFiles/CMakeTmp/CMakeFiles 1

  The system cannot find the path specified.

  make.exe[1]: ***
  [CMakeFiles/cmTryCompileExec3536241854.dir/testCXXCompiler.cxx.obj] Error
  1

  make.exe[1]: Leaving directory
  `F:/P4V/brobins_sim_DEV/build_msys/Release/CMakeFiles/CMakeTmp'

  make.exe: *** [cmTryCompileExec3536241854/fast] Error 2

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:30 (project)

-- Configuring incomplete, errors occurred!
See also
F:/P4V/brobins_sim_DEV/build_msys/Release/CMakeFiles/CMakeOutput.log.
See also
F:/P4V/brobins_sim_DEV/build_msys/Release/CMakeFiles/CMakeError.log.

Any ideas what I should attempt next?

Thank you!

Ben
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

[CMake] 'MinGW Makefiles' generator can't link when using Intel Fortran

2014-12-08 Thread Ben Robinson
I am having trouble getting a CMake to compile Fortran on Windows.  I have
mingw32-make.exe in my path.  I have the Intel Fortran compile ifort.exe in
my path.  If I choose the 'Visual Studio 11 2012' generator, Fortran is
properly detected and the project sets up fine.  I am willing to use a
different Makefiles generator, provided I can also compile C++ with Visual
Studio compiler in a Makefiles based build.

Here is my entire top level CMakeLists.txt file:

project(Fortran_1 LANGUAGES Fortran)
cmake_minimum_required(VERSION 3.0)

That's not an excerpt.  :)  I invoke CMake via the following shell command:

F:\workspaces\cmake_fortran_1\build\Debug cmake -GMinGW Makefiles
-DCMAKE_BUILD_TYPE=Debug -DOUTPUT_DIR=F:\workspaces\cmake_fortran_1\build\
F:\workspaces\cmake_fortran_1\source

And I get the following output:

-- The Fortran compiler identification is unknown
-- Check for working Fortran compiler: C:/Program Files
(x86)/Intel/Composer XE 2015/bin/intel64/ifort.exe
-- Check for working Fortran compiler: C:/Program Files
(x86)/Intel/Composer XE 2015/bin/intel64/ifort.exe  -- broken
CMake Error at C:/Program Files
(x86)/CMake/share/cmake-3.0/Modules/CMakeTestFortranCompiler.cmake:54
(message):
  The Fortran compiler C:/Program Files (x86)/Intel/Composer XE
2015/bin/intel64/ifort.exe is not able to compile a simple test program.
  It fails with the following output:
   Change Dir: F:/workspaces/cmake_fortran_1/build/Debug/CMakeFiles/CMakeTmp

   Run Build Command:C:/MinGW/bin/mingw32-make.exe
  cmTryCompileExec3922092051/fast

  C:/MinGW/bin/mingw32-make.exe -f
  CMakeFiles\cmTryCompileExec3922092051.dir\build.make
  CMakeFiles/cmTryCompileExec3922092051.dir/build

  mingw32-make.exe[1]: Entering directory
  'F:/workspaces/cmake_fortran_1/build/Debug/CMakeFiles/CMakeTmp'

  C:\Program Files (x86)\CMake\bin\cmake.exe -E cmake_progress_report
  F:\workspaces\cmake_fortran_1\build\Debug\CMakeFiles\CMakeTmp\CMakeFiles 1

  Building Fortran object
  CMakeFiles/cmTryCompileExec3922092051.dir/testFortranCompiler.f.obj

  C:\PROGRA~2\Intel\COMPOS~4\bin\intel64\ifort.exe -c

F:\workspaces\cmake_fortran_1\build\Debug\CMakeFiles\CMakeTmp\testFortranCompiler.f
-o CMakeFiles\cmTryCompileExec3922092051.dir\testFortranCompiler.f.obj

  Intel(R) Visual Fortran Intel(R) 64 Compiler XE for applications running
on
  Intel(R) 64, Version 15.0.0.108 Build 20140726

  Copyright (C) 1985-2014 Intel Corporation.  All rights reserved.

  Linking Fortran executable cmTryCompileExec3922092051.exe

  C:\Program Files (x86)\CMake\bin\cmake.exe -E cmake_link_script
CMakeFiles\cmTryCompileExec3922092051.dir\link.txt --verbose=1

  C:\PROGRA~2\Intel\COMPOS~4\bin\intel64\ifort.exe
CMakeFiles/cmTryCompileExec3922092051.dir/testFortranCompiler.f.obj -o
cmTryCompileExec3922092051.exe

  Intel(R) Visual Fortran Intel(R) 64 Compiler XE for applications running
on
  Intel(R) 64, Version 15.0.0.108 Build 20140726
  Copyright (C) 1985-2014 Intel Corporation.  All rights reserved.

  Microsoft (R) Incremental Linker Version 12.00.31101.0
  Copyright (C) Microsoft Corporation.  All rights reserved.

  -out:cmTryCompileExec3922092051.exe
  -subsystem:console

  CMakeFiles/cmTryCompileExec3922092051.dir/testFortranCompiler.f.obj

  LINK : fatal error LNK1104: cannot open file 'ifconsol.lib'

  CMakeFiles\cmTryCompileExec3922092051.dir\build.make:79: recipe for target
  'cmTryCompileExec3922092051.exe' failed

  mingw32-make.exe[1]: *** [cmTryCompileExec3922092051.exe] Error 1104

  mingw32-make.exe[1]: Leaving directory
  'F:/workspaces/cmake_fortran_1/build/Debug/CMakeFiles/CMakeTmp'

  Makefile:117: recipe for target 'cmTryCompileExec3922092051/fast' failed

  mingw32-make.exe: *** [cmTryCompileExec3922092051/fast] Error 2


  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:1 (project)

-- Configuring incomplete, errors occurred!
See also
F:/workspaces/cmake_fortran_1/build/Debug/CMakeFiles/CMakeOutput.log.
See also
F:/workspaces/cmake_fortran_1/build/Debug/CMakeFiles/CMakeError.log.

Anything I should try?

Thank you!

Ben Robinson
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] 'MinGW Makefiles' generator can't link when using Intel Fortran

2014-12-08 Thread Ben Robinson
More information, I do not have msys in my path.  My mingw32-make.exe
version support the job server as it is version:

GNU Make 3.82.90
Built for i686-pc-mingw32

My CMake version is 3.0.2.

My Intel Fortran compiler version is:

Intel(R) Visual Fortran Intel(R) 64 Compiler XE for applications running on
Intel(R) 64, Version 15.0.0.108 Build 20140726

Thank you,

Ben
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] 'MinGW Makefiles' generator can't link when using Intel Fortran

2014-12-08 Thread Ben Robinson
Thank you Bill!

By running from the Intel command prompt shell, I am able to compile F90
code using CMake + MinGW Make + Intel Fortran.  Then, in order to support
both CXX and Fortran, I set 'CXX=cl.exe' before calling CMake to generate
the project.  This seems to work for now.  I was surprised I didn't need to
run from within the VS command prompt shell to support C++, as I did for
Intel Fortran.

Of course, I am only using Makefiles for Fortran as a workaround until
there is CMake+Ninja+Fortran support.  :P

Cheers,

Ben


On Mon, Dec 8, 2014 at 11:55 AM, Ben Robinson ben.robinson@gmail.com
wrote:

 More information, I do not have msys in my path.  My mingw32-make.exe
 version support the job server as it is version:

 GNU Make 3.82.90
 Built for i686-pc-mingw32

 My CMake version is 3.0.2.

 My Intel Fortran compiler version is:

 Intel(R) Visual Fortran Intel(R) 64 Compiler XE for applications running
 on Intel(R) 64, Version 15.0.0.108 Build 20140726

 Thank you,

 Ben


-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake