Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Compilation errors with IFORT 21

オープン
#960 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
fortran
領域
build-system

調査の方向性

Start by reading the compiler-sensitive code in lin_stdlib_blas_constants.f90, stdlib_error.f90 around appendr, and stdlib_linalg_lapack_aux.F90 around stdlib_ieeeck. Reproduce the reported failures with IFORT 21 on Debian 11 and check whether the quick fixes preserve rank-zero handling and IEEE checks. Done means the sources compile successfully with IFORT 21 while retaining the intended behavior.

索引モデルが issue の本文から書いたものです。

説明

bug
Description

I have downloaded the sources from the fpm branch and tried to compile them "manually" (I mean without fpm). The objective is to put the sources in our industrial software, which has its own build system, and IFORT 21 is the compiler I have to use (and which is not the list of the tested compilers).

The compilation is mostly OK, except for a couple of files, for which I had to apply some quick (and dirty?) fixes... Here is the list:

2 modules in a single file lin_stdlib_blas_constants.f90

It contains lin_stdlib_blas_constants_sp and lin_stdlib_blas_constants_dp. Our dependency management assumes that a source file can contain only one module, with the exact same name as the file (without the .f90 suffix). I think it's a very common convention, and it would be nice to split this into two files.

Internal compiler error in stdlib_error.f90

It happens here:

    pure subroutine appendr(msg,a,prefix)
       class(*),optional,intent(in) :: a(..)
       character(len=*),intent(inout) :: msg
       character,optional,intent(in) :: prefix

       if (present(a)) then
          select rank (v=>a)
             rank (0)                         !!! line 383 !!
                call append (msg,v,prefix)
             rank (1)
                call appendv(msg,v)
             rank default
                msg = trim(msg)//' <ERROR: INVALID RANK>'

          end select
       endif

    end subroutine appendr

stdlib/lin_stdlib_error.f90(383): catastrophic error: **Internal compiler error: internal abort**

I had to rewrite it to make it compile, but obviously nothing will be done for rank(a)==0, and I don't know if it's a problem or not:

    pure subroutine appendr(msg,a,prefix)
       class(*),optional,intent(in) :: a(..)
       character(len=*),intent(inout) :: msg
       character,optional,intent(in) :: prefix

       if (present(a)) then
          if (rank(a) == 0) return
       end if
       if (present(a)) then
          select rank (v=>a)
             !rank (0)                         !!! line 383 !!
             !   call append (msg,v,prefix)
             rank (1)
                call appendv(msg,v)
             rank default
                msg = trim(msg)//' <ERROR: INVALID RANK>'

          end select
       endif

    end subroutine appendr

Unrecognized functions in stdlib_linalg_lapack_aux.F90

It happens here:

     pure integer(ilp) function stdlib_ieeeck( ispec, zero, one )
     !! IEEECK is called from the ILAENV to verify that Infinity and
     !! possibly NaN arithmetic is safe (i.e. will not trap).
        ! -- lapack auxiliary routine --
        ! -- lapack is a software package provided by univ. of tennessee,    --
        ! -- univ. of california berkeley, univ. of colorado denver and nag ltd..--
           ! Scalar Arguments
           integer(ilp), intent(in) :: ispec
           real(sp), intent(in) :: one, zero

        ! =====================================================================
           ! Executable Statements
           stdlib_ieeeck = 1

           ! Test support for infinity values
           if (.not.ieee_support_inf(one)) then
              stdlib_ieeeck = 0
              return
           end if

           ! return if we were only asked to check infinity arithmetic
           if (ispec == 0) return

           if (.not.ieee_support_nan(one)) then
              stdlib_ieeeck = 0
              return
           end if

           return
     end function stdlib_ieeeck
stdlib/lin_stdlib_linalg_lapack_aux.F90(138): error #7137: Any procedure referenced in a PURE procedure, including one referenced via a defined operation or assignment, must have an explicit interface and be declared PURE.   [IEEE_ARITHMETIC^FOR_IEEE_SUPPORT_INF]
           if (.not.ieee_support_inf(one)) then
--------------------^
stdlib/lin_stdlib_linalg_lapack_aux.F90(146): error #7137: Any procedure referenced in a PURE procedure, including one referenced via a defined operation or assignment, must have an explicit interface and be declared PURE.   [IEEE_ARITHMETIC^FOR_IEEE_SUPPORT_NAN]
           if (.not.ieee_support_nan(one)) then
--------------------^

This one is weird... I ended up by simply returning the value $0$, but again I don't know what are the consequences:

```fortran
     pure integer(ilp) function stdlib_ieeeck( ispec, zero, one )
           integer(ilp), intent(in) :: ispec
           real(sp), intent(in) :: one, zero
         
           stdlib_ieeeck = 0

     end function stdlib_ieeeck
Expected Behaviour

successful compilation ;)

Version of stdlib

0.7.0

Platform and Architecture

Debian 11

Additional Information

No response

主要言語
Fortran
スター
1.4k
フォーク
233
平均マージ
4日 11時間
マージ済み PR(30日)
5

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

fortran-lang/stdlib のほかの issue

fortran-lang/stdlib の issue をすべて見る

似ている issue

Build System の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。