Which library am I using ?

When linking a code against more than one library you can have the linker print which library ( with the complete path) a given routine is from using the -Wl,-y option. For example:

ifort  -o time_dgem timing_dgemm.f90 -Wl,--start-group $MKLROOT/lib/em64t/libmkl_core.a
$MKLROOT/lib/em64t/libmkl_intel_lp64.a $MKLROOT/lib/em64t/libmkl_intel_thread.a 
-Wl,--end-group  -liomp5 -ldl -lm -lpthread -Wl,-ydgemm

/opt/share/intel/11.1/x86_64/mkl/lib/em64t/
libmkl_intel_lp64.a(_dgemm_lp64.o): definition of dgemm