A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
minor typo
[simgrid.git]
/
src
/
smpi
/
smpif2c.in
diff --git
a/src/smpi/smpif2c.in
b/src/smpi/smpif2c.in
index
bdcbe86
..
e79c31f
100755
(executable)
--- a/
src/smpi/smpif2c.in
+++ b/
src/smpi/smpif2c.in
@@
-1,22
+1,36
@@
#! /usr/bin/env perl
#! /usr/bin/env perl
+# Copyright (c) 2010-2014. The SimGrid Team.
+# All rights reserved.
+
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the license (GNU LGPL) which comes with this package.
+
use warnings;
use strict;
use File::Temp;
use File::Copy;
use warnings;
use strict;
use File::Temp;
use File::Copy;
-my $include="
-I@top_srcdir@/include -I@top_srcdir@/include/smpi -I@includedir@ -I@includedir@/smpi
";
+my $include="
@includeflag@@f2cflags@
";
foreach my $fortran (@ARGV) {
my $output = $fortran;
$output =~ s/.f$/.c/;
foreach my $fortran (@ARGV) {
my $output = $fortran;
$output =~ s/.f$/.c/;
+
+ #print "F2C INPUT : ".$fortran."\n";
+ #print "F2C OUTPUT: ".$output."\n";
+
+ my$outputdir = $output;
+ $outputdir=~s/[^\/]*\.c$//g;
+ #print "F2C DIR : ".$outputdir."\n";
+
my $tmp = new File::Temp;
$tmp->autoflush(1);
my $tmp = new File::Temp;
$tmp->autoflush(1);
- `f2c $include -w -a $fortran`;
+ #print "f2c -d$outputdir $include -w -a $fortran\n";
+ `f2c -d$outputdir $include -w -a $fortran`;
die "F2C failed\n" if $?;
die "F2C failed\n" if $?;
- open F2C,"<$output";
+ open F2C,"<$output"
or die "Unable to open file $output"
;
my $started = 0;
my $started = 0;
- my $cutext = 0;
print $tmp "#ifndef INTEGER_STAR_8\n";
print $tmp "#define INTEGER_STAR_8\n";
print $tmp "#endif\n";
print $tmp "#ifndef INTEGER_STAR_8\n";
print $tmp "#define INTEGER_STAR_8\n";
print $tmp "#endif\n";
@@
-43,17
+57,9
@@
foreach my $fortran (@ARGV) {
if(/\/\* Table of constant values \*\// || /MAIN__/) {
$started = 0;
}
if(/\/\* Table of constant values \*\// || /MAIN__/) {
$started = 0;
}
- if(/extern \/\* Subroutine \*\//) {
- $cutext = 1;
- }
- if($cutext) {
- if(/;$/) {
- $cutext = 0;
- }
- next;
- }
+ $_ =~ s/(mpi_[\w]*_)_/$1/g;
if(/\/* Main program alias \*\/\s*int\s+.*\s*\(\s*\)\s*{(.*)}/) {
if(/\/* Main program alias \*\/\s*int\s+.*\s*\(\s*\)\s*{(.*)}/) {
- $_ = "int smpi_simulated_main(int argc, char** argv) { smpi_process_init(&argc, &argv); $1 }\n";
+ $_ = "int smpi_simulated_main
_
(int argc, char** argv) { smpi_process_init(&argc, &argv); $1 }\n";
}
print $tmp "$_\n";
}
}
print $tmp "$_\n";
}