Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11
I have compiled a simple c++ program and made an exe file in my computer (i686). now, I want to use on another computer(i586). It gives me " floating point ...
  1. #1
    shk
    shk is offline
    Just Joined!
    Join Date
    Jun 2010
    Posts
    12

    Runing an (c++)exe file on different linux computer

    I have compiled a simple c++ program and made an exe file in my computer (i686). now, I want to use on another computer(i586). It gives me " floating point exception" error!

    I know I should make an exe file compatible with i586, but how? I tried to use -mtune command but it gives me the "command not found ".

    Please tell me how to change the arch option in my compiler or give me some key words to search! I couldn't find useful information in google!

    Best,
    Sh

  2. #2
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    http://www.linuxforums.org/forum/red...ile-linux.html

    the information was given to you in your other thread, you need to pass that argument to g++ when you compile your program

  3. #3
    shk
    shk is offline
    Just Joined!
    Join Date
    Jun 2010
    Posts
    12
    Noo!! they told me to use the -mtune or -march commands but these commands doeasn't work!

    As I explained, when i use these commands, it gives me bace command not found!

  4. #4
    Linux Engineer rcgreen's Avatar
    Join Date
    May 2006
    Location
    the hills
    Posts
    1,114
    As I explained, when i use these commands, it gives me bace command not found!
    Maybe you should explain again. There are a number of arguments
    to the compiler that will help specify what processor you want to run
    the program on. When you use one of these, do you get error messages
    from the compiler? If the program compiles OK, does it run OK on
    the machine you are compiling on and fail on the other machine?
    What commands are you using to compile?

  5. #5
    shk
    shk is offline
    Just Joined!
    Join Date
    Jun 2010
    Posts
    12
    Haah! I am new in linux and I made a mistake! I entered -mtune instead of gcc -mtune!

    -mtune command with out gcc is incorrect and it gave me "command not found" !!!!! Sorry

    You understood my problem mr/s rcgreen.

    (my problem is or was: I can compile "hello world " C code using gcc and make a.out on my computer. I also can run a.out on my computer but when I move a.out to another linux machine " board" I can't run it. when I want to run a.out file using this command "./a.out", It gives me " floating point exception" error!

    And Mr/s Green told me :

    Since my linux systems architecture are different, I should make a an exe file compatible with the target machine, using -mtune and I didn't know how to use -mtune! but now, I know how to use it )



    by the way, thanks a lot .Tomorrow I will check it again

  6. #6
    shk
    shk is offline
    Just Joined!
    Join Date
    Jun 2010
    Posts
    12

    Help again

    Although I changed the gcc option using " gcc -mtune=i586 program-name" command and created an exe file compatible with target cpu, it gives me " floating point exception" error when I want to run the exe code on target Linux board!!!!!

    I am frustrated!!!! My program is just a main function and do nothing!!!!!!! I don't know why an exe file can't be run on different systems!!!

    my computer is i686 (I think with Fedora) and my board is i586 (with pyramid).

  7. #7
    Linux Engineer rcgreen's Avatar
    Join Date
    May 2006
    Location
    the hills
    Posts
    1,114
    Maybe this is a dumb question. Does it run OK on the computer
    you compiled it on? Maybe you should post your code. It might
    have a bug.

  8. #8
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    Try -mtune=i386 instead of 586 (lower common denominator). It may still fail since the i386 will require software math libraries to be available. i586 is a low-end pentium and it will have hardware math, though it is possible that your embedded system does not have such. Can you post the specs of your board?
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  9. #9
    shk
    shk is offline
    Just Joined!
    Join Date
    Jun 2010
    Posts
    12
    Quote Originally Posted by rcgreen View Post
    Maybe this is a dumb question. Does it run OK on the computer
    you compiled it on? Maybe you should post your code. It might
    have a bug.
    Yea, I am sure that it has no bug. I compiled 2 programs:

    1- hello world program. When I run its exe file in my computer, I can see "hello world" expression in the terminal! (the result that I want)

    2- an empty main function without any include and any commands!. I can make exe file without any error and when I run it in my computer, I see no error!

    When I move the exe files of these 2 simple codes to my board and I want to run them, I see " floating point exception" error!!! I have no arithmetic operation in my code and they are really simple! I don't know whats wrong!

    I will check the exe files on another computer so that I find out which one has problem, my boards or exe files!!!

    Thank you very much for your help!

  10. #10
    shk
    shk is offline
    Just Joined!
    Join Date
    Jun 2010
    Posts
    12
    Quote Originally Posted by Rubberman View Post
    Try -mtune=i386 instead of 586 (lower common denominator). It may still fail since the i386 will require software math libraries to be available. i586 is a low-end pentium and it will have hardware math, though it is possible that your embedded system does not have such. Can you post the specs of your board?
    Thanks, I will check it as soon as i get to the lab .

    It's a Metrix Mark II wireless networking kit with Soekris net4526 board and pyramid linux installed on it!!

    It's such a weird board!

Page 1 of 2 1 2 LastLast

Posting Permissions

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