diff -ruN oommf12a4pre-20100719/app/mmdisp/scripts/mmdisp.tcl oommf12a4pre-20100719bis/app/mmdisp/scripts/mmdisp.tcl --- oommf12a4pre-20100719/app/mmdisp/scripts/mmdisp.tcl 2008-07-09 19:06:27.000000000 -0400 +++ oommf12a4pre-20100719bis/app/mmdisp/scripts/mmdisp.tcl 2011-10-15 23:44:23.397980291 -0400 @@ -15,7 +15,7 @@ ########################### PROGRAM DOCUMENTATION ################### Oc_Main SetAppName mmDisp Oc_Main SetVersion 1.2.0.4 -regexp \\\044Date:(.*)\\\044 {$Date: 2008-07-09 23:06:27 $} _ date +regexp \\\044Date:(.*)\\\044 {$Date: 2010-08-25 20:52:56 $} _ date Oc_Main SetDate [string trim $date] # regexp \\\044Author:(.*)\\\044 {$Author: donahue $} _ author # Oc_Main SetAuthor [Oc_Person Lookup [string trim $author]] @@ -3531,16 +3531,31 @@ } bind $canvas { OMF_InitZoomBox %x %y 1 } bind $canvas { OMF_InitZoomBox %x %y -1 } -bind $canvas { OMF_InitZoomBox %x %y -1 } bind $canvas [Oc_SkipWrap {OMF_DrawZoomBox %x %y}] bind $canvas [Oc_SkipWrap {OMF_DrawZoomBox %x %y}] -bind $canvas [Oc_SkipWrap {OMF_DrawZoomBox %x %y}] bind $canvas { OMF_DoZoom %x %y } bind $canvas { CancelZoom ; CenterScreenView %x %y } bind $canvas { CancelZoom ; CenterScreenView %x %y } bind $canvas { continue } ;# Make these nops so they don't bind $canvas { continue } ;# interact with other bindings. +if {[Ow_IsAqua]} { + # Macs have only one button, so use "Command" modifier key with + # button 1 as a stand-in for Button-3. Tk registers the Command key + # as Mod1, but on Windows Tk associates Mod1 with the NumLock key. + # Some laptop keyboards lack a NumLock key, in which case the system + # may report NumLock as always on. This wrecks havoc with other + # Button-1 bindings, so only add these binding on the Mac. + bind $canvas { OMF_InitZoomBox %x %y -1 } + bind $canvas [Oc_SkipWrap {OMF_DrawZoomBox %x %y}] +} +# If using OS X + X11, then the "Command" key maps to "Meta" (instead of +# Mod1). Since I'm not currently able to find any other systems that +# bind anything to Meta, it is probably(?) okay to make these bindings +# always. +bind $canvas { OMF_InitZoomBox %x %y -1 } +bind $canvas [Oc_SkipWrap {OMF_DrawZoomBox %x %y}] + # Vector value display bind $canvas { OMF_ShowPosition %x %y } bind $canvas { OMF_ShowPosition %x %y 1 } diff -ruN oommf12a4pre-20100719/app/oxs/base/oxs.h oommf12a4pre-20100719bis/app/oxs/base/oxs.h --- oommf12a4pre-20100719/app/oxs/base/oxs.h 2010-07-19 17:43:45.000000000 -0400 +++ oommf12a4pre-20100719bis/app/oxs/base/oxs.h 2011-10-15 23:44:28.806426667 -0400 @@ -23,7 +23,7 @@ #define OXS_RELEASE_SERIAL 4 /* Set this value when making a snapshot release, example value 20061206 */ -#define OXS_SNAPSHOT_DATE 20100719 +#define OXS_SNAPSHOT_DATE 20100719bis #define OXS_VERSION OC_MAKE_VERSION(OXS) diff -ruN oommf12a4pre-20100719/app/oxs/base/oxsthread.h oommf12a4pre-20100719bis/app/oxs/base/oxsthread.h --- oommf12a4pre-20100719/app/oxs/base/oxsthread.h 2010-07-16 18:33:13.000000000 -0400 +++ oommf12a4pre-20100719bis/app/oxs/base/oxsthread.h 2011-10-15 23:44:28.806426667 -0400 @@ -26,6 +26,8 @@ #include // Used for thread local storage #include +#include + #include "oc.h" /* includes tcl.h */ /* End includes */ diff -ruN oommf12a4pre-20100719/app/oxs/ext/fft3v.cc oommf12a4pre-20100719bis/app/oxs/ext/fft3v.cc --- oommf12a4pre-20100719/app/oxs/ext/fft3v.cc 2010-07-16 18:33:27.000000000 -0400 +++ oommf12a4pre-20100719bis/app/oxs/ext/fft3v.cc 2011-10-15 23:44:23.424982529 -0400 @@ -561,8 +561,10 @@ const OXS_FFT_REAL_TYPE* mult_base) const { // NOTE: The bit-reversal code in this routine // is only valid for fftsize>=128. - const OC_INDEX block32_count = 4*(log2fftsize%2); - const OC_INDEX block16_count = 4*(1+log2fftsize%2); + // The following Oc_Nop is a workaround for an optimization bug in the + // version of gcc 4.2.1 that ships alongside Mac OS X Lion. + const OC_INDEX block32_count = Oc_Nop(4*(log2fftsize%2)); + const OC_INDEX block16_count = block32_count + 4; const OC_INDEX cstride = 2*(fftsize+1)*OFTV_VECSIZE; for(OC_INDEX row=0;row=128. - const OC_INDEX block32_count = 4*(log2fftsize%2); - const OC_INDEX block16_count = 4*(1+log2fftsize%2); + // The following Oc_Nop is a workaround for an optimization bug in the + // version of gcc 4.2.1 that ships alongside Mac OS X Lion. + const OC_INDEX block32_count = Oc_Nop(4*(log2fftsize%2)); + const OC_INDEX block16_count = block32_count + 4; const OC_INDEX cstride = 2*(fftsize+1)*OFTV_VECSIZE; for(OC_INDEX row=0;row=128. - const OC_INDEX block32_count = 4*(log2fftsize%2); - const OC_INDEX block16_count = 4*(1+log2fftsize%2); + // The following Oc_Nop is a workaround for an optimization bug in the + // version of gcc 4.2.1 that ships alongside Mac OS X Lion. + const OC_INDEX block32_count = Oc_Nop(4*(log2fftsize%2)); + const OC_INDEX block16_count = block32_count + 4; const OC_INDEX cstride = 2*(fftsize+1)*OFTV_VECSIZE; for(OC_INDEX row=0;row=128. assert(workbuffer != 0); - const OC_INDEX block32_count = 4*(log2fftsize%2); - const OC_INDEX block16_count = 4*(1+log2fftsize%2); + // The following Oc_Nop is a workaround for an optimization bug in the + // version of gcc 4.2.1 that ships alongside Mac OS X Lion. + const OC_INDEX block32_count = Oc_Nop(4*(log2fftsize%2)); + const OC_INDEX block16_count = block32_count + 4; const OC_INDEX cstride = 2*(fftsize+1)*OFTV_VECSIZE; for(OC_INDEX row=0;row=128. - const OC_INDEX block32_count = 4*(log2fftsize%2); - const OC_INDEX block16_count = 4*(1+log2fftsize%2); + // The following Oc_Nop is a workaround for an optimization bug in the + // version of gcc 4.2.1 that ships alongside Mac OS X Lion. + const OC_INDEX block32_count = Oc_Nop(4*(log2fftsize%2)); + const OC_INDEX block16_count = block32_count + 4; for(OC_INDEX block=0;blockarrcount-block @@ -9515,8 +9525,10 @@ (OXS_FFT_REAL_TYPE* arr) const { // NOTE: The bit-reversal code in this routine // is only valid for fftsize>=128. - const OC_INDEX block32_count = 4*(log2fftsize%2); - const OC_INDEX block16_count = 4*(1+log2fftsize%2); + // The following Oc_Nop is a workaround for an optimization bug in the + // version of gcc 4.2.1 that ships alongside Mac OS X Lion. + const OC_INDEX block32_count = Oc_Nop(4*(log2fftsize%2)); + const OC_INDEX block16_count = block32_count + 4; for(OC_INDEX block=0;blockarrcount-block @@ -9988,8 +10000,10 @@ // two-times zero padding. // NOTE: The bit-reversal code in this routine is only valid // for fftsize>=128. - const OC_INDEX block32_count = 4*(log2fftsize%2); - const OC_INDEX block16_count = 4*(1+log2fftsize%2); + // The following Oc_Nop is a workaround for an optimization bug in the + // version of gcc 4.2.1 that ships alongside Mac OS X Lion. + const OC_INDEX block32_count = Oc_Nop(4*(log2fftsize%2)); + const OC_INDEX block16_count = block32_count + 4; OC_INDEX bw = OFS_ARRAY_BLOCKSIZE + (arrcount % OFS_ARRAY_BLOCKSIZE); if(bw>OFS_ARRAY_MAXBLOCKSIZE) bw -= OFS_ARRAY_BLOCKSIZE; @@ -10602,8 +10616,10 @@ // two-times zero padding. // NOTE: The bit-reversal code in this routine is only valid // for fftsize>=128. - const OC_INDEX block32_count = 4*(log2fftsize%2); - const OC_INDEX block16_count = 4*(1+log2fftsize%2); + // The following Oc_Nop is a workaround for an optimization bug in the + // version of gcc 4.2.1 that ships alongside Mac OS X Lion. + const OC_INDEX block32_count = Oc_Nop(4*(log2fftsize%2)); + const OC_INDEX block16_count = block32_count + 4; OC_INDEX bw = OFS_ARRAY_BLOCKSIZE + (arrcount % OFS_ARRAY_BLOCKSIZE); if(bw>OFS_ARRAY_MAXBLOCKSIZE) bw -= OFS_ARRAY_BLOCKSIZE; diff -ruN oommf12a4pre-20100719/app/oxs/ext/twosurfaceexchange.cc oommf12a4pre-20100719bis/app/oxs/ext/twosurfaceexchange.cc --- oommf12a4pre-20100719/app/oxs/ext/twosurfaceexchange.cc 2010-07-16 18:33:40.000000000 -0400 +++ oommf12a4pre-20100719bis/app/oxs/ext/twosurfaceexchange.cc 2011-10-15 23:44:23.426982695 -0400 @@ -277,9 +277,9 @@ ThreeVector wtemp; mesh->Center(min_index,wtemp); wtemp -= cell1; - OC_REAL8m cellwgt = wtemp.x*mesh->EdgeLengthX() - + wtemp.y*mesh->EdgeLengthY() - + wtemp.z*mesh->EdgeLengthZ(); + OC_REAL8m cellwgt = fabs(wtemp.x*mesh->EdgeLengthX() + + wtemp.y*mesh->EdgeLengthY() + + wtemp.z*mesh->EdgeLengthZ()); if(cellwgt>0.) { // Safety cellwgt = sqrt(min_distsq)/cellwgt; // min_distsq _should_ be wtemp.MagSq(), so @@ -289,7 +289,7 @@ Oxs_TwoSurfaceExchangeLinkParams ltemp; ltemp.index1 = *it1; ltemp.index2 = min_index; - ltemp.exch_coef1 = (init_sigma + init_sigma2) * cellwgt; + ltemp.exch_coef1 = (init_sigma + 2*init_sigma2) * cellwgt; ltemp.exch_coef2 = -init_sigma2 * cellwgt; // NB: The init_sigma and init_sigma2 references above // will likely be replaced in the future with a call diff -ruN oommf12a4pre-20100719/app/oxs/local/spintevolve.cc oommf12a4pre-20100719bis/app/oxs/local/spintevolve.cc --- oommf12a4pre-20100719/app/oxs/local/spintevolve.cc 2010-07-19 17:51:16.000000000 -0400 +++ oommf12a4pre-20100719bis/app/oxs/local/spintevolve.cc 2011-10-15 23:44:23.428982861 -0400 @@ -573,6 +573,8 @@ Oxs_SimState& new_state, OC_REAL8m& norm_error) const { + new_state.ClearDerivedData(); + const Oxs_MeshValue& old_spin = old_state.spin; Oxs_MeshValue& new_spin = new_state.spin; diff -ruN oommf12a4pre-20100719/app/pimake/makerule.tcl oommf12a4pre-20100719bis/app/pimake/makerule.tcl --- oommf12a4pre-20100719/app/pimake/makerule.tcl 2003-04-29 20:12:34.000000000 -0400 +++ oommf12a4pre-20100719bis/app/pimake/makerule.tcl 2011-10-15 23:44:23.429982944 -0400 @@ -172,11 +172,9 @@ # There could be a rule for this target in another makerules file. # We search for the file 'makerules.tcl' starting in the directory # of the target upward until we find such a rule or reach the root. - set rootIterations 0 set dir [file dirname $target] - while {![info exists ruleWhichMakes($target)] \ - && ([string compare $dir [file dirname $dir]] \ - || ![incr rootIterations])} { + while {![info exists ruleWhichMakes($target)] + && [string compare $dir [file dirname $dir]]} { set rulesFile [file join $dir makerules.tcl] if {[catch {$class SourceRulesFile $rulesFile} msg]} { global errorInfo errorCode @@ -187,6 +185,9 @@ error $msg "$ei\n (while finding rule for target\ '$target')" $errorCode } + if {$msg == 0} { + break + } set dir [file dirname $dir] } # Check again to see if we now know a rule for the target. @@ -211,7 +212,7 @@ # Tell caller we've read the file. return $filesRead($rulesFile) } - if {[file readable $rulesFile]} { + if {[file readable $rulesFile] && [file isfile $rulesFile]} { set filesRead($rulesFile) 1 set savedir [pwd] set code [catch { @@ -231,6 +232,7 @@ return 1 } } else { + set filesRead($rulesFile) 0 return 0 } set index [string last "\n invoked from within" $ei] diff -ruN oommf12a4pre-20100719/pkg/oc/config.tcl oommf12a4pre-20100719bis/pkg/oc/config.tcl --- oommf12a4pre-20100719/pkg/oc/config.tcl 2010-07-19 17:44:11.000000000 -0400 +++ oommf12a4pre-20100719bis/pkg/oc/config.tcl 2011-10-15 23:44:28.848430139 -0400 @@ -250,7 +250,7 @@ method SnapshotDate {} { # If not a snapshot release, return empty string. # Otherwise, return string of the form yyyy.mm.dd - return "2010.07.19" + return "2010.07.19bis" #return {} } @@ -663,7 +663,9 @@ } else { set search [list] if {[string match Darwin $tcl_platform(os)]} { + lappend search /System/Library/Frameworks/Tcl.framework/Versions/$tcl_version/Headers lappend search /Library/Frameworks/Tcl.framework/Versions/$tcl_version/Headers + lappend search /System/Library/Frameworks/Tcl.framework/Headers lappend search /Library/Frameworks/Tcl.framework/Headers } if {![catch {$this GetValue TCL_INC_DIR} incdir]} { @@ -693,7 +695,9 @@ } else { set search [list] if {[string match Darwin $tcl_platform(os)]} { + lappend search /System/Library/Frameworks/Tk.framework/Versions/$tcl_version/Headers lappend search /Library/Frameworks/Tk.framework/Versions/$tcl_version/Headers + lappend search /System/Library/Frameworks/Tk.framework/Headers lappend search /Library/Frameworks/Tk.framework/Headers } if {![catch {$this GetValue TK_INC_DIR} incdir]} { @@ -729,7 +733,9 @@ # anything else: if {[string match Darwin $tcl_platform(os)]} { foreach libdir [list \ + /System/Library/Frameworks/Tcl.framework/Versions/$tcl_version \ /Library/Frameworks/Tcl.framework/Versions/$tcl_version \ + /System/Library/Frameworks/Tcl.framework \ /Library/Frameworks/Tcl.framework] { if {[file readable [file join $libdir tclConfig.sh]]} { return [file join $libdir tclConfig.sh] @@ -758,11 +764,20 @@ } # Not in usual places, go searching for tclsh... set candshells [list] - if {[regsub -nocase wish $exec tclsh shell]} { + if {[regsub -nocase wish [file tail $exec] tclsh shell]} { + lappend candshells [file join [file dirname $exec] $shell] lappend candshells $shell } - lappend candshells tclsh[package provide Tcl] - lappend candshells tclsh[join [split [package provide Tcl] .] ""] + if {![regexp {^([^.]*(.[^.]*|$))} [package provide Tcl] dummy majmin]} { + set majmin [info tclversion] + } + if {[string compare $majmin [package provide Tcl]]!=0} { + lappend candshells tclsh[package provide Tcl] + lappend candshells tclsh[join [split [package provide Tcl] .] ""] + } + lappend candshells tclsh$majmin + lappend candshells tclsh[join [split $majmin .] ""] + lappend candshells tclsh ;# Last resort foreach shell $candshells { set shell [auto_execok $shell] if {[llength $shell]} { @@ -797,7 +812,9 @@ # anything else: if {[string match Darwin $tcl_platform(os)]} { foreach libdir [list \ + /System/Library/Frameworks/Tk.framework/Versions/$tcl_version \ /Library/Frameworks/Tk.framework/Versions/$tcl_version \ + /System/Library/Frameworks/Tk.framework \ /Library/Frameworks/Tk.framework] { if {[file readable [file join $libdir tkConfig.sh]]} { return [file join $libdir tkConfig.sh] @@ -846,12 +863,25 @@ } } # Not in usual places, go searching for wish... - set candshells [list] - if {[regsub -nocase tclsh $exec wish shell]} { + set candshells [list] + if {[regsub -nocase tclsh [file tail $exec] wish shell]} { + lappend candshells [file join [file dirname $exec] $shell] lappend candshells $shell + } + + if {![regexp {^([^.]*(.[^.]*|$))} [$class TkVersion] dummy majmin]} { + set majmin [info tclversion] ;# Fallback } - lappend candshells wish[$class TkVersion] - lappend candshells wish[join [split [$class TkVersion] .] ""] + if {[string compare $majmin [$class TkVersion]]!=0} { + lappend candshells wish[$class TkVersion] + lappend candshells wish[join [split [$class TkVersion] .] ""] + } + lappend candshells wish$majmin + lappend candshells wish[join [split $majmin .] ""] + if {[regexp -nocase wish [file tail $exec]]} { + lappend candshells [file tail $exec] + } + lappend candshells wish ;# Last resort foreach shell $candshells { set shell [auto_execok $shell] if {[llength $shell]} { diff -ruN oommf12a4pre-20100719/pkg/oc/procs.tcl oommf12a4pre-20100719bis/pkg/oc/procs.tcl --- oommf12a4pre-20100719/pkg/oc/procs.tcl 2010-07-17 03:45:02.000000000 -0400 +++ oommf12a4pre-20100719bis/pkg/oc/procs.tcl 2011-10-15 23:44:23.431983110 -0400 @@ -1159,7 +1159,7 @@ set f "" set error [catch { set f [open tclIndex a] - puts $f $index nonewline + puts -nonewline $f $index close $f cd $oldDir } msg]