#69 closed defect (fixed)
HP g95 has invalid switches
Reported by: | Dave Offiler | Owned by: | Dave Offiler |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | ROPP (all) | Version: | 0.8 |
Keywords: | G95 HP | Cc: |
Description
ropp_tools fails to build using G95 on HP-UX:
hpg95 +ppu +U77 -O2 -I/data/nwp1/grassaf/ropp/hpg95/include -c -o algdiv.o `test -f '../math/dcdflib/src/algdiv.f' || echo './'`../math/dcdflib/src/algdiv.f hpg95: +ppu: No such file or directory hpg95: +U77: No such file or directory
Switches +ppu and +U77 are not valid and being interpreted as files.
Change history (3)
comment:1 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 by , 18 years ago
Version: | → 0.8 |
---|
Note:
See TracTickets
for help on using tickets.
1) G95 needs to be separarately detected from GFortran in cm_compilers.m4 as they now use different cfortran.h switches (g95: -Df2cFortran, gfc: -DNAGf90Fortran). Both were being detected as vendor 'GCC', so the same switch (-Df2cFortran, previously also used by gfc) was generated for both compilers' Makefiles; this stopped gfc from linking with C routines.
Solution: Modified cm_compilers.m4 to add 'G95' to the vendor list, so G95 is detected as vendor 'G95'. Modified cm_compiler_defaults.m4 to add a new platform-independent block for G95 from the similar template for GFortran (GCC), changing the cfortran.h switch appropriately for GCC.
Result: These changes correctly support both g95 & gfc on Linux.
2) In cm_compiler_defaults, running on HP-UX with G95, O/S hp-ux is detected, but (in a recent change) skipped if the vendor is 'NAG' or 'GCC' (G95 and GFortran), so the platform independent GCC set up is run. The change in (1) - vendor now 'G95' - was being grabbed as hp-ux and the offending hpf switches (the subject of this Ticket) are generated. An extra test is needed in the hp-ux block to skip 'G95' as well as 'GCC', allowing the platform-independednt G95 setup to run.
Solution: Modified cm_compiler_defaults.m4 to add a test for vendor 'G95', in addition to 'NAG' & 'GCC' in the hp-ux block.
Result: This change allows correct configure for ropp_tools and ropp_1dvar, but the offending switched are still generated for ropp_io and ropp_fm.
3) cm_tools.m4 in ropp_io/m4 and ropp_fm/m4 both have duplicate macro definitions for CM_COMPILER_DEFAULTS to the (old) macro in cm_compiler_defaults.m4. aclocal is picking up this macro and not the (new) one in cm_compiler_defaults.m4. Hence the modified m4 files built correct configure files for ropp_tools and ropp_1dvar, but not for ropp_io and ropp_fm.
Solution: Remove the duplicate macro in cm_tools.m4 in ropp_io & ropp_fm
Result: Correct configure in all modules.
Updated m4 and re-generated configure files committed as [885]
All ropp modules can now be built on RH Linux gfc and HP-UX g95. This does not mean that the code runs correctly!