Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7956 Discussions

Openmp aborted without error message

jackyjngwn
Beginner
505 Views
Hi,

I am compiling and linking an application, but have got problems with openmp.

My application is compiled using gcc 4.6.1, but uses some existing vendor modules, which requires libomp5. I link the modules and my own object files using

g++ -lpthread -liomp5 -L/lib

The application was compiled successfully, but when it was executed, it aborted at the first openmp function. When I set KMP_VERSION 1, I got the following output:

Intel OMP performance library (dynamic) ver. 20080215 (C) Copyright 1997-2008 by Intel Corporation

Intel OMP library built: Feb 15 2008, 11:58:08 using Intel C++ Compiler 10.1

Intel OMP port library

Intel OMP nested library

Intel OMP alternative compiler support

Intel OMP sibling library

Intel OMP no tracefile support

Intel OMP no consistency checking support

Intel OMP INTEGER*8 dynamic dispatch support

Intel OMP INTEGER*8 dynamic scheduling support

Intel OMP Helper Thread support

Intel OMP debugger support version 1.1

Abort

I then tried to use the latest libiomp5, but still the application aborted at the same place. Could someone help me with it? Thanks.

0 Kudos
9 Replies
Anoop_M_Intel
Employee
505 Views
Hi

Please try the same with the library compiled using the latest Intel C++ Compiler 12.0 Update 6. I can see from the log that the library used in this application is compiled using Intel C++ Compiler 10.1. You can download the latest compiler from our registration center.

Thanks and Regards
Anoop
0 Kudos
Anoop_M_Intel
Employee
505 Views
Hi

I just saw that you have also tried with the latest libiomp5. Which version did you use? Also was wondering if you are encountering the same error when you execute the application compiled with icc..

Thanks and Regards
Anoop
0 Kudos
jackyjngwn
Beginner
505 Views
Thanks for your reply.

Yes, I did try with Intel Compiler 2011.2.137. I got the same error.

0 Kudos
Anoop_M_Intel
Employee
505 Views

It will be great if you can share the testcase so that I can troubleshoot it here.

Regards
Anoop

0 Kudos
Anoop_M_Intel
Employee
505 Views
Hi

Please try the following command:

g++ -fopenmp filename.cpp -liomp5 -L /lib

without -fopenmp, the #pragma statements will be simply neglected. AlsoFYI openmp library implies pthread library. So we need not explicitly specify that. You can use ldd command to check the contents of any dynamic library.

let me know if this works.

Regards
Anoop

0 Kudos
TimP
Honored Contributor III
505 Views
When you check
ldd a.out
you should assure that you haven't linked both libiomp5 and libgomp. libgomp has improved greatly since libiomp5 was first introduced, so the most likely reason for linking with libiomp5 is to support an application which includes Intel as well as gnu OpenMP compilation, or so as to support features specific to libiomp5.
0 Kudos
jackyjngwn
Beginner
505 Views

I do have both libiomp5 and libgomp linked. How can I avoid that? Thanks.

0 Kudos
TimP
Honored Contributor III
505 Views
In order to avoid linking libgomp, you would avoid setting -fopenmp in your link step, as well as deleting any explicit reference -lgomp. You would set -fopenmp only for making .o files, and you could not build from source files in your link step.
If you had any references to libgomp which aren't taken care of by current libiomp5, it might be that your gcc is too new for full compatibility with libiomp5, and I would advise filing a case on premier.intel.com demonstrating this. You can't run with more than 1 OpenMP library linked in, so I suspect that may be the cause of your problem.
On the other hand, if you link normally with libgomp, you would remove any reference to -liomp5 or libiomp5.
As I hinted, I would use libiomp5 only if you wish compatibility for objects compiled with icc -openmp (or -parallel). If you made any explicit calls to kmp_ functions, those would not be supported with libgomp.
If you use MKL threaded, you must choose either the gnu/libgomp compatible library or the libiomp5 compatible library.
0 Kudos
jackyjngwn
Beginner
505 Views
I followed your advice and compiled and linked the application again. The application was built successfully, and I made sure that libgomp was not linked. However, the application still aborted as before.

Any idea?

thanks.
0 Kudos
Reply