Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Reply-To: From: "Takashi Sato" To: Subject: How to use MKL with cygwin. Date: Wed, 24 Oct 2001 12:12:25 +0900 Message-ID: <00a401c15c39$b6077d80$756d080a@cappuccino> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook CWS, Build 9.0.2416 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 When I attempted to link my cygwin compiled binary with MKL, Intel Math Kernel Library, dlls, I could not find any information from the Internet. It might be, but I just couldn't. If someone knows the place of proper instruction. Please let me know. This time, I just post this for the others convenience. This is what I did to link cygwin compiled binary with MKL dlls. I'm not sure all of the functions MKL provided work well in this way. I just tested a few functions I needed to use. You need DUMPBIN.EXE and the other programs and dlls called by DUMPBIN. These are parts of MS Visual Studio. The following instruction will make the import library for mkl_p3.dll. You will need to make mkl_lapack32.a and mkl_lapack64.a to use LAPACK functions. 1. Obtain the list of exported symbols DUMPBIN /EXPORTS mkl_p3.dll > mkl_p3.def 2. Edit the def as proper .def. Input "EXPORTS" at the top. remove all word except mkl_funcname. like this. -------------- EXPORTS mkl_caxpy mkl_caxpyi mkl_ccopy .... -------------- 3. Create the import library dlltool --def mkl_p3.def --dllname mkl_p3.dll --output-lib mkl_p3.a At this point, you can call mkl_funcname functions form your c program. To link with FORTRAN, you have to make wrapper programs like this. void sgemm_(char *transa,char *transb,int *m,int *n,int *k,float *alpha,float *a,int *lda,float *b,int *ldb,float *beta,float *c,int *ldc) { mkl_sgemm(transa,transb,m,n,k,alpha,a,lda,b,ldb,beta,c,ldc); } Because FORTRAN needs trailed '_' and mkl provides headed 'mkl_' for symbols. To replace libf77blas.a or liblapack.a. Something more should be done. I myself have not done it. If someone successfully made the replaceable library. Please let me know. Thank you. References Intel Math Kernel Library 5.1 User Notes MSDN Knowledge Base: HOWTO:Create 32-bit Import Libraries Without .OBJs or Source Cygwin User's Guide: Building and Using DLLs Takashi -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/