[Scons-users] Getting builds to work with the -j flag

Plunket, Tom tom.plunket at aristocrat-inc.com
Wed Feb 17 21:30:07 EST 2016


Decomposing the messages he’s getting results in:

LINK : fatal error LNK1181: cannot open input file 'add.lib'
   Creating library add.lib and object add.exp

So basically it’s trying to link the DLL’s export library just before it’s started to create it.

I have no problems with -j but I’m also not using SCons to build code. ;)

This does point out one annoyance I have with SCons which is that it interleaves output of the different processes. Has anyone started working on this, or is there an architecture proposal that I might look at and possibly assist? I still need to get into filename handling (files with ‘#’ characters aren’t supported for some reason and anything outside of latin-1 causes exceptions) but as I get more of a handle on building and testing SCons, addressing output interleaving would be one of my top priorities.

From: Scons-users [mailto:scons-users-bounces at scons.org] On Behalf Of William Blevins
Sent: Wednesday, February 17, 2016 4:53 PM
To: SCons users mailing list <scons-users at scons.org>
Subject: Re: [Scons-users] Getting builds to work with the -j flag

I'm not 100% sure, but it doesn't look like you are adding any CPPFLAGS in your example. Does the linker you are using require shared library specific flags? This isn't a case that you have both a static and shared library in the same directory?

On Wed, Feb 17, 2016 at 11:40 PM, Steve Robinson <steven.robinson at motorolasolutions.com<mailto:steven.robinson at motorolasolutions.com>> wrote:
Hello,

I'm trying to get the -j flag to work in an existing build system to speed up build times.  I'm running into errors like this:

c1xx : fatal error C1083: Cannot open source file: 'path\to\source\source.cpp': No such file or directory

general error c1010070: Failed to load and parse the manifest. The system cannot find the path specified.

midl\oleaut32.dll : error MIDL2020 : error generating type library : SaveAllChanges Failed : .\vc120.tlb (0x80070005)
LINK : fatal error LNK1240: failed to compile IDL content

I don't always have the same problem with the same files, but I can't get through a complete build without hitting one of these.  When I remove -j #, there are no errors.


Trying to simplify the problem I set up a simple SCons project that builds a library and builds a program that links to the library:

====== add.cpp ======
#include "add.h"

int addTwoNumbers(int number1, int number2)
{
return number1+number2;
}
===================


====== add.h ========
int __declspec(dllexport) addTwoNumbers(int number1, int number2);
===================


====== main.cpp =====
#include <stdio.h>
#include "add.h"

int main()
{
int number1 = 1;
int number2 = 2;
int answer = addTwoNumbers(number1, number2);
printf("%i + %i = %i", number1, number2, answer);
return 0;
}
===================

====== SConstruct ===
SharedLibrary('add', 'add.cpp')
Program('main', 'main.cpp', LIBS='add')
===================

I place all these files in a directory, open a command prompt, cd to the directory, and run:
scons -j 2

Usually, but not always, I get an error like this:
LINK : fatal error LNK1181: cannot open in p u tC rfeialtei n'ga dldi.blriabr'y
 add.lib and object add.exp
scons: *** [main.exe] Error 1181
scons: building terminated because of errors.

So this isn't the same linker error as what I get in the full build system, but it's a repeatable example of a build that works fine without the -j flag, but has an error with it.

Anyone have any ideas what's going on?

Here's my environment:
SCons 2.4.1
Windows 7 64-bit
Visual Studio 2013

This is just my third month with SCons and it's been really great to work with after a few years with CMake.  Hope I can help support this community once I get more experience under my belt!

-Steve

_______________________________________________
Scons-users mailing list
Scons-users at scons.org<mailto:Scons-users at scons.org>
https://pairlist4.pair.net/mailman/listinfo/scons-users



IMPORTANT CONFIDENTIALITY NOTICE:

This E-mail(including any documents referred to in, or attached, to this E-mail) may contain information that is personal, confidential or the subject of copyright or other proprietary rights in favor of Aristocrat, its affiliates or third parties. This E-mail is intended only for the named addressee. Any privacy, confidence, copyright or other proprietary rights in favor of Aristocrat, its affiliates or third parties, is not lost because this E-mail was sent to you by mistake.

If you received this E-mail by mistake you should: (i) not copy, disclose, distribute or otherwise use it, or its contents, without the consent of Aristocrat or the owner of the relevant rights; (ii) let us know of the mistake by reply E-mail or by telephone (US 1-877-274-9661, or  AU +61 2 9013 6000); and (iii) delete it from your system and destroy all copies.

Any personal information contained in this E-mail must be handled in accordance with applicable privacy laws.

Electronic and internet communications can be interfered with or affected by viruses and other defects. As a result, such communications may not be successfully received or, if received, may cause interference with the integrity of receiving, processing or related systems (including hardware, software and data or information on, or using, that hardware or software). Aristocrat gives no assurances in relation to these matters.

If you have any doubts about the veracity or integrity of any electronic communication we appear to have sent you, please call (US 1-877-274-9661, or  AU +61 2 9013 6000) for clarification.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20160218/50ddd709/attachment-0001.html>


More information about the Scons-users mailing list