Closed kasra-keshavarz closed 1 month ago
Forgot to mention that the VM is running on a arm64
computer (MacBook Pro M2 CPU).
Including #include <string.h>
does resolve the issue. librmn will be updated in the future, so we'll see if then they've already accounted for this. A pending update to the makefile targets will also provide more flexibility to omit inactive model codes from being compiled. This will also resolve the issue if SVS isn't required and would be disabled during compile-time outright.
Please re-open the ticket if further action is required for @roalva82's specific needs.
Thanks Dan, I tried to follow your suggestion:
$ make netcdf gfortran
...
gcc -c -O2 -I./LSS_Model/SVS/svs1/changes_to_rpnphy -I./LSS_Model/SVS/svs1/rpnphy_5.8.3_all -I./LSS_Model/SVS/svs1/svs_GEM_v5.8.rc2 -I./Modules/librmn/19.7.0/CUSTOM_INCLUDES/ ./Modules/librmn/19.7.0/primitives/getenvc.c
./Modules/librmn/19.7.0/primitives/getenvc.c:34:1: error: parameter names (without types) in function declaration [-Wdeclaration-missing-parameter-type]
34 | F2Cl len1, len2;
| ^~~~
./Modules/librmn/19.7.0/primitives/getenvc.c:33:1: error: 'f77name' declared as function returning a function
33 | f77name(getenvc) ( name, value, len1, len2 )
| ^~~~~~~
./Modules/librmn/19.7.0/primitives/getenvc.c: In function 'f77name':
./Modules/librmn/19.7.0/primitives/getenvc.c:33:1: error: type of 'getenvc' defaults to 'int' [-Wimplicit-int]
./Modules/librmn/19.7.0/primitives/getenvc.c:35:15: error: declaration for parameter 'value' but no such parameter
35 | char name[1], value[1];
| ^~~~~
./Modules/librmn/19.7.0/primitives/getenvc.c:35:6: error: declaration for parameter 'name' but no such parameter
35 | char name[1], value[1];
| ^~~~
./Modules/librmn/19.7.0/primitives/getenvc.c:34:13: error: declaration for parameter 'len2' but no such parameter
34 | F2Cl len1, len2;
| ^~~~
./Modules/librmn/19.7.0/primitives/getenvc.c:34:7: error: declaration for parameter 'len1' but no such parameter
34 | F2Cl len1, len2;
| ^~~~
make: *** [getenvc.o] Error 1
(base) kasras-mbp:MESH-Dev kasrakeshavarz$ git diff
diff --git a/Modules/librmn/19.7.0/primitives/getenvc.c b/Modules/librmn/19.7.0/primitives/getenvc.c
index bbd2dbf..d8bc783 100644
--- a/Modules/librmn/19.7.0/primitives/getenvc.c
+++ b/Modules/librmn/19.7.0/primitives/getenvc.c
@@ -17,9 +17,9 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
-
#if defined(NEC)
#endif
+#include <string.h>
#include <stdlib.h>
#include <rpnmacros.h>
/*
Problem statement
I'm not quite sure about the source code of
MESH
, as I am not completely aware of all the ins and outs, but while trying to provide @roalva82 with an executable on an Ubuntu VM, I noticed>gcc-9.4.0
(could be earlier versions too) throws an error for the involvedC
codes inMESH
. Are we missing a flag or something?Here is the typical error:
Suggested fix
It apparently relates to the
SVS
source code? I thought a quick fix could be like the following:and, the original code is the following: https://github.com/MESH-Model/MESH-Dev/blob/ff1de25e67ef552844f1e789c0faffb4175a8dac/Modules/librmn/19.7.0/primitives/getenvc.c#L21-L75
Let me know if this is an acceptable fix, and I'll send it as a
PR
.Suggestions
I know
SVS
is probably an upstream package, but not sure if it is under active development, so I can submit this there? Also, is there a possibility to useSVS
as a shared library, rather than statically linking (if it is) it withMESH
executables?