OTB Applications which use OpenMP cannot be loaded with gcc version < 4.3.0
Mantis Issue 975, reported by msavinaud, assigned to msavinaud, created: 2014-09-26
With a gcc 4.1.1 and OTB 4.0 (OC platform, RedHat 5) the application HomologousPointsExtraction fails to be loaded. It is due to the fact that with this version of gcc openMP is build with the option nodlopen flag.
This issue have been already reported to gcc by other users which use the same mechanism of plug-in [1]. Issue have been corrected with the gcc 4.3.0.
[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=28482
I propose to add an option OTB_USE_OPENMP which the default value is ON.
Other solution but more complex and time consuming is to made a try_run test after the find_package(OpenMP) into the otbsiftfast CMakeLists.txt. This try_run test will work with a main which try to load a plugin with OpenMP code and return the status.
1417450219 - rashadkmOpenMP is bundled with gcc (libgomp) and other compilers. As this bug is specific to a gcc < 4.3 the possible solutions are:
- Upgrade gcc compiler. 4.9.1 being the latest (good but may wreck other libs relying on gcc 4.3)
- disable openmp support in OTB and issue a warning.
- rebuild gcc 4.3 with the patch from bugzilla tracker (https://gcc.gnu.org/bugzilla/attachment.cgi?id=14788&action=edit)
1418223671 - rashadkmI tried to reproduce this on centos5 and OTB 4.2.1 but didnt work.
I have otbcli_HomologousPointsExtraction afer build
Also cmake says:
-- Found OpenMP: -fopenmp
-- Enabling OpenMP support
As opposed to INSTALL[1] in siftfast.
"Note that OpenMP is available only on gcc versions >= 4.2." If that is the case the gcc4.1 wont have openmp
and gcc --version says: gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-55)
[1] http://hg.orfeo-toolbox.org/OTB/file/8881c66c4899/Utilities/otbsiftfast/INSTALL
1418653896 - mickaelThe migration of gcc to 4.1.2