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

linking problem under F90

luer21
Beginner
1,773 Views
I am trying to run a simple code(hello.f90) under linux using F90. (code is shown as follows):
> > program hello
> > !
> > implicit none
> > !
> > write ( *, '(a)' ) ' '
> > write ( *, '(a)' ) 'hello:'
> > write ( *, '(a)' ) ' '
> > write ( *, '(a)' ) ' hello, world!'
> > write ( *, '(a)' ) ' '
> >
> > stop
> > end
when I compiled it, it was fine:
>ifc -w90 -c -o -quiet hello.o hello.f90
but linking showed problems:
>/compat/linux/usr/bin/ld hello.o

/compat/linux/usr/bin/ld: warning: cannot find entry symbol _start; defaulting to 08048074
hello.o: In function `MAIN__':
hello.o(.text+0x10): undefined reference to `__intel_proc_init'
hello.o(.text+0x1a): undefined reference to `for_set_reentrancy'
hello.o(.text+0x52): undefined reference to `for_write_seq_fmt'
hello.o(.text+0x8a): undefined reference to `for_write_seq_fmt'
hello.o(.text+0xc2): undefined reference to `for_write_seq_fmt'
hello.o(.text+0xfa): undefined reference to `for_write_seq_fmt'
hello.o(.text+0x141): undefined reference to `for_write_seq_fmt'
hello.o(.text+0x158): undefined reference to `for_stop_core'
I do not know if my command is not correct or some other problems. could anyone help solve this problem?
thanks!
0 Kudos
3 Replies
Steven_L_Intel1
Employee
1,773 Views
You should link using ifc (or ifort if 8.0), as the Fortran driver supplies the necessary libraries. If you must use ld directly, see the Fortran User Manual for the libraries to use.
0 Kudos
luer21
Beginner
1,773 Views
I tried as you said, but it did not work. I just saw an old message on the board about installing intel fortran complier on FreeBSD. you metioned FreeBSD isn't one of the supported platforms. actually our fortran complier is installed on FreeBSD. Is that the real reason caused such a problem?
0 Kudos
TimP
Honored Contributor III
1,773 Views
Check that the compiler environment paths are set up for the linker to find the libraries installed by the Intel compiler. Non-support of FreeBSD may mean only that someone must set up those paths manually. The environment variable scripts which come with the compiler are provided to accomplish this under tcsh or bash, when running on linux.
0 Kudos
Reply