- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi everyone, I am facing a problem.
Problem:
I installed OneAPI Base Toolkit on my Dell Inspiron 13 7306 which is having Core i5-1135G7. I am running both Windows and Linux (dual boot) on it. First I installed OneAPI Base Toolkit on Linux. After which I compiled and executed the following code but I am unable to use Max Number of Cores / Threads i.e 4 Cores and 8 Threads. In my code I have used
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
SOLVED!
Thank you @Gennady_F_Intel , your answer lead towards the solution.
I used -lmkl_intel_thread intead of -lmkl_sequential. So my compile command was:
g++ -o code code.cpp -I/opt/intel/oneapi/mkl/latest/include -L/opt/intel/oneapi/mkl/latest/lib -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lpthread -lm -ldl
BUT it was giving a new error which was as follows:
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_critical_with_hint'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_end_critical'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_for_static_init_8'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_atomic_float8_add'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_dispatch_next_4'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_master'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_for_static_fini'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_dispatch_init_4u'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_end_reduce'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_flush'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_dispatch_next_8u'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_for_static_init_8u'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_for_static_init_4'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_fork_call'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_dispatch_next_8'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_push_num_threads'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_ordered'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_omp_task_alloc'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_dispatch_init_8u'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_barrier'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_atomic_cmplx8_add'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_omp_task'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_global_thread_num'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_dispatch_init_4'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_critical'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_end_serialized_parallel'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_atomic_fixed4_add'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_omp_task_with_deps'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_reduce_nowait'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_atomic_float4_max'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_end_master'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_single'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_dispatch_fini_8'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_for_static_init_4u'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_dispatch_init_8'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_atomic_fixed8_add'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_atomic_cmplx4_add'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_ok_to_fork'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_end_single'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_dispatch_next_4u'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_end_ordered'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_end_reduce_nowait'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_serialized_parallel'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_atomic_float4_add'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_atomic_float8_max'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_reduce'
collect2: error: ld returned 1 exit status
So here are some changes I made which resolved this error:
1. Used icpx -fsycl as my compiler.
2. Added -liomp5 flag. Reference: Intel MKL Thread
After this my code compiled successfully and executed on max threads or any specified number of threads.
My Final Build Command for the same code is now:
icpx -fsycl -o code code.cpp -I/opt/intel/oneapi/mkl/latest/include -L/opt/intel/oneapi/mkl/latest/lib -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lm -ldl -liomp5 -lpthread
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You have to link this test against -lmkl_intel_thread instead of -lmkl_sequential.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
SOLVED!
Thank you @Gennady_F_Intel , your answer lead towards the solution.
I used -lmkl_intel_thread intead of -lmkl_sequential. So my compile command was:
g++ -o code code.cpp -I/opt/intel/oneapi/mkl/latest/include -L/opt/intel/oneapi/mkl/latest/lib -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lpthread -lm -ldl
BUT it was giving a new error which was as follows:
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_critical_with_hint'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_end_critical'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_for_static_init_8'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_atomic_float8_add'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_dispatch_next_4'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_master'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_for_static_fini'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_dispatch_init_4u'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_end_reduce'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_flush'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_dispatch_next_8u'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_for_static_init_8u'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_for_static_init_4'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_fork_call'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_dispatch_next_8'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_push_num_threads'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_ordered'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_omp_task_alloc'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_dispatch_init_8u'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_barrier'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_atomic_cmplx8_add'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_omp_task'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_global_thread_num'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_dispatch_init_4'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_critical'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_end_serialized_parallel'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_atomic_fixed4_add'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_omp_task_with_deps'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_reduce_nowait'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_atomic_float4_max'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_end_master'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_single'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_dispatch_fini_8'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_for_static_init_4u'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_dispatch_init_8'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_atomic_fixed8_add'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_atomic_cmplx4_add'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_ok_to_fork'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_end_single'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_dispatch_next_4u'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_end_ordered'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_end_reduce_nowait'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_serialized_parallel'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_atomic_float4_add'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_atomic_float8_max'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_reduce'
collect2: error: ld returned 1 exit status
So here are some changes I made which resolved this error:
1. Used icpx -fsycl as my compiler.
2. Added -liomp5 flag. Reference: Intel MKL Thread
After this my code compiled successfully and executed on max threads or any specified number of threads.
My Final Build Command for the same code is now:
icpx -fsycl -o code code.cpp -I/opt/intel/oneapi/mkl/latest/include -L/opt/intel/oneapi/mkl/latest/lib -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lm -ldl -liomp5 -lpthread
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you @Gennady_F_Intel , your answer led towards solution.
I replaced -lmkl_sequential with -lmkl_intel_thread but I was still getting an error.
Error:
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_critical_with_hint'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_end_critical'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_for_static_init_8'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_atomic_float8_add'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_dispatch_next_4'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_master'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_for_static_fini'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_dispatch_init_4u'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_end_reduce'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_flush'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_dispatch_next_8u'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_for_static_init_8u'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_for_static_init_4'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_fork_call'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_dispatch_next_8'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_push_num_threads'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_ordered'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_omp_task_alloc'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_dispatch_init_8u'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_barrier'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_atomic_cmplx8_add'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_omp_task'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_global_thread_num'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_dispatch_init_4'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_critical'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_end_serialized_parallel'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_atomic_fixed4_add'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_omp_task_with_deps'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_reduce_nowait'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_atomic_float4_max'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_end_master'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_single'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_dispatch_fini_8'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_for_static_init_4u'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_dispatch_init_8'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_atomic_fixed8_add'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_atomic_cmplx4_add'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_ok_to_fork'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_end_single'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_dispatch_next_4u'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_end_ordered'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_end_reduce_nowait'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_serialized_parallel'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_atomic_float4_add'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_atomic_float8_max'
/usr/bin/ld: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so: undefined reference to `__kmpc_reduce'
To solve this:
- I used icpx compiler instead of g++.
- I added -liomp5 flag. (Reference to this change: Intel MKL Thread)
After appending these changes my code successfully compiled and executed with multiple threads.
My final build command now is:
icpx -fsycl -o test test.cpp -I/opt/intel/oneapi/mkl/latest/include -L/opt/intel/oneapi/mkl/latest/lib -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lm -ldl -liomp5 -lpthread
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Gennady_F_Intel I found a solution but upon posting it, it is being marked spam. Tried posting 2 times.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you @Gennady_F_Intel , your answer led towards solution.
I used -lmkl_intel_thread intead of -lmkl_sequential. So my compile command was:
g++ -o code code.cpp -I/opt/intel/oneapi/mkl/latest/include -L/opt/intel/oneapi/mkl/latest/lib -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lpthread -lm -ldl
I replaced -lmkl_sequential with -lmkl_intel_thread but I was still getting an error.
Error: collect2: error: ld returned 1 exit status (Screenshot Attached.)
To solve this:
- I used icpx compiler instead of g++.
- I added -liomp5 flag. (Reference to this change: Intel MKL Thread)
After appending these changes my code successfully compiled and executed with multiple threads.
My final build command now is:
icpx -fsycl -o test test.cpp -I/opt/intel/oneapi/mkl/latest/include -L/opt/intel/oneapi/mkl/latest/lib -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lm -ldl -liomp5 -lpthread
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page