Find the answer to your Linux question:
Results 1 to 7 of 7
Hello, well as you may suspect, my problem is that i made a program in linux Knoppi and when i try to run it in another distro (tried fedora & ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2004
    Posts
    8

    Made code in Knoppix and its not running in Mandrake


    Hello, well as you may suspect, my problem is that i made a program in linux Knoppi and when i try to run it in another distro (tried fedora & mandrake) it doesnt run. Im using functions like fork,execvp and pipes. When i compile it in the other versions of linux its ok, the problem comes when i execute it.Hope anyone can tell me something about this.Thanks.

  2. #2
    Linux Newbie
    Join Date
    Oct 2004
    Posts
    158
    There is no binary compatibilty (meaning to compile an image in one distro then copy it to a different one and run it there) guaranteed among
    linux distributions.

    Each shared library of each distro is different, because they are implemented in special ways to accomodate kernel peculiarities for a particular distro.

    For example, execve may call a completely different entry point in Mandrake vs RedHat - or simply be a wrapper for a syscall.

    In other words, don't do it.

  3. #3
    Linux User
    Join Date
    Oct 2004
    Location
    /dev/random
    Posts
    404
    Quote Originally Posted by jim mcnamara
    There is no binary compatibilty (meaning to compile an image in one distro then copy it to a different one and run it there) guaranteed among
    linux distributions.

    Each shared library of each distro is different, because they are implemented in special ways to accomodate kernel peculiarities for a particular distro.

    For example, execve may call a completely different entry point in Mandrake vs RedHat - or simply be a wrapper for a syscall.

    In other words, don't do it.
    No..
    The userspace libs (and most of the kernel space functions too) are the same - mostly(99%). It's linux afterall and not something different. The only things that would change are their entry point addresses - which would be taken care of by the linker while compiling the user program.

    The only places where the distros differ are how they refer to things, how they package things and where they store things. But that should not hamper the user program - unless it is using explicit full paths which MAY differ in various distros.

    @Rauldinho,
    Could you give what errors are you getting exactly?
    Since you're compiling the code on mandrake - and it's getting compiled and linked properly too - I don't think there should be any problem with the libs.
    The Unforgiven
    Registered Linux User #358564

  4. #4
    don
    don is offline
    Linux Newbie
    Join Date
    Apr 2004
    Posts
    101
    For example, execve may call a completely different entry point in Mandrake vs RedHat - or simply be a wrapper for a syscall.
    Adding to this discussion, execve is a POSIX system call and its implementation is standard not only in Linux, but also in all other POSIX compliant systems. It may be enhanced by some OSes but for complainace it has to support common bare minimum features.

    Distro makers do customize the kernel for distro specific optimizations, but they do not change linux( the kernel that is) too drastically. Also standard libraries and paths remain the same.
    I\'m just a simple fisherman blessed with a lot of friends

  5. #5
    Just Joined!
    Join Date
    Oct 2004
    Posts
    8
    well the_unforgiven the program compiles and links ok, but the problem comes when i run it, it just hangs. I have to close it from the system guard the process that the program starts, thats the problem im getting

  6. #6
    Linux User
    Join Date
    Oct 2004
    Location
    /dev/random
    Posts
    404
    Quote Originally Posted by don
    For example, execve may call a completely different entry point in Mandrake vs RedHat - or simply be a wrapper for a syscall.
    Adding to this discussion, execve is a POSIX system call and its implementation is standard not only in Linux, but also in all other POSIX compliant systems. It may be enhanced by some OSes but for complainace it has to support common bare minimum features.

    Distro makers do customize the kernel for distro specific optimizations, but they do not change linux( the kernel that is) too drastically. Also standard libraries and paths remain the same.
    POSIX does not specify how the IMPLEMENTATION should be done - it just specifies how the INTERFACE should look like.

    BTW, for people who do not know what POSIX is, it is Portable Operating System Interface and Computing Services (originally, spelled as POSICS).
    It is a standard/specification that specifies practices or conventions to be followed for making programs portable across operating systems. The kernel of the OS can also conform to this standard.
    It follows the same tradition of naming as MULTICS, UNIX (originally, UNICS)
    MULTICS => MULTIplexed Computing Services
    UNICS (or UNIX) => UNIplexed Computing Services

    Now that tradition is broken by new unices like BSD, Hurd and Linux... :P

    @Rauldinho,
    Well, it didn't help at all :P
    Perhaps the program is really running, you can check it with something like top (command line) or gtop (GUI)
    You could also try and find out whether it gives errors or hangs at a particular system call by using various profiling tools like valgrind (http://valgrind.kde.org), strace (for tracing system calls) or any other profiler.
    The Unforgiven
    Registered Linux User #358564

  7. #7
    Linux Guru
    Join Date
    Apr 2003
    Location
    London, UK
    Posts
    3,284
    Quote Originally Posted by Rauldinho
    well the_unforgiven the program compiles and links ok, but the problem comes when i run it, it just hangs. I have to close it from the system guard the process that the program starts, thats the problem im getting
    More than likely its a bug in your program rather than a problem with the distro you are running it on. Maybe run it through a debugger on the system is having the problem's, or post the code that is not working here.

    Also make sure when you compile your program you use "-Wall" in your GCC line's and make sure your code compiles cleanly without any warnings or errors.

Posting Permissions

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