and one more thing, even when I change the extension of the source code to ".cpp" and compile it with "icc" I again get "undefined reference" error which is normal since when files with ".cpp" is being compiled using Intel, "icpc" will automatically launched. I am wondering if I need to pass parameters in the command in an different way when "icpc" is used.
It looks like you haven't included the headers to define the pardiso functions as using C linkage (no C++ mangling of the names). Also, it seems like a very bad idea to link against 3 incompatible OpenMP libraries and 2 incompatible Fortran run-time libraries in random order.
Thanks! As you mentioned, icpc mangles function names so all I needed to do was to add
before function headers. What did you mean about incompatible OpenMP libraries and Fortran run-time libraries in random order? Would it be efficient if I change the order or remove some libraries? Are they redundant? DO you have any suggestion?
If you have functions which depend on libguide or libgomp, libiomp5 will take care of all of them. If you stay with dynamic linkage against libiomp5, it won't make a lot of difference where that library is specified in your command line, as long as it follows at least one reference to it, but it still seems preferable to list dependencies in order. You will run into trouble if you link against parts of more than one of those libraries (even if you link against multiple versions of libiomp5). I guess it may be OK to link against libgfortran, provided that you make no use of ifort run-time libraries, as there is no run-time library compatibility between ifort and gfortran. If the dependency on libgfortran was left over from linking against pre-built open source alternatives to MKL, I'm worried about confusion, when you apparently don't need any of the gfortran alternative libraries provided with MKL.