Use the Intel short vector math library for vector intrinsics

Your application calls scalar instead of vectorized versions of math functions. To fix: Do all of the following:

Example

gfortran PROGRAM.FOR -O2 -ftree-vectorize -funsafe-math-optimizations -mveclibabi=svml -L/opt/intel/lib/intel64 -lm -lsvml -Wl,-rpath=/opt/intel/lib/intel64
gfortran PROGRAM.FOR -O2 -ftree-vectorize -funsafe-math-optimizations -mveclibabi=svml -L/opt/intel/lib/intel64 -lm -lsvml -Wl,-rpath=/opt/intel/lib/intel64
program main
    parameter (N=100000000)
    real*8 angles(N), results(N)
    integer i
    call srand(86456)

    do i=1,N
        angles(i) = rand()
    enddo

    ! the loop will be auto-vectorized
    do i=1,N
        results(i) = cos(angles(i))
    enddo

end

Read More