View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0013034CMake(No Category)public2012-03-09 23:272012-09-03 16:02
ReporterBen Matthews 
Assigned ToBrad King 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformIBM Bluegene/LOSLinux (SuSe PowerPC multilib)OS VersionSLES 9
Product VersionCMake 2.8.7 
Target VersionCMake 2.8.8Fixed in VersionCMake 2.8.8 
Summary0013034: CMAKE_Fortran_MODULE_DIRECTORY does not document that it is output only
DescriptionXLF 10.1 looks for modules in the directories passed to the "-I" switch. CMake correctly sets -qmoddir= to set the module output directory, but fails to generate the matching -I switch, causing builds using a non-standard module directory to fail.

(The build also fails with the GFortran 3.3.3 as shipped with BG/L with
g77: unrecognized option `-Jmodules')
Steps To Reproducemkdir tmp
git clone https://matthb2@github.com/matthb2/CMake-XL-Fortran-Module-Bug.git [^]
mkdir build-broken
cd build-broken
cmake -DCMAKE_TOOLCHAIN_FILE=/gpfs/gpfs0/home/matthb2/bluegenexlc-mpixlf.cmake ../CMake-XL-Fortran-Module-Bug/
#snipped
make
Scanning dependencies of target test
[ 50%] Building Fortran object CMakeFiles/test.dir/modexample.f.o
** test === End of Compilation 1 ===
1501-510 Compilation successful for file modexample.f.
[100%] Building Fortran object CMakeFiles/test.dir/main.f.o
"/gpfs/gpfs0/home/matthb2/cmake_bug/CMake-XL-Fortran-Module-Bug/main.f", line 2.15: 1514-219 (S) Unable to access module symbol file for module test. Check path and file permissions of file. Use association not done for this module.
1501-511 Compilation failed for file main.f.
make[2]: *** [CMakeFiles/test.dir/main.f.o] Error 1
make[1]: *** [CMakeFiles/test.dir/all] Error 2
make: *** [all] Error 2

cd ../CMake-XL-Fortran-Module-Bug
git checkout -b workaround origin/workaround
mkdir ../build-works
cd ../build-works
cmake -DCMAKE_TOOLCHAIN_FILE=/gpfs/gpfs0/home/matthb2/bluegenexlc-mpixlf.cmake ../CMake-XL-Fortran-Module-Bug/
#snipped
make

-- Configuring done
-- Generating done
-- Build files have been written to: /gpfs/gpfs0/home/matthb2/cmake_bug/build
Scanning dependencies of target test
[ 50%] Building Fortran object CMakeFiles/test.dir/modexample.f.o
** test === End of Compilation 1 ===
1501-510 Compilation successful for file modexample.f.
[100%] Building Fortran object CMakeFiles/test.dir/main.f.o
** demo === End of Compilation 1 ===
1501-510 Compilation successful for file main.f.
Linking Fortran executable test
[100%] Built target test
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0028887)
Ben Matthews (reporter)
2012-03-09 23:29
edited on: 2012-03-09 23:31

Test system is a front-end node for an IBM Bluegene/L

Likely also applicable to /P, but I haven't tested it.

Example (master branch) works fine with modern versions of gfortran on x86

(0028889)
Brad King (manager)
2012-03-12 09:07

The CMAKE_Fortran_MODULE_DIRECTORY variable is about where module *output* goes. This is orthogonal in principle to where module *input* is searched. It is perfectly reasonable for a target to generate modules it doesn't use and thus would not need the output directory to be an input directory automatically. You need to add the location with include_directories().
(0028892)
Ben Matthews (reporter)
2012-03-12 11:46

Ok. To me, it would be nice if the documentation made this a little more clear, since this issue only seems to show up on a few (less common) compilers.
(0028893)
Brad King (manager)
2012-03-12 11:57

This came up on the mailing list recently too. I've updated the documentation:

  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=54604ee7 [^]
(0030885)
David Cole (manager)
2012-09-03 16:02

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2012-03-09 23:27 Ben Matthews New Issue
2012-03-09 23:29 Ben Matthews Note Added: 0028887
2012-03-09 23:31 Ben Matthews Note Edited: 0028887
2012-03-12 09:07 Brad King Note Added: 0028889
2012-03-12 11:46 Ben Matthews Note Added: 0028892
2012-03-12 11:56 Brad King Summary Setting CMAKE_Fortran_MODULE_DIRECTORY breaks build on IBM XLF Compiler => CMAKE_Fortran_MODULE_DIRECTORY does not document that it is output only
2012-03-12 11:57 Brad King Note Added: 0028893
2012-03-12 11:57 Brad King Status new => resolved
2012-03-12 11:57 Brad King Fixed in Version => CMake 2.8.8
2012-03-12 11:57 Brad King Resolution open => fixed
2012-03-12 11:57 Brad King Assigned To => Brad King
2012-04-19 15:53 David Cole Target Version => CMake 2.8.8
2012-09-03 16:02 David Cole Note Added: 0030885
2012-09-03 16:02 David Cole Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team