2013-09-27 1 views
1

컴파일 오류가 발생했습니다. 이해할 수 없습니다. 라이브러리 중 하나의 함수에 대해 불평하고 있습니다. Windows 또는 Redhat에서 컴파일하면이 오류가 발생하지 않으며 내 우분투 12.04에서만 발생합니다. 이 문제의 원인을 찾도록 도와주세요. 인터넷에서 다른 게시물을 보았지만 해결책은 없습니다.FORTRAN : '_start'함수에서 crt1.o의 메인에 대한 정의되지 않은 참조

여기 컴파일러 출력입니다 :

mpif90 -w -ffree-line-length-256  -c blah -I/usr/local/dislin/ifc/ -lm 
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info):  relocation  0  has invalid symbol index 10 

/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/crt1.o: In function `_start': 
(.text+0x20): undefined reference to `main' 
collect2: ld returned 1 exit status 
Process terminated with status 1 (0 minutes, 1 seconds) 
1 errors, 0 warnings (0 minutes, 1 seconds) 

코드 자체가 그래서 그것을 모두를 게시 할 수 없습니다 크지 만 어쨌든 연결 단계가 문제이며 나는 그것이 내 시스템이 아닌 코드 생각 보인다.

내가 gfortran과 함께 MPICH2에게 mpif90 1.4.1 래퍼를 사용하고 4.6.3

편집 :

  -------------- Build: Debug in K2 (compiler: mpif90 from GNU Fortran Compiler)--------------- 

    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2common.F90 -o obj/Debug/Dropbox/Codes/K2/K2common.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2matrix.F90 -o obj/Debug/Dropbox/Codes/K2/K2matrix.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2common_parallel.F90 -o obj/Debug/Dropbox/Codes/K2/K2common_parallel.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2eispack.F90 -o obj/Debug/Dropbox/Codes/K2/K2eispack.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2advectxi.F90 -o obj/Debug/Dropbox/Codes/K2/K2advectxi.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2collsee.F90 -o obj/Debug/Dropbox/Codes/K2/K2collsee.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2convertf.F90 -o obj/Debug/Dropbox/Codes/K2/K2convertf.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2advectyr.F90 -o obj/Debug/Dropbox/Codes/K2/K2advectyr.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2advectpi.F90 -o obj/Debug/Dropbox/Codes/K2/K2advectpi.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2timestep.F90 -o obj/Debug/Dropbox/Codes/K2/K2timestep.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2hydro.F90 -o obj/Debug/Dropbox/Codes/K2/K2hydro.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2tests.F90 -o obj/Debug/Dropbox/Codes/K2/K2tests.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2maxwell.F90 -o obj/Debug/Dropbox/Codes/K2/K2maxwell.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2parameters.F90 -o obj/Debug/Dropbox/Codes/K2/K2parameters.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2rotate.F90 -o obj/Debug/Dropbox/Codes/K2/K2rotate.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2advectp_VL.F90 -o obj/Debug/Dropbox/Codes/K2/K2advectp_VL.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2correctE.F90 -o obj/Debug/Dropbox/Codes/K2/K2correctE.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2advectp.F90 -o obj/Debug/Dropbox/Codes/K2/K2advectp.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2initialise.F90 -o obj/Debug/Dropbox/Codes/K2/K2initialise.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2collsie.F90 -o obj/Debug/Dropbox/Codes/K2/K2collsie.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2transport.F90 -o obj/Debug/Dropbox/Codes/K2/K2transport.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2advectyr4.F90 -o obj/Debug/Dropbox/Codes/K2/K2advectyr4.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2advectxp.F90 -o obj/Debug/Dropbox/Codes/K2/K2advectxp.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2fluxes.F90 -o obj/Debug/Dropbox/Codes/K2/K2fluxes.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2calcGHi.F90 -o obj/Debug/Dropbox/Codes/K2/K2calcGHi.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2output.F90 -o obj/Debug/Dropbox/Codes/K2/K2output.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2maxwell2.F90 -o obj/Debug/Dropbox/Codes/K2/K2maxwell2.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2advecty.F90 -o obj/Debug/Dropbox/Codes/K2/K2advecty.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2gridi.F90 -o obj/Debug/Dropbox/Codes/K2/K2gridi.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2extras.F90 -o obj/Debug/Dropbox/Codes/K2/K2extras.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2magnetic.F90 -o obj/Debug/Dropbox/Codes/K2/K2magnetic.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2ohms.F90 -o obj/Debug/Dropbox/Codes/K2/K2ohms.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2collsee_ani.F90 -o obj/Debug/Dropbox/Codes/K2/K2collsee_ani.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2advectp_cubic.F90 -o obj/Debug/Dropbox/Codes/K2/K2advectp_cubic.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2advectp_chang.F90 -o obj/Debug/Dropbox/Codes/K2/K2advectp_chang.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2evolveEB.F90 -o obj/Debug/Dropbox/Codes/K2/K2evolveEB.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2advectx_ppm.F90 -o obj/Debug/Dropbox/Codes/K2/K2advectx_ppm.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2smooth.F90 -o obj/Debug/Dropbox/Codes/K2/K2smooth.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2hybrid.F90 -o obj/Debug/Dropbox/Codes/K2/K2hybrid.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2grid.F90 -o obj/Debug/Dropbox/Codes/K2/K2grid.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2advectyr2.F90 -o obj/Debug/Dropbox/Codes/K2/K2advectyr2.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2collsii.F90 -o obj/Debug/Dropbox/Codes/K2/K2collsii.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2unused.F90 -o obj/Debug/Dropbox/Codes/K2/K2unused.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2momentsi.F90 -o obj/Debug/Dropbox/Codes/K2/K2momentsi.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2colls_ee_gyor.F90 -o obj/Debug/Dropbox/Codes/K2/K2colls_ee_gyor.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2single.F90 -o obj/Debug/Dropbox/Codes/K2/K2single.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2initial_calcs.F90 -o obj/Debug/Dropbox/Codes/K2/K2initial_calcs.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2calcGH.F90 -o obj/Debug/Dropbox/Codes/K2/K2calcGH.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2moments.F90 -o obj/Debug/Dropbox/Codes/K2/K2moments.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2advecty_rot.F90 -o obj/Debug/Dropbox/Codes/K2/K2advecty_rot.o 
    mpif90 -Jobj/Debug/ -w -ffree-line-length-256  -c /home/mark/Dropbox/Codes/K2/K2advectx.F90 -o obj/Debug/Dropbox/Codes/K2/K2advectx.o 
    mpif90 -o bin/Debug/K2 obj/Debug/Dropbox/Codes/K2/K2common.o obj/Debug/Dropbox/Codes/K2/K2matrix.o obj/Debug/Dropbox/Codes/K2/K2common_parallel.o 
    obj/Debug/Dropbox/Codes/K2/K2eispack.o obj/Debug/Dropbox/Codes/K2/K2advectxi.o 
    obj/Debug/Dropbox/Codes/K2/K2collsee.o obj/Debug/Dropbox/Codes/K2/K2convertf.o 
    obj/Debug/Dropbox/Codes/K2/K2advectyr.o obj/Debug/Dropbox/Codes/K2/K2advectpi.o 
    obj/Debug/Dropbox/Codes/K2/K2timestep.o obj/Debug/Dropbox/Codes/K2/K2hydro.o 
    obj/Debug/Dropbox/Codes/K2/K2tests.o obj/Debug/Dropbox/Codes/K2/K2maxwell.o 
    obj/Debug/Dropbox/Codes/K2/K2parameters.o obj/Debug/Dropbox/Codes/K2/K2rotate.o 
     obj/Debug/Dropbox/Codes/K2/K2advectp_VL.o obj/Debug/Dropbox/Codes/K2/K2correctE.o 
     obj/Debug/Dropbox/Codes/K2/K2advectp.o obj/Debug/Dropbox/Codes/K2/K2initialise.o 
     obj/Debug/Dropbox/Codes/K2/K2collsie.o obj/Debug/Dropbox/Codes/K2/K2transport.o 
     obj/Debug/Dropbox/Codes/K2/K2advectyr4.o obj/Debug/Dropbox/Codes/K2/K2advectxp.o 
     obj/Debug/Dropbox/Codes/K2/K2fluxes.o obj/Debug/Dropbox/Codes/K2/K2calcGHi.o 
     obj/Debug/Dropbox/Codes/K2/K2output.o obj/Debug/Dropbox/Codes/K2/K2maxwell2.o 
     obj/Debug/Dropbox/Codes/K2/K2advecty.o obj/Debug/Dropbox/Codes/K2/K2gridi.o 
     obj/Debug/Dropbox/Codes/K2/K2extras.o obj/Debug/Dropbox/Codes/K2/K2magnetic.o 
     obj/Debug/Dropbox/Codes/K2/K2ohms.o obj/Debug/Dropbox/Codes/K2/K2collsee_ani.o 
     obj/Debug/Dropbox/Codes/K2/K2advectp_cubic.o obj/Debug/Dropbox/Codes/K2/K2advectp_chang.o 
     obj/Debug/Dropbox/Codes/K2/K2evolveEB.o obj/Debug/Dropbox/Codes/K2/K2advectx_ppm.o 
     obj/Debug/Dropbox/Codes/K2/K2smooth.o obj/Debug/Dropbox/Codes/K2/K2hybrid.o 
     obj/Debug/Dropbox/Codes/K2/K2grid.o obj/Debug/Dropbox/Codes/K2/K2advectyr2.o 
     obj/Debug/Dropbox/Codes/K2/K2collsii.o obj/Debug/Dropbox/Codes/K2/K2unused.o 
     obj/Debug/Dropbox/Codes/K2/K2momentsi.o obj/Debug/Dropbox/Codes/K2/K2colls_ee_gyor.o 
     obj/Debug/Dropbox/Codes/K2/K2single.o obj/Debug/Dropbox/Codes/K2/K2initial_calcs.o 
     obj/Debug/Dropbox/Codes/K2/K2calcGH.o obj/Debug/Dropbox/Codes/K2/K2moments.o 
      obj/Debug/Dropbox/Codes/K2/K2advecty_rot.o obj/Debug/Dropbox/Codes/K2/K2advectx.o -I/usr/local/dislin/ifc/ -lm 
    /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 0 has invalid symbol index 10 
    /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 1 has invalid symbol index 11 
    /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 2 has invalid symbol index 2 
    /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 3 has invalid symbol index 2 
    /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 4 has invalid symbol index 10 
    /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 5 has invalid symbol index 12 
    /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 6 has invalid symbol index 12 
    /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 7 has invalid symbol index 12 
    /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 8 has invalid symbol index 2 
    /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 9 has invalid symbol index 2 
    /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 10 has invalid symbol index 11 
    /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 11 has invalid symbol index 12 
    /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 12 has invalid symbol index 12 
    /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 13 has invalid symbol index 12 
    /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 14 has invalid symbol index 12 
    /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 15 has invalid symbol index 12 
    /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 16 has invalid symbol index 12 
    /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 17 has invalid symbol index 12 
    /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 18 has invalid symbol index 12 
    /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 19 has invalid symbol index 12 
    /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 20 has invalid symbol index 19 
    /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/crt1.o: In function `_start': 
    (.text+0x20): undefined reference to `main' 
    collect2: ld returned 1 exit status 
    Process terminated with status 1 (0 minutes, 15 seconds) 
    1 errors, 0 warnings (0 minutes, 15 seconds) 
+0

컴파일러 명령 줄에 소스 파일이나 개체 파일이 표시되지 않습니다. 당신이 그 오류를 범하는 것은 놀라운 일이 아닙니다. –

+0

필자는이 파일을 삭제하여 해당 행을 읽기 쉽도록했습니다 (즉, "멍청이"가 무엇인지). 그러나 게시물을 편집하고 전체 명령 행을 추가합니다. – kotozna

+0

'mpif90 -show'는 무엇을 보여줍니까? –

답변

1

나는 경우 경우에서 알이 오류 : 여기에 내가 명령 줄에 보낼거야 메인 프로그램 (program foo ;-)로 시작하는 오브젝트 파일을 추가하는 것을 잊었습니다. 당신도 그 중 하나를 놓칠 수 있습니까?

+0

예 해결되었습니다! 고맙습니다 :) – kotozna