From d439d26cad5d8829d756bf6e1b8cab58924f5044 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Tue, 17 Jan 2023 11:14:43 -0700 Subject: Tweak gfortran tool to respect tool setting If one of the Fortran compiler environment values *other than* FORTRAN is set when calling Environment, if the tool is gfortran that choice was not respected. Now uses the supplied values of, for example, F77, SHF77, F95 or SHF95. The setting of FORTRAN/SHFORTRAN was already respected. Signed-off-by: Mats Wichmann --- CHANGES.txt | 4 +++ SCons/Tool/fortran.xml | 8 ++--- SCons/Tool/gfortran.py | 23 ++++++------ SCons/Tool/linkCommon/__init__.py | 13 ++++--- test/Fortran/F95FLAGS.py | 72 ++++++++++++++++++------------------- test/Fortran/SHF95FLAGS.py | 75 +++++++++++++++++++-------------------- test/Fortran/link-with-cxx.py | 57 +++++++++++++---------------- 7 files changed, 125 insertions(+), 127 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 279ef2e..c2bb504 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -106,6 +106,10 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER not be cached because the emitted filename contained a '$' and when looked up through a node ended up generating a Python SyntaxError because it was passed through scons_subst(). + - Have the gfortran tool do a better job of honoring user preferences + for the dialect tools (F95, SHF95, etc.). Previously set those + unconditionally to 'gfortran'. Cleaned a few Fortran tests - + behavior does not change. RELEASE 4.4.0 - Sat, 30 Jul 2022 14:08:29 -0700 diff --git a/SCons/Tool/fortran.xml b/SCons/Tool/fortran.xml index 5bb1bd2..e91f659 100644 --- a/SCons/Tool/fortran.xml +++ b/SCons/Tool/fortran.xml @@ -111,9 +111,8 @@ contain (or similar) include or module search path options that scons generates automatically from &cv-link-FORTRANPATH;. See -&cv-link-_FORTRANINCFLAGS; and &cv-link-_FORTRANMODFLAG;, -below, -for the variables that expand those options. +&cv-link-_FORTRANINCFLAGS; and &cv-link-_FORTRANMODFLAG; +for the &consvars; that expand those options. @@ -123,8 +122,9 @@ for the variables that expand those options. General user-specified options that are passed to the Fortran compiler. Similar to &cv-link-FORTRANFLAGS;, -but this variable is applied to all dialects. +but is &consvar; is applied to all dialects. +New in version 4.4. diff --git a/SCons/Tool/gfortran.py b/SCons/Tool/gfortran.py index 3c7e8b5..f9c0a45 100644 --- a/SCons/Tool/gfortran.py +++ b/SCons/Tool/gfortran.py @@ -29,24 +29,27 @@ It will usually be imported through the generic SCons.Tool.Tool() selection method. """ -import SCons.Util +from SCons.Util import CLVar from . import fortran def generate(env): - """Add Builders and construction variables for gfortran to an - Environment.""" + """Add Builders and construction variables for gfortran.""" fortran.generate(env) - for dialect in ['F77', 'F90', 'FORTRAN', 'F95', 'F03', 'F08']: - env[f'{dialect}'] = 'gfortran' - env[f'SH{dialect}'] = f'${dialect}' - if env['PLATFORM'] in ['cygwin', 'win32']: - env[f'SH{dialect}FLAGS'] = SCons.Util.CLVar(f'${dialect}FLAGS') - else: - env[f'SH{dialect}FLAGS'] = SCons.Util.CLVar(f'${dialect}FLAGS -fPIC') + # fill in other dialects (FORTRAN dialect set by fortran.generate(), + # but don't overwrite if they have been set manually. + for dialect in ['F77', 'F90', 'F95', 'F03', 'F08']: + if dialect not in env: + env[f'{dialect}'] = 'gfortran' + if f'SH{dialect}' not in env: + env[f'SH{dialect}'] = f'${dialect}' + # The fortran module always sets the shlib FLAGS, but does not + # include -fPIC, which is needed for the GNU tools. Rewrite if needed. + if env['PLATFORM'] not in ['cygwin', 'win32']: + env[f'SH{dialect}FLAGS'] = CLVar(f'${dialect}FLAGS -fPIC') env[f'INC{dialect}PREFIX'] = "-I" env[f'INC{dialect}SUFFIX'] = "" diff --git a/SCons/Tool/linkCommon/__init__.py b/SCons/Tool/linkCommon/__init__.py index 7aaffab..5461ad3 100644 --- a/SCons/Tool/linkCommon/__init__.py +++ b/SCons/Tool/linkCommon/__init__.py @@ -137,11 +137,14 @@ def smart_link(source, target, env, for_signature): if has_cplusplus and has_fortran and not has_d: global issued_mixed_link_warning if not issued_mixed_link_warning: - msg = "Using $CXX to link Fortran and C++ code together.\n\t" + \ - "This may generate a buggy executable if the '%s'\n\t" + \ - "compiler does not know how to deal with Fortran runtimes." - SCons.Warnings.warn(SCons.Warnings.FortranCxxMixWarning, - msg % env.subst('$CXX')) + msg = ( + "Using $CXX to link Fortran and C++ code together.\n" + " This may generate a buggy executable if the '%s'\n" + " compiler does not know how to deal with Fortran runtimes." + ) + SCons.Warnings.warn( + SCons.Warnings.FortranCxxMixWarning, msg % env.subst('$CXX') + ) issued_mixed_link_warning = True return '$CXX' elif has_d: diff --git a/test/Fortran/F95FLAGS.py b/test/Fortran/F95FLAGS.py index 2853cc9..e706264 100644 --- a/test/Fortran/F95FLAGS.py +++ b/test/Fortran/F95FLAGS.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,9 +22,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import TestSCons @@ -31,26 +30,30 @@ _python_ = TestSCons._python_ test = TestSCons.TestSCons() _exe = TestSCons._exe +# ref: test/fixture/mylink.py test.file_fixture('mylink.py') +# ref: test/Fortran/fixture/myfortran_flags.py test.file_fixture(['fixture', 'myfortran_flags.py']) test.write('SConstruct', """ -env = Environment(LINK = r'%(_python_)s mylink.py', - LINKFLAGS = [], - F95 = r'%(_python_)s myfortran_flags.py g95', - F95FLAGS = '-x', - FORTRAN = r'%(_python_)s myfortran_flags.py fortran', - FORTRANFLAGS = '-y') -env.Program(target = 'test01', source = 'test01.f') -env.Program(target = 'test02', source = 'test02.F') -env.Program(target = 'test03', source = 'test03.for') -env.Program(target = 'test04', source = 'test04.FOR') -env.Program(target = 'test05', source = 'test05.ftn') -env.Program(target = 'test06', source = 'test06.FTN') -env.Program(target = 'test07', source = 'test07.fpp') -env.Program(target = 'test08', source = 'test08.FPP') -env.Program(target = 'test13', source = 'test13.f95') -env.Program(target = 'test14', source = 'test14.F95') +env = Environment( + LINK=r'%(_python_)s mylink.py', + LINKFLAGS=[], + F95=r'%(_python_)s myfortran_flags.py g95', + F95FLAGS='-x', + FORTRAN=r'%(_python_)s myfortran_flags.py fortran', + FORTRANFLAGS='-y', +) +env.Program(target='test01', source='test01.f') +env.Program(target='test02', source='test02.F') +env.Program(target='test03', source='test03.for') +env.Program(target='test04', source='test04.FOR') +env.Program(target='test05', source='test05.ftn') +env.Program(target='test06', source='test06.FTN') +env.Program(target='test07', source='test07.fpp') +env.Program(target='test08', source='test08.FPP') +env.Program(target='test13', source='test13.f95') +env.Program(target='test14', source='test14.F95') """ % locals()) test.write('test01.f', "This is a .f file.\n#link\n#fortran\n") @@ -80,24 +83,22 @@ test.must_match('test14' + _exe, " -c -x\nThis is a .F95 file.\n") fc = 'f95' g95 = test.detect_tool(fc) - - if g95: test.subdir('x') - test.write(['x','dummy.i'], """ # Exists only such that -Ix finds the directory... """) + # ref: test/fixture/wrapper.py test.file_fixture('wrapper.py') test.write('SConstruct', """ -foo = Environment(F95 = '%(fc)s') +foo = Environment(F95='%(fc)s') f95 = foo.Dictionary('F95') -bar = foo.Clone(F95 = r'%(_python_)s wrapper.py ' + f95, F95FLAGS = '-Ix') -foo.Program(target = 'foo', source = 'foo.f95') -bar.Program(target = 'bar', source = 'bar.f95') +bar = foo.Clone(F95=r'%(_python_)s wrapper.py ' + f95, F95FLAGS='-Ix') +foo.Program(target='foo', source='foo.f95') +bar.Program(target='bar', source='bar.f95') """ % locals()) test.write('foo.f95', r""" @@ -114,21 +115,18 @@ bar.Program(target = 'bar', source = 'bar.f95') END """) - - test.run(arguments = 'foo' + _exe, stderr = None) - - test.run(program = test.workpath('foo'), stdout = " foo.f95\n") - + test.run(arguments='foo' + _exe, stderr=None) + test.run(program=test.workpath('foo'), stdout=" foo.f95\n") test.must_not_exist('wrapper.out') import sys - if sys.platform[:5] == 'sunos': - test.run(arguments = 'bar' + _exe, stderr = None) - else: - test.run(arguments = 'bar' + _exe) - test.run(program = test.workpath('bar'), stdout = " bar.f95\n") + if sys.platform.startswith('sunos'): + test.run(arguments='bar' + _exe, stderr=None) + else: + test.run(arguments='bar' + _exe) + test.run(program=test.workpath('bar'), stdout=" bar.f95\n") test.must_match('wrapper.out', "wrapper.py\n") test.pass_test() diff --git a/test/Fortran/SHF95FLAGS.py b/test/Fortran/SHF95FLAGS.py index 56744d6..7aaca56 100644 --- a/test/Fortran/SHF95FLAGS.py +++ b/test/Fortran/SHF95FLAGS.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,9 +22,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import TestSCons @@ -32,23 +31,25 @@ _obj = TestSCons._shobj obj_ = TestSCons.shobj_ test = TestSCons.TestSCons() +# ref: test/Fortran/fixture/myfortran_flags.py test.file_fixture(['fixture', 'myfortran_flags.py']) test.write('SConstruct', """ -env = Environment(SHF95 = r'%(_python_)s myfortran_flags.py g95', - SHFORTRAN = r'%(_python_)s myfortran_flags.py fortran') -env.Append(SHF95FLAGS = '-x', - SHFORTRANFLAGS = '-y') -env.SharedObject(target = 'test01', source = 'test01.f') -env.SharedObject(target = 'test02', source = 'test02.F') -env.SharedObject(target = 'test03', source = 'test03.for') -env.SharedObject(target = 'test04', source = 'test04.FOR') -env.SharedObject(target = 'test05', source = 'test05.ftn') -env.SharedObject(target = 'test06', source = 'test06.FTN') -env.SharedObject(target = 'test07', source = 'test07.fpp') -env.SharedObject(target = 'test08', source = 'test08.FPP') -env.SharedObject(target = 'test13', source = 'test13.f95') -env.SharedObject(target = 'test14', source = 'test14.F95') +env = Environment( + SHF95=r'%(_python_)s myfortran_flags.py g95', + SHFORTRAN=r'%(_python_)s myfortran_flags.py fortran', +) +env.Append(SHF95FLAGS='-x', SHFORTRANFLAGS='-y') +env.SharedObject(target='test01', source='test01.f') +env.SharedObject(target='test02', source='test02.F') +env.SharedObject(target='test03', source='test03.for') +env.SharedObject(target='test04', source='test04.FOR') +env.SharedObject(target='test05', source='test05.ftn') +env.SharedObject(target='test06', source='test06.FTN') +env.SharedObject(target='test07', source='test07.fpp') +env.SharedObject(target='test08', source='test08.FPP') +env.SharedObject(target='test13', source='test13.f95') +env.SharedObject(target='test14', source='test14.F95') """ % locals()) test.write('test01.f', "This is a .f file.\n#fortran\n") @@ -62,8 +63,7 @@ test.write('test08.FPP', "This is a .FPP file.\n#fortran\n") test.write('test13.f95', "This is a .f95 file.\n#g95\n") test.write('test14.F95', "This is a .F95 file.\n#g95\n") -test.run(arguments = '.', stderr = None) - +test.run(arguments='.', stderr=None) test.must_match(obj_ + 'test01' + _obj, " -c -y\nThis is a .f file.\n") test.must_match(obj_ + 'test02' + _obj, " -c -y\nThis is a .F file.\n") test.must_match(obj_ + 'test03' + _obj, " -c -y\nThis is a .for file.\n") @@ -75,29 +75,30 @@ test.must_match(obj_ + 'test08' + _obj, " -c -y\nThis is a .FPP file.\n") test.must_match(obj_ + 'test13' + _obj, " -c -x\nThis is a .f95 file.\n") test.must_match(obj_ + 'test14' + _obj, " -c -x\nThis is a .F95 file.\n") - - fc = 'f95' g95 = test.detect_tool(fc) - if g95: - test.subdir('x') - test.write(['x','dummy.i'], """ # Exists only such that -Ix finds the directory... """) + # ref: test/fixture/wrapper.py test.file_fixture('wrapper.py') - test.write('SConstruct', """ -foo = Environment(SHF95 = '%(fc)s') +foo = Environment(SHF95='%(fc)s') shf95 = foo.Dictionary('SHF95') -bar = foo.Clone(SHF95 = r'%(_python_)s wrapper.py ' + shf95) -bar.Append(SHF95FLAGS = '-Ix') -foo.SharedLibrary(target = 'foo/foo', source = 'foo.f95') -bar.SharedLibrary(target = 'bar/bar', source = 'bar.f95') +#print(f"foo SHF95={foo.Dictionary('SHF95')}", file=sys.stderr) +#print(f"foo F95FLAGS={foo.Dictionary('F95FLAGS')}", file=sys.stderr) +#print(f"foo SHF95FLAGS={foo.Dictionary('SHF95FLAGS')}", file=sys.stderr) +bar = foo.Clone(SHF95=r'%(_python_)s wrapper.py ' + shf95) +bar.Append(SHF95FLAGS='-Ix') +#print(f"bar SHF95={bar.Dictionary('SHF95')}", file=sys.stderr) +#print(f"bar F95FLAGS={bar.Dictionary('F95FLAGS')}", file=sys.stderr) +#print(f"bar SHF95FLAGS={bar.Dictionary('SHF95FLAGS')}", file=sys.stderr) +foo.SharedLibrary(target='foo/foo', source='foo.f95') +bar.SharedLibrary(target='bar/bar', source='bar.f95') """ % locals()) test.write('foo.f95', r""" @@ -114,17 +115,15 @@ bar.SharedLibrary(target = 'bar/bar', source = 'bar.f95') END """) - - test.run(arguments = 'foo', stderr = None) - + test.run(arguments='foo', stderr=None) test.must_not_exist('wrapper.out') import sys - if sys.platform[:5] == 'sunos': - test.run(arguments = 'bar', stderr = None) - else: - test.run(arguments = 'bar') + if sys.platform.startswith('sunos'): + test.run(arguments='bar', stderr=None) + else: + test.run(arguments='bar') test.must_match('wrapper.out', "wrapper.py\n") test.pass_test() diff --git a/test/Fortran/link-with-cxx.py b/test/Fortran/link-with-cxx.py index 22d9081..2f19e82 100644 --- a/test/Fortran/link-with-cxx.py +++ b/test/Fortran/link-with-cxx.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# MIT License +# +# Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,9 +22,6 @@ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" """ Verify the smart_link() warning messages used when attempting to link @@ -41,6 +40,7 @@ test = TestSCons.TestSCons(match = TestSCons.match_re) test.write('test_linker.py', """\ import sys + if sys.argv[1] == '-o': with open(sys.argv[2], 'wb') as ofp: for infile in sys.argv[3:]: @@ -54,9 +54,9 @@ elif sys.argv[1][:5] == '/OUT:': sys.exit(0) """) - test.write('test_fortran.py', """\ import sys + with open(sys.argv[2], 'wb') as ofp: for infile in sys.argv[4:]: with open(infile, 'rb') as ifp: @@ -64,35 +64,35 @@ with open(sys.argv[2], 'wb') as ofp: sys.exit(0) """) - test.write('SConstruct', """ import SCons.Tool.link + def copier(target, source, env): s = str(source[0]) t = str(target[0]) with open(t, 'wb') as ofp, open(s, 'rb') as ifp: ofp.write(ifp.read()) -env = Environment(CXX = r'%(_python_)s test_linker.py', - CXXCOM = Action(copier), - SMARTLINK = SCons.Tool.link.smart_link, - LINK = r'$SMARTLINK', - LINKFLAGS = '', - # We want to re-define this as follows (so as to - # not rely on a real Fortran compiler) but can't - # because $FORTRANCOM is defined with an extra space - # so it ends up as a CommandAction, not a LazyAction. - # Must look into changing that after 1.0 is out. - #FORTRANCOM = Action(copier)) - FORTRAN = r'%(_python_)s test_fortran.py') +env = Environment( + CXX=r'%(_python_)s test_linker.py', + CXXCOM=Action(copier), + SMARTLINK=SCons.Tool.link.smart_link, + LINK=r'$SMARTLINK', + LINKFLAGS='', + # We want to re-define this as follows (so as to + # not rely on a real Fortran compiler) but can't + # because $FORTRANCOM is defined with an extra space + # so it ends up as a CommandAction, not a LazyAction. + # Must look into changing that after 1.0 is out. + # FORTRANCOM = Action(copier)) + FORTRAN=r'%(_python_)s test_fortran.py', +) env.Program('prog1.exe', ['f1.cpp', 'f2.f']) env.Program('prog2.exe', ['f1.cpp', 'f2.f']) if ARGUMENTS.get('NO_LINK'): - # Can remove no-deprecated when we drop Python1.5 - SetOption('warn', ['no-link', 'no-deprecated']) + SetOption('warn', ['no-link']) if ARGUMENTS.get('NO_MIX'): - # Can remove no-deprecated when we drop Python1.5 - SetOption('warn', ['no-fortran-cxx-mix', 'no-deprecated']) + SetOption('warn', ['no-fortran-cxx-mix']) """ % locals()) test.write('f1.cpp', "f1.cpp\n") @@ -100,52 +100,43 @@ test.write('f2.f', "f2.f\n") expect = (""" scons: warning: Using \\$CXX to link Fortran and C\\+\\+ code together. -\tThis may generate a buggy executable if the '%s test_linker.py' -\tcompiler does not know how to deal with Fortran runtimes. + This may generate a buggy executable if the '%s test_linker.py' + compiler does not know how to deal with Fortran runtimes. """ % re.escape(_python_)) + TestSCons.file_expr test.run(arguments = '.', stderr=expect) - test.must_match('prog1.exe', "f1.cpp\nf2.f\n") test.must_match('prog2.exe', "f1.cpp\nf2.f\n") test.run(arguments = '-c .', stderr=expect) - test.must_not_exist('prog1.exe') test.must_not_exist('prog2.exe') test.run(arguments = '--warning=no-link .') - test.must_match('prog1.exe', "f1.cpp\nf2.f\n") test.must_match('prog2.exe', "f1.cpp\nf2.f\n") test.run(arguments = '-c .', stderr=expect) - test.must_not_exist('prog1.exe') test.must_not_exist('prog2.exe') test.run(arguments = '--warning=no-fortran-cxx-mix .') - test.must_match('prog1.exe', "f1.cpp\nf2.f\n") test.must_match('prog2.exe', "f1.cpp\nf2.f\n") test.run(arguments = '-c .', stderr=expect) - test.must_not_exist('prog1.exe') test.must_not_exist('prog2.exe') test.run(arguments = 'NO_LINK=1 .') - test.must_match('prog1.exe', "f1.cpp\nf2.f\n") test.must_match('prog2.exe', "f1.cpp\nf2.f\n") test.run(arguments = '-c .', stderr=expect) - test.must_not_exist('prog1.exe') test.must_not_exist('prog2.exe') test.run(arguments = 'NO_MIX=1 .') - test.must_match('prog1.exe', "f1.cpp\nf2.f\n") test.must_match('prog2.exe', "f1.cpp\nf2.f\n") -- cgit v0.12 From 8b793169a1bab12e9912a54c4d53875e8347aca0 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Wed, 18 Jan 2023 08:39:21 -0700 Subject: Fix editing mistake in fortran doc [skip appveyor] Signed-off-by: Mats Wichmann --- SCons/Tool/fortran.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SCons/Tool/fortran.xml b/SCons/Tool/fortran.xml index e91f659..4a092ec 100644 --- a/SCons/Tool/fortran.xml +++ b/SCons/Tool/fortran.xml @@ -122,7 +122,7 @@ for the &consvars; that expand those options. General user-specified options that are passed to the Fortran compiler. Similar to &cv-link-FORTRANFLAGS;, -but is &consvar; is applied to all dialects. +but this &consvar; is applied to all dialects. New in version 4.4. -- cgit v0.12 From f30704396e0a6d4dd7c49c85494de445df68655a Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Sun, 22 Jan 2023 07:44:28 -0700 Subject: gfortran - remove some debug prints [skip appveyor] One of the tests had some debug fluff left over - cleaned. Reworded the CHANGES blurb and added one to RELEASE. Signed-off-by: Mats Wichmann --- CHANGES.txt | 7 ++++--- RELEASE.txt | 6 ++++++ test/Fortran/SHF95FLAGS.py | 6 ------ 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index c2bb504..aaa44a0 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -107,9 +107,10 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER looked up through a node ended up generating a Python SyntaxError because it was passed through scons_subst(). - Have the gfortran tool do a better job of honoring user preferences - for the dialect tools (F95, SHF95, etc.). Previously set those - unconditionally to 'gfortran'. Cleaned a few Fortran tests - - behavior does not change. + for the dialect tools (F95, SHF95, etc.). Previously these were + unconditionally forced to 'gfortran'; the change should be more + in line with expectations of how these variables should work. + Also cleaned a few Fortran tests - test behavior does not change. RELEASE 4.4.0 - Sat, 30 Jul 2022 14:08:29 -0700 diff --git a/RELEASE.txt b/RELEASE.txt index 35fd845..703bf7b 100644 --- a/RELEASE.txt +++ b/RELEASE.txt @@ -71,6 +71,12 @@ FIXES the compilation step for the source/target pair. - A refactor in the caching logic for version 4.4.0 left Java inner classes failing with an exception when a CacheDir was enabled. This is now corrected. +- When using the gfortran tool (the default on most platforms as long as a GNU + toolchain is installed), the user setting of the "dialect" compilers + (F77, F90, F03 and F09, as well as the shared-library complements SHF77, + SHF90, SHF03, SHF09) is now honored; previously the tool forced the + settings to 'gfortran', which made it difficult reference a cross-compile + version for dialects. IMPROVEMENTS diff --git a/test/Fortran/SHF95FLAGS.py b/test/Fortran/SHF95FLAGS.py index 7aaca56..dcec49b 100644 --- a/test/Fortran/SHF95FLAGS.py +++ b/test/Fortran/SHF95FLAGS.py @@ -89,14 +89,8 @@ if g95: test.write('SConstruct', """ foo = Environment(SHF95='%(fc)s') shf95 = foo.Dictionary('SHF95') -#print(f"foo SHF95={foo.Dictionary('SHF95')}", file=sys.stderr) -#print(f"foo F95FLAGS={foo.Dictionary('F95FLAGS')}", file=sys.stderr) -#print(f"foo SHF95FLAGS={foo.Dictionary('SHF95FLAGS')}", file=sys.stderr) bar = foo.Clone(SHF95=r'%(_python_)s wrapper.py ' + shf95) bar.Append(SHF95FLAGS='-Ix') -#print(f"bar SHF95={bar.Dictionary('SHF95')}", file=sys.stderr) -#print(f"bar F95FLAGS={bar.Dictionary('F95FLAGS')}", file=sys.stderr) -#print(f"bar SHF95FLAGS={bar.Dictionary('SHF95FLAGS')}", file=sys.stderr) foo.SharedLibrary(target='foo/foo', source='foo.f95') bar.SharedLibrary(target='bar/bar', source='bar.f95') """ % locals()) -- cgit v0.12 From d108866d7cea119ca73e87a0ea131c5b25612033 Mon Sep 17 00:00:00 2001 From: William Deegan Date: Mon, 23 Jan 2023 11:16:16 -0800 Subject: [ci skip] Updates to CHANGES/RELEASE --- CHANGES.txt | 5 +++-- RELEASE.txt | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index aaa44a0..c7944ba 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -107,8 +107,9 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER looked up through a node ended up generating a Python SyntaxError because it was passed through scons_subst(). - Have the gfortran tool do a better job of honoring user preferences - for the dialect tools (F95, SHF95, etc.). Previously these were - unconditionally forced to 'gfortran'; the change should be more + for the dialect tools (F77, F90, F03 and F09, as well as the shared-library + equivalents SHF77, SHF90, SHF03, SHF09). Previously these were + unconditionally overwritten to 'gfortran'; the change should be more in line with expectations of how these variables should work. Also cleaned a few Fortran tests - test behavior does not change. diff --git a/RELEASE.txt b/RELEASE.txt index 703bf7b..c78bcb2 100644 --- a/RELEASE.txt +++ b/RELEASE.txt @@ -73,8 +73,8 @@ FIXES failing with an exception when a CacheDir was enabled. This is now corrected. - When using the gfortran tool (the default on most platforms as long as a GNU toolchain is installed), the user setting of the "dialect" compilers - (F77, F90, F03 and F09, as well as the shared-library complements SHF77, - SHF90, SHF03, SHF09) is now honored; previously the tool forced the + (F77, F90, F03 and F09, as well as the shared-library equivalents SHF77, + SHF90, SHF03, SHF09) is now honored; previously the tool overwrote the settings to 'gfortran', which made it difficult reference a cross-compile version for dialects. -- cgit v0.12