I have found the PGI included (reference) Blas to be as slow as expected, so I am trying to use the Intel MKL. However, I cannot figure out how to link these libraries with PGI Workstation 10.3. This is in the Windows 7 64 bit environment.
Here is the source file (zoo.f95) I am using:
program zoo
real(8), dimension(:,:), allocatable :: x, y
real(8), u, v
character(len=64) arg
integer i, j, k, n
call get_command_argument(1, arg)
read(arg, ‘(I5)’) n
allocate(x(n,n), y(n,n))
! fill the x array with the Hilbert matrix
do i = 1, n
x(i,:) = dble(i - 1)
end do
do j = 1, n
v = dble(j)
x(:,j) = 1.0d0 / (x(:,j) + v)
end do
y = 0.0d0
! equivalent to y = matmul(x, x)
call dgemm(‘n’, ‘n’, n, n, n, 1.0d0, x, n, x, n, 0.0d0, y, n)
! output the sum to ensure result was calculated
print *, sum(y)
end
According to bash, the apparent location of the MKL libraries on my system is:
/c/Program Files/Intel/MKL/10.2.4.032/em64t/lib
However the space in the pathname necessitates quotes of some sort.
I have tried several things. At the moment I am trying
pgfortran -fast -Minfo -Mconcur zoo.f95 -L/c/“Program Files”/Intel/MKL/10.2.4.032/em64t/lib -lmkl_core
but this does not seem to work.
I get the error:
LINK : fatal error LNK1004: cannot open file libmkl_core.lib
The first issue here is that the MKL library files do not have names that start with lib. Surely there is a way to let the linker in on the joke - in fact I have a very dim memory of needing to do this once many years ago. The point is, how to tell the PGI linker about this.
The second issue is that I am not convinced the linker is even looking in the first place. There is, in the directory in question, a file called libguide.lib. So when I attempt to compile with
pgfortran -fast -Minfo -Mconcur zoo.f95 -L/c/“Program Files”/Intel/MKL/10.2.4.032/em64t/lib -lguide
and I get the error
LINK : fatal error LNK1004: cannot open file libguide.lib
which does not bode well.
I have been through the user’s guides and manuals for PGI and MKL but haven’t come across a hint for this.
Anyone here know how to link with MKL on Windows 7 64 bit?
Alternatively, is there a freely available BLAS/LAPACK which I can compile with PGI that is roughly performance comparable to MKL for intel CPUs?