Bug 263902 - math/blas 3.10.1: linker error with gfortran 12 / GCC 12
Summary: math/blas 3.10.1: linker error with gfortran 12 / GCC 12
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-fortran (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-10 20:56 UTC by Philipp Engel
Modified: 2022-11-19 23:58 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (fortran)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Engel 2022-05-10 20:56:12 UTC
Building math/blas on FreeBSD 13.0 with Poudriere fails. The make configuration:

USE_PACKAGE_DEPENDS=yes
BATCH=yes
WRKDIRPREFIX=/wrkdirs
PORTSDIR=/usr/ports
PACKAGES=/packages
DISTDIR=/distfiles
FORCE_PACKAGE=yes
PACKAGE_BUILDING=yes
PACKAGE_BUILDING_FLAVORS=yes
WRKDIRPREFIX=/tmp/ports
DEFAULT_VERSIONS+=ssl=base python=3.9 php=7.3 gcc=12 llvm=13
OPTIONS_SET=SNDIO
OPTIONS_UNSET=ICONV ALSA AVAHI AVX2 BASH CPUFLAGS CPU_OPTS CUPS DBUS DEBUG DOCS EXAMPLES FLAC FONTCONFIG GNOME GSTREAMER HAL JACK JAVA JPEG2000 LDAP MANPAGES NLS NOTIFY OPTIMIZED_CFLAGS POLICYKIT PULSEAUDIO PROFILE SNDIO SPEEX TEST TESTS VIDEO_WAYLAND VIM_OPTIONS WAYLAND ZSH OPENCV

The log:

/bin/mkdir -p /tmp/ports/usr/ports/math/blas/work/.build
-- The Fortran compiler identification is GNU 12.1.0
-- The C compiler identification is Clang 11.0.1
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: /usr/local/bin/gfortran12 - skipped
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Checking if build type is 'Coverage'
-- Checking if build type is 'Coverage': 0
-- Performing Test _frecursiveFlag
-- Performing Test _frecursiveFlag - Success
-- Build tests: OFF
-- Reducing RELEASE optimization level to O2
-- Looking for Fortran NONE - found
-- Looking for Fortran INT_CPU_TIME - found
-- Looking for Fortran EXT_ETIME - not found
-- Looking for Fortran EXT_ETIME_ - not found
-- Looking for Fortran INT_ETIME - found
-- --> Will use second_INT_ETIME.f and dsecnd_INT_ETIME.f as timing function.
-- Build deprecated routines: ON
-- Build single precision real: ON
-- Build double precision real: ON
-- Build single precision complex: ON
-- Build double precision complex: ON
-- Using supplied NETLIB BLAS implementation
-- Using supplied NETLIB LAPACK implementation
-- Detecting Fortran/C Interface
Failed to compile
-- Verifying Fortran/C Compiler Compatibility
Failed to compile
CMake Warning (dev) at /usr/local/share/cmake/Modules/FortranCInterface.cmake:309 (message):
  No FortranCInterface mangling known for VerifyFortran
Call Stack (most recent call first):
  /usr/local/share/cmake/Modules/FortranCInterface/Verify/CMakeLists.txt:16 (FortranCInterface_HEADER)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Verifying Fortran/C Compiler Compatibility - Failed
CMake Error at /usr/local/share/cmake/Modules/FortranCInterface.cmake:391 (message):
  The Fortran compiler:

    /usr/local/bin/gfortran12

  and the C compiler:

    /usr/bin/cc

  failed to compile a simple test project using both languages.  The output
  was:

    Change Dir: /tmp/ports/usr/ports/math/blas/work/.build/CMakeFiles/FortranCInterface/VerifyC
    
    Run Build Command(s):/usr/bin/make -f Makefile VerifyFortranC && /usr/local/bin/cmake -S/usr/local/share/cmake/Modules/FortranCInterface/Verify -B/tmp/ports/usr/ports/math/blas/work/.build/CMakeFiles/FortranCInterface/VerifyC --check-build-system CMakeFiles/Makefile.cmake 0
    /usr/bin/make  -f CMakeFiles/Makefile2 VerifyFortranC
    /usr/local/bin/cmake -S/usr/local/share/cmake/Modules/FortranCInterface/Verify -B/tmp/ports/usr/ports/math/blas/work/.build/CMakeFiles/FortranCInterface/VerifyC --check-build-system CMakeFiles/Makefile.cmake 0
    /usr/local/bin/cmake -E cmake_progress_start /tmp/ports/usr/ports/math/blas/work/.build/CMakeFiles/FortranCInterface/VerifyC/CMakeFiles 5
    /usr/bin/make  -f CMakeFiles/Makefile2 CMakeFiles/VerifyFortranC.dir/all
    /usr/bin/make  -f CMakeFiles/VerifyFortran.dir/build.make CMakeFiles/VerifyFortran.dir/depend
    cd /tmp/ports/usr/ports/math/blas/work/.build/CMakeFiles/FortranCInterface/VerifyC && /usr/local/bin/cmake -E cmake_depends "Unix Makefiles" /usr/local/share/cmake/Modules/FortranCInterface/Verify /usr/local/share/cmake/Modules/FortranCInterface/Verify /tmp/ports/usr/ports/math/blas/work/.build/CMakeFiles/FortranCInterface/VerifyC /tmp/ports/usr/ports/math/blas/work/.build/CMakeFiles/FortranCInterface/VerifyC /tmp/ports/usr/ports/math/blas/work/.build/CMakeFiles/FortranCInterface/VerifyC/CMakeFiles/VerifyFortran.dir/DependInfo.cmake
    Scanning dependencies of target VerifyFortran
    /usr/bin/make  -f CMakeFiles/VerifyFortran.dir/build.make CMakeFiles/VerifyFortran.dir/build
    [ 20%] Building Fortran object CMakeFiles/VerifyFortran.dir/VerifyFortran.f.o
    /usr/local/bin/gfortran12  -I/tmp/ports/usr/ports/math/blas/work/.build/CMakeFiles/FortranCInterface/VerifyC -O -Wl,-rpath=/usr/local/lib/gcc12 -frecursive -O2 -DNDEBUG -O2 -c /usr/local/share/cmake/Modules/FortranCInterface/Verify/VerifyFortran.f -o CMakeFiles/VerifyFortran.dir/VerifyFortran.f.o
    [ 40%] Linking Fortran static library libVerifyFortran.a
    /usr/local/bin/cmake -P CMakeFiles/VerifyFortran.dir/cmake_clean_target.cmake
    /usr/local/bin/cmake -E cmake_link_script CMakeFiles/VerifyFortran.dir/link.txt --verbose=1
    /usr/local/bin/ar qc libVerifyFortran.a CMakeFiles/VerifyFortran.dir/VerifyFortran.f.o
    /usr/local/bin/ranlib libVerifyFortran.a
    [ 40%] Built target VerifyFortran
    /usr/bin/make  -f CMakeFiles/VerifyFortranC.dir/build.make CMakeFiles/VerifyFortranC.dir/depend
    cd /tmp/ports/usr/ports/math/blas/work/.build/CMakeFiles/FortranCInterface/VerifyC && /usr/local/bin/cmake -E cmake_depends "Unix Makefiles" /usr/local/share/cmake/Modules/FortranCInterface/Verify /usr/local/share/cmake/Modules/FortranCInterface/Verify /tmp/ports/usr/ports/math/blas/work/.build/CMakeFiles/FortranCInterface/VerifyC /tmp/ports/usr/ports/math/blas/work/.build/CMakeFiles/FortranCInterface/VerifyC /tmp/ports/usr/ports/math/blas/work/.build/CMakeFiles/FortranCInterface/VerifyC/CMakeFiles/VerifyFortranC.dir/DependInfo.cmake
    /usr/bin/make  -f CMakeFiles/VerifyFortranC.dir/build.make CMakeFiles/VerifyFortranC.dir/build
    [ 60%] Building C object CMakeFiles/VerifyFortranC.dir/main.c.o
    /usr/bin/cc  -I/tmp/ports/usr/ports/math/blas/work/.build/CMakeFiles/FortranCInterface/VerifyC -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing -MD -MT CMakeFiles/VerifyFortranC.dir/main.c.o -MF CMakeFiles/VerifyFortranC.dir/main.c.o.d -o CMakeFiles/VerifyFortranC.dir/main.c.o -c /usr/local/share/cmake/Modules/FortranCInterface/Verify/main.c
    [ 80%] Building C object CMakeFiles/VerifyFortranC.dir/VerifyC.c.o
    /usr/bin/cc  -I/tmp/ports/usr/ports/math/blas/work/.build/CMakeFiles/FortranCInterface/VerifyC -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing -MD -MT CMakeFiles/VerifyFortranC.dir/VerifyC.c.o -MF CMakeFiles/VerifyFortranC.dir/VerifyC.c.o.d -o CMakeFiles/VerifyFortranC.dir/VerifyC.c.o -c /usr/local/share/cmake/Modules/FortranCInterface/Verify/VerifyC.c
    [100%] Linking C executable VerifyFortranC
    /usr/local/bin/cmake -E cmake_link_script CMakeFiles/VerifyFortranC.dir/link.txt --verbose=1
    /usr/bin/cc -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing  -Wl,-rpath=/usr/local/lib/gcc12  -L/usr/local/lib/gcc12 -B/usr/local/bin -fstack-protector-strong CMakeFiles/VerifyFortranC.dir/main.c.o CMakeFiles/VerifyFortranC.dir/VerifyC.c.o -o VerifyFortranC   -L/usr/local/bin  -L/usr/local/lib/gcc12/gcc/x86_64-portbld-freebsd13.0/12.1.0  -L/usr/local/x86_64-portbld-freebsd13.0/lib  libVerifyFortran.a -lgfortran -lm -lssp_nonshared -lquadmath -lm 
    /usr/local/bin/ld: CMakeFiles/VerifyFortranC.dir/main.c.o: in function `main':
    main.c:(.text+0xa): undefined reference to `VerifyFortran'
    cc: error: linker command failed with exit code 1 (use -v to see invocation)
    *** Error code 1
Comment 1 Philipp Engel 2022-05-10 23:13:35 UTC
Building with GCC 11 works though.
Comment 2 Thierry Thomas freebsd_committer freebsd_triage 2022-11-19 17:31:11 UTC
Lorenzo, recently you launched an exp-run for GCC 12: did you notice a problem with math/blas ?
Comment 3 Lorenzo Salvadore freebsd_committer freebsd_triage 2022-11-19 19:25:31 UTC
(In reply to Thierry Thomas from comment #2)

Antoine has done two exp run for updating GCC_DEFAULT from 11 to 12, one on 2022-09-02 and another one on 2022-11-16. None of them reported any issue with math/blas.

Please see bug #265948.

I guess this can be closed as "overcome by events".
Comment 4 Thierry Thomas freebsd_committer freebsd_triage 2022-11-19 23:58:26 UTC
Thanks Lorenzo!

To submitter: if another error occurs, please open a new PR.