slackbuilds_ponce/development/csmith/launchn.diff
B. Watson 49853566bb
development/csmith: Added (generates random C programs).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
2023-06-17 07:52:18 +07:00

42 lines
1.4 KiB
Diff

diff -Naur csmith-csmith-2.3.0/scripts/launchn.pl csmith-csmith-2.3.0.patched/scripts/launchn.pl
--- csmith-csmith-2.3.0/scripts/launchn.pl 2017-06-21 16:50:24.000000000 -0400
+++ csmith-csmith-2.3.0.patched/scripts/launchn.pl 2023-06-10 17:14:02.157839502 -0400
@@ -30,32 +30,31 @@
###############################################################################
# This script illustrates how to run compiler_test.pl in parallel on multi-core machines. Please make sure
-# these processes are terminated at the end of your testing
+# these processes are terminated at the end of your testing
#!/usr/bin/perl -w
use strict;
use warnings;
-use Sys::CPU;
sub usage () {
- die "usage: launchn.pl <config-file>\n";
+ die "usage: launchn <config-file>\n";
}
my $CONFIG_FILE = "";
-my $CPUS = Sys::CPU::cpu_count();
+chomp (my $CPUS = `nproc`);
if (scalar (@ARGV) != 1 || !(-e $ARGV[0]) ) {
usage();
-}
+}
print "looks like we have $CPUS cpus\n";
-$CONFIG_FILE = $ARGV[0];
+chomp ($CONFIG_FILE = `realpath $ARGV[0]`);
for (my $i=0; $i<$CPUS; $i++) {
my $dir = "work$i";
system "rm -rf $dir";
system "mkdir $dir";
chdir $dir;
- system "nice -19 nohup ../compiler_test.pl 0 ../$CONFIG_FILE > output.txt 2>&1 &";
+ system "nice -19 nohup compiler_test 0 $CONFIG_FILE > output.txt 2>&1 &";
print "start working in $dir\n";
chdir "..";
}