MantisBT - CMake
View Issue Details
0012421CMakeCMakepublic2011-08-25 17:182016-06-10 14:31
Budo Zindovic 
Brad King 
highmajoralways
closedmoved 
WindowsXP
CMake 2.8.5 
 
0012421: Fortran-C/C++ interoperability test fail
During the configuration for mixed language build, CMake tests whether C/C++ and FORTRAN compilers can interact with each other. After the initial configuration, one test (FortranCInterface.sln) is build successfully but the other (VerifyFortranC.sln) fails to compile. After a careful look into the project that wasn't build properly, I saw that the project VerifyFortranC.sln has been messed up so that it contains C/C++ and Fortran sources.

Main problem is that compilation of this project would work if Microsoft Visual Studio had a built-in FORTRAN compiler (that would work on Linux). Since this is not the case, the solution would be to built these two separately (one would be FORTRAN and the other would be C/C++ project) and then link them together.
To reproduce this bug, the user is required to build any mixed lanugage programming library. This example uses Trilinos library:

1. Extract library to a desired location
2. Open the Cmake-GUI and point to the source and desired build directory
3. set TPL_ENABLE_BLAS, TPL_ENABLE_LAPACK, Trilinos_ENABLE_Amesos, Trilinos_ENABLE_AztecOO, Trilinos_ENABLE_Belos and Trilinos_ENABLE_CTrilinos to ON
4. Set-up the paths to BLAS/LAPACK and CLapack libraries
5. Click Configure
Attachment contains two zipped versions of the VerifyFortranC.sln project: one is the original output from CMake 2.8.6 (its name is VerifyCXX-Original.zip) and the proposition of the layout for this test (two projects separated for FORTRAN and for C/C++ test and is named VerifyCXX-Suggestion.zip). This proposed version is the one I have successfully built on my machine but the options are tuned for Debug and Release Configuration only (MinSizeRel and RelWithDebInfo were not set-up at all).
No tags attached.
zip VerifyCXX.zip (1,812,150) 2011-08-25 17:19
https://public.kitware.com/Bug/file/4021/VerifyCXX.zip
Issue History
2011-08-25 17:18Budo ZindovicNew Issue
2011-08-25 17:19Budo ZindovicFile Added: VerifyCXX.zip
2011-08-29 10:22Brad KingAssigned To => Bill Hoffman
2011-08-29 10:22Brad KingStatusnew => assigned
2011-08-29 10:23Brad KingAssigned ToBill Hoffman => Brad King
2011-08-29 10:27Brad KingNote Added: 0027282
2012-08-13 10:44Brad KingStatusassigned => backlog
2012-08-13 10:44Brad KingNote Added: 0030551
2016-06-10 14:28Kitware RobotNote Added: 0041890
2016-06-10 14:28Kitware RobotStatusbacklog => resolved
2016-06-10 14:28Kitware RobotResolutionopen => moved
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0027282)
Brad King   
2011-08-29 10:27   
Try this (untested) patch to the CMake Modules directory:

diff --git a/Modules/FortranCInterface/Verify/CMakeLists.txt b/Modules/FortranCInterface/Verify/CMakeLists.txt
index 052dd59..0a3980a 100644
--- a/Modules/FortranCInterface/Verify/CMakeLists.txt
+++ b/Modules/FortranCInterface/Verify/CMakeLists.txt
@@ -24,7 +24,9 @@ include(FortranCInterface)
 FortranCInterface_HEADER(VerifyFortran.h SYMBOLS VerifyFortran)
 include_directories(${VerifyFortranC_BINARY_DIR})

-add_executable(VerifyFortranC main.c VerifyC.c VerifyFortran.f ${VerifyCXX})
+add_library(VerifyFortran VerifyFortran.f)
+add_executable(VerifyFortranC main.c VerifyC.c ${VerifyCXX})
+target_link_libraries(VerifyFortranC VerifyFortran)

 if(NOT VERIFY_CXX)
   # The entry point (main) is defined in C; link with the C compiler.
(0030551)
Brad King   
2012-08-13 10:44   
Sending issues I'm not actively working on to the backlog to await someone with time for them.

If an issue you care about is sent to the backlog when you feel it should have been addressed in a different manner, please bring it up on the CMake mailing list for discussion. Sign up for the mailing list here, if you're not already on it:

 http://www.cmake.org/mailman/listinfo/cmake [^]

It's easy to re-activate a bug here if you can find a CMake developer or contributor who has the bandwidth to take it on.
(0041890)
Kitware Robot   
2016-06-10 14:28   
Resolving issue as `moved`.

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.