- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am new to Intel and I face a strange problem on defining MPI_INT as long int.
Problem: I add
#define MKL_INT long int
at the very beginning of the provided example <mklroot>/examples/examples_core_c.tgz/spblasc/source/sparse_trsv.c, and the output data for mkl_sparse_d_trsv is [1.0, 5.0, 3.0, 4.0, -13.0], which is incorrect, while no issue is raised when compling.
If I don't add that #define sentence, everything is fine and the output data is the correct answer [1.0, 7.0, 1.0, 6.0, -55.0].
The working environment:
- Ubuntu 18.04.1 with x86_64 GNU/Linux kenel 4.18.0-25-generic
- Intel(R) Math Kernel Library Version 2020.0.0 Product Build 20191122 for Intel(R) 64 architecture applications with Processor optimization: Intel(R) AVX2 enabled processors
- gcc-4.9.3 (Ubuntu 4.9.3-13ubuntu2)
- compiling command: gcc sparse_trsv.c -lmkl_rt -I<mklroot>/include -L<mklroot>/lib/intel64 -Wall
- CPU if helpful: Intel® Core™ i7-8700
Any advice or solution is welcome.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Liangxi,
MKL has different interface libraries: lp64 and ilp64 version, which use different definition of MKL_INT (see mkl_types.h). You cannot redefine MKL_INT in your code to a binary incompatible type.
Please, refer to https://software.intel.com/en-us/articles/a-new-linking-model-single-dynamic-library-mkl_rt-since-intel-mkl-103if you want use long integers and the single dynamic library (mkl_rt). There you can read how to set the interface library which will be used (either through an environment variable MKL_INTERFACE_LAYER or via mkl_set_interface_layer(MKL_INTERFACE_ILP64).
Best,
Kirill
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Liangxi,
MKL has different interface libraries: lp64 and ilp64 version, which use different definition of MKL_INT (see mkl_types.h). You cannot redefine MKL_INT in your code to a binary incompatible type.
Please, refer to https://software.intel.com/en-us/articles/a-new-linking-model-single-dynamic-library-mkl_rt-since-intel-mkl-103if you want use long integers and the single dynamic library (mkl_rt). There you can read how to set the interface library which will be used (either through an environment variable MKL_INTERFACE_LAYER or via mkl_set_interface_layer(MKL_INTERFACE_ILP64).
Best,
Kirill
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Kirill,
thank you for your answer. At this time everything goes well.
Best,
Xin
Voronin, Kirill (Intel) wrote:Hello Liangxi,
MKL has different interface libraries: lp64 and ilp64 version, which use different definition of MKL_INT (see mkl_types.h). You cannot redefine MKL_INT in your code to a binary incompatible type.
Please, refer to https://software.intel.com/en-us/articles/a-new-linking-model-single-dyn... you want use long integers and the single dynamic library (mkl_rt). There you can read how to set the interface library which will be used (either through an environment variable MKL_INTERFACE_LAYER or via mkl_set_interface_layer(MKL_INTERFACE_ILP64).
Best,
Kirill
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page