Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
7056 Discussions

Integrating a C Subfunction for Optimizing R Code

Fio
Beginner
513 Views

Hello,

I have previously asked a question about oneMKL , but I'd like to restate it here. I would appreciate any help. 

I would like to perform the compilation of the following C code (which is saved on the path "C:\Users\Desktop\example.c") directly within the R desktop environment.

#include <stdio.h>
#include <mkl.h>
int main() {
    double x[] = {1.0, 2.0, 3.0};
    double y[] = {4.0, 5.0, 6.0};
    double z;
    // Perform vector multiplication and summation using Intel MKL
    z = cblas_ddot(3, x, 1, y, 1);
    printf("Result: %lf\n", z);
    return 0;
}

I executed the following command in R desktop, but an issue occurred during the process.

> system('icx -o myfunction "C:\\Users\\Desktop\\example.c" /Qmkl /MD')
Intel(R) oneAPI DPC++/C++ Compiler for applications running on Intel(R) 64, Version 2023.1.0 Build 20230320
Copyright (C) 1985-2023 Intel Corporation. All rights reserved.

LINK : fatal error LNK1104: cannot open file 'libiomp5md.lib'
icx: error: linker command failed with exit code 1104 (use -v to see invocation)
[1] 1104

My environment variables are displayed in the image below. 

Fio_0-1695726525055.png

I've installed the Intel® oneAPI Base Toolkit on a Windows platform.

Than you very much.

0 Kudos
1 Reply
IntelSupport
Community Manager
417 Views

Hi,

 

Thanks for posting in Intel communities.

 

Since this is a duplicate thread of "https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Integrating-a-C-Subfunction-for-Optimizing-R-Code-Performance-gt/m-p/1526558#M35165 " , we will no longer monitor this thread. We will continue addressing this issue in the other thread.

 

Thanks & Regards,

Jilani

 

0 Kudos
Reply