Find the answer to your Linux question:
Results 1 to 5 of 5
I have problems,I get this: milenko@hp6830s:~/mt2ddi$ make mt2ddi f77 -o -m64 driver.o solve_mt2d_direct.o boem.o rotz.o gebolr.o d2emod.o pobo.o mte.o d2hmod.o gsres.o mth.o z1idu.o h1iud.o phase.o /usr/bin/ld.real: unrecognised emulation mode: 64 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    May 2010
    Posts
    44

    /usr/bin/ld.real: unrecognised emulation mode: 64


    I have problems,I get this:
    milenko@hp6830s:~/mt2ddi$ make mt2ddi
    f77 -o -m64 driver.o solve_mt2d_direct.o boem.o rotz.o gebolr.o d2emod.o pobo.o mte.o d2hmod.o gsres.o mth.o z1idu.o h1iud.o phase.o
    /usr/bin/ld.real: unrecognised emulation mode: 64
    Supported emulations: elf_x86_64 elf_i386 i386linux
    collect2: ld returned 1 exit status
    My makefile:
    FFLAGS = -O4 -g
    #CFLAGS = -O -I/usr/openwin/include
    CFLAGS = -O
    LDFLAGS= -L/usr/lib/libf2c.a -m64


    #
    #rules for compiling .f files:
    #
    .f.o:
    $(COMPILE.f) $(FFLAGS) $< $(INCS)
    .c.o:
    $(COMPILE.c) $(CFLAGS) $< $(INCS)
    #---------------------------------------------------------------------------
    #
    # Source objects
    #
    MT2DDI_OBJS= driver.o solve_mt2d_direct.o boem.o rotz.o gebolr.o d2emod.o pobo.o mte.o d2hmod.o gsres.o mth.o z1idu.o h1iud.o phase.o
    #
    # Executable name
    #
    MT2DDI_EXEC=$(EXEDIR)/mt2ddi
    #
    mt2ddi: $(MT2DDI_EXEC)
    $(MT2DDI_EXEC): ${MT2DDI_OBJS}
    f77 -o -m64 ${MT2DDI_OBJS}
    mv main ${MT2DDI_EXEC}

  2. #2
    drl
    drl is offline
    Linux Engineer drl's Avatar
    Join Date
    Apr 2006
    Location
    Saint Paul, MN, USA / CentOS, Debian, Slackware, {Free, Open, Net}BSD, Solaris
    Posts
    1,304
    Hi.

    The f77 command is very old. It was not found on any of the current Linux systems I use: SuSE, CentOS (RedHat), Fedora, Debian, Ubuntu. Try instead:
    Code:
    gfortran -o a.out -m64 ${MT2DDI_OBJS}

    Note that -o for the modern gcc compile sequence usually takes an argument:
    Code:
           -o file
               Place output in file file.  This applies regardless to whatever
               sort of output is being produced, whether it be an executable file,
               an object file, an assembler file or preprocessed C code.
    -- excerpt from man gcc
    In any case, please tell us what Linux you are using. For example, I most often use:
    Code:
    OS, ker|rel, machine: Linux, 2.6.26-2-amd64, x86_64
    Distribution        : Debian GNU/Linux 5.0 (lenny) 
    gfortran GNU Fortran (Debian 4.3.2-1.1) 4.3.2
    Best wishes ... cheers, drl
    Welcome - get the most out of the forum by reading forum basics and guidelines: click here.
    90% of questions can be answered by using man pages, Quick Search, Advanced Search, Google search, Wikipedia.
    We look forward to helping you with the challenge of the other 10%.
    ( Mn, 2.6.n, AMD-64 3000+, ASUS A8V Deluxe, 1 GB, SATA + IDE, Matrox G400 AGP )

  3. #3
    Just Joined!
    Join Date
    May 2010
    Posts
    44
    Thanks drl.Well it is same with gfortran.
    2.6.28-19-generic
    Architecutre is x86_64,I think that I have problem with fortran libraires(64bit issue) so now I am tring to install libf2c2-dev_20090411-2_amd64.

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    May 2010
    Posts
    44
    /usr/lib/gcc/x86_64-linux-gnu/4.3.3/libgfortranbegin.a(fmain.o): In function `main':
    (.text+0x2: undefined reference to `MAIN__'
    collect2: ld returned 1 exit status
    This is what i now get.
    Any ideas?

  6. #5
    drl
    drl is offline
    Linux Engineer drl's Avatar
    Join Date
    Apr 2006
    Location
    Saint Paul, MN, USA / CentOS, Debian, Slackware, {Free, Open, Net}BSD, Solaris
    Posts
    1,304
    Hi.

    Here is a script to show characteristics of a gfortran run. The first part shows the environment, the last part the results:
    #!/usr/bin/env bash

    # @(#) s1 Demonstrate gfortran compile, link, execute.

    # Section 1, setup, pre-solution.
    # Infrastructure details, environment, commands for forum posts.
    # Uncomment export command to test script as external user.
    # export PATH="/usr/local/bin:/usr/bin:/bin"
    set +o nounset
    pe() { for i;do printf "%s" "$i";done; printf "\n"; }
    pl() { pe;pe "-----" ;pe "$*"; }
    C=$HOME/bin/context && [ -f $C ] && . $C gfortran
    set -o nounset
    pe

    # Section 2, display file.
    # Display sample of data file, with head & tail as a last resort.
    pe " || start [ first:middle:last ]"
    specimen main.f suba.f \
    || { pe "(head/tail)"; head -n 5 main.f suba.f pe " ||"; tail -n 5 main.f suba.f ; }
    pe " || end"

    # Section 3, solution.

    pl " Results, object files are:"
    rm -f *.o a.out
    gfortran -c *.f
    gfortran *.o
    file *.o

    pl " Output from executable:"
    ./a.out

    pl " Libraries used by this executable:"
    ldd a.out

    exit 0
    producing:
    Code:
    % ./s1
    
    Environment: LC_ALL = C, LANG = C
    (Versions displayed with local utility "version")
    OS, ker|rel, machine: Linux, 2.6.26-2-amd64, x86_64
    Distribution        : Debian GNU/Linux 5.0 (lenny) 
    GNU bash 3.2.39
    gfortran GNU Fortran (Debian 4.3.2-1.1) 4.3.2
    
     || start [ first:middle:last ]
    Whole: 5:0:5 of 4 lines in file "main.f"
          program main
          write(6,*) " Hello, world from main."
    	  call a
          end
    
    Whole: 5:0:5 of 3 lines in file "suba.f"
          subroutine a
          write(6,*) " Hello, world from subroutine a."
          end
     || end
    
    -----
     Results, object files are:
    main.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped
    suba.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped
    
    -----
     Output from executable:
      Hello, world from main.
      Hello, world from subroutine a.
    
    -----
     Libraries used by this executable:
    	linux-vdso.so.1 =>  (0x00007fffffffe000)
    	libgfortran.so.3 => /usr/lib/libgfortran.so.3 (0x00007f8b8a998000)
    	libm.so.6 => /lib/libm.so.6 (0x00007f8b8a715000)
    	libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007f8b8a4fe000)
    	libc.so.6 => /lib/libc.so.6 (0x00007f8b8a1ab000)
    	/lib64/ld-linux-x86-64.so.2 (0x00007f8b8ac73000)
    Good luck ... cheers, drl
    Welcome - get the most out of the forum by reading forum basics and guidelines: click here.
    90% of questions can be answered by using man pages, Quick Search, Advanced Search, Google search, Wikipedia.
    We look forward to helping you with the challenge of the other 10%.
    ( Mn, 2.6.n, AMD-64 3000+, ASUS A8V Deluxe, 1 GB, SATA + IDE, Matrox G400 AGP )

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •