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 9205085
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:52:08+00:00 2026-06-17T23:52:08+00:00

I want to compile this C code with MKL, but when I run it

  • 0

I want to compile this C code with MKL, but when I run it using the command mpicc -mkl mkl_thread.c, it gives me an error about an unrecognized command line option -mkl. When I run it as mpicc mkl_thread.c -o mkl_thread, it gives a different error, saying “undefined reference to `MKL_Set_Num_Threads'”. I don’t know how I can run it with or link with MKL.

My code is:

define NUM_PROCS 5 

int main (int argc, char ** argv)

{

    int threads_per_proc[NUM_PROCS] = { 1,2 ,3, 4,5 };
    int rank;
    MPI_Init(&argc, &argv);
    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
    // ...
    // Signal an error if rank >= 5
    // ...
    mkl_set_num_threads(threads_per_proc[rank]);
    MPI_Finalize();
}
  • 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-17T23:52:10+00:00Added an answer on June 17, 2026 at 11:52 pm

    -mkl is an Intel specific option which can not be recognized by mpicc.

    For non-Intel compiler, you could specify the link options explicitly.

    $ mpicc mkl_thread.c -o mkl_thread \
            -I$(MKLROOT)/include -L$(MKLROOT)/lib/intel64 \
            -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core \
            -liomp5 -lpthread -lm
    

    Please refer to Intel® Math Kernel Library Link Line Advisor for other link options.

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

Sidebar

Related Questions

I have C code and I want to compile and run this code in
I want to compile the Rigi source code but I get some error while
This code below compiles fine with VS2010 but doesn't want to compile with gcc
I have difficulty in using the vb code dom. Basically, I want to compile
How do you compile assembly code using Visual Studio? I want to compile and
This code does not want to compile. So I tried making the time text
I have this code, but it won't compile and i can't understand what is
I've installed Code::Blocks with MinGW and OpenCV 2.4.3. I want to compile this simple
Ideally I want a function something like the following (this example doesn't compile): void
I want to compile the data for reporting purpose, using php communicating with postgres,

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.