|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
Kevin
Joined: 01 Mar 2012 Posts: 34 Location: Ascot, UK
|
Posted: Mon Feb 27, 2023 5:06 pm Post subject: First Absoft and now... no more Lahey |
|
|
Lahey Computer Systems will permanently close on
December 31, 2022 |
|
Back to top |
|
|
Robert
Joined: 29 Nov 2006 Posts: 450 Location: Manchester
|
Posted: Mon Feb 27, 2023 10:09 pm Post subject: |
|
|
Haven't they effectively been closed for a while though? |
|
Back to top |
|
|
mecej4
Joined: 31 Oct 2006 Posts: 1896
|
Posted: Wed Mar 01, 2023 6:16 am Post subject: SLATEC library in DLL form for use with FTN95 |
|
|
Yes, Lahey closed down three months ago.
They provided two different compiler products. The first was a superb Windows 32-bit compiler (LF95) from Fujitsu with customisations for use with Visual Studio and Windows libraries. The second was an older version of Gfortran with Visual Studio integrations (LGF). Included in the packages were some rather useful libraries: BLAS, Lapack, Fujitsu SSL2 (all for LF95), and BLAS, Lapack and SLATEC (all for LGF).
Absoft, which closed down in October, also provided prebuilt SLATEC libraries with their Fortran compiler product.
SLATEC is a fine, if dated, mathematical routine library. You can obtain the sources at Netlib (www.netlib.org/slatec). To get an idea of what the library contains, see http://www.lahey.com/docs/lgf14help/LFUGSLATEC.htm .
I spent some time attempting to build a SLATEC DLL for use with FTN95. I found and fixed a number of errors (uninitialised variables, subscript overrun, name clashes between single-precision and double-precision versions of routines and their common blocks). SLATEC is a large library (about 2,000 source files), not easy to use by a new user who is not familiar with F77.
The DLL that I produced is about 6.7 MB, and works with FTN95-64 or Intel Fortran 64-bit. All the 54 test programs included in the SLATEC distributions ran correctly when built with FTN95-64.
If someone is interested, I can upload the DLL to the cloud and provide a link here.
Last edited by mecej4 on Thu Mar 02, 2023 10:02 am; edited 2 times in total |
|
Back to top |
|
|
Robert
Joined: 29 Nov 2006 Posts: 450 Location: Manchester
|
Posted: Wed Mar 01, 2023 11:16 am Post subject: |
|
|
SLATEC sounds interesting, maybe we could make it a download from our main site. |
|
Back to top |
|
|
mecej4
Joined: 31 Oct 2006 Posts: 1896
|
Posted: Wed Mar 01, 2023 5:06 pm Post subject: |
|
|
Robert, even though the SLATEC DLL that I built works fine with FTN95-compiled driver programs, it has one drawback. The DLL was compiled with the Intel OneAPI compiler, and depends on the the Intel RTL package being installed. There is a free download for the RTL, but it is a chore to download, install and configure.
In an attempt to avoid requiring the Intel RTL, I tried to build a DLL using FTN95. I ran into a surprising problem, which I have reported in a separate thread:
http://forums.silverfrost.com/viewtopic.php?p=33842#33842
In short, the SLATEC package has a substantial error reporting subpackage, and the gateway routine, XERMSG, has a namesake already lurking in SALFLIBC.DLL/SALFLIBC64.DLL. If this namesake gets linked in instead of the SLATEC routine, unbeknown to the user, mysterious program crashes occur.
I hope that this problem can be overcome. |
|
Back to top |
|
|
mecej4
Joined: 31 Oct 2006 Posts: 1896
|
Posted: Tue Mar 07, 2023 11:49 am Post subject: |
|
|
Robert, here is an update on my attempt to build a SLATEC DLL using FTN95 (rather than other compilers, which would drag in their runtime libraries).
Paul has provided me updated DLLs with fixes for two of the three issues in my post http://forums.silverfrost.com/viewtopic.php?t=4746 . I am now able to build a DLL for SLATEC using FTN95. Of the 54 tests in the SLATEC test suite, 53 pass.
The remaining test (TEST04) exercises the Fullerton special function routines (Bessel, Airy, etc., with real or complex arguments), and it fails because of the complex variables/arithmetic bug that I reported (in the same thread as the one quoted above). When Paul fixes that bug I should be able to release my updated SLATEC source files.
Have you decided how you want to test the new SLATEC distribution and make the DLLs (32- and 64-bit) and sources available on www.silverfrost.com? I ask because I probably have to document my fixes so that users can become aware of the changes, although I have tried not to touch the API to the SLATEC routines.
We are all probably aware that the SLATEC source code was placed in the public domain by the US Govt., decades ago.
I am working on preparing a few example programs that use the SLATEC DLL to solve standard numerical analysis problems. Here is one, for solving a nonlinear equation in one variable (for details of the physical derivation, see https://www.diva-portal.org/smash/get/diva2:647481/FULLTEXT01.pdf . Stefan's eq. is eq. (2.57) ).
Code: | ! Example program, root of nonlinear eq. in one variable
! See http://www.cs.yorku.ca/~roumani/fortran/slatecAPI/fzero.f.html
!
module global_c
implicit none
real Ste ! parameter in equation being solved
end module
program xfzero ! example program for SLATEC routine Fzero
use global_c
implicit none
real b,c,r,relerr,abserr
integer iflag
real, external :: func
Ste = 0.3 ! set value of parameter in nonlinear equation
r = sqrt(Ste/2) ! approximate solution
b = 0.0 ! search interval (b, c)
c = 1.0
print *,'trial root = ',r
relerr = 0.001
abserr = 0.0005
call fzero(func, b, c, r, relerr, abserr, iflag)
if (iflag .eq. 1) then
print *,' Approx. root found: ', b
print *,' func(root) value = ', func(b)
else
print *,' Iflag = ',iflag
endif
end program
real function func(x)
use global_c ! module makes equation parameter available
implicit none
real x
real, external :: erf
func = sqrt(acos(-1.0))*x*exp(x*x)*erf(x) - Ste !Stefan's equation
return
end function |
Building the program and running it:
Code: | S:\ALGO\SLATEC\Examples>ftn95 /64 xfzero.f90
S:\ALGO\SLATEC\Examples>slink64 xfzero.obj ..\slatec64.dll
xfzero |
|
|
Back to top |
|
|
mecej4
Joined: 31 Oct 2006 Posts: 1896
|
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|