[cmake-developers] [CMake 0013034]: Setting CMAKE_Fortran_MODULE_DIRECTORY breaks build on IBM XLF Compiler

Mantis Bug Tracker mantis at public.kitware.com
Fri Mar 9 23:27:44 EST 2012


The following issue has been SUBMITTED. 
====================================================================== 
http://www.cmake.org/Bug/view.php?id=13034 
====================================================================== 
Reported By:                Ben Matthews
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   13034
Category:                   (No Category)
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2012-03-09 23:27 EST
Last Modified:              2012-03-09 23:27 EST
====================================================================== 
Summary:                    Setting CMAKE_Fortran_MODULE_DIRECTORY breaks build
on IBM XLF Compiler
Description: 
XLF 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 Reproduce: 
mkdir 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

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-03-09 23:27 Ben Matthews   New Issue                                    
======================================================================




More information about the cmake-developers mailing list