The R Project SVN R

Rev

Rev 88860 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
85873 maechler 1
																-*-markdown-*-
72150 ripley 2
The Fortran routines here were extracted from LAPACK 3.1.0, then
82211 ripley 3
3.1.1, 3.4.1, 3.4.2, 3.5.0, 3.6.0, 3.6.1, 3.7.0, 3.7.1, 3.8.0, 3.9.0,
87868 ripley 4
3.10.0 3.10.1 3.11.0 3.12.0 3.12.1
85873 maechler 5
(Sources from https://www.netlib.org/lapack and mirrors).
14301 ripley 6
 
88860 ripley 7
NB: The NEWS for R 4.5.0 accnounced the intention never to update this
88870 ripley 8
collection: an external BLAS/LAPACK is preferred and is likely to be
88860 ripley 9
required in the near future.
10
 
85873 maechler 11
dlapack.f contains support routines for `real' LAPACK calls.
72150 ripley 12
cmplx.f contains support routines for LAPACK calls from complex
13
arithmetic routines, that are only used if COMPLEX*16 is supported by
14
the Fortran compiler and compatible with the Rcomplex type.
64440 ripley 15
Neither will be compiled if an external LAPACK is used.
44673 maechler 16
 
59916 ripley 17
We have tried to avoid including any single-precision routines.
18
 
19
 
72150 ripley 20
Preparation
21
-----------
59916 ripley 22
 
83470 ripley 23
For 3.11.0 SRC/dlatrs.f needed patching for gfortran 12: see R.patch.
85772 ripley 24
No longer needed for 3.12.0.
83470 ripley 25
 
87876 ripley 26
The original release of 3.12.1 had the wrong version in llaver.f and
27
needs ediitng.
28
 
72877 ripley 29
dlapack.f and cmplx.f were created at the top level in the LAPACK
83470 ripley 30
3.x.y sources by copying {dble,cmplx}.txt there and running in R
69830 ripley 31
 
85873 maechler 32
```{r}
72150 ripley 33
dir.create('dble')
34
foo <- scan('dble.txt', "")
35
file.copy(file.path("SRC", foo), 'dble')
72877 ripley 36
file.copy(file.path("INSTALL", 'ilaver.f'), 'dble')
85772 ripley 37
system('cpp SRC/iparam2stage.F > dble/iparam2stage.f') ## may give warnings
85873 maechler 38
Sys.setlocale("LC_COLLATE", "C")
39
## system("cat dble/* > dlapack.f") #-- a version that *sorts* correctly:
40
system(paste("cat", paste0(list.files("dble", full.names=TRUE), collapse=" "), "> dlapack.f"))
69830 ripley 41
 
72877 ripley 42
dir.create('cmplx')
72150 ripley 43
foo <- scan('cmplx.txt', "")
85873 maechler 44
table( file.copy(file.path("SRC", foo), 'cmplx') ) # all TRUE !?
45
Sys.setlocale("LC_COLLATE", "C")
46
## system("cat cmplx/* > cmplx.f") #-- a version that *sorts* correctly:
47
system(paste("cat", paste0(list.files("cmplx", full.names=TRUE), collapse=" "), "> cmplx.f"))
48
```
71018 ripley 49
 
85772 ripley 50
Then in the terminal
82211 ripley 51
 
85873 maechler 52
	cat INSTALL/droundup_lwork.f >> dlapack.f
53
 
72150 ripley 54
If you update the LAPACK version, you need to copy over the LICENSE
72877 ripley 55
file and update it in doc/COPYRIGHTS.  And if you patch the sources,
83470 ripley 56
*DO* mention it here and add the patch to a file R.patch.
59916 ripley 57
 
82211 ripley 58
la_xisnan.f90 was created by
81909 ripley 59
 
85873 maechler 60
	cpp SRC/la_xisnan.F90 > la_xisnan.f90
81909 ripley 61
 
72150 ripley 62
New LAPACK versions (even point releases) often add new auxiliary
72877 ripley 63
routines, and these can be hard to track down.  We found it helpful to
72150 ripley 64
compare the outputs of
59916 ripley 65
 
85873 maechler 66
	nm -g dlapack.o | grep ' T ' | cut -b20-
67
	nm -g dlapack.o | grep ' U ' | cut -b20-
72150 ripley 68
 
84215 maechler 69
before and after updating (ditto for cmplx.o).  (This may need
72150 ripley 70
adjusting for your platform's nm.)
71
 
85873 maechler 72
Lnx Fedora 38 (2024-02-06), for `cmplx.o`; old version renamed to `complx.o_1`:
73
```{sh}
74
 nm -g cmplx.o   | grep ' U ' | cut -b20- > cmplx_U_new
75
 nm -g cmplx.o   | grep ' T ' | cut -b20- > cmplx_T_new
76
 nm -g cmplx.o_1 | grep ' T ' | cut -b20- > cmplx_T_1
77
 nm -g cmplx.o_1 | grep ' U ' | cut -b20- > cmplx_U_1
78
 diff cmplx_U_1 cmplx_U_new
79
 ## shows newly needed auxiliary routines - incl one from BLAS (which needs *no* action)
80
 diff cmplx_T_1 cmplx_T_new
81
 ## shows the newly added routines (by yourself, i.e., via cmplx.txt)
82
```
72150 ripley 83
 
85873 maechler 84
 
72150 ripley 85
History
86
-------
87
 
69991 ripley 88
zlahr2 zlaqr0 zlaqr1 zlaqr2 zlaqr3 zlaqr4 zlaqr5 zlartg zpotf2 zpotrf
89
zrot ztrexc
72150 ripley 90
were added in R 2.5.0.
69830 ripley 91
 
69991 ripley 92
izmax1 zdrscl zgecon zlacn2 zlantr ztrcon
72150 ripley 93
were added in R 2.7.0.
69991 ripley 94
 
95
dzsum1 ilazlc ilazlr zunmhr
72150 ripley 96
were added in R 2.15.2.
69991 ripley 97
 
98
zgelsd zgesdd zlacp2 zlacrm zlals0 zlalsa zlalsd zlarcm
99
were added in R 3.1.0.
100
 
101
zgeequ zgees zgels zgerfs zgesc2 zgesvx zgetc2 zgetri zggbak zggbal
102
zgges zggev zgghrd zheevd zhgeqz zlaed0 zlaed7 zlaed8 zlaqge zlasyf
103
zlatdf zlauu2 zlauum zpotri zstedc zsymv zsyr zsytf2 zsytrf zsytri
104
ztgevc ztgex2 ztgexc ztgsen ztgsy2 ztgsyl ztrsen ztrsyl ztrti2 ztrtri
105
zunm2l zunmql zunmtr
106
were added in R 3.3.0 for use by a CRAN package.
107
 
72150 ripley 108
dbdsvdx dgesvdx dgetrf2 dgges3 dggev3 dgghd3 dggsvd3 dggsvp3 dorm22 dpotrf2
109
zgetrf2 zpotrf2
110
were new in LAPACK 3.6.0 and added in R 3.3.0.
111
 
112
dtrevc3 and ztrevc3 were new in LAPACK 3.6.1 and added in R 3.4.0.
113
 
85781 ripley 114
dcombssq.f was patched in R 3.6.3 (see the R-admin manual): that patch
115
is now in the main distribution.
81887 ripley 116
 
81909 ripley 117
Patches from LAPACK 3.9.0 to 3.10.0 were applied for R 4.2.0 but not
118
the new .f90 files replacing dlartg.f dlassq.f zlartg.f zlassq.f
119
 
82211 ripley 120
Those 4 routines were replaced by their .f90 versions in R 4.3.0.
121
 
85873 maechler 122
### R 4.2.2 added
82957 ripley 123
 
124
zgbcon zgbequ zgbrfs zgbsv zgbsvx zgbtf2 zgbtrf zgbtrs zgeevx zgtcon
125
zgtrfs zgtsv zgtsvx zgttrf zgttrs zgtts2 zlagtm zlangb zlangt zlansy
126
zlantb zlaqgb zlaqhe zlatbs zpbtf2 zpbtrf zpocon zpoequ zporfs zposv
127
zposvx zpotrs zpstf2 zpstrf ztrsna
128
 
129
for recent RcppArmadillo with LLVM clang 15.
130
 
85873 maechler 131
### R 4.4.0 added
85772 ripley 132
 
85873 maechler 133
zrscl needed for zgetf2 in 3.12.0
85772 ripley 134
 
86265 maechler 135
zlansp zlantp zlatps zppcon zpptrf zpptri zpptrs zspcon
85772 ripley 136
zspr zsptrf zsptri zsptrs zsycon zsytrs ztpcon ztptri ztptrs
85873 maechler 137
zhecon zhetrf zhetri zhetrs
138
zhpcon zhptrf zhptri zhptrs zlanhp
85772 ripley 139
 
86265 maechler 140
plus   zspmv   for BLAS
85772 ripley 141
 
86265 maechler 142
at the request of the Matrix maintainers
143
 
87868 ripley 144
### R 4.5.0 added
145
 
146
dlarf1f dlarf1l zlarf1f zlarf1l added for 3.12.1
147
 
148
and dgemmtr and zgemmtr to BLAS.  These have not been added to 
149
src/incclude/R_ext/{BLAS,LAPACK}.h
150
 
151
 
85778 ripley 152
We still include the deprecated (in LAPACK 3.6.0) subroutines in files
85873 maechler 153
DEPRECATED/dgegv.f DEPRECATED/dgeqpf.f DEPRECATED/dggsvd.f DEPRECATED/dggsvp.f
85778 ripley 154
DEPRECATED/dgegs.f DEPRECATED/dgelsx.f DEPRECATED/dlahrd.f DEPRECATED/dlatzm.f
155
DEPRECATED/dtzrqf.f
156
 
87868 ripley 157
If you change this, alter `../../include/R_ext/Lapack.h` accordingly:
158
it documents those in the first line.
85778 ripley 159
 
69991 ripley 160
-------------------------------------------------
161
 
162
For 'base' R addition of a new .Call()able Lapack routine,
163
all these files must be updated {path relative to R's topdir}:
164
 
165
  src/gnuwin32/Rdll.hide
166
  src/include/R_ext/Lapack.h
167
  src/include/Rmodules/Rlapack.h
168
  src/main/basedecl.h
169
  src/main/lapack.c
170
  src/main/registration.c
171
  src/modules/lapack/Lapack.c
172
  src/modules/lapack/Lapack.h
173
  src/modules/lapack/cmplx.f or dlapack.f