second trailing underscore in symbols with old compilers

second trailing underscore in symbols with old compilers

I have been trying to build a FOSS package with different compilers. It uses the FFTW2 libraries. So first step is building FFTW2.

FFTW2 builds okay with gcc gfortran (32 or 64-bit) using the -fno-second-underscore flag. This means a symbol containing underscores will get 1 underscore appended instead of 2. I believe the Intel equivalent of this is -assume no2underscores. I can compile FFTW2 with 64-bit version 11.1 of Intel C++ and Fortran compilers, and get 1 underscore at end of symbols. But if I compile with 32-bit version 9.1 or 10.0 and then try "nm librfftw.a", I see 2 underscores at the end of some symbols. If I look at the configure log for FFTW2, it appears to be using -assume no2underscores. I tried putting this compiler option into the ifort.cfg file to make sure, but still get two underscores.

Has anybody encountered this problem in the past?

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

By default, Intel Fortran does not append a second underscore in any case. If you specify -assume 2underscores, then you get two underscores unless the name has an embedded underscore - this is for g77 compatibility. It may be that the old compilers you're using didn't handle this properly - I know the current one does.

Steve - Intel Developer Support

I found another post claiming that this only happens with IA32 compiler. So I installed the version 10.0.026 comilers on two computers with RHEL 5.8. One had 32-bit OS and the other 64-bit. Then built FFTW2 with each.
With 64-bit compiler, got correct underscores. With 32-bit compiler on 64-bit OS, also correct. But on the 32-bit OS, get 2 underscores.
So it is a weird bug. 32-bit compiler only goes wonky when cut off from its 64-bit silbling.
Probably not many people compiling 32-bit code today, but would have been 5 years ago. I am surprised to find few complaints about this.
I can't use the latest version 13 compiler, as it has a problem with another component of the package I wish to install.
I haven't gotten around to trying version 12 compiler yet.

Leave a Comment

Please sign in to add a comment. Not a member? Join today