From 58b032943d9361d54833701953b59b8a2fb93c40 Mon Sep 17 00:00:00 2001 From: Ryan Burns Date: Tue, 17 Dec 2019 09:36:50 -0800 Subject: [PATCH 1/2] Use command_argument_count in mdx_main I was having trouble compiling using macports gfortran-mp-9 due to being unable to link to symbol iargc. I think [1] implies this is a gfortran 77 extension, so maybe it isn't available in the mac library? It looks like there is a replacement [2] which is standard fortran as of '03, and using this function fixes this bug for me. [1] https://gcc.gnu.org/onlinedocs/gfortran/IARGC.html [2] https://gcc.gnu.org/onlinedocs/gfortran/COMMAND_005fARGUMENT_005fCOUNT.html --- contrib/mdx/src/SConscript | 2 +- contrib/mdx/src/mdx_main.F | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/contrib/mdx/src/SConscript b/contrib/mdx/src/SConscript index 9f0bd88..51ea02b 100644 --- a/contrib/mdx/src/SConscript +++ b/contrib/mdx/src/SConscript @@ -35,7 +35,7 @@ import os Import('envmdx') envmdx.Append( CCFLAGS=['-DSUN','-DIO64','-I'+envmdx['MOTIFINCPATH'],'-I'+envmdx['X11INCPATH']] ) envmdx.PrependUnique( LIBPATH=[envmdx['MOTIFLIBPATH'],envmdx['X11LIBPATH']] ) -envmdx.Append( FORTRANFLAGS=['-DSUN','-DIO64','-DGFORTRAN'] ) +envmdx.Append( FORTRANFLAGS=['-DSUN','-DIO64'] ) listFiles = ['graphx_mdx.c','rdf_reader_subs.f','mdx_subs.F'] build = envmdx['PRJ_LIB_DIR'] diff --git a/contrib/mdx/src/mdx_main.F b/contrib/mdx/src/mdx_main.F index 042b73c..ce77460 100644 --- a/contrib/mdx/src/mdx_main.F +++ b/contrib/mdx/src/mdx_main.F @@ -74,12 +74,6 @@ c***************************************************************** integer i_arg integer i_inarg - integer iargc -#ifdef GFORTRAN -c external iargc -#else - external iargc -#endif integer rdflen external rdflen @@ -110,7 +104,7 @@ c external iargc equivalence(b_data,r_data) a_cmd = '-V' - i_inarg = iargc() + i_inarg = command_argument_count() if (i_inarg .eq. 0) then write(6,*) ' ' write(6,'(1x,a,a18,a)' ) ' << mdx Version ',version_mdx(), ' >> ' From 9bee1a326b06e6501eb135078fe9d314af108918 Mon Sep 17 00:00:00 2001 From: Ryan Burns Date: Fri, 20 Dec 2019 19:45:16 -0800 Subject: [PATCH 2/2] Fix complex cast for gcc9 Fixes #57 --- components/mroipac/looks/bindings/looksmodule.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/mroipac/looks/bindings/looksmodule.cpp b/components/mroipac/looks/bindings/looksmodule.cpp index 27d40f1..122e52b 100644 --- a/components/mroipac/looks/bindings/looksmodule.cpp +++ b/components/mroipac/looks/bindings/looksmodule.cpp @@ -250,7 +250,7 @@ int takeLookscpx(DataAccessor *IAIn, DataAccessor* IAout, int ld, int la) for(int j = 0; j < nfull; j++) { - bdbl[j] += ain[j]; + bdbl[j] += complex(ain[j].real(), ain[j].imag()); } }