From steve.white at aei.mpg.de Mon May 1 17:51:28 2006 From: steve.white at aei.mpg.de (Steve White) Date: Tue, 2 May 2006 00:51:28 +0200 Subject: [Patches] GridFuncStuff bug fix and cleanup Message-ID: <20060501225127.GA8857@xeon01.aei.mpg.de> Hi again, Attached find a diff for lib/sbin/GridFuncStuff.pl. It fixes two minor bugs (that is, bugs that weren't bugging anybody right now). It also includes an overall cleanup of the code, which begain with the first bug fix, and resulted in the discovery of the second bug. The first bug fix was to put in use strict; (According to L. Wall, a Perl file without use strict constitutes a bug.) This resulted in lots of errors about variables needing their scope to be specified. So I did this. At the end, I found that I couldn't fix a certain occurrance of $group. There was no sensible way that it was being set. The code was to produce a warning concerning creating groups with mixed dimensions. See 'warn_mixeddim_gfs'. The Perl code was taking a global value of $group set at build time to be the last group in a loop. However, the offending group is determined at run time in CreateThornGroupInitializers. So the warning message would typically be wrong. Affect code written in bindings/Variables/.c Also: Perl 5-ied function calls deleted great wads of commented-out code Testing ------- Ran testsuites on my laptop with Whisky benchmark thornlist. No change was detected in the results. -- Steve White : Programmer Max-Planck-Institut f?r Gravitationsphysik Albert-Einstein-Institut Am M?hlenberg 1, D-14476 Golm, Germany +49-331-567-7625 -------------- next part -------------- Index: lib/sbin/GridFuncStuff.pl =================================================================== RCS file: /cactusdevcvs/Cactus/lib/sbin/GridFuncStuff.pl,v retrieving revision 1.105 diff -u -r1.105 GridFuncStuff.pl --- lib/sbin/GridFuncStuff.pl 28 Sep 2005 17:09:31 -0000 1.105 +++ lib/sbin/GridFuncStuff.pl 1 May 2006 22:27:52 -0000 @@ -8,7 +8,7 @@ # @enddesc # @version $Id: GridFuncStuff.pl,v 1.105 2005/09/28 17:09:31 schnetter Exp $ #@@*/ - +use strict; #/*@@ # @routine CreateVariableBindings @@ -21,14 +21,13 @@ sub CreateVariableBindings { my($bindings_dir, $rhinterface_db, $rhparameter_db) = @_; - my(@data); - my($thorn, $line, $block, $filelist); + my @data = (); if(! -d $bindings_dir) { mkdir("$bindings_dir", 0755) || die "Unable to create $bindings_dir"; } - $start_dir = `pwd`; + my $start_dir = `pwd`; chdir $bindings_dir; # Create the header files @@ -37,11 +36,11 @@ mkdir("include", 0755) || die "Unable to create include directory"; } - foreach $thorn (split(" ",$rhinterface_db->{"THORNS"})) + foreach my $thorn (split(" ",$rhinterface_db->{"THORNS"})) { - @data = &CreateThornArgumentHeaderFile($thorn, $rhinterface_db); - $dataout = join ("\n", @data); - &WriteFile("include/$thorn\_arguments.h",\$dataout); + @data = CreateThornArgumentHeaderFile($thorn, $rhinterface_db); + my $dataout = join ("\n", @data); + WriteFile("include/$thorn\_arguments.h",\$dataout); } @data = (); @@ -130,7 +129,7 @@ push(@data, '#define DECLARE_CCTK_ARGUMENTS DECLARE_CCTK_FARGUMENTS'); push(@data, '#endif'); - foreach $thorn (split(" ",$rhinterface_db->{"THORNS"})) + foreach my $thorn (split(" ",$rhinterface_db->{"THORNS"})) { push(@data, ''); push(@data, "#ifdef THORN_IS_$thorn"); @@ -143,15 +142,15 @@ } push(@data, "\n"); # workaround for perl 5.004_04 to add a trailing newline - $dataout = join ("\n", @data); - &WriteFile("include/cctk_Arguments.h",\$dataout); + my $dataout = join ("\n", @data); + WriteFile("include/cctk_Arguments.h",\$dataout); if(! -d "Variables") { mkdir("Variables", 0755) || die "Unable to create Variables directory"; } - $filelist = "BindingsVariables.c"; + my $filelist = "BindingsVariables.c"; @data = (); push(@data, '/*@@'); @@ -168,7 +167,7 @@ push(@data, '#include "cctk_ActiveThorns.h"'); push(@data, ''); - foreach $thorn (split(" ",$rhinterface_db->{"THORNS"})) + foreach my $thorn (split(" ",$rhinterface_db->{"THORNS"})) { push(@data, "int CactusBindingsVariables_${thorn}_Initialise(void);"); } @@ -179,7 +178,7 @@ push(@data, 'int CCTKi_BindingsVariablesInitialise(void)'); push(@data, '{'); - foreach $thorn (split(" ",$rhinterface_db->{"THORNS"})) + foreach my $thorn (split(" ",$rhinterface_db->{"THORNS"})) { push(@data, " if (CCTK_IsThornActive(\"$thorn\"))"); push(@data, ' {'); @@ -191,10 +190,10 @@ push(@data, '}'); push(@data, "\n"); # workaround for perl 5.004_04 to add a trailing newline - $dataout = join ("\n", @data); - &WriteFile("Variables/BindingsVariables.c",\$dataout); + my $dataout = join ("\n", @data); + WriteFile("Variables/BindingsVariables.c",\$dataout); - foreach $thorn (split(" ",$rhinterface_db->{"THORNS"})) + foreach my $thorn (split(" ",$rhinterface_db->{"THORNS"})) { @data = (); push(@data, '/*@@'); @@ -246,32 +245,37 @@ push(@data, "int CactusBindingsVariables_${thorn}_Initialise(void)"); push(@data, '{'); - push(@data, ' int warn_mixeddim_gfs;'); + push(@data, ' const char * warn_mixeddim_gfs = "";'); + push(@data, ' int warn_mixeddim = 0;'); push(@data, ' const CCTK_INT *allow_mixeddim_gfs;'); push(@data, ''); push(@data, ''); - push(@data, ' warn_mixeddim_gfs = 0;'); push(@data, ' allow_mixeddim_gfs = CCTK_ParameterGet ("allow_mixeddim_gfs", "Cactus", 0);'); push(@data, ''); - foreach $block ("PUBLIC", "PROTECTED", "PRIVATE") + foreach my $block ("PUBLIC", "PROTECTED", "PRIVATE") { - push(@data, &CreateThornGroupInitialisers($thorn, $block, $rhinterface_db, $rhparameter_db)); + push(@data, CreateThornGroupInitialisers($thorn, $block, $rhinterface_db, $rhparameter_db)); } push(@data, ''); - push(@data, ' if (warn_mixeddim_gfs)'); + push(@data, ' if (strlen (warn_mixeddim_gfs) > 0)'); push(@data, ' {'); push(@data, ' if (allow_mixeddim_gfs && *allow_mixeddim_gfs)'); push(@data, ' {'); push(@data, ' CCTK_VWarn (2, __LINE__, __FILE__, "Cactus",'); push(@data, ' "CCTKi_CreateGroup: Working dimension already set, "'); - push(@data, " \"creating GF group '$group' with different dimension $rhinterface_db->{\"\U$thorn GROUP $group\E DIM\"}\");"); + push(@data, ' "' + . "creating GF group \%s with different dimension \%d\","); + push(@data, ' warn_mixeddim_gfs, warn_mixeddim);'); + push(@data, ' }'); push(@data, ' else'); push(@data, ' {'); push(@data, ' CCTK_VWarn (0, __LINE__, __FILE__, "Cactus",'); push(@data, ' "CCTKi_CreateGroup: Working dimension already set,"'); - push(@data, " \" cannot create GF group $group with dimension $rhinterface_db->{\"\U$thorn GROUP $group\E DIM\"}\");"); + push(@data, ' "' + . "cannot create GF group \%s with dimension \%d\","); + push(@data, ' warn_mixeddim_gfs, warn_mixeddim);'); push(@data, ' }'); push(@data, ' }'); push(@data, ''); @@ -282,28 +286,14 @@ push(@data, '}'); push(@data, "\n"); # workaround for perl 5.004_04 to add a trailing newline - $dataout = join ("\n", @data); - &WriteFile("Variables/$thorn.c",\$dataout); + my $dataout = join ("\n", @data); + WriteFile("Variables/$thorn.c",\$dataout); $filelist .= " $thorn.c"; } -# TR 24 Jan 2003 -# Fortran wrappers are now defined and registered in "Variables/$thorn.c" -# -# foreach $thorn (split(" ",$rhinterface_db->{"THORNS"})) -# { -# @data = &CreateThornFortranWrapper($thorn); -# push(@data, "\n"); # workaround for perl 5.004_04 to add a trailing newline -# -# $dataout = join ("\n", @data); -# &WriteFile("Variables/$thorn\_FortranWrapper.c",\$dataout); -# -# $filelist .= " $thorn\_FortranWrapper.c"; -# } - $dataout = "SRCS = $filelist\n"; - &WriteFile("Variables/make.code.defn",\$dataout); + WriteFile("Variables/make.code.defn",\$dataout); chdir $start_dir; } @@ -321,11 +311,10 @@ sub GetThornArguments { my($this_thorn, $block, $rhinterface_db) = @_; - my(%arguments); - my(@other_imps); - my($my_imp, $imp, $thorn, $group, $variable, $vtype, $gtype, $type); + my %arguments = (); + my @other_imps = (); - $my_imp = $rhinterface_db->{"\U$this_thorn IMPLEMENTS"}; + my $my_imp = $rhinterface_db->{"\U$this_thorn IMPLEMENTS"}; if($block eq "PUBLIC") { @@ -344,14 +333,14 @@ die "Unknown block type $block!!!\n"; } -# print "Thorn is $this_thorn, implementation $my_imp, block is $block\n"; -# print "Other imps are @other_imps\n"; - - foreach $imp (@other_imps,$my_imp) + my $sep = ''; + foreach my $imp (@other_imps,$my_imp) { next if (! defined $imp); + my $thorn; + if ($block eq "PRIVATE") { $thorn = $this_thorn; @@ -363,13 +352,13 @@ $thorn = $1; } - foreach $group (split(" ",$rhinterface_db->{"\U$thorn $block GROUPS\E"})) + foreach my $group (split(" ",$rhinterface_db->{"\U$thorn $block GROUPS\E"})) { - $vtype = $rhinterface_db->{"\U$thorn GROUP $group VTYPE\E"}; - $gtype = $rhinterface_db->{"\U$thorn GROUP $group GTYPE\E"}; - $ntimelevels = $rhinterface_db->{"\U$thorn GROUP $group TIMELEVELS\E"}; + my $vtype = $rhinterface_db->{"\U$thorn GROUP $group VTYPE\E"}; + my $gtype = $rhinterface_db->{"\U$thorn GROUP $group GTYPE\E"}; + my $ntimelevels = $rhinterface_db->{"\U$thorn GROUP $group TIMELEVELS\E"}; - $type = "$vtype"; + my $type = "$vtype"; my $vararraysize = $rhinterface_db->{"\U$thorn GROUP $group\E VARARRAY_SIZE"}; my $compactgroup = $rhinterface_db->{"\U$thorn GROUP $group\E COMPACT"}; @@ -388,7 +377,7 @@ $sep = ''; } - for($dim =0; $dim < $rhinterface_db->{"\U$thorn GROUP $group DIM\E"}; $dim++) + for(my $dim =0; $dim < $rhinterface_db->{"\U$thorn GROUP $group DIM\E"}; $dim++) { # FIXME: quick hack to shorten argument names # $type .= "${sep}cctkv$dim$group"; @@ -446,9 +435,7 @@ $type .= '!'; } -# print "Group is $group, resulting type is $type\n"; - - foreach $variable (split(" ", $rhinterface_db->{"\U$thorn GROUP $group\E"})) + foreach my $variable (split(" ", $rhinterface_db->{"\U$thorn GROUP $group\E"})) { $arguments{$variable} = $type; } @@ -470,11 +457,10 @@ sub CreateFortranArgumentDeclarations { my(%arguments) = @_; - my($argument); my(@declarations) = (); # Put all storage arguments first. - foreach $argument (sort keys %arguments) + foreach my $argument (sort keys %arguments) { if($arguments{$argument} =~ m:STORAGESIZE|GROUPLENGTH:) { @@ -483,19 +469,17 @@ } # Now deal with the rest of the arguments - foreach $argument (sort keys %arguments) + foreach my $argument (sort keys %arguments) { next if ($arguments{$argument} =~ m:STORAGESIZE|GROUPLENGTH:); $arguments{$argument} =~ m:^([^! ]+) ?([^!]*)?!([^!]*)!([^!]*):; - $type = $1; - $dimensions = $2; - $ntimelevels = $4; + my $type = $1; + my $dimensions = $2; + my $ntimelevels = $4; -# print "var $argument - type \"$arguments{$argument}\" - tl $ntimelevels \n"; - - for($level = 0; $level < $ntimelevels; $level++) + for(my $level = 0; $level < $ntimelevels; $level++) { push(@declarations, "CCTK_$type $argument$dimensions"); @@ -505,7 +489,7 @@ if(! $type =~ /^(BYTE|INT|INT1|INT2|INT4|INT8|REAL|REAL4|REAL8|REAL16|COMPLEX|COMPLEX8|COMPLEX16|COMPLEX32)$/) { - &CST_error(0,"Unknown argument type \"$type\"","",__LINE__,__FILE__); + CST_error(0,"Unknown argument type \"$type\"","",__LINE__,__FILE__); } } push(@declarations, ''); @@ -526,23 +510,22 @@ sub CreateCArgumentDeclarations { my(%arguments) = @_; - my($varname, $imp, $type, $fullname, $ntimelevels); my(@declarations) = (); # Now deal with the rest of the arguments - foreach $varname (sort keys %arguments) + foreach my $varname (sort keys %arguments) { next if ($arguments{$varname} =~ m:STORAGESIZE|GROUPLENGTH:); $arguments{$varname} =~ m\^([^! ]+) ?([^!]*)?!([^!]*)::([^!]*)!([^!]*)!([^!]*)\; - $type = $1; - $implementation = "\U\"$3\""; - $ntimelevels = $5; - $var = "\"$varname$6\""; + my $type = $1; + my $implementation = "\U\"$3\""; + my $ntimelevels = $5; + my $var = "\"$varname$6\""; - for($level = 0; $level < $ntimelevels; $level++) + for(my $level = 0; $level < $ntimelevels; $level++) { push(@declarations, "CCTK_$type * CCTK_RESTRICT $varname = (cctki_dummy_int = \&$varname - \&$varname, (CCTK_$type *) CCTKi_VarDataPtr(cctkGH, $level, $implementation, $var));"); @@ -552,7 +535,7 @@ if(! $type =~ /^(BYTE|INT|INT1|INT2|INT4|INT8|REAL|REAL4|REAL8|REAL16|COMPLEX|COMPLEX8|COMPLEX16|COMPLEX32)$/) { - &CST_error(0,"Unknown argument type $type","",__LINE__,__FILE__); + CST_error(0,"Unknown argument type $type","",__LINE__,__FILE__); } } @@ -572,11 +555,10 @@ sub CreateFortranArgumentList { my(%arguments) = @_; - my($argument, $varname); my(@argumentlist) = (); # Put all storage arguments first. - foreach $argument (sort keys %arguments) + foreach my $argument (sort keys %arguments) { if($arguments{$argument} =~ m:STORAGESIZE|GROUPLENGTH:) { @@ -585,15 +567,15 @@ } # Now deal with the rest of the arguments - foreach $varname (sort keys %arguments) + foreach my $varname (sort keys %arguments) { next if ($arguments{$varname} =~ m:STORAGESIZE|GROUPLENGTH:); $arguments{$varname} =~ m:^([^! ]+) ?([^!]*)?!([^!]*)!([^!]*):; - $ntimelevels = $4; + my $ntimelevels = $4; - for($level = 0; $level < $ntimelevels; $level++) + for(my $level = 0; $level < $ntimelevels; $level++) { push(@argumentlist, $varname); @@ -617,19 +599,16 @@ sub CreateCArgumentStatics { my(%arguments) = @_; - my($argument, $group, $allgroups); my(@declarations) = (); - $allgroups = ''; - foreach $argument (sort keys %arguments) + my $allgroups = ''; + foreach my $argument (sort keys %arguments) { next if ($arguments{$argument} =~ m:STORAGESIZE|GROUPLENGTH:); push(@declarations, "static int CCTKARGNUM_$argument = -1;"); $arguments{$argument} =~ /::([^!]+)![0-9]+/; - $group = $1; - -# print "ARG is $arguments{$argument}, group is $group\n"; + my $group = $1; if ($allgroups !~ / $group /) { @@ -653,22 +632,21 @@ sub CreateCArgumentInitialisers { my(%arguments) = @_; - my($argument, $allgroups, $group, $qualifier); my(@initialisers) = (); - $allgroups = ''; - foreach $argument (sort keys %arguments) + my $allgroups = ''; + foreach my $argument (sort keys %arguments) { next if ($arguments{$argument} =~ m:STORAGESIZE|GROUPLENGTH:); $arguments{$argument} =~ m,^([^! ]+) ?([^!]*)?!([^!]*)\::([^!]*)!([^!]*)!([^!]*),; - $qualifier = $3; - $varsuffix = $6; + my $qualifier = $3; + my $varsuffix = $6; push(@initialisers, "if(CCTKARGNUM_$argument == -1) CCTKARGNUM_$argument = CCTK_VarIndex(\"$qualifier\::$argument$varsuffix\");"); $arguments{$argument} =~ /\::([^!]+)/; - $group = $1; + my $group = $1; if ($allgroups !~ / $group /) { $allgroups .= " $group "; @@ -691,10 +669,9 @@ { my(%arguments) = @_; my(@prototype) = (); - my($argument, $type, $ntimelevels); # Put all storage arguments first. - foreach $argument (sort keys %arguments) + foreach my $argument (sort keys %arguments) { if($arguments{$argument} =~ m:STORAGESIZE|GROUPLENGTH:) { @@ -703,7 +680,7 @@ } # Now deal with the rest of the arguments - foreach $argument (sort keys %arguments) + foreach my $argument (sort keys %arguments) { next if ($arguments{$argument} =~ m:STORAGESIZE|GROUPLENGTH:); @@ -713,17 +690,17 @@ { $arguments{$argument} =~ m:^([^! ]+) ?([^!]*)?!([^!]*)!([^!]*):; - $type = $1; - $ntimelevels = $4; + my $type = $1; + my $ntimelevels = $4; - for($level = 0; $level < $ntimelevels; $level++) + for(my $level = 0; $level < $ntimelevels; $level++) { push(@prototype, "CCTK_$type *"); } if($type !~ /^(CHAR|BYTE|INT|INT1|INT2|INT4|INT8|REAL|REAL4|REAL8|REAL16|COMPLEX|COMPLEX8|COMPLEX16|COMPLEX32)$/) { - &CST_error(0,"Unknown argument type $type","",__LINE__,__FILE__); + CST_error(0,"Unknown argument type $type","",__LINE__,__FILE__); } } } @@ -745,11 +722,10 @@ { my(%arguments) = @_; my(@arglist) = (); - my(@argument, $type, $ntimelevels); # Put all storage arguments first. - foreach $argument (sort keys %arguments) + foreach my $argument (sort keys %arguments) { if($arguments{$argument} =~ m/STORAGESIZE\([^,]*::([^,]*),\s*(\d+)/) { @@ -762,18 +738,18 @@ } # Now deal with the rest of the arguments - foreach $argument (sort keys %arguments) + foreach my $argument (sort keys %arguments) { next if ($arguments{$argument} =~ m:STORAGESIZE|GROUPLENGTH:); $arguments{$argument} =~ m:^([^! ]+) ?([^!]*)?!([^!]*)!([^!]*):; - $type = $1; - $ntimelevels = $4; + my $type = $1; + my $ntimelevels = $4; $arguments{$argument} =~ /\::([^!]+)/; - $group = $1; + my $group = $1; - for($level = 0; $level < $ntimelevels; $level++) + for(my $level = 0; $level < $ntimelevels; $level++) { push(@arglist, "(CCTK_$type *)(PASS_REFERENCE($argument, $level))"); } @@ -783,12 +759,12 @@ # DEPRECATED IN BETA 10 if($type eq 'CHAR') { - &CST_error(1,"CCTK_CHAR is replaced by CCTK_BYTE, please change your code","",__LINE__,__FILE__); + CST_error(1,"CCTK_CHAR is replaced by CCTK_BYTE, please change your code","",__LINE__,__FILE__); } } else { - &CST_error(0,"Unknown argument type $type","",__LINE__,__FILE__); + CST_error(0,"Unknown argument type $type","",__LINE__,__FILE__); } } @@ -806,9 +782,8 @@ sub CreateThornArgumentHeaderFile { my($this_thorn, $rhinterface_db) = @_; - my($line, $thorn); - my(@returndata) = (); - my(%hasvars); + my @returndata = (); + my %hasvars = (); # Header Data push(@returndata, '/*@@'); @@ -822,22 +797,14 @@ push(@returndata, ''); push(@returndata, ''); - $thorn = "\U$this_thorn"; + my $thorn = "\U$this_thorn"; # Create the basic thorn block definitions - foreach $block ("PRIVATE", "PROTECTED", "PUBLIC") + foreach my $block ("PRIVATE", "PROTECTED", "PUBLIC") { - %data = &GetThornArguments($this_thorn, $block, $rhinterface_db); + my %data = GetThornArguments($this_thorn, $block, $rhinterface_db); -# $print_data = 1; -# if ($print_data) -# { -# foreach $arg (sort keys %data) -# { -# print "$this_thorn data: $arg : $data{\"$arg\"}\n"; -# } -# } # Remember if there actually are any arguments here. $hasvars{$block} = 1 if(keys %data > 0) ; @@ -846,13 +813,13 @@ # Create the fortran argument declarations push(@returndata, "#define DECLARE_${thorn}_${block}_FARGUMENTS \\"); - @data = &CreateFortranArgumentDeclarations(%data); + my @data = CreateFortranArgumentDeclarations(%data); push(@returndata, join ("&&\\\n", @data)); push(@returndata, ''); # Create the fortran argument list push(@returndata, "#define ${thorn}_${block}_FARGUMENTS \\"); - push(@returndata, &CreateFortranArgumentList(%data)); + push(@returndata, CreateFortranArgumentList(%data)); push(@returndata, ''); push(@returndata, '#endif /* FCODE */'); @@ -866,30 +833,30 @@ # Create the C argument declarations push(@returndata, "#define DECLARE_${thorn}_${block}_CARGUMENTS \\"); - @data = &CreateCArgumentDeclarations(%data); + @data = CreateCArgumentDeclarations(%data); push(@returndata, join (" \\\n", @data)); push(@returndata, ''); # Create the C argument variable number statics push(@returndata, "#define DECLARE_${thorn}_${block}_C2F \\"); - @data = &CreateCArgumentStatics(%data); + @data = CreateCArgumentStatics(%data); push(@returndata, join (" \\\n", @data)); push(@returndata, ''); # Create the C argument variable number statics initialisers push(@returndata, "#define INITIALISE_${thorn}_${block}_C2F \\"); - @data = &CreateCArgumentInitialisers(%data); + @data = CreateCArgumentInitialisers(%data); push(@returndata, join (" \\\n", @data)); push(@returndata, ''); # Create the C argument prototypes push(@returndata, "#define ${thorn}_${block}_C2F_PROTO \\"); - push(@returndata, &CreateCArgumentPrototype(%data)); + push(@returndata, CreateCArgumentPrototype(%data)); push(@returndata, ''); # Create the C argument list push(@returndata, "#define PASS_${thorn}_${block}_C2F(GH) \\"); - push(@returndata, &CreateCArgumentList(%data)); + push(@returndata, CreateCArgumentList(%data)); push(@returndata, ''); push(@returndata, '#endif /* CCODE */'); @@ -900,14 +867,14 @@ # Create the final thorn argument macros - $fortran_arguments = "#define ${thorn}_FARGUMENTS _CCTK_FARGUMENTS"; - $fortran_declarations = "#define DECLARE_${thorn}_FARGUMENTS _DECLARE_CCTK_FARGUMENTS"; - $c_declarations = "#define \UDECLARE_${thorn}_CARGUMENTS _DECLARE_CCTK_CARGUMENTS"; - $c_argument_prototypes = "#define \U${thorn}_C2F_PROTO _CCTK_C2F_PROTO"; - $c_argument_lists = "#define PASS_\U${thorn}_C2F(GH) _PASS_CCTK_C2F(GH)"; - $c_declare_statics = "#define DECLARE_\U${thorn}_C2F _DECLARE_CCTK_C2F"; - $c_initialize_statics = "#define INITIALISE_\U${thorn}_C2F _INITIALISE_CCTK_C2F"; - foreach $block ("PRIVATE", "PROTECTED", "PUBLIC") + my $fortran_arguments = "#define ${thorn}_FARGUMENTS _CCTK_FARGUMENTS"; + my $fortran_declarations = "#define DECLARE_${thorn}_FARGUMENTS _DECLARE_CCTK_FARGUMENTS"; + my $c_declarations = "#define \UDECLARE_${thorn}_CARGUMENTS _DECLARE_CCTK_CARGUMENTS"; + my $c_argument_prototypes = "#define \U${thorn}_C2F_PROTO _CCTK_C2F_PROTO"; + my $c_argument_lists = "#define PASS_\U${thorn}_C2F(GH) _PASS_CCTK_C2F(GH)"; + my $c_declare_statics = "#define DECLARE_\U${thorn}_C2F _DECLARE_CCTK_C2F"; + my $c_initialize_statics = "#define INITIALISE_\U${thorn}_C2F _INITIALISE_CCTK_C2F"; + foreach my $block ("PRIVATE", "PROTECTED", "PUBLIC") { if($hasvars{$block}) { @@ -964,22 +931,22 @@ sub CreateThornGroupInitialisers { my($thorn, $block, $rhinterface_db, $rhparameter_db) = @_; - my(@variables, @data); - my($imp, $line, $group, $dim, $string, $numsize, $message, $type); + my @data = (); - $imp = $rhinterface_db->{"\U$thorn\E IMPLEMENTS"}; + my $imp = $rhinterface_db->{"\U$thorn\E IMPLEMENTS"}; - foreach $group (split(" ", $rhinterface_db->{"\U$thorn $block GROUPS"})) + foreach my $group (split(" ", $rhinterface_db->{"\U$thorn $block GROUPS"})) { - $type = $rhinterface_db->{"\U$thorn GROUP $group\E GTYPE"}; + my $type = $rhinterface_db->{"\U$thorn GROUP $group\E GTYPE"}; # Check consistency of SIZE and (optional) GHOSTSIZE options for arrays if ($type eq 'ARRAY') { - $size = $rhinterface_db->{"\U$thorn GROUP $group\E SIZE"}; - &CheckArraySizes($size,$thorn,$rhparameter_db,$rhinterface_db,$group); - $dim = $rhinterface_db->{"\U$thorn GROUP $group\E DIM"}; - $numsize = split (',', $size); + my $message = ''; + my $size = $rhinterface_db->{"\U$thorn GROUP $group\E SIZE"}; + CheckArraySizes($size,$thorn,$rhparameter_db,$rhinterface_db,$group); + my $dim = $rhinterface_db->{"\U$thorn GROUP $group\E DIM"}; + my $numsize = split (',', $size); if ($dim != $numsize) { if ($numsize == 0) @@ -991,15 +958,15 @@ $message = "Array dimension $dim doesn't match the $numsize ". "array sizes\n ($size) for '$group' in '$thorn'"; } - $hint = "Array sizes must be comma separated list of $dim " . + my $hint = "Array sizes must be comma separated list of $dim " . "constants or parameters"; - &CST_error(0,$message,$hint,__LINE__,__FILE__); + CST_error(0,$message,$hint,__LINE__,__FILE__); } - $ghostsize = $rhinterface_db->{"\U$thorn GROUP $group\E GHOSTSIZE"}; + my $ghostsize = $rhinterface_db->{"\U$thorn GROUP $group\E GHOSTSIZE"}; if ($ghostsize) { - &CheckArraySizes($ghostsize,$thorn,$rhparameter_db,$rhinterface_db,$group); - $numghostsize = split (',', $ghostsize); + CheckArraySizes($ghostsize,$thorn,$rhparameter_db,$rhinterface_db,$group); + my $numghostsize = split (',', $ghostsize); if ($dim != $numghostsize) { if ($numghostsize == 0) @@ -1011,14 +978,14 @@ $message = "Array dimension $dim doesn't match the $numghostsize ". "array ghossizes\n ($size) for '$group' in '$thorn'"; } - $hint = "Array ghostsizes must be comma separated list of $dim " . + my $hint = "Array ghostsizes must be comma separated list of $dim " . "constants or parameters"; - &CST_error(0,$message,$hint,__LINE__,__FILE__); + CST_error(0,$message,$hint,__LINE__,__FILE__); } } } - $line = " if (CCTKi_CreateGroup (\"\U$group\", \"$thorn\", \"$imp\","; + my $line = " if (CCTKi_CreateGroup (\"\U$group\", \"$thorn\", \"$imp\","; push(@data, $line); $line = ' "' . $rhinterface_db->{"\U$thorn GROUP ${group}\E GTYPE"} @@ -1052,11 +1019,11 @@ push(@data, $line); # Is it a vector group ? - @variables = split(" ", $rhinterface_db->{"\U$thorn GROUP $group\E"}); + my @variables = split(" ", $rhinterface_db->{"\U$thorn GROUP $group\E"}); if(defined($rhinterface_db->{"\U$thorn GROUP $group\E VARARRAY_SIZE"})) { # Check that the size is allowed. - &CheckArraySizes($rhinterface_db->{"\U$thorn GROUP $group\E VARARRAY_SIZE"},$thorn,$rhparameter_db,$rhinterface_db,$group); + CheckArraySizes($rhinterface_db->{"\U$thorn GROUP $group\E VARARRAY_SIZE"},$thorn,$rhparameter_db,$rhinterface_db,$group); # Pass in the size of the GV array, which may be a valid parameter expression $line = ' "' . $rhinterface_db->{"\U$thorn GROUP $group\E VARARRAY_SIZE"} @@ -1071,71 +1038,24 @@ $line = ' ' . scalar(@variables); - foreach $variable (@variables) + foreach my $variable (@variables) { $line .= ",\n \"$variable\""; - } + } $line .= ') == 1)'; push(@data, $line); push(@data, ' {'); - push(@data, ' warn_mixeddim_gfs = 1;'); + push(@data, " warn_mixeddim_gfs = \"$group\";"); + push(@data, " warn_mixeddim = " + . $rhinterface_db->{"\U$thorn GROUP $group\E DIM"} . ';'); push(@data, ' }'); } return @data; } -# TR 24 Jan 2003 -# Fortran wrappers are now defined and registered in "Variables/$thorn.c" -# -#sub CreateThornFortranWrapper -#{ -# my($thorn) = @_; -# my(@data); -# -# @data = (); -# push(@data, '/*@@'); -# push(@data, " \@file ${thorn}_FortranWrapper.c"); -# push(@data, ' @author Automatically generated by GridFuncStuff.pl'); -# push(@data, ' @desc'); -# push(@data, " Defines the fortran wrappers for scheduled fortran routines of thorn $thorn"); -# push(@data, ' @enddesc'); -# push(@data, ' @@*/'); -# push(@data, ''); -# push(@data, ''); -# -# push(@data, "#define THORN_IS_$thorn 1"); -# push(@data, ''); -# push(@data, '#include "cctk.h"'); -# push(@data, '#include "cctk_Flesh.h"'); -# push(@data, '#include "cctk_Groups.h"'); -# push(@data, '#include "cctk_Comm.h"'); -# push(@data, '#include "cctk_Arguments.h"'); -# push(@data, ''); -# -# push(@data, "int CCTKi_BindingsFortranWrapper$thorn(cGH *GH, CCTK_FPOINTER fpointer);"); -# push(@data, ''); -# push(@data, "int CCTKi_BindingsFortranWrapper$thorn(cGH *GH, CCTK_FPOINTER fpointer)"); -# push(@data, '{'); -# push(@data, ' const int _cctk_zero = 0;'); -# push(@data, " void (*function)(\U$thorn\E_C2F_PROTO);"); -# push(@data, " DECLARE_\U$thorn\E_C2F"); -# push(@data, " INITIALISE_\U$thorn\E_C2F"); -# push(@data, ' (void) (_cctk_zero + 0);'); -# push(@data, ''); -# -# push(@data, " function = (void (*) (\U$thorn\E_C2F_PROTO)) fpointer;"); -# push(@data, " function (PASS_\U$thorn\E_C2F (GH));"); -# push(@data, ''); -# push(@data, ' return 0;'); -# push(@data, '}'); -# -# return (@data); -#} - - #/*@@ # @routine CheckArraySizes # @date Thu May 10 2001 @@ -1150,46 +1070,12 @@ sub CheckArraySizes { my($size,$thornname,$rhparameter_db,$rhinterface_db,$group) = @_; - my($par,$thorn,$base); # append a dummy space character to catch expressions with trailing commas $size .= ' '; - foreach $par (split(",",$size)) + foreach my $par (split(",",$size)) { - -# # check for size to be a constant -# next if $par =~ /^\d+$/; - -# # check for size to be a parameter -# if ($par =~ /^([A-Za-z]\w*)(::([A-Za-z]\w*))?([+-]\d+)?$/) -# { -# if (defined $2) -# { -# $thorn = $1; -# $base = $3; -# } -# else -# { -# $thorn = $thornname; -# $base = $1; -# } - -# # check if the parameter really exists -# if ($rhparameter_db->{"\U$thorn Private\E variables"} !~ m:$base:i && -# $rhparameter_db->{"\U$thorn Global\E variables"} !~ m:$base:i && -# $rhparameter_db->{"\U$thorn Restricted\E variables"} !~ m:$base:i) -# { -# &CST_error(0,"Array size \'$par\' in $thornname is not a parameter", -# "",__LINE__,__FILE__); -# } -# } -# else -# { -# &CST_error(0,"Array size \'$par\' in $thornname has invalid syntax", -# "",__LINE__,__FILE__); -# } - - &VerifyParameterExpression($par,$thornname,$rhparameter_db,$rhinterface_db,$group); + VerifyParameterExpression($par,$thornname,$rhparameter_db,$rhinterface_db,$group); } } @@ -1209,53 +1095,51 @@ sub VerifyParameterExpression { my($expression,$thornname,$rhparameter_db,$rh_interface_db,$group) = @_; - my($i,$count, at fields); my $msg = "Array size in '$thornname' is an invalid arithmetic expression\n" . ' '; - # Eliminate white space in expression $expression =~ s/\s+//g; # First do some global checks if($expression !~ m%^[-+*/a-zA-Z0-9_():\[\]]+$%) { - &CST_error(0, $msg . "'$expression' contains invalid characters", + CST_error(0, $msg . "'$expression' contains invalid characters", '',__LINE__,__FILE__); } - $count = 0; + my $count = 0; - for $i (split(//,$expression)) + for my $i (split(//,$expression)) { $count++ if($i eq "("); $count-- if($i eq ")"); if($count < 0) { - &CST_error(0, $msg . "'$expression' has too many closing parentheses", + CST_error(0, $msg . "'$expression' has too many closing parentheses", '',__LINE__,__FILE__); } } if($count > 0) { - &CST_error(0, $msg . "'$expression' has unmatched parentheses", + CST_error(0, $msg . "'$expression' has unmatched parentheses", '',__LINE__,__FILE__); } if($expression =~ m:[-+*/]$:) { - &CST_error(0, $msg . "'$expression' ends with an operator", + CST_error(0, $msg . "'$expression' ends with an operator", '',__LINE__,__FILE__); } # Now split the string on operators and parentheses - @fields = split(/([-+*\/()])/, $expression); + my @fields = split(/([-+*\/()])/, $expression); - for $i (@fields) + for my $i (@fields) { # Get rid of any empty tokens next if($i =~ m:^\s*$:); @@ -1271,6 +1155,8 @@ # Now check if it is a valid parameter name if($i =~ m:^([a-zA-Z][a-zA-Z0-9_]*)(\:\:([a-zA-Z][a-zA-Z0-9_]*))?:) { + my $thorn; + my $base; if (defined $2) { $thorn = $1; @@ -1290,7 +1176,7 @@ $rhparameter_db->{"\U$thorn Global\E variables"} !~ m:$base:i && $rhparameter_db->{"\U$thorn Restricted\E variables"} !~ m:$base:i) { - &CST_error(0,"Expression '$expression' in group: $group, type: " . $rh_interface_db->{"\U$thorn GROUP ${group}\E GTYPE"} . " and thorn: '$thornname' contains a constant which isn\'t a parameter", + CST_error(0,"Expression '$expression' in group: $group, type: " . $rh_interface_db->{"\U$thorn GROUP ${group}\E GTYPE"} . " and thorn: '$thornname' contains a constant which isn\'t a parameter", '',__LINE__,__FILE__); } } @@ -1310,14 +1196,14 @@ # Ok, so it does share from this implementation if($rhparameter_db->{"\U$thornname SHARES $implementation\E variables"} !~ m/\b$base\b/i) { - &CST_error(0,"Array size '$expression' in '$thornname' contains a reference to a parameter from $implementation" . + CST_error(0,"Array size '$expression' in '$thornname' contains a reference to a parameter from $implementation" . " which is neither USED nor EXTENDED", '',__LINE__,__FILE__); } } else { - &CST_error(0,"Array size '$expression' in '$thornname' contains a reference to a parameter from $implementation" . + CST_error(0,"Array size '$expression' in '$thornname' contains a reference to a parameter from $implementation" . " which is not global nor shared", '',__LINE__,__FILE__); } @@ -1326,31 +1212,31 @@ elsif($i =~ m:^\(\)$:) { # Empty parenthesis - bad - &CST_error(0, $msg . "'$expression' contains empty parentheses", + CST_error(0, $msg . "'$expression' contains empty parentheses", '',__LINE__,__FILE__); } elsif($i =~ m:[-+/*]{2,}:) { # Two operators in a row - bad - &CST_error(0, $msg . "'$expression' contains two operators in a row", + CST_error(0, $msg . "'$expression' contains two operators in a row", '',__LINE__,__FILE__); } elsif($i =~ m:[-+/*]\):) { # Operator followed by closing parenthesis - bad - &CST_error(0, $msg . "'$expression' has a missing operand", + CST_error(0, $msg . "'$expression' has a missing operand", '',__LINE__,__FILE__); } elsif($i =~ m:\([-+/*]:) { # Opening parenthesis followed by operator - bad - &CST_error(0, $msg . "'$expression' has a missing operand", + CST_error(0, $msg . "'$expression' has a missing operand", '',__LINE__,__FILE__); } else { # I've run out of imagination - &CST_error(0, $msg . "'$expression' contains unrecognised token '$i'", + CST_error(0, $msg . "'$expression' contains unrecognised token '$i'", '',__LINE__,__FILE__); } } From schnetter at cct.lsu.edu Thu May 4 10:51:09 2006 From: schnetter at cct.lsu.edu (Erik Schnetter) Date: Thu, 4 May 2006 10:51:09 -0500 Subject: [Patches] Add parameter to choose prolongation type for ADMBase Message-ID: Introduce a parameter ADMBase::prolongation type, which chooses how the ADMBase variable are prolongated. This parameter is references in the ADMBase group tag tables. The default is as is, namely "Lagrange". Another useful value is "none", disabling prolongation of these variables, which allows people to activate fewer time levels to save memory. -erik -- Erik Schnetter My email is as private as my paper mail. I therefore support encrypting and signing email messages. Get my PGP key from www.keyserver.net. -------------- next part -------------- A non-text attachment was scrubbed... Name: ADMBase-prolongation.diff Type: application/octet-stream Size: 2074 bytes Desc: not available Url : http://www.cactuscode.org/pipermail/patches/attachments/20060504/7b53edf3/attachment.obj -------------- next part -------------- From schnetter at cct.lsu.edu Sat May 6 12:34:09 2006 From: schnetter at cct.lsu.edu (Erik Schnetter) Date: Sat, 6 May 2006 12:34:09 -0500 Subject: [Patches] Add parameters to choose prolongation type for ADMBase Message-ID: Introduce parameters which chooses how the ADMBase variable are prolongated. These parameters are referenced in the ADMBase group tag tables. The default is the current behaviour, namely "Lagrange". Another useful setting is "none", disabling prolongation of these variables, which allows people to activate fewer time levels to save memory. -erik -- Erik Schnetter My email is as private as my paper mail. I therefore support encrypting and signing email messages. Get my PGP key from www.keyserver.net. -------------- next part -------------- A non-text attachment was scrubbed... Name: ADMBase-prolongation.diff Type: application/octet-stream Size: 2675 bytes Desc: not available Url : http://www.cactuscode.org/pipermail/patches/attachments/20060506/ce151e33/attachment.obj From tradke at aei.mpg.de Mon May 8 11:06:00 2006 From: tradke at aei.mpg.de (Thomas Radke) Date: Mon, 08 May 2006 18:06:00 +0200 Subject: [Patches] new parameter IO::require_empty_output_directory Message-ID: <445F6C68.4000703@aei.mpg.de> This patch introduces the new boolean I/O parameter IO::require_empty_output_directory which can be used to test if IO::out_dir points to either a non-existing or empty directory at simulation startup. If this parameter is set to "yes" and an already existing IO::out_dir is found to have any contents (eg. output files from a previous simulation which was using the same output directory) Cactus will print an appropriate error message and abort, as opposed to continuing and (potentially by accident) overwriting existing files. The default for IO::require_empty_output_directory is "no". -- Cheers, Thomas. -------------- next part -------------- A non-text attachment was scrubbed... Name: iotuil.patch Type: text/x-patch Size: 4003 bytes Desc: not available Url : http://www.cactuscode.org/pipermail/patches/attachments/20060508/4d543f9d/attachment.bin From tradke at aei.mpg.de Wed May 10 11:54:17 2006 From: tradke at aei.mpg.de (Thomas Radke) Date: Wed, 10 May 2006 18:54:17 +0200 Subject: [Patches] new parameter IO::truncate_files Message-ID: <44621AB9.3090508@aei.mpg.de> Currently Cactus always truncates existing output files unless the simulation has been recovered from a checkpoint (in which case existing output files will get appended unless the parameter IO::truncate_files_after_recovering is set to true). Christian Ott requested that it should also be possible to always append new datasets to existing output files. The new boolean I/O parameter IO::truncate_files implements that. Its default value is true, preserving the existing Cactus behaviour. -- Cheers, Thomas. -------------- next part -------------- A non-text attachment was scrubbed... Name: ioutil.patch Type: text/x-patch Size: 1086 bytes Desc: not available Url : http://www.cactuscode.org/pipermail/patches/attachments/20060510/72e8bccb/attachment.bin From tradke at aei.mpg.de Thu May 11 09:25:08 2006 From: tradke at aei.mpg.de (Thomas Radke) Date: Thu, 11 May 2006 16:25:08 +0200 Subject: [Patches] APPLIED: Re: new parameter IO::require_empty_output_directory In-Reply-To: <445F6C68.4000703@aei.mpg.de> References: <445F6C68.4000703@aei.mpg.de> Message-ID: <44634944.7080006@aei.mpg.de> Applied. -- Cheers, Thomas. From tradke at aei.mpg.de Thu May 11 09:25:36 2006 From: tradke at aei.mpg.de (Thomas Radke) Date: Thu, 11 May 2006 16:25:36 +0200 Subject: [Patches] APPLIED: Re: new parameter IO::truncate_files In-Reply-To: <44621AB9.3090508@aei.mpg.de> References: <44621AB9.3090508@aei.mpg.de> Message-ID: <44634960.6010506@aei.mpg.de> Applied. -- Cheers, Thomas. From jthorn at aei.mpg.de Thu May 11 09:50:34 2006 From: jthorn at aei.mpg.de (Jonathan Thornburg) Date: Thu, 11 May 2006 16:50:34 +0200 (CEST) Subject: [Patches] Re: 'typo' in UsersGuide? Message-ID: Based on discussion at today's cactus call, I have just committed a slightly-modified version of David Rideout's patch http://www.cactuscode.org/old/pipermail/patches/2006-February/000147.html to CVS. ciao, -- -- Jonathan Thornburg Max-Planck-Institut fuer Gravitationsphysik (Albert-Einstein-Institut), Golm, Germany, "Old Europe" http://www.aei.mpg.de/~jthorn/home.html "Washing one's hands of the conflict between the powerful and the powerless means to side with the powerful, not to be neutral." -- quote by Freire / poster by Oxfam From tradke at aei.mpg.de Thu May 11 10:23:15 2006 From: tradke at aei.mpg.de (Thomas Radke) Date: Thu, 11 May 2006 17:23:15 +0200 Subject: [Patches] APPLIED: Re: [Developers] CartGrid3D: reduce compiler warnings In-Reply-To: <20060303105233.GA25120@xeon01.aei.mpg.de> References: <20060303105233.GA25120@xeon01.aei.mpg.de> Message-ID: <446356E3.80601@aei.mpg.de> Applied. -- Cheers, Thomas. From schnetter at cct.lsu.edu Fri May 12 23:51:47 2006 From: schnetter at cct.lsu.edu (Erik Schnetter) Date: Fri, 12 May 2006 23:51:47 -0500 Subject: [Patches] Add configuration flag PROFILE=yes Message-ID: Add a new configuration flag PROFILE=yes, which enables profiling in a build. This flag is equivalent to OPTIMISE=yes and DEBUG=yes. Additional compiler options {C,CXX,F77,F90}_PROFILE_FLAGS are also introduced. The configuration stage sets the F77 flags to the F90 flags if an F90 compiler is found. This flag setting was done too early, namely before the default values for the F90 flags were set. This flag setting has been moved to a later time. The link command used undefined make variables $(OPTIMISE_C) etc. These variables have been removed. Instead $(CXX_OPTIMISE_FLAGS) etc. are added to the link statement. This makes the linker pick up the correct flags e.g. for profiling. -erik -- Erik Schnetter My email is as private as my paper mail. I therefore support encrypting and signing email messages. Get my PGP key from www.keyserver.net. -------------- next part -------------- A non-text attachment was scrubbed... Name: profile.diff Type: application/octet-stream Size: 81116 bytes Desc: not available Url : http://www.cactuscode.org/pipermail/patches/attachments/20060512/e9c144e9/attachment.obj From iwsmith at cct.lsu.edu Mon May 15 15:23:12 2006 From: iwsmith at cct.lsu.edu (iwsmith at cct.lsu.edu) Date: Mon, 15 May 2006 15:23:12 -0500 Subject: [Patches] IsoView Patch Message-ID: <20060515152312.is33to1xogogswks@webmail.cct.lsu.edu> The attached patch will allow IsoView to work with the version of IsoSurfacer in the stable cactus release. Although the patch seems to remove some necessary bounds checking, it actually doesn't. Due to IsoView's rather inventive (read: poor) redesign that I did, the normal data is *not* read from IsoSurfacer, but rather somehow generated from the vertex data (and not through the traditional methods, through a totally accidental occurrence). Regardless, this accidental method does sort of work, if there is enough interest in IsoView we should consider recoding this section of it. -- Ian Wesley-Smith Undergraduate Student Center for Computation and Technology Louisiana State University ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. From iwsmith at cct.lsu.edu Mon May 15 15:36:40 2006 From: iwsmith at cct.lsu.edu (iwsmith at cct.lsu.edu) Date: Mon, 15 May 2006 15:36:40 -0500 Subject: [Patches] IsoView Patch Message-ID: <20060515153640.k0n11kb5oo4gkwk4@webmail.cct.lsu.edu> Evidently I don't know how to send attachments with the new version of IMP, apologies. Patch is attached now (really). -- Ian Wesley-Smith Center for Computation and Technology Louisiana State University http://cct.lsu.edu/~iwsmith ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. -------------- next part -------------- A non-text attachment was scrubbed... Name: IsoView.patch Type: text/x-patch Size: 371 bytes Desc: not available Url : http://www.cactuscode.org/pipermail/patches/attachments/20060515/7a21b19a/attachment.bin From schnetter at cct.lsu.edu Tue May 16 10:54:09 2006 From: schnetter at cct.lsu.edu (Erik Schnetter) Date: Tue, 16 May 2006 10:54:09 -0500 Subject: [Patches] New aliased function "GetSymmetryBoundaries" Message-ID: <381A00C7-C8D9-43AB-9BC6-C6F4E56EC6A5@cct.lsu.edu> Introduce a new aliased function "GetSymmetryBoundaries" to SymBase, which looks at the symmetry table and returns an array describing which outer boundaries are symmetry boundaries. This function is easier to use that examining the table manually. -erik -- Erik Schnetter My email is as private as my paper mail. I therefore support encrypting and signing email messages. Get my PGP key from www.keyserver.net. -------------- next part -------------- A non-text attachment was scrubbed... Name: symbnd.diff Type: application/octet-stream Size: 3254 bytes Desc: not available Url : http://www.cactuscode.org/pipermail/patches/attachments/20060516/bfd963f9/attachment.obj From iwsmith at cct.lsu.edu Wed May 17 13:30:31 2006 From: iwsmith at cct.lsu.edu (iwsmith) Date: Wed, 17 May 2006 13:30:31 -0500 Subject: [Patches] Renderer Patches Message-ID: <446B6BC7.6020108@cct.lsu.edu> Hello all, Some time ago I wrote a patch to get the long lost Renderer thorn functional. Well, I rewrote the patch (the old version modified HTTPD, which Erik tells me is not a good idea), and now it only modifies Renderer and IsoSurfacer (which is necessary due to a namespace conflict). I have separated the patch into two different files, one of which contains the Renderer patches, while the other contains the IsoSurfacer patch. Renderer is in cactusdevcvs AlphaThorns/Renderer -- Ian Wesley-Smith Research Student Frameworks Division Center for Computation and Technology Louisiana State University http://cct.lsu.edu/~iwsmith -------------- next part -------------- A non-text attachment was scrubbed... Name: IsoSurfacer.patch Type: text/x-patch Size: 330 bytes Desc: not available Url : http://www.cactuscode.org/pipermail/patches/attachments/20060517/173ace62/attachment.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: Renderer.patch Type: text/x-patch Size: 1034 bytes Desc: not available Url : http://www.cactuscode.org/pipermail/patches/attachments/20060517/173ace62/attachment-0001.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 191 bytes Desc: OpenPGP digital signature Url : http://www.cactuscode.org/pipermail/patches/attachments/20060517/173ace62/attachment-0002.bin From steve.white at aei.mpg.de Wed May 24 04:59:29 2006 From: steve.white at aei.mpg.de (Steve White) Date: Wed, 24 May 2006 11:59:29 +0200 Subject: [Patches] Fortran REAL*16 detection In-Reply-To: <20060429115315.GC13473@xeon01.aei.mpg.de> References: <20060429115315.GC13473@xeon01.aei.mpg.de> Message-ID: <20060524095929.GA16295@xeon01.aei.mpg.de> Hi, This is a replacement to my patch of 29.04.06, incorporating Erik's correction of my Fortran 77 test file. Sorry for the delay: I plum forgot. On 29.04.06, Steve White wrote: > Hi, > > Enclosed is a patch that makes Cactus directly detect Fortran support > for a REAL*16 type. > > The problem has been that Cactus based CCTK_REAL16 on support for the C type > 'long double'. This would cause it to create Fortran code for REAL*16, a > type which was sometimes not supported. > > In particular, on a 64-bit Athlon machine with Gnu 4.1.0, gfortran > defines REAL*8 but not REAL*16, while gcc defines 'long double'. > This caused thorn AEIThorns/Fortran to fail to compile. > > This patch causes the configuration to directly compile Fortran code that > features REAL*16, and define CCTK_REAL16 only if that compiles *and* C's > 'long double' is supported. > > When you make config, you will see a new line about Fortran REAL*16. > > I have tested the enclosed patch on > my laptop with Gnu 4.10 and Intel 9.0 compilers > 64-bit AMD Athlon with same compilers > POWER4 with IBM XL compilers > > BUT NOTE: I have severe doubts about using REAL*16 on any of these > architectures. That 16-byte (128-bit) type is not natively supported > on the Xeon, Athlon, or POWER machines. While some compilers support > such types, calculation is done in software, not on the FPU. > -- Steve White : Programmer Max-Planck-Institut f?r Gravitationsphysik Albert-Einstein-Institut Am M?hlenberg 1, D-14476 Golm, Germany +49-331-567-7625 -------------- next part -------------- ? real16.diff Index: aclocal.m4 =================================================================== RCS file: /cactusdevcvs/Cactus/lib/make/aclocal.m4,v retrieving revision 1.16 diff -u -r1.16 aclocal.m4 --- aclocal.m4 4 Apr 2006 23:10:05 -0000 1.16 +++ aclocal.m4 24 May 2006 09:44:21 -0000 @@ -154,7 +154,7 @@ AC_LANG_SAVE AC_LANG_C rm -fr conftest* -AC_TRY_COMPILER([main(){return(0);} PilotMain(){return(0);}], ac_cv_prog_cc_works, ac_cv_prog_cc_cross) +AC_TRY_COMPILER([main(){return(0);} int PilotMain(){return(0);}], ac_cv_prog_cc_works, ac_cv_prog_cc_cross) AC_LANG_RESTORE AC_MSG_RESULT($ac_cv_prog_cc_works) if test $ac_cv_prog_cc_works = no; then @@ -181,6 +181,24 @@ cross_compiling=$ac_cv_prog_cxx_cross ]) +dnl see Autoconf manual: Examining Syntax +dnl AC_TRY_COMPILE (includes, function-body, [action-if-found [, action-if-not-found]]) +AC_DEFUN(CCTK_PROG_FORTRAN_REAL16_WORKS, +[AC_MSG_CHECKING([for Fortran REAL*16 ($F77 $F77FLAGS)]) +AC_LANG_SAVE +AC_LANG_FORTRAN77 +rm -fr conftest* +AC_TRY_COMPILER([ + PROGRAM main + REAL*16 a + END + ], ac_cv_real16_works, ac_cv_real16_works_not) +AC_LANG_RESTORE +dnl AC_MSG_ERROR([STEEVIE: $ac_cv_real16_works]) +AC_MSG_RESULT($ac_cv_real16_works) +fortran_does_real16=$ac_cv_real16_works +]) + AC_DEFUN(CCTK_HEADER_REGEX, [AC_MSG_CHECKING([for regex.h]) AC_CACHE_VAL(cctk_cv_header_regex_h, Index: configure =================================================================== RCS file: /cactusdevcvs/Cactus/lib/make/configure,v retrieving revision 1.146 diff -u -r1.146 configure --- configure 4 Apr 2006 23:10:05 -0000 1.146 +++ configure 24 May 2006 09:45:39 -0000 @@ -23,6 +23,8 @@ + + # CCTK_CHECK_FUNCS(FUNCTION..., [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # --------------------------------------------------------------------- @@ -642,7 +644,7 @@ fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:646: checking host system type" >&5 +echo "configure:648: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -688,7 +690,7 @@ fi echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:692: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:694: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -721,7 +723,7 @@ # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:725: checking for $ac_word" >&5 +echo "configure:727: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -753,7 +755,7 @@ fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:757: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:759: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -765,12 +767,12 @@ rm -fr conftest* cat > conftest.$ac_ext << EOF -#line 769 "configure" +#line 771 "configure" #include "confdefs.h" -main(){return(0);} PilotMain(){return(0);} +main(){return(0);} int PilotMain(){return(0);} EOF -if { (eval echo configure:774: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:776: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -796,12 +798,12 @@ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:800: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:802: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:805: checking whether we are using GNU C" >&5 +echo "configure:807: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -810,7 +812,7 @@ yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:814: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:816: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -826,7 +828,7 @@ # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:830: checking for $ac_word" >&5 +echo "configure:832: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -858,7 +860,7 @@ fi echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:862: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 +echo "configure:864: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -870,12 +872,12 @@ rm -fr conftest* cat > conftest.$ac_ext << EOF -#line 874 "configure" +#line 876 "configure" #include "confdefs.h" int main(){return(0);} extern "C" int PilotMain(){return(0);} EOF -if { (eval echo configure:879: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:881: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cxx_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -901,12 +903,12 @@ { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:905: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:907: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 -echo "configure:910: checking whether we are using GNU C++" >&5 +echo "configure:912: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -915,7 +917,7 @@ yes; #endif EOF -if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:919: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:921: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no @@ -929,7 +931,7 @@ # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:933: checking for $ac_word" >&5 +echo "configure:935: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -965,7 +967,7 @@ # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:969: checking for $ac_word" >&5 +echo "configure:971: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_CPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1011,7 +1013,7 @@ # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1015: checking for $ac_word" >&5 +echo "configure:1017: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_FPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1055,7 +1057,7 @@ # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1059: checking for $ac_word" >&5 +echo "configure:1061: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_PERL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1092,7 +1094,7 @@ # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1096: checking for $ac_word" >&5 +echo "configure:1098: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_F90'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1129,7 +1131,7 @@ # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1133: checking for $ac_word" >&5 +echo "configure:1135: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_F77'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1166,7 +1168,7 @@ # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1170: checking for $ac_word" >&5 +echo "configure:1172: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1203,7 +1205,7 @@ # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1207: checking for $ac_word" >&5 +echo "configure:1209: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_MKDIR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1240,7 +1242,7 @@ # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1244: checking for $ac_word" >&5 +echo "configure:1246: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_SHELL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1359,7 +1361,7 @@ echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1363: checking how to run the C preprocessor" >&5 +echo "configure:1365: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1374,13 +1376,13 @@ # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1384: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1386: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1391,13 +1393,13 @@ rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1401: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1403: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1408,13 +1410,13 @@ rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1418: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1420: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1439,12 +1441,12 @@ echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1443: checking for ANSI C header files" >&5 +echo "configure:1445: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1452,7 +1454,7 @@ #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1456: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1458: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1469,7 +1471,7 @@ if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1487,7 +1489,7 @@ if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1508,7 +1510,7 @@ : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1519,7 +1521,7 @@ exit (0); } EOF -if { (eval echo configure:1523: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1525: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1546,14 +1548,14 @@ if test "x$cross_compiling" = 'xno' ; then echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:1550: checking whether byte ordering is bigendian" >&5 +echo "configure:1552: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < #include @@ -1564,11 +1566,11 @@ #endif ; return 0; } EOF -if { (eval echo configure:1568: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1570: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include @@ -1579,7 +1581,7 @@ #endif ; return 0; } EOF -if { (eval echo configure:1583: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1585: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -1599,7 +1601,7 @@ { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no else @@ -1655,7 +1657,7 @@ fi echo $ac_n "checking size of long long""... $ac_c" 1>&6 -echo "configure:1659: checking size of long long" >&5 +echo "configure:1661: checking size of long long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1663,9 +1665,10 @@ ac_cv_sizeof_long_long=$SIZEOF_LONG_LONG else cat > conftest.$ac_ext < +#include main() { FILE *f=fopen("conftestval", "w"); @@ -1674,7 +1677,7 @@ exit(0); } EOF -if { (eval echo configure:1678: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1681: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long_long=`cat conftestval` else @@ -1699,7 +1702,7 @@ fi echo $ac_n "checking size of long int""... $ac_c" 1>&6 -echo "configure:1703: checking size of long int" >&5 +echo "configure:1706: checking size of long int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1707,9 +1710,10 @@ ac_cv_sizeof_long_int=$SIZEOF_LONG_INT else cat > conftest.$ac_ext < +#include main() { FILE *f=fopen("conftestval", "w"); @@ -1718,7 +1722,7 @@ exit(0); } EOF -if { (eval echo configure:1722: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1726: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long_int=`cat conftestval` else @@ -1743,7 +1747,7 @@ fi echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:1747: checking size of int" >&5 +echo "configure:1751: checking size of int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1751,9 +1755,10 @@ ac_cv_sizeof_int=$SIZEOF_INT else cat > conftest.$ac_ext < +#include main() { FILE *f=fopen("conftestval", "w"); @@ -1762,7 +1767,7 @@ exit(0); } EOF -if { (eval echo configure:1766: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int=`cat conftestval` else @@ -1787,7 +1792,7 @@ fi echo $ac_n "checking size of short int""... $ac_c" 1>&6 -echo "configure:1791: checking size of short int" >&5 +echo "configure:1796: checking size of short int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_short_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1795,9 +1800,10 @@ ac_cv_sizeof_short_int=$SIZEOF_SHORT_INT else cat > conftest.$ac_ext < +#include main() { FILE *f=fopen("conftestval", "w"); @@ -1806,7 +1812,7 @@ exit(0); } EOF -if { (eval echo configure:1810: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_short_int=`cat conftestval` else @@ -1833,7 +1839,7 @@ fi echo $ac_n "checking size of long double""... $ac_c" 1>&6 -echo "configure:1837: checking size of long double" >&5 +echo "configure:1843: checking size of long double" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1841,9 +1847,10 @@ ac_cv_sizeof_long_double=$SIZEOF_LONG_DOUBLE else cat > conftest.$ac_ext < +#include main() { FILE *f=fopen("conftestval", "w"); @@ -1852,7 +1859,7 @@ exit(0); } EOF -if { (eval echo configure:1856: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1863: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long_double=`cat conftestval` else @@ -1877,7 +1884,7 @@ fi echo $ac_n "checking size of double""... $ac_c" 1>&6 -echo "configure:1881: checking size of double" >&5 +echo "configure:1888: checking size of double" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_double'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1885,9 +1892,10 @@ ac_cv_sizeof_double=$SIZEOF_DOUBLE else cat > conftest.$ac_ext < +#include main() { FILE *f=fopen("conftestval", "w"); @@ -1896,7 +1904,7 @@ exit(0); } EOF -if { (eval echo configure:1900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_double=`cat conftestval` else @@ -1922,7 +1930,7 @@ fi echo $ac_n "checking size of float""... $ac_c" 1>&6 -echo "configure:1926: checking size of float" >&5 +echo "configure:1934: checking size of float" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_float'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1930,9 +1938,10 @@ ac_cv_sizeof_float=$SIZEOF_FLOAT else cat > conftest.$ac_ext < +#include main() { FILE *f=fopen("conftestval", "w"); @@ -1941,7 +1950,7 @@ exit(0); } EOF -if { (eval echo configure:1945: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1954: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_float=`cat conftestval` else @@ -1968,7 +1977,7 @@ fi echo $ac_n "checking size of char *""... $ac_c" 1>&6 -echo "configure:1972: checking size of char *" >&5 +echo "configure:1981: checking size of char *" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_char_p'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1976,9 +1985,10 @@ ac_cv_sizeof_char_p=$SIZEOF_POINTER else cat > conftest.$ac_ext < +#include main() { FILE *f=fopen("conftestval", "w"); @@ -1987,7 +1997,7 @@ exit(0); } EOF -if { (eval echo configure:1991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2001: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_char_p=`cat conftestval` else @@ -2022,7 +2032,7 @@ else echo $ac_n "checking for the null device""... $ac_c" 1>&6 -echo "configure:2026: checking for the null device" >&5 +echo "configure:2036: checking for the null device" >&5 if eval "test \"`echo '$''{'cctk_cv_nulldevice'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2085,12 +2095,12 @@ for ac_func in gethostbyname do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2089: checking for $ac_func" >&5 +echo "configure:2099: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2127: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2135,7 +2145,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for gethostbyname in library nsl""... $ac_c" 1>&6 -echo "configure:2139: checking for gethostbyname in library nsl" >&5 +echo "configure:2149: checking for gethostbyname in library nsl" >&5 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2144,7 +2154,7 @@ ac_save_LIBS="$LIBS" LIBS="nsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2169: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2186,12 +2196,12 @@ # Check if we have mode_t available echo $ac_n "checking if mode_t is defined""... $ac_c" 1>&6 -echo "configure:2190: checking if mode_t is defined" >&5 +echo "configure:2200: checking if mode_t is defined" >&5 if eval "test \"`echo '$''{'cctk_cv_have_mode_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2201,7 +2211,7 @@ mode_t foo; return 0 ; return 0; } EOF -if { (eval echo configure:2205: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2215: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "cctk_cv_have_mode_t=yes" else @@ -2227,12 +2237,12 @@ echo $ac_n "checking for availability of gettimeofday timing""... $ac_c" 1>&6 -echo "configure:2231: checking for availability of gettimeofday timing" >&5 +echo "configure:2241: checking for availability of gettimeofday timing" >&5 if eval "test \"`echo '$''{'cctk_cv_time_gettimeofday'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2254: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "cctk_cv_time_gettimeofday=yes" else @@ -2262,12 +2272,12 @@ fi if eval "test \"`echo '$cctk_cv_time_gettimeofday'`\" = yes"; then echo $ac_n "checking if gettimeofday needs timezone""... $ac_c" 1>&6 -echo "configure:2266: checking if gettimeofday needs timezone" >&5 +echo "configure:2276: checking if gettimeofday needs timezone" >&5 if eval "test \"`echo '$''{'cctk_cv_time_gettimeofday_timezone'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2280,7 +2290,7 @@ return 0; ; return 0; } EOF -if { (eval echo configure:2284: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2294: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "cctk_cv_time_gettimeofday_timezone=yes" else @@ -2303,12 +2313,12 @@ fi echo $ac_n "checking for availability of getrusage timing""... $ac_c" 1>&6 -echo "configure:2307: checking for availability of getrusage timing" >&5 +echo "configure:2317: checking for availability of getrusage timing" >&5 if eval "test \"`echo '$''{'cctk_cv_time_getrusage'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2321,7 +2331,7 @@ return 0; ; return 0; } EOF -if { (eval echo configure:2325: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "cctk_cv_time_getrusage=yes" else @@ -2343,12 +2353,12 @@ fi echo $ac_n "checking for availability of _ftime timing""... $ac_c" 1>&6 -echo "configure:2347: checking for availability of _ftime timing" >&5 +echo "configure:2357: checking for availability of _ftime timing" >&5 if eval "test \"`echo '$''{'cctk_cv_time_ftime'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2361,7 +2371,7 @@ return 0; ; return 0; } EOF -if { (eval echo configure:2365: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2375: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "cctk_cv_time_ftime=yes" else @@ -2388,12 +2398,12 @@ do cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6 -echo "configure:2392: checking for $cctk_hdr" >&5 +echo "configure:2402: checking for $cctk_hdr" >&5 if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2401,7 +2411,7 @@ ; return 0; } EOF -if { (eval echo configure:2405: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2415: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "cctk_cv_header_$cctk_safe=yes" else @@ -2428,12 +2438,12 @@ do cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6 -echo "configure:2432: checking for $cctk_hdr" >&5 +echo "configure:2442: checking for $cctk_hdr" >&5 if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2441,7 +2451,7 @@ ; return 0; } EOF -if { (eval echo configure:2445: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2455: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "cctk_cv_header_$cctk_safe=yes" else @@ -2468,12 +2478,12 @@ do cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6 -echo "configure:2472: checking for $cctk_hdr" >&5 +echo "configure:2482: checking for $cctk_hdr" >&5 if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2481,7 +2491,7 @@ ; return 0; } EOF -if { (eval echo configure:2485: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2495: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "cctk_cv_header_$cctk_safe=yes" else @@ -2508,12 +2518,12 @@ do cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6 -echo "configure:2512: checking for $cctk_hdr" >&5 +echo "configure:2522: checking for $cctk_hdr" >&5 if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2521,7 +2531,7 @@ ; return 0; } EOF -if { (eval echo configure:2525: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2535: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "cctk_cv_header_$cctk_safe=yes" else @@ -2548,12 +2558,12 @@ do cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6 -echo "configure:2552: checking for $cctk_hdr" >&5 +echo "configure:2562: checking for $cctk_hdr" >&5 if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2561,7 +2571,7 @@ ; return 0; } EOF -if { (eval echo configure:2565: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2575: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "cctk_cv_header_$cctk_safe=yes" else @@ -2588,12 +2598,12 @@ do cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6 -echo "configure:2592: checking for $cctk_hdr" >&5 +echo "configure:2602: checking for $cctk_hdr" >&5 if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2601,7 +2611,7 @@ ; return 0; } EOF -if { (eval echo configure:2605: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2615: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "cctk_cv_header_$cctk_safe=yes" else @@ -2628,12 +2638,12 @@ do cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6 -echo "configure:2632: checking for $cctk_hdr" >&5 +echo "configure:2642: checking for $cctk_hdr" >&5 if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2641,7 +2651,7 @@ ; return 0; } EOF -if { (eval echo configure:2645: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2655: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "cctk_cv_header_$cctk_safe=yes" else @@ -2668,12 +2678,12 @@ do cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6 -echo "configure:2672: checking for $cctk_hdr" >&5 +echo "configure:2682: checking for $cctk_hdr" >&5 if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2681,7 +2691,7 @@ ; return 0; } EOF -if { (eval echo configure:2685: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2695: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "cctk_cv_header_$cctk_safe=yes" else @@ -2708,12 +2718,12 @@ do cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6 -echo "configure:2712: checking for $cctk_hdr" >&5 +echo "configure:2722: checking for $cctk_hdr" >&5 if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2721,7 +2731,7 @@ ; return 0; } EOF -if { (eval echo configure:2725: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2735: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "cctk_cv_header_$cctk_safe=yes" else @@ -2745,12 +2755,12 @@ done echo $ac_n "checking for regex.h""... $ac_c" 1>&6 -echo "configure:2749: checking for regex.h" >&5 +echo "configure:2759: checking for regex.h" >&5 if eval "test \"`echo '$''{'cctk_cv_header_regex_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2758,7 +2768,7 @@ return 0; ; return 0; } EOF -if { (eval echo configure:2762: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2772: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "cctk_cv_header_regex_h=yes" else @@ -2783,12 +2793,12 @@ do cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6 -echo "configure:2787: checking for $cctk_hdr" >&5 +echo "configure:2797: checking for $cctk_hdr" >&5 if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2798,7 +2808,7 @@ ; return 0; } EOF -if { (eval echo configure:2802: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2812: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "cctk_cv_header_$cctk_safe=yes" else @@ -2825,12 +2835,12 @@ do cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6 -echo "configure:2829: checking for $cctk_hdr" >&5 +echo "configure:2839: checking for $cctk_hdr" >&5 if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2840,7 +2850,7 @@ ; return 0; } EOF -if { (eval echo configure:2844: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2854: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "cctk_cv_header_$cctk_safe=yes" else @@ -2867,12 +2877,12 @@ do cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6 -echo "configure:2871: checking for $cctk_hdr" >&5 +echo "configure:2881: checking for $cctk_hdr" >&5 if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2882,7 +2892,7 @@ ; return 0; } EOF -if { (eval echo configure:2886: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2896: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "cctk_cv_header_$cctk_safe=yes" else @@ -2909,12 +2919,12 @@ do cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6 -echo "configure:2913: checking for $cctk_hdr" >&5 +echo "configure:2923: checking for $cctk_hdr" >&5 if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2924,7 +2934,7 @@ ; return 0; } EOF -if { (eval echo configure:2928: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2938: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "cctk_cv_header_$cctk_safe=yes" else @@ -2951,12 +2961,12 @@ do cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6 -echo "configure:2955: checking for $cctk_hdr" >&5 +echo "configure:2965: checking for $cctk_hdr" >&5 if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -2966,7 +2976,7 @@ ; return 0; } EOF -if { (eval echo configure:2970: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2980: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "cctk_cv_header_$cctk_safe=yes" else @@ -2993,12 +3003,12 @@ do cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6 -echo "configure:2997: checking for $cctk_hdr" >&5 +echo "configure:3007: checking for $cctk_hdr" >&5 if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -3008,7 +3018,7 @@ ; return 0; } EOF -if { (eval echo configure:3012: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3022: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "cctk_cv_header_$cctk_safe=yes" else @@ -3035,12 +3045,12 @@ do cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6 -echo "configure:3039: checking for $cctk_hdr" >&5 +echo "configure:3049: checking for $cctk_hdr" >&5 if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -3048,7 +3058,7 @@ ; return 0; } EOF -if { (eval echo configure:3052: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3062: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "cctk_cv_header_$cctk_safe=yes" else @@ -3075,12 +3085,12 @@ do cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6 -echo "configure:3079: checking for $cctk_hdr" >&5 +echo "configure:3089: checking for $cctk_hdr" >&5 if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -3090,7 +3100,7 @@ ; return 0; } EOF -if { (eval echo configure:3094: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3104: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "cctk_cv_header_$cctk_safe=yes" else @@ -3117,12 +3127,12 @@ do cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6 -echo "configure:3121: checking for $cctk_hdr" >&5 +echo "configure:3131: checking for $cctk_hdr" >&5 if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -3130,7 +3140,7 @@ ; return 0; } EOF -if { (eval echo configure:3134: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3144: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "cctk_cv_header_$cctk_safe=yes" else @@ -3155,12 +3165,12 @@ echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:3159: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:3169: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3169,7 +3179,7 @@ struct tm *tp; ; return 0; } EOF -if { (eval echo configure:3173: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3183: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -3194,12 +3204,12 @@ # Check if we have socklen_t available echo $ac_n "checking if socklen_t is defined""... $ac_c" 1>&6 -echo "configure:3198: checking if socklen_t is defined" >&5 +echo "configure:3208: checking if socklen_t is defined" >&5 if eval "test \"`echo '$''{'cctk_cv_have_socklen_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3219,7 +3229,7 @@ socklen_t foo; return 0 ; return 0; } EOF -if { (eval echo configure:3223: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3233: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "cctk_cv_have_socklen_t=yes" else @@ -3244,12 +3254,12 @@ # Check if someone has defined SOCKET echo $ac_n "checking if SOCKET is defined""... $ac_c" 1>&6 -echo "configure:3248: checking if SOCKET is defined" >&5 +echo "configure:3258: checking if SOCKET is defined" >&5 if eval "test \"`echo '$''{'cctk_cv_have_SOCKET'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3269,7 +3279,7 @@ SOCKET foo; return 0 ; return 0; } EOF -if { (eval echo configure:3273: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3283: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "cctk_cv_have_SOCKET=yes" else @@ -3294,19 +3304,19 @@ # Check if we have __int64 echo $ac_n "checking if __int64 is defined""... $ac_c" 1>&6 -echo "configure:3298: checking if __int64 is defined" >&5 +echo "configure:3308: checking if __int64 is defined" >&5 if eval "test \"`echo '$''{'cctk_cv_have___int64'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3320: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "cctk_cv_have___int64=yes" else @@ -3341,12 +3351,12 @@ do cctk_safe=`echo "$cctk_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $cctk_hdr""... $ac_c" 1>&6 -echo "configure:3345: checking for $cctk_hdr" >&5 +echo "configure:3355: checking for $cctk_hdr" >&5 if eval "test \"`echo '$''{'cctk_cv_header_$cctk_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -3354,7 +3364,7 @@ ; return 0; } EOF -if { (eval echo configure:3358: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3368: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "cctk_cv_header_$cctk_safe=yes" else @@ -3393,12 +3403,12 @@ for ac_func in getopt_long_only do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3397: checking for $ac_func" >&5 +echo "configure:3407: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3435: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3464,12 +3474,12 @@ fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:3468: checking for working const" >&5 +echo "configure:3478: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3532: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -3539,21 +3549,21 @@ fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:3543: checking for inline" >&5 +echo "configure:3553: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3567: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -3580,14 +3590,14 @@ echo $ac_n "checking for C restrict""... $ac_c" 1>&6 -echo "configure:3584: checking for C restrict" >&5 +echo "configure:3594: checking for C restrict" >&5 if eval "test \"`echo '$''{'cctk_cv_c_restrict'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cctk_cv_c_restrict=no for ac_kw in restrict __restrict__ __restrict; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3612: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cctk_cv_c_restrict=$ac_kw; break else @@ -3624,7 +3634,7 @@ esac echo $ac_n "checking for C++ restrict""... $ac_c" 1>&6 -echo "configure:3628: checking for C++ restrict" >&5 +echo "configure:3638: checking for C++ restrict" >&5 if eval "test \"`echo '$''{'cctk_cv_cxx_restrict'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3639,7 +3649,7 @@ for ac_kw in restrict __restrict__ __restrict; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3664: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cctk_cv_cxx_restrict=$ac_kw; break else @@ -3684,20 +3694,20 @@ echo $ac_n "checking for C bool""... $ac_c" 1>&6 -echo "configure:3688: checking for C bool" >&5 +echo "configure:3698: checking for C bool" >&5 if eval "test \"`echo '$''{'cctk_cv_have_c_bool'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cctk_cv_have_c_bool=no cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3711: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cctk_cv_have_c_bool=yes else @@ -3719,7 +3729,7 @@ fi echo $ac_n "checking for CXX bool""... $ac_c" 1>&6 -echo "configure:3723: checking for CXX bool" >&5 +echo "configure:3733: checking for CXX bool" >&5 if eval "test \"`echo '$''{'cctk_cv_have_cxx_bool'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3733,14 +3743,14 @@ cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3754: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cctk_cv_have_cxx_bool=yes else @@ -3769,14 +3779,80 @@ fi +echo $ac_n "checking for Fortran REAL*16 ($F77 $F77FLAGS)""... $ac_c" 1>&6 +echo "configure:3784: checking for Fortran REAL*16 ($F77 $F77FLAGS)" >&5 + +ac_ext=f +ac_compile='${F77-f77} -c $FFLAGS conftest.$ac_ext 1>&5' +ac_link='${F77-f77} -o conftest${ac_exeext} $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_f77_cross + +rm -fr conftest* +cat > conftest.$ac_ext << EOF + + + PROGRAM main + REAL*16 a + END + +EOF +if { (eval echo configure:3800: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + ac_cv_real16_works=yes + # If we can't run a trivial program, we are probably using a cross compiler. + if (./conftest; exit) 2>/dev/null; then + ac_cv_real16_works_not=no + else + ac_cv_real16_works_not=yes + fi +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_real16_works=no +fi +rm -fr conftest* +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +echo "$ac_t""$ac_cv_real16_works" 1>&6 +fortran_does_real16=$ac_cv_real16_works + +echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 +echo "configure:3825: checking whether we are using GNU C++" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.C <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gxx=yes +else + ac_cv_prog_gxx=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gxx" 1>&6 +if test "$fortran_does_real16" = 'yes'; then + cat >> confdefs.h <<\EOF +#define HAVE_FORTRAN_REAL16 1 +EOF + +fi + ac_link='${CC-cc} -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext `CCTK_Wrap "$LIBDIR_PREFIX" "$LIBDIR_SUFFIX" "$LIBDIRS"` `CCTK_Wrap "$LIBLINK_PREFIX" "$LIBLINK_SUFFIX" "$LIBS"` >&5' echo $ac_n "checking for crypt""... $ac_c" 1>&6 -echo "configure:3775: checking for crypt" >&5 +echo "configure:3851: checking for crypt" >&5 if eval "test \"`echo '$''{'ac_cv_func_crypt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3879: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_crypt=yes" else @@ -3817,7 +3893,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for crypt in library crypt""... $ac_c" 1>&6 -echo "configure:3821: checking for crypt in library crypt" >&5 +echo "configure:3897: checking for crypt in library crypt" >&5 ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3826,7 +3902,7 @@ ac_save_LIBS="$LIBS" LIBS="crypt $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3917: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3878,12 +3954,12 @@ for ac_func in finite do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3882: checking for $ac_func" >&5 +echo "configure:3958: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3986: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3928,7 +4004,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for finite in library m""... $ac_c" 1>&6 -echo "configure:3932: checking for finite in library m" >&5 +echo "configure:4008: checking for finite in library m" >&5 ac_lib_var=`echo m'_'finite | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3937,7 +4013,7 @@ ac_save_LIBS="$LIBS" LIBS="m $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4028: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3990,12 +4066,12 @@ for ac_func in isnan do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3994: checking for $ac_func" >&5 +echo "configure:4070: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4098: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4040,7 +4116,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for isnan in library m""... $ac_c" 1>&6 -echo "configure:4044: checking for isnan in library m" >&5 +echo "configure:4120: checking for isnan in library m" >&5 ac_lib_var=`echo m'_'isnan | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4049,7 +4125,7 @@ ac_save_LIBS="$LIBS" LIBS="m $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4140: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4102,12 +4178,12 @@ for ac_func in mkstemp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4106: checking for $ac_func" >&5 +echo "configure:4182: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4210: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -4152,7 +4228,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for mkstemp in library c""... $ac_c" 1>&6 -echo "configure:4156: checking for mkstemp in library c" >&5 +echo "configure:4232: checking for mkstemp in library c" >&5 ac_lib_var=`echo c'_'mkstemp | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4161,7 +4237,7 @@ ac_save_LIBS="$LIBS" LIBS="c $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4252: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4211,19 +4287,19 @@ echo $ac_n "checking for va_copy""... $ac_c" 1>&6 -echo "configure:4215: checking for va_copy" >&5 +echo "configure:4291: checking for va_copy" >&5 if eval "test \"`echo '$''{'cctk_cv_have_va_copy'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { va_list src, dest; va_copy(dest, src); return 0 ; return 0; } EOF -if { (eval echo configure:4227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4303: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "cctk_cv_have_va_copy=yes" else @@ -4250,7 +4326,7 @@ if test "X$PTHREADS" = 'Xyes'; then PTHREAD_LIBS= echo $ac_n "checking for main in library c_r""... $ac_c" 1>&6 -echo "configure:4254: checking for main in library c_r" >&5 +echo "configure:4330: checking for main in library c_r" >&5 ac_lib_var=`echo c_r'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4259,14 +4335,14 @@ ac_save_LIBS="$LIBS" LIBS="c_r $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4346: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4287,7 +4363,7 @@ fi echo $ac_n "checking for main in library pthread""... $ac_c" 1>&6 -echo "configure:4291: checking for main in library pthread" >&5 +echo "configure:4367: checking for main in library pthread" >&5 ac_lib_var=`echo pthread'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4296,14 +4372,14 @@ ac_save_LIBS="$LIBS" LIBS="pthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4322,7 +4398,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for main in library pthreads""... $ac_c" 1>&6 -echo "configure:4326: checking for main in library pthreads" >&5 +echo "configure:4402: checking for main in library pthreads" >&5 ac_lib_var=`echo pthreads'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4331,14 +4407,14 @@ ac_save_LIBS="$LIBS" LIBS="pthreads $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4418: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4463,7 +4539,10 @@ fi # Float types - +echo "Float types" +echo "x$ac_cv_sizeof_long_double" +echo "x$ac_cv_sizeof_double" +echo "x$ac_cv_sizeof_float" case "x$ac_cv_sizeof_long_double" in 'x16') CCTK_REAL16='long double' ;; @@ -4495,7 +4574,7 @@ { echo "configure: error: Didn't recognise setting of DISABLE_REAL16=\"$DISABLE_REAL16\"; should be either \"yes\" or \"no\" or \"\" (empty)" 1>&2; exit 1; } fi -if test -n "$CCTK_REAL16" -a "x$DISABLE_REAL16" != 'xyes' ; then +if test -n "$CCTK_REAL16" -a "x$DISABLE_REAL16" != 'xyes' -a -n "$HAVE_FORTRAN_REAL16" ; then cat >> confdefs.h <&6 -echo "configure:4923: checking for X" >&5 +echo "configure:5002: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -4981,12 +5060,12 @@ # First, try using that file with no special directory specified. cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4990: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5069: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5055,14 +5134,14 @@ ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5145: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. Index: configure.in =================================================================== RCS file: /cactusdevcvs/Cactus/lib/make/configure.in,v retrieving revision 1.142 diff -u -r1.142 configure.in --- configure.in 27 Jan 2006 01:20:10 -0000 1.142 +++ configure.in 24 May 2006 09:45:54 -0000 @@ -528,6 +528,12 @@ CCTK_C_BOOL CCTK_CXX_BOOL +CCTK_PROG_FORTRAN_REAL16_WORKS +AC_PROG_CXX_GNU +if test "$fortran_does_real16" = 'yes'; then + AC_DEFINE(HAVE_FORTRAN_REAL16) +fi + dnl Do we have crypt(3) CCTK_CHECK_FUNC(crypt, , CCTK_CHECK_LIB_FUNC(crypt, crypt)) @@ -646,7 +652,10 @@ fi # Float types - +echo "Float types" +echo "x$ac_cv_sizeof_long_double" +echo "x$ac_cv_sizeof_double" +echo "x$ac_cv_sizeof_float" case "x$ac_cv_sizeof_long_double" in 'x16') CCTK_REAL16='long double' ;; @@ -678,7 +687,7 @@ AC_ERROR([Didn't recognise setting of DISABLE_REAL16=\"$DISABLE_REAL16\"; should be either \"yes\" or \"no\" or \"\" (empty)]) fi -if test -n "$CCTK_REAL16" -a "x$DISABLE_REAL16" != 'xyes' ; then +if test -n "$CCTK_REAL16" -a "x$DISABLE_REAL16" != 'xyes' -a -n "$HAVE_FORTRAN_REAL16" ; then AC_DEFINE_UNQUOTED(CCTK_REAL16, $CCTK_REAL16) AC_DEFINE(HAVE_CCTK_REAL16) fi From jthorn at aei.mpg.de Sun May 28 08:12:27 2006 From: jthorn at aei.mpg.de (Jonathan Thornburg) Date: Sun, 28 May 2006 15:12:27 +0200 (CEST) Subject: [Patches] patch: document how to add a new command-line option Message-ID: As I discussed in two recent messages on the cactusmaint mailing list, http://www.cactuscode.org/mailman/private/cactusmaint/2006-May/021429.html http://www.cactuscode.org/mailman/private/cactusmaint/2006-May/021430.html adding a new command-line option to Cactus is quite error-prone, with updates required in (at least) 5 different places in the code, not to mention the Fine Documentation. The Right Solution would clearly be to drive all the code's command line handling (short-option parsing, long-option parsing, and help messages) from a single table. However, as a hopefully-temporary bandaid until this is done, the following patch puts a comment at 4 of the 5 places-in-the-code-where-the-list-of-all-command-options-appears pointing to a longer comment at the 5th place, which lists all 5 places. This way a future programmer who goes to add a new command-line option can at least quickly find all 5 places needing updating. ciao, -- -- Jonathan Thornburg Max-Planck-Institut fuer Gravitationsphysik (Albert-Einstein-Institut), Golm, Germany, "Old Europe" http://www.aei.mpg.de/~jthorn/home.html "Washing one's hands of the conflict between the powerful and the powerless means to side with the powerful, not to be neutral." -- quote by Freire / poster by Oxfam -------------- next part -------------- Index: CommandLine.c =================================================================== RCS file: /cactusdevcvs/Cactus/src/main/CommandLine.c,v retrieving revision 1.59 diff -u -r1.59 CommandLine.c --- CommandLine.c 11 May 2006 13:55:51 -0000 1.59 +++ CommandLine.c 28 May 2006 13:10:32 -0000 @@ -61,6 +61,11 @@ /******************************************************************** ********************* Defines ********************** ********************************************************************/ + +/* + * See comments in CCTKi_ProcessCommandLine() for a list of all the + * places you have to update if you add a new command-line option. + */ #define CACTUS_COMMANDLINE_OPTIONS \ "[-h] [-O] [-o paramname] [-L n] [-W n] [-E n] [-r[o|e|oe|eo]] " \ "[-S] [-T] [-t name] [-parameter-level ] [-v] " \ @@ -538,6 +543,11 @@ void CCTKi_CommandLineHelp (void) { char **argv; + + /* + * See comments in CCTKi_ProcessCommandLine() for a list of all the + * places you have to update if you add a new command-line option. + */ const char *commandline_options_description = "-h, -help : gets this help.\n" "-O[v], -describe-all-parameters : describes all the parameters.\n" Index: ProcessCommandLine.c =================================================================== RCS file: /cactusdevcvs/Cactus/src/main/ProcessCommandLine.c,v retrieving revision 1.36 diff -u -r1.36 ProcessCommandLine.c --- ProcessCommandLine.c 11 May 2006 13:55:51 -0000 1.36 +++ ProcessCommandLine.c 28 May 2006 13:10:33 -0000 @@ -93,6 +93,19 @@ @@*/ int CCTKi_ProcessCommandLine(int *inargc, char ***inargv, tFleshConfig *ConfigData) { + /* + * If you add a new command-line option, you must update (at least) + * the following different places in the code: + * - the definition of long_options[] in this function + * - the 3rd argument in the call to getopt_long_only() in this function + * - the switch (c) statement in this function + * - the #define of CACTUS_COMMANDLINE_OPTIONS near the top of + * src/main/CommandLine.c + * - the help message printed by CCTKi_CommandLineHelp() + * (also in src/main/CommandLine.c ) + * You should also update the description of command-line options in the + * Cactus Users' Guide, in doc/UsersGuide/RunningCactus.tex . + */ int option_index = 0; int c; From jthorn at aei.mpg.de Sun May 28 08:35:00 2006 From: jthorn at aei.mpg.de (Jonathan Thornburg) Date: Sun, 28 May 2006 15:35:00 +0200 (CEST) Subject: [Patches] patch: add command-line option to control stdout/stderr buffering Message-ID: Hi, When debugging Cactus code, it's often a problem for me that messages written to stdout/stderr may be buffered in the stdio system, and so appear out-of-sequence with respect to each other and with respect to the actual execution of my code. In message http://www.cactuscode.org/old/pipermail/developers/2006-May/001863.html I proposed that we should deal with this problem by adding a new flesh flesh command-line option to control stdout/stderr buffering. The attached patch implements this: -b, -buffering [u|l] : Sets standard output and standard error to be unbuffered or to use line buffering. ciao, -- -- Jonathan Thornburg Max-Planck-Institut fuer Gravitationsphysik (Albert-Einstein-Institut), Golm, Germany, "Old Europe" http://www.aei.mpg.de/~jthorn/home.html "Washing one's hands of the conflict between the powerful and the powerless means to side with the powerful, not to be neutral." -- quote by Freire / poster by Oxfam -------------- next part -------------- Index: CommandLine.c =================================================================== RCS file: /cactusdevcvs/Cactus/src/main/CommandLine.c,v retrieving revision 1.59 diff -u -r1.59 CommandLine.c --- CommandLine.c 11 May 2006 13:55:51 -0000 1.59 +++ CommandLine.c 28 May 2006 13:19:52 -0000 @@ -63,7 +63,7 @@ ********************************************************************/ #define CACTUS_COMMANDLINE_OPTIONS \ "[-h] [-O] [-o paramname] [-L n] [-W n] [-E n] [-r[o|e|oe|eo]] " \ - "[-S] [-T] [-t name] [-parameter-level ] [-v] " \ + "[-b[u|l]] [-S] [-T] [-t name] [-parameter-level ] [-v] " \ "" @@ -458,6 +458,39 @@ /*@@ + @routine CCTKi_CommandLineuffering + @date Sun May 28 13:00:02 CEST 2006 + @author Jonathan Thornburg + @desc + Set stdout and stderr to be unbuffered or line-buffered. + @enddesc + + @var argument + @vdesc option argument + @vtype const char * + @vio in + @endvar +@@*/ +void CCTKi_CommandLineBuffering(const char* const argument) +{ + if (!argument || (strcmp(argument,"u") == 0)) /* set unbuffered */ + { + setvbuf(stdout, NULL, _IONBF, 0); + setvbuf(stderr, NULL, _IONBF, 0); + } + else if (strcmp(argument, "l") == 0) /* set line-buffered */ + { + setvbuf(stdout, NULL, _IOLBF, 0); + setvbuf(stderr, NULL, _IOLBF, 0); + } + else /* illegal value for this option */ + { + CCTKi_CommandLineUsage(); /*NOTREACHED*/ + } +} + + + /*@@ @routine CCTKi_CommandLinePrintSchedule @date 2005-06-10 @author Erik Schnetter @@ -552,6 +585,8 @@ "-E, -error-level : Sets the error level to n.\n" "-r, -redirect [o|e|oe|eo] : Redirects standard output and/or standard\n" " error to files.\n" + "-b, -buffering [u|l] : Sets standard output and standard error\n" + " to be unbuffered or to use line buffering.\n" "-S, -print-schedule : Print the schedule tree, then exit.\n" "-T, -list-thorns : Lists the compiled-in thorns.\n" "-t, -test-thorn-compiled : Tests for the presence of thorn .\n" Index: ProcessCommandLine.c =================================================================== RCS file: /