- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Link Copied
- « Previous
-
- 1
- 2
- Next »
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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**

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- « Previous
-
- 1
- 2
- Next »