Fixed type mismatch errors noted by Brian Ripley with gfortran/gcc10 beta. 
      These concerned e.g. 
      
      "Type mismatch between actual argument at (1) and actual 
      argument at (2) (REAL(4)/INTEGER(4))" 
      
      ...for zswapy in lapack.f, and
      
      "Rank mismatch between actual argument at (1) and actual argument
      at (2) (scalar and rank-1)"
      
      ...for DSCALX. These are warnings generated by gfortran / gcc10, 
      which constitute errors on latest CRAN check.  They are reproduced
      reproduced by installing gcc10 from macports, then making variable 
      definitions explicit so that types match.
      
      E.g., where u(:) (a rank-1 vector) disagrees with wsp(ip) (a scalar),
      make a double precision u1, and say u1 = u(1) and replace u(:).
      
      All tests pass with this change. Changes marked with 2019-11-04_NJM.
      
      
gfortran my_expokit.f
my_expokit.f:463:46:

  463 |       if ( j.gt.0 ) call DSCALX( n, 1.0d0/p1, w(:),1 )
      |                                              1
......
  674 |       call DSCALX( mm, 2.0d0, wsp(ip), 1 )
      |                              2                
Error: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1)
my_expokit.f:2178:28:

  670 |       call DAXPX( mm, -1.0d0,wsp(ip),1, wsp(iq),1 )
      |                             2
......
 2178 |       call DAXPX( n, 1.0d0, u(:),1, wsp(iv),1 )
      |                            1
Error: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1)
my_expokit.f:2537:28:

  670 |       call DAXPX( mm, -1.0d0,wsp(ip),1, wsp(iq),1 )
      |                             2
......
 2537 |       call DAXPX( n, 1.0d0, u,1, wsp(iv),1 )
      |                            1
Error: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1)





gfortran lapack/lapack.f
lapack/lapack.f:1246:31:

 1221 |                call zswapy(k-1,tempx,a(1,k),1,b(1),1)
      |                               2
......
 1246 |                call zswapy(k-2,b(k),a(1,k),1,b(1),1)
      |                               1
Error: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/INTEGER(4)).
lapack/lapack.f:1247:31:

 1221 |                call zswapy(k-1,tempx,a(1,k),1,b(1),1)
      |                               2
......
 1247 |                call zswapy(k-2,b(k-1),a(1,k-1),1,b(1),1)
      |                               1
Error: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/INTEGER(4)).
lapack/lapack.f:777:31:

  777 |                call zswapy(k-2,b(k),a(1,k),1,b(1),1)
      |                               1
......
 1221 |                call zswapy(k-1,tempx,a(1,k),1,b(1),1)
      |                               2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/INTEGER(4)).
lapack/lapack.f:778:31:

  778 |                call zswapy(k-2,b(k-1),a(1,k-1),1,b(1),1)
      |                               1
......
 1221 |                call zswapy(k-1,tempx,a(1,k),1,b(1),1)
      |                               2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/INTEGER(4)).
lapack/lapack.f:646:32:

  646 |                   call zswapy(j,t,a(1,k),1,a(1,j),1)
      |                                1
......
 1221 |                call zswapy(k-1,tempx,a(1,k),1,b(1),1)
      |                               2 
Error: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/INTEGER(4)).
lapack/lapack.f:648:32:

  648 |                   call zswapy(j,t,a(1,k-1),1,a(1,j),1)
      |                                1
......
 1221 |                call zswapy(k-1,tempx,a(1,k),1,b(1),1)
      |                               2 
Error: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/INTEGER(4)).
lapack/lapack.f:343:28:

  343 |             call zswapy(k-1,t,a(1,k),1,b(1),1)
      |                            1
......
 1221 |                call zswapy(k-1,tempx,a(1,k),1,b(1),1)
      |                               2
Error: Type mismatch between actual argument at (1) and actual argument at (2) (COMPLEX(8)/INTEGER(4)).




c     Declaring a rank-1 array of double-precisions,
c     to avoid "Rank mismatch between actual argument at (1) 
c               and actual argument at (2) (scalar and rank-1)"
      double precision, dimension(1) :: wspip



            tempt = INT(t)
            call zswapy(k-1,tempt,a(1,k),1,b(1),1)
c





m_expokit.f:

      wspip(1) = wsp(ip)
      call DAXPX( mm, -1.0d0,wspip,1, wsp(iq),1 )
c      call DAXPX( mm, -1.0d0,wsp(ip),1, wsp(iq),1 )


      wspip(1) = wsp(ip)
      call DSCALX( mm, 2.0d0, wspip, 1 )
c      call DSCALX( mm, 2.0d0, wsp(ip), 1 )











2020-07-03_fixes to:

===================
* installing *source* package ‘rexpokit’ ...
** package ‘rexpokit’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
make[2]: Entering directory '/data/gannet/ripley/R/packages/tests-LTO/rexpokit/src'
gfortran -fno-optimize-sibling-calls  -fpic  -g -O2 -mtune=native -Wall -pedantic -flto -c lapack/blas_mod.f -o lapack/blas_mod.o
gfortran -fno-optimize-sibling-calls  -fpic  -g -O2 -mtune=native -Wall -pedantic -flto -c lapack/lapack.f -o lapack/lapack.o
gfortran -fno-optimize-sibling-calls  -fpic  -g -O2 -mtune=native -Wall -pedantic -flto -c mataid.f -o mataid.o
gfortran -fno-optimize-sibling-calls  -fpic  -g -O2 -mtune=native -Wall -pedantic -flto -c my_expokit.f -o my_expokit.o
gfortran -fno-optimize-sibling-calls  -fpic  -g -O2 -mtune=native -Wall -pedantic -flto -c my_matexp.f -o my_matexp.o
gfortran -fno-optimize-sibling-calls  -fpic  -g -O2 -mtune=native -Wall -pedantic -flto -c itscale5.f -o itscale5.o
g++ -std=gnu++11 -I"/data/gannet/ripley/R/LTO/include" -DNDEBUG  -I'/data/gannet/ripley/R/test-4.1/Rcpp/include' -I/usr/local/include   -fpic  -g -O2 -Wall -pedantic -mtune=native -Wno-ignored-attributes -Wno-deprecated-declarations -Wno-parentheses -flto -c coo.cpp -o coo.o
g++ -std=gnu++11 -I"/data/gannet/ripley/R/LTO/include" -DNDEBUG  -I'/data/gannet/ripley/R/test-4.1/Rcpp/include' -I/usr/local/include   -fpic  -g -O2 -Wall -pedantic -mtune=native -Wno-ignored-attributes -Wno-deprecated-declarations -Wno-parentheses -flto -c wrappers.cpp -o wrappers.o
g++ -std=gnu++11 -shared -L/usr/local/lib64 -o rexpokit.so lapack/blas_mod.o lapack/lapack.o mataid.o my_expokit.o my_matexp.o itscale5.o coo.o wrappers.o -L/data/gannet/ripley/R/LTO/lib -lRlapack -L/data/gannet/ripley/R/LTO/lib -lRblas -lgfortran -lm -lquadmath -lgfortran -lm -lquadmath
lapack/lapack.f:1225:35: warning: type of ‘zswapy’ does not match original declaration [-Wlto-type-mismatch]
 1225 |               call zswapy(k-1,b(k),a(1,k),1,b(1),1)
      |                                   ^
lapack/blas_mod.f:961: note: ‘zswapy’ was previously declared here
  961 |       subroutine  zswapy (n,m,zx,incx,zy,incy)
      | 
lapack/blas_mod.f:961: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used
make[2]: Leaving directory '/data/gannet/ripley/R/packages/tests-LTO/rexpokit/src'
installing to /data/gannet/ripley/R/packages/tests-LTO/Libs/rexpokit-lib/00LOCK-rexpokit/00new/rexpokit/libs
** R
** demo
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (rexpokit)
Time 0:30.85, 26.56 + 1.77
===================



https://solarianprogrammer.com/2019/10/12/compiling-gcc-macos/

xcode-select --install


cd ~/Downloads
mkdir gcc_all && cd gcc_all

curl -L https://ftpmirror.gnu.org/gcc/gcc-10.1.0/gcc-10.1.0.tar.xz | tar xf -
cd gcc-10.1.0
contrib/download_prerequisites

mkdir build && cd build
../configure --prefix=/usr/local/gcc-10.1.0 --enable-checking=release --enable-languages=c,c++,fortran --disable-multilib --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk --program-suffix=-10.1
make -j 8
sudo make install-strip



