View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015990CMakeCMakepublic2016-02-26 14:402016-06-10 13:55
Reporterabductor 
Assigned ToBrad King 
PriorityhighSeveritymajorReproducibilityalways
StatusclosedResolutionfixed 
Platformx64OSWindowsOS Version7
Product VersionCMake 3.4.1 
Target VersionCMake 3.6Fixed in VersionCMake 3.6 
Summary0015990: CMake multi-processor compilation for Fortran projects
DescriptionFor Fortran project Visual Studio support /MP flags for multi-processor compile.

How set this flag in CMakeLists.txt for Fortran projects?

For example, I set definition /MP for c++ projects. and it is work.

But don't work for Fortran language. I try set in CMAKE_Fortran_FLAGS /MP flag, but unsuccessfully.

http://stackoverflow.com/questions/35636166/cmake-multi-processor-compile-for-fortran-projects [^]
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0040562)
Brad King (manager)
2016-02-26 15:06

Something like this might work (untested):

----------------------------------------------------------------------------
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index ae6a24e..cdc4f68 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -480,6 +480,11 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorFlagTable[] =
   {"ProgramDataBaseFileName", "Fd", "Program Database File Name", "",
    cmVS7FlagTable::UserValue},
 
+ {"MultiProcessorCompilation", "MP", "", "true",
+ cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue},
+ {"ProcessorNumber", "MP", "Multi-processor Compilation", "",
+ cmVS7FlagTable::UserValueRequired},
+
   // boolean flags
   {"BufferSecurityCheck", "GS", "Buffer security check", "true", 0},
   {"BufferSecurityCheck", "GS-", "Turn off Buffer security check", "false", 0},
----------------------------------------------------------------------------

The names may need to be updated to match what .vfproj files expect.
(0040563)
abductor (reporter)
2016-02-26 15:11

This patch is consist in 3.5.0 ?
(0040582)
abductor (reporter)
2016-02-29 11:14

I add you patch in 3.4.3. don't work.
(0040764)
abductor (reporter)
2016-03-28 16:14

up!
(0040766)
Brad King (manager)
2016-03-29 08:47

The patch in 0015990:0040562 added the entries to the wrong flag table. I've applied a corrected version of the patch:

 VS: Map Intel Fortran `/MP` flag for multi-processor compilation
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=729f5f01 [^]
(0041150)
abductor (reporter)
2016-06-07 15:40

thanks, it's work.
(0041154)
Kitware Robot (administrator)
2016-06-10 13:55

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2016-02-26 14:40 abductor New Issue
2016-02-26 15:06 Brad King Note Added: 0040562
2016-02-26 15:11 abductor Note Added: 0040563
2016-02-29 11:14 abductor Note Added: 0040582
2016-03-28 16:14 abductor Note Added: 0040764
2016-03-29 08:47 Brad King Note Added: 0040766
2016-03-29 08:48 Brad King Assigned To => Brad King
2016-03-29 08:48 Brad King Status new => resolved
2016-03-29 08:48 Brad King Resolution open => fixed
2016-03-29 08:48 Brad King Fixed in Version => CMake 3.6
2016-03-29 08:48 Brad King Target Version => CMake 3.6
2016-03-29 08:48 Brad King Description Updated
2016-06-07 15:40 abductor Note Added: 0041150
2016-06-10 13:55 Kitware Robot Note Added: 0041154
2016-06-10 13:55 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team