Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29034 Discussions

ifort 9.0: undef reference "__ctype_b"

fuchs
Beginner
858 Views
Hi everyone,

I get linker errors like:
tecxxx.cpp:(.text+0xe7): undefined reference to `__ctype_b'

when I compile&link a small fortran code `test.f':
program test; call tecini; end

against tecio.a (renamed to libtecio.a):
ifort test.f -ltecio

on my system (Debian, libc6_2.3.5-6, ifort 9.0, tecplot 10)

Obviously I cannot modify the tecplot library.
What can I do ? Is there a workaround ? Maybe a simple wrapper __ctype_b -> __ctype_b_loc ?

Thanks,
Christian
0 Kudos
5 Replies
TimP
Honored Contributor III
858 Views
This has nothing to do with ifort. Your outdated libtecio.a requires an old version of C library support. glibc 2.3 made an incompatible change in "string.h". If someone decided that long ago to commit to this commercial package, they might have considered the perpetual license.
0 Kudos
ronaldo_alves
Beginner
858 Views
Hi tim,
I got the same error. Actually the complete error was:
$ ifc -o teste1 teste1.f90
program TESTE

5 Lines Compiled
/opt/intel/compiler70/ia32/lib/libIEPCF90.a(f90file.o)(.text+0x4746): In function 'FileOpen':
: undefined reference to 'errno'
/opt/intel/compiler70/ia32/lib/libIEPCF90.a(f90fioerr.o)(.text+0x4d3): In function 'f_f77ioerr':
: undefined reference to 'errno'
/opt/intel/compiler70/ia32/lib/libIEPCF90.a(f90fioerr.o)(.text+0x6d9): In function 'f_fiomess.':
: undefined reference to 'errno'
/opt/intel/compiler70/ia32/lib/libIEPCF90.a(f90fioerr.o)(.text+0x76b): In function 'f_seterrno':
: undefined reference to 'errno'

The program teste1.f90 consists of:
program teste
x = 1
y = 2 + x
write(*,*)
end program teste


I read about the old C libraries, but I didn't understand it well. How do I identify the obsolete libraries? For which ones shall I replace?

Thanks
Ronaldo
UFRJ-Brazil.
0 Kudos
TimP
Honored Contributor III
858 Views
This is not necessarily related to the problem of the previous posts. If you have updated your glibc (perhaps as a consequence of updating linux) since you installed ifc 7.x, you could try removing the ifc installation and repeating it. If you are trying to use ifc 7.x with a newer version of linux, you may have to figure out yourself which glibc library satisfies the errno reference, and add it to the link line e.g.
if
nm libsomething.a | grep errno
or
cat libsomething.so |grep erron
shows that libsomething contains errno,
add
-lsomething
to your command line.
gcc -print-search-dirs
would show the library search paths which you should consider.
This may be among the reasons why currently supported ifort versions check the gcc library paths at compile time.
0 Kudos
andrewritzmann
Beginner
858 Views

Hi Christian,

You might consider downloading the source for tecio from the following location and compiling it with your version of gcc. This should resolve any issues with incompatible types.

http://download.tecplottalk.com/tecio/

Best Regards,

Andrew

0 Kudos
Steven_L_Intel1
Employee
858 Views
Note that this thread is more than three and a half years old.
0 Kudos
Reply