Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29264 Discussions

xilib problem with number of object files

chuckhp
Beginner
2,367 Views
We have recently upgraded to the latest version of the compiler (11.0.066), and we have an odd linking problem that we are unable to resolve. While trying to build a project from visual studio that contains 199 separate fortran source files, we get the error "A tool returned an error code". From the build log, we determined that the problem was occuring during the linking stage using xilib. We ran xilib from the command line using the arguments provided in the build log, and despite reporting no errors, it did not create the lib file. However, it appears to be related to the number of object files passed to xilib. If we break the long list of 199 object files into two batches, each batch appears to link fine. That is, we can create a library successfully using the first 100 object files and then the next 99 object files. It just has a problem when we try to link them all at once.

What's even weirder is that on another machine, the exact same call to xilib with the same version of compiler and visual studio succeeds using all 199 object files at once. I even tried copying all the object files originally created on the machine with the problem over to the machine that doesn't have the problem and was able to link these objects successfully on the second machine using xilib. Based on our diagnosis of the problem, then, it appears to be heaving a problem with the number of object files being linked but only on one machine. We have checked configurations settings, paths, everything we can think of to try and determine what could be different between the two machines that allows it to succeed on one and fail on the other but to no avail. The machines are not identical hardware, but they are both similar laptops running the same OS (Windows XP), with the same version of visual studio and the same compiler version. Everything is apparently identical, and yet we still have this problem.

I was hoping that maybe someone would have some suggestion to help figure out why this problem is happening. We are at a loss for what to try next.
0 Kudos
1 Solution
Steven_L_Intel1
Employee
2,367 Views
Try using lib.exe instead of link.exe. It really is the linker with a /lib switch under the hood.

View solution in original post

0 Kudos
6 Replies
Steven_L_Intel1
Employee
2,367 Views
It could be a bug in xilib that it is not able to handle command lines the same way that "lib" does.

Are these static library projects? Might you be able to separate them int two projects, have one a dependent of the other and specify the Librarian > Link library dependencies > Yes property?

I will try to put together a test project and see if I can reproduce the problem.
0 Kudos
chuckhp
Beginner
2,367 Views
It could be a bug in xilib that it is not able to handle command lines the same way that "lib" does.

Are these static library projects? Might you be able to separate them int two projects, have one a dependent of the other and specify the Librarian > Link library dependencies > Yes property?

I will try to put together a test project and see if I can reproduce the problem.

If it is a bug, it must be architecture, system or configuration dependent since these same projects compile fine with the same version of xilib on at least two other machines that we have upgraded so far. It's only this one particular laptop that is giving us trouble. Before installing version 11.0 of the compiler, it compiled and linked just fine with the previous version of the compiler (10.0). All we did is upgrade from 10.0 to 11.0 and this problem started happening. I already thought of splitting the projects up, but we were reluctant to do that over just this one machine. These projects have been there almost untouched for over a decade. We were hoping that maybe it was some misconfiguration or setting somewhere that got corrupted that we could easily fix rather than having to restructure our projects. These same projects have always compiled fine on that laptop prior to this version of the compiler.

We were also hoping that maybe there was a way to coax xilib to report more errors to tell us what is doesn't like. I tried using the verbose switch, but it didn't help at all. I also noticed that if one or more of the object files is missing when I try to run xilib, it will also fail without reporting any error message unless that object file happens to be the last one on the list. That seems like a pretty severe error to not be reporting.

In a previous post, I saw that you had recommended copying over link.exe from a MSVC directory and replacing xilib with it. Would that be a feasible resolution to this problem for the time being?

Thanks for your help, but it may be very difficult to reproduce this problem, because as I said it only occurs on this one particular laptop and we have not been able to figure out what is different about it. It has an almost identical hardware and software setup as my laptop, which works fine.
0 Kudos
Steven_L_Intel1
Employee
2,367 Views
Yes, copying link.exe over xilib.exe may indeed help you. I'd be interested in knowing if it does.
0 Kudos
chuckhp
Beginner
2,367 Views
Yes, copying link.exe over xilib.exe may indeed help you. I'd be interested in knowing if it does.

When I use link.exe with the same command line arguments as xilib to create the library, it complains about all the unresolved symbols that it can't find. I am just building a library and then this library is linked with other libraries when I link the final main executable project. Is there a way to indicate to link that this is just a library and that it shouldn't concern itself with unresolved symbols at this point? I tried to force it to create the library with /FORCE but then when I tried to link that library into the final executable, it told me the library I created was invalid or corrupt. I'm not that familiar with the link.exe options. How would I get it to produce the same result as xilib?
0 Kudos
Steven_L_Intel1
Employee
2,368 Views
Try using lib.exe instead of link.exe. It really is the linker with a /lib switch under the hood.
0 Kudos
chuckhp
Beginner
2,367 Views
Try using lib.exe instead of link.exe. It really is the linker with a /lib switch under the hood.
Copying over link.exe and lib.exe did work! We replaced xilib.exe with lib.exe and xilink.exe with link.exe and it linked just fine. The weird thing is that we have installed the new compiler on many other laptops by now and they all work fine except for this one laptop. I have attached a build log including environment information (at least I think I did if I understand the process correctly) in case this is any help in identifying the source of the problem. Perhaps it is some peculiarity with this specific type of processor or something. If this is a bug in xilib, hopefully it can be fixed in the future.
0 Kudos
Reply