Bug 1260490 - C+Fortran interface detection broken
C+Fortran interface detection broken
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: cmake (Show other bugs)
23
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Orion Poplawski
Fedora Extras Quality Assurance
http://www.cmake.org/Bug/view.php?id=...
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-09-07 02:04 EDT by Susi Lehtola
Modified: 2015-09-19 14:54 EDT (History)
5 users (show)

See Also:
Fixed In Version: 3.3.1-5.fc23
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-09-19 14:54:38 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Susi Lehtola 2015-09-07 02:04:39 EDT
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 02:05:15 EDT
The same spec builds in Fedora 21 and 22.
Comment 2 Orion Poplawski 2015-09-10 00:23:09 EDT
Please give cmake-3.3.1-4.fc24 a try when that finishes building.
Comment 3 Susi Lehtola 2015-09-10 19:13:54 EDT
Maybe build it first? :P
Comment 4 Susi Lehtola 2015-09-11 00:57:32 EDT
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 10:37:15 EDT
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 13:17:32 EDT
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 18:52:49 EDT
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 17:24:59 EDT
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 14:54:36 EDT
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.