[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Condor-users] condor_compile problem



OK, I've got it to work after some mucking about, but it's not a pretty solution. The line in the Makefile that was failing was:

condor_compile g++ -I. -I/home/mcal00/softsusy/trunk -L/home/mcal00/softsusy/trunk -L/home/mcal00/mwCalc/trunk/Program -L. -ansi -pedantic -Wall -Df2cFortran -O2 -lsoft -lmarkov -lm -lkernlib -lpacklib -lmathlib -lsoft -lAMWObs -lg2c

This was being expanded by condor_compile into:

/usr/bin/ld -L/Condor/Debian/condor/lib -Bstatic --eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 /Condor/Debian/condor/lib/condor_rt0.o /usr/lib/gcc/i486-linux-gnu/3.4.6/../../../../lib/crti.o /usr/lib/gcc/i486-linux-gnu/3.4.6/crtbeginT.o -L/home/mcal00/softsusy/trunk -L/home/mcal00/mwCalc/trunk/Program -L. -L/Condor/Debian/condor/lib -L/usr/lib/gcc/i486-linux-gnu/3.4.6 -L/usr/lib/gcc/i486-linux-gnu/3.4.6 -L/usr/lib/gcc/i486-linux-gnu/3.4.6/../../../../lib -L/usr/lib/gcc/i486-linux-gnu/3.4.6/../../.. -L/lib/../lib -L/usr/lib/../lib -lsoft -lmarkov -lkernlib -lpacklib -lmathlib -lsoft -lAMWObs /Condor/Debian/condor/lib/libcondorzsyscall.a /Condor/Debian/condor/lib/libz.a /Condor/Debian/condor/lib/libcomp_libstdc++.a -lg2c /Condor/Debian/condor/lib/libcomp_libstdc++.a -lm /Condor/Debian/condor/lib/libcomp_libgcc.a /Condor/Debian/condor/lib/libcomp_libgcc_eh.a -lc -lnss_files -lnss_dns -lresolv -lc -lnss_files -lnss_dns -lresolv -lc /Condor/Debian/condor/lib/libcomp_libgcc.a /Condor/Debian/condor/lib/libcomp_libgcc_eh.a /usr/lib/gcc/i486-linux-gnu/3.4.6/crtend.o /usr/lib/gcc/i486-linux-gnu/3.4.6/../../../../lib/crtn.o

...and this would fail with an undefined reference to `main'. Now, the main routine lives in sugrafit.o which in turn is archived in the library libmarkov.a. Hence in order to get the linking to work I had to explicitly mention that object file early on in the call to ld, link in libmarkov.a earlier and put in and explicit mention to libstdc++.a, so the ld directive now looks like:

/usr/bin/ld sugrafit.o -lmarkov -lstdc++ <everything else but remove -lmarkov>

This now links together a working standard-universe executable.
Mark

On Jul 7 2006, David A. Kotz wrote:

I've recently run into a very similar problem that I was going to write up. The code compiles and runs just fine under the vanilla universe, but when we try to condor_compile it, we get the "undefined reference to 'main'" error.

- dave


Mark Calleja wrote:
Hi,

I'm trying to link together some code with Condor's libraries via condor_compile but have run into a problem. The code works perfectly well on its own, but condor_compile fails with:

/Condor/Debian/condor/lib/libcondorzsyscall.a(remote_startup.o): In function `MAIN': /home/condor/execute/dir_8777/userdir/src/condor_syscall_lib/remote_startup.c:485: undefined reference to `main' collect2: ld returned 1 exit status

What I find strange is that mysterious path: "/home/condor/execute/dir_8777/userdir/src/condor_syscall_lib" which does not exist on my machine. Am I to assume that this is an artefact of Condor's build environment at UWCS? As for a "main" function, it is certainly in the .o files I'm linking together as without the condor_compile directive the code builds cleanly (I'm using g++ v3.4).

Can anyone shed light as to what the problem may be?

Ta,
Mark
_______________________________________________
Condor-users mailing list
To unsubscribe, send a message to condor-users-request@xxxxxxxxxxx with a
subject: Unsubscribe
You can also unsubscribe by visiting
https://lists.cs.wisc.edu/mailman/listinfo/condor-users

The archives can be found at either
https://lists.cs.wisc.edu/archive/condor-users/
http://www.opencondor.org/spaces/viewmailarchive.action?key=CONDOR

_______________________________________________
Condor-users mailing list
To unsubscribe, send a message to condor-users-request@xxxxxxxxxxx with a
subject: Unsubscribe
You can also unsubscribe by visiting
https://lists.cs.wisc.edu/mailman/listinfo/condor-users

The archives can be found at either
https://lists.cs.wisc.edu/archive/condor-users/
http://www.opencondor.org/spaces/viewmailarchive.action?key=CONDOR


--
Dr Mark Calleja
Cambridge eScience Centre, University of Cambridge
Centre for Mathematical Sciences, Wilberforce Road, Cambridge CB30WA
Tel. (+44/0) 1223 765317, Fax  (+44/0) 1223 765900
http://www.escience.cam.ac.uk/~mcal00