[Scons-users] Compile and launch

Dirk Bächle tshortik at gmx.de
Tue Nov 4 09:08:26 EST 2014


Hi Sven,

On 04.11.2014 14:51, Sven Lars Tobias Stål wrote:
> Hi
>
> I’m new to SCons, and, I have to admit, rather new to software construction in general, but now I’m forced to use SCons to build flows for a scientific program package. I spent a couple of days now to study the manual and examples online, but no success. I’d be very grateful if one of you experienced users could spare 2 min to help me start, I just can’t figure out what I’m doing wrong.
>
> What I can’t get to work is (I hope it makes sense):
>
> 1. Compile a code, with the same result as running  $ gcc -m32 -o abc2 abc2.c
>
> 2. Execute the program, with the same result as running $ abc2 1234.dat 2

please try something along the lines of:

   # Setting up environment
   env = Environment()
   # Adding '-m32' to the flags for compiling C files
   env.Append(CCFLAGS=['-m32'])
   # Creating a program from the source file
   env.Program('abc2.c')

in your SConstruct file. If this doesn't work, please post the full 
error message you get...a minimal working example (MWE) attached to your 
replay would be even better.

For your second problem it would be good to know which file gets output 
(=built) by the command "abc2 1234.dat 2". Remember that SCons is a 
build system in first place, and it works file-oriented. So you can't 
simply "serialize commands", without defining dependencies between the 
output files (=targets) of each command to their source files.

Best regards,

Dirk



More information about the Scons-users mailing list