Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
공지
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29285 토론

Silly program takes a very long time to get compiled

Arjen_Markus
명예로운 기여자 II
5,311 조회수

At the Fortran discourse site (https://fortran-lang.discourse.group/t/computing-at-compile-time/3044/13) there is a discussion about the possibility to use compile-time computation. I wrote a small program to meet a challenge that was posted, getting a list of prime numbers at run-time. While hardly the right tool of course, for more serious purposes, it is short and it causes an amazing problem it seems for the compiler. The Intel Fortran oneAPI compiler has been running for more than 4 hours (as has the gfortran compiler).

Here is the code:

! primesieve.f90 --
!     Is it possible t obuild a prime sieve using compile-time computation?
!
program primesieve
    implicit none

    integer, parameter :: N = 1000
    integer            :: i, j
    integer, parameter :: candidates(*) = [(i, i=2,N)]
    integer, parameter :: multiples(*)  = [(( i*j, i=2,N), j=2,N)]
    integer, parameter :: primes(*)     = pack( candidates, [(all(candidates(i) /= multiples), i = 1,size(candidates))] )

    write(*,*) primes

end program primesieve

 

0 포인트
1 솔루션
Ron_Green
중재자
5,053 조회수

Bug ID CMPLRLLVM-36328


원본 게시물의 솔루션 보기

0 포인트
21 응답
JNichols
새로운 기여자 I
514 조회수

Deleting all the partitions, make a new partition and reinstalling windows has fixed the problem. 

I sometimes wonder how many computers are out there that are not maintained and updated.  

Turning off all of the MS stuff takes almost as much time as the install.  

This site would not allow me to include a child's name, from a novel, that is the shortened form of Richard.   **Bleep** is my new go to word.  

What happens if someone has the name **Bleep** (Intel I added it for you so you do not have to).  

The gods are only human. 

**Bleep**

0 포인트
응답