Return to menuGo up
Condor_compile
or: how I learned not to worry and compile for condor

Running a job on condor has a small change of perspective from the normal running of programs. Some of the advanced features of condor need to have the program code relinked using condor's own code linker. In fact, when you compile a program, you use the default system linker (which, in linux, is normally r /usr/bin/ld).

This is needed if you want to use all those languages which link at compile time, like C/C++, Fortran, and so on. It is NOT NEEDED for Java: Java is linked at run time, so you can leave this task to the Java Virtual Machine which will be executed when the job is launched.

The idea here is that you need to replace this default linker with condor's linker. After installing condor, you should do the following (as root, and for a Linux platform):

  • rename the system linker from ld to ld.real

    mv /usr/bin/ld  /usr/bin/ld.real
     

  • copy the condor linker to your system linker path:

    cp /usr/local/condor/lib/ld  /usr/local/ld
     

  • make the condor linker a root-owned executable program:

    chown root  /usr/bin/ld
    chmod 755  /usr/bin/ld

From now on you will be able to use the condor_compile program in the following way. Let's suppose that, to compile the program you are going to send to the condor pool, you normally use the following command:

gcc myprogram.c -o myprogram

To compile it for condor (and use the condor linker), just prefix that line with condor_compile:

condor_compile gcc myprogram.c -o myprogram

That's all. You can now run that job on the pool, and take advantage of features such as checkpoints, remote system calls, etcetera.
NOTE: replacing the system linker will NOT affect the default compilations; in fact, having renamed the default linker to ld.real allows the condor linker to refer to it whenever you compile anything without using condor_compile. Also, if you remove condor later, the default linker will keep on working. However, it might be a good idea to put the default linker back to its default name ld.
NOTE2: if you upgrade or patch your operating system, you might have the linker replaced again by the default system linker. If that's the case, you might have to repeat the above procedure.
NOTE3: for other platforms, locations of the system linker are, according to the condor manual:

Solaris 2.x  ->  /usr/css/bin/ld
OSF/1 (Digital Unix)  ->  /usr/lib/cmplrs/cc/ld
IRIX: a rather complicate situation here, refer to the condor manual for a detailed explanation of what to do.