Bug 1260490 - C+Fortran interface detection broken
Summary: C+Fortran interface detection broken
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: cmake
Version: 23
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Orion Poplawski
QA Contact: Fedora Extras Quality Assurance
URL: http://www.cmake.org/Bug/view.php?id=...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-09-07 06:04 UTC by Susi Lehtola
Modified: 2015-09-19 18:54 UTC (History)
5 users (show)

Fixed In Version: 3.3.1-5.fc23
Clone Of:
Environment:
Last Closed: 2015-09-19 18:54:38 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Susi Lehtola 2015-09-07 06:04:39 UTC
Description of problem:

The Fortran/C{,++} interface detection is broken in Fedora 23 and 24.


Version-Release number of selected component (if applicable):
cmake-3.3.1-3

How reproducible:
Try to build package that mixes C and Fortran.

Steps to Reproduce:
Try to build psi4-0.3-1.188450git

Actual results:
-- Detecting Fortran/C Interface
-- Detecting Fortran/C Interface - Found GLOBAL and MODULE mangling
-- Verifying Fortran/CXX Compiler Compatibility
-- Verifying Fortran/CXX Compiler Compatibility - Failed
CMake Error at /usr/share/cmake/Modules/FortranCInterface.cmake:331 (message):
  The Fortran compiler:
    /usr/bin/gfortran
  and the CXX compiler:
    /usr/bin/g++
  failed to compile a simple test project using both languages.  The output
  was:

(clip)

    /usr/bin/g++   -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -std=c++11 -Wno-narrowing -DNDEBUG -fopenmp   -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld CMakeFiles/VerifyFortranC.dir/main.c.o CMakeFiles/VerifyFortranC.dir/VerifyC.c.o CMakeFiles/VerifyFortranC.dir/VerifyCXX.cxx.o  -o VerifyFortranC -rdynamic libVerifyFortran.a 
    libVerifyFortran.a(VerifyFortran.f.o): In function `verifyfortran_':
    /usr/share/cmake/Modules/FortranCInterface/Verify/VerifyFortran.f:2: undefined reference to `_gfortran_st_write'
    /usr/share/cmake/Modules/FortranCInterface/Verify/VerifyFortran.f:2: undefined reference to `_gfortran_transfer_character_write'
    /usr/share/cmake/Modules/FortranCInterface/Verify/VerifyFortran.f:2: undefined reference to `_gfortran_st_write_done'
    collect2: error: ld returned 1 exit status
    CMakeFiles/VerifyFortranC.dir/build.make:150: recipe for target 'VerifyFortranC' failed
    gmake[2]: Leaving directory '/builddir/build/BUILD/psi4public-1881450f30d3bd2ac91dbc4fc6a4eaa5c9f03ae5/objdir-i686-redhat-linux-gnu/CMakeFiles/FortranCInterface/VerifyCXX'
    gmake[2]: *** [VerifyFortranC] Error 1


Expected results:
-- Detecting Fortran/C Interface
-- Detecting Fortran/C Interface - Found GLOBAL and MODULE mangling
-- Verifying Fortran/CXX Compiler Compatibility
-- Verifying Fortran/CXX Compiler Compatibility - Success


Additional info:
Looks like the problem is that libgfortran isn't specified in the link command.

Comment 1 Susi Lehtola 2015-09-07 06:05:15 UTC
The same spec builds in Fedora 21 and 22.

Comment 2 Orion Poplawski 2015-09-10 04:23:09 UTC
Please give cmake-3.3.1-4.fc24 a try when that finishes building.

Comment 3 Susi Lehtola 2015-09-10 23:13:54 UTC
Maybe build it first? :P

Comment 4 Susi Lehtola 2015-09-11 04:57:32 UTC
Well, built it for you.

And it still fails. The problem isn't that it fails to parse the compiler output, but rather that it's not linking the gfortran runtime libraries in.

Comment 5 Orion Poplawski 2015-09-11 14:37:15 UTC
It seemed a long shot - but there was a very similar issue on the cmake list that it appeared to fix.  I'll try to take a closer look.

Comment 6 Orion Poplawski 2015-09-11 17:17:32 UTC
Use of redhat-hardened-ld is confusing cmake.  Filed http://www.cmake.org/Bug/view.php?id=15737 upstream.

Comment 7 Fedora Update System 2015-09-11 22:52:49 UTC
cmake-3.3.1-5.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-15668

Comment 8 Fedora Update System 2015-09-12 21:24:59 UTC
cmake-3.3.1-5.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.\nIf you want to test the update, you can install it with \n su -c 'yum --enablerepo=updates-testing update cmake'. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-15668

Comment 9 Fedora Update System 2015-09-19 18:54:36 UTC
cmake-3.3.1-5.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.