Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9299239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T22:30:48+00:00 2026-06-18T22:30:48+00:00

I have been trying to use Intel MKL in a mex file in MATLAB.

  • 0

I have been trying to use Intel MKL in a mex file in MATLAB. I used the following switches to be able to compile and link, but no success.

>> mex -v myMEX.cpp -I"C:\Program Files (x86)\Intel\ComposerXE-2011\mkl\include\" -L"C:\Program Files (x86)\Intel\ComposerXE-2011\mkl\lib\intel64" -l mkl_intel_lp64.lib -l mkl_core.lib -l mkl_sequential.lib

I get the following error

->    Options file           = C:\Users\Ahd\AppData\Roaming\MathWorks\MATLAB\R2012b\mexopts.bat 
      MATLAB                 = C:\Program Files\MATLAB\R2012b 
->    COMPILER               = cl 
->    Compiler flags: 
         COMPFLAGS           = /c /GR /W3 /EHs /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /DMATLAB_MEX_FILE /nologo /MD 
         OPTIMFLAGS          = /O2 /Oy- /DNDEBUG 
         DEBUGFLAGS          = /Z7 
         arguments           =  -I"C:\Program Files (x86)\Intel\ComposerXE-2011\mkl\include\" 
         Name switch         = /Fo 
->    Pre-linking commands   =  
->    LINKER                 = link 
->    Link directives: 
         LINKFLAGS           = /dll /export:mexFunction /LIBPATH:"C:\Program Files\MATLAB\R2012b\extern\lib\win64\microsoft" libmx.lib libmex.lib libmat.lib /MACHINE:X64 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /incremental:NO /implib:"C:\Users\Ahd\AppData\Local\Temp\mex__fKb2b\templib.x" /MAP:"myMEX.mexw64.map" 
         LINKDEBUGFLAGS      = /DEBUG /PDB:"myMEX.mexw64.pdb" 
         LINKFLAGSPOST       =  
         Name directive      = /out:"myMEX.mexw64" 
         File link directive =  
         Lib. link directive =  
         Rsp file indicator  = @ 
->    Resource Compiler      = rc /fo "mexversion.res" 
->    Resource Linker        =  
---------------------------------------------------------------- 


--> cl  -I"C:\Program Files (x86)\Intel\ComposerXE-2011\mkl\include\" /c /GR /W3 /EHs /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /DMATLAB_MEX_FILE /nologo /MD /FoC:\Users\Ahd\AppData\Local\Temp\mex__fKb2b\myMEX.obj -I"C:\Program Files\MATLAB\R2012b\extern\include" -I"C:\Program Files\MATLAB\R2012b\simulink\include" /O2 /Oy- /DNDEBUG -DMX_COMPAT_32 myMEX.cpp 

Microsoft (R) C/C++ Optimizing Compiler Version 15.00.30729.01 for x64 
Copyright (C) Microsoft Corporation.  All rights reserved. 

cl : Command line warning D9024 : unrecognized source file type 'Files\MATLAB\R2012b\extern\include -IC:\Program', object file assumed 
DNDEBUG -DMX_COMPAT_32 myMEX.cpp 
c1xx : fatal error C1083: Cannot open source file: 'Files\MATLAB\R2012b\simulink\include /O2 /Oy- /DNDEBUG -DMX_COMPAT_32 myMEX.cpp': No such file or directory 

  C:\PROGRA~1\MATLAB\R2012B\BIN\MEX.PL: Error: Compile of 'myMEX.cpp' failed. 

Error using mex (line 206)
Unable to complete successfully.

Could someone please help me?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T22:30:49+00:00Added an answer on June 18, 2026 at 10:30 pm

    Check mexopts.bat file.
    Looks like MATLAB variable is not defined properly, or some path in INCLUDE statement. Consider putting quotes around paths which contain spaces.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to use the following MySQL: SELECT distinct(photos.id) , photos.file ,
I have been trying to use c++/cx StorageFile::ReadAsync() to read a file in a
I have been trying to use an ajax-style file upload component (like the dojox
I have been trying to use Roslyn to parse a solution file and programmatically
I have been trying to use g++ to compile a program with SDL. The
I have been trying to use a formula that is used to work out
I have been trying to use temporary tables along with nhibernate. The following piece
I have been trying to use date_format , however as far as I know,
I have been trying to use array_unique to remove duplicates from the search results
I have been trying to use routes.rb for creating a URL /similar-to-:product (where product

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.