[LLVMdev] llvm-gfortran gives errors on AMD64-Ubuntu

Jun Li jun.li.mcgill at gmail.com
Sat Nov 1 07:04:14 PDT 2008


Hi, 

I have installed llvm and llvm-gfortran on Pentium4 machine using 32-bit
Ubuntu, it works fine. I recently installed them on AMD64-Ubuntu 8.04,
llvm-gfortran gave me following errors 

$ llvm-gfortran -Wall hello.f95 -o hellof

/home/jli127/LLVM/llvm-gcc/install/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.2.1/../../../../lib64/libgfortran.a(error.o):
In function `_gfortrani_gfc_itoa':
(.text+0x76): undefined reference to `__umoddi3'
/home/jli127/LLVM/llvm-gcc/install/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.2.1/../../../../lib64/libgfortran.a(error.o):
In function `_gfortrani_gfc_itoa':
(.text+0x8a): undefined reference to `__udivdi3'
/home/jli127/LLVM/llvm-gcc/install/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.2.1/../../../../lib64/libgfortran.a(list_read.o):
In function `convert_integer':
(.text+0xd7c): undefined reference to `__divdi3'
/home/jli127/LLVM/llvm-gcc/install/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.2.1/../../../../lib64/libgfortran.a(read.o):
In function `_gfortrani_read_radix':
(.text+0x366): undefined reference to `__udivdi3'
/home/jli127/LLVM/llvm-gcc/install/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.2.1/../../../../lib64/libgfortran.a(read.o):
In function `_gfortrani_read_decimal':
(.text+0x603): undefined reference to `__udivdi3'
collect2: ld returned 1 exit status

The program is very simple:
PROGRAM hello
	IMPLICIT NONE
	WRITE (*,*) "Hello World!"
END PROGRAM hello

(2) Can I get LLVM bitcode file and run it as llvm-gcc does? 
It give following errors on both 32bit and 64bit Ubuntu.
$ llvm-gfortran -O3 -emit-llvm hello.f95 -c -o hellof.bc
$ lli hellof.bc
	ERROR : 'main' function not found in module.	
$ llc hellof.bc -o hellof.s
$ gcc hellof.s -o hellof.native
ERROR: 
/usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../lib/crt1.o: In function
`_start':
(.text+0x18): undefined reference to `main'
/tmp/cc4i3wD7.o: In function `MAIN__':
(.text+0x1f): undefined reference to `_gfortran_set_std'
/tmp/cc4i3wD7.o: In function `MAIN__':
(.text+0x4b): undefined reference to `_gfortran_st_write'
/tmp/cc4i3wD7.o: In function `MAIN__':
(.text+0x63): undefined reference to `_gfortran_transfer_character'
/tmp/cc4i3wD7.o: In function `MAIN__':
(.text+0x6b): undefined reference to `_gfortran_st_write_done'
collect2: ld returned 1 exit status

(3) Where can I get the SPEC/polyhedron testsuites?

Thanks
Jun
-- 
View this message in context: http://www.nabble.com/llvm-gfortran-gives-errors-on-AMD64-Ubuntu-tp20280697p20280697.html
Sent from the LLVM - Dev mailing list archive at Nabble.com.




More information about the llvm-dev mailing list