[CMake] Fortran name mangling

Biddiscombe, John A. biddisco at cscs.ch
Wed Nov 25 03:03:08 EST 2009


First off, I'd like to say thanks to whoever is responsible for the huge improvements in Fortran support in cmake-1.8.0. I've got most of the hdf5 Fortran testing framework essentially running smoothly on win32 intel visual fortran 11.x - no changes necessary to the default Fortran flags and detection stuff in cmake (that's close to a miracle!).



However, the same cmake code gave me link errors under linux, so I tried to get the name mangling right using



include(FortranCInterface)

FortranCInterface_HEADER(${HDF5Fortran_BINARY_DIR}/FCMangle.h

                         MACRO_NAMESPACE "H5_FC_FUNC_"

                         SYMBOL_NAMESPACE "H5_FC_SYM_"

                         SYMBOLS mysub mymod:my_sub)



Which works out of the box under linux (intel fortran, will try PGI/Cray etc later). Superb job with the detection. Really nice, even gets the module prefixes and stuff right (module_mp_func etc).



However, for unknown reasons, when I use this code on the win32 machine which is compiling the primary fortran projects happily, this happens

[cid:image003.jpg at 01CA6DAE.1B56F060]



Now if I click through saying Yes, Yes, Yes, several times, the intermediate solution/project files do get loaded behind the scenes and the name mangling is correctly detected. But if I say No, then the try_compile phase is skiped and detection fails. (And if I navigate to the binary dir where the solution files are being created and load the projects manually, the same error is displayed)



The question is, why is/are the solution files being corrupted when running  in the CFortranInterface try compile stages - when other projects are generated correctly.



I will do some digging to try to uncover the problem, but if someone on the core cmake team can guess what's wrong (and fix it), then thanks in advance.



JB
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20091125/5e9c9196/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.jpg
Type: image/jpeg
Size: 8133 bytes
Desc: image003.jpg
URL: <http://www.cmake.org/pipermail/cmake/attachments/20091125/5e9c9196/attachment.jpg>


More information about the CMake mailing list