source: issm/oecreview/Archive/24684-25833/ISSM-25638-25639.diff@ 25834

Last change on this file since 25834 was 25834, checked in by Mathieu Morlighem, 4 years ago

CHG: added 24684-25833

File size: 3.3 KB
RevLine 
[25834]1Index: ../trunk-jpl/src/c/modules/QmuStatisticsx/QmuStatisticsx.cpp
2===================================================================
3--- ../trunk-jpl/src/c/modules/QmuStatisticsx/QmuStatisticsx.cpp (revision 25638)
4+++ ../trunk-jpl/src/c/modules/QmuStatisticsx/QmuStatisticsx.cpp (revision 25639)
5@@ -173,14 +173,14 @@
6
7 /*figure out size of file, and read the whole thing:*/
8 _printf0_(" reading file:\n");
9- fseek (fid, 0, SEEK_END);
10+ fseek(fid, 0, SEEK_END);
11 length = ftell (fid);
12- fseek (fid, 0, SEEK_SET);
13+ fseek(fid, 0, SEEK_SET);
14 buffer = xNew<char>(length);
15- fread (buffer, sizeof(char), length, fid);
16+ fread(buffer, sizeof(char), length, fid);
17
18 /*close file:*/
19- fclose (fid);
20+ fclose(fid);
21
22 /*create a memory stream with this buffer:*/
23 _printf0_(" processing file:\n");
24Index: ../trunk-jpl/m4/issm_options.m4
25===================================================================
26--- ../trunk-jpl/m4/issm_options.m4 (revision 25638)
27+++ ../trunk-jpl/m4/issm_options.m4 (revision 25639)
28@@ -191,9 +191,15 @@
29 )
30
31 AC_MSG_CHECKING([if this is a Mac build])
32+ MAC_FMEMOPEN=0
33 case "${host_os}" in
34 *darwin*)
35 IS_MAC=yes
36+ if [[ $(system_profiler SPSoftwareDataType | $(which grep) "System Version:" | sed -e "s/[[:space:]]*System Version: macOS //" | cut -d "." -f 2) -ge 13 ]]; then
37+ MAC_FMEMOPEN=yes
38+ else
39+ MAC_FMEMOPEN=no
40+ fi
41 ;;
42 *)
43 IS_MAC=no
44@@ -200,6 +206,7 @@
45 ;;
46 esac
47 AM_CONDITIONAL([MAC], [test "${IS_MAC}" == "yes"])
48+ AM_CONDITIONAL([MAC_FMEMOPEN], [test "${MAC_FMEMOPEN}" == "yes"])
49 AC_MSG_RESULT([${IS_MAC}])
50
51 IS_WINDOWS=no
52@@ -2331,7 +2338,7 @@
53 AC_DEFINE([_HAVE_GMSH_], [1], [with Gmsh in ISSM src])
54
55 AC_MSG_CHECKING(for Gmsh version)
56- GMSH_VERSION_MAJOR=`${GMSH_ROOT}/bin/gmsh -info | grep "Version" | sed -e "s/Version@<:@@<:@:blank:@:>@@:>@*:@<:@@<:@:blank:@:>@@:>@//" | cut -d "." -f1`
57+ GMSH_VERSION_MAJOR=`${GMSH_ROOT}/bin/gmsh -info | grep "Version" | sed -e "s/Version@<:@@<:@:blank:@:>@@:>@*:@<:@@<:@:blank:@:>@@:>@//" | cut -d "." -f 1`
58 AC_MSG_RESULT([${GMSH_VERSION_MAJOR}])
59 AC_DEFINE_UNQUOTED(_GMSH_VERSION_MAJOR_, $GMSH_VERSION_MAJOR, [Gmsh major version])
60 fi
61Index: ../trunk-jpl/src/c/modules/QmuStatisticsx/QmuStatisticsx.h
62===================================================================
63--- ../trunk-jpl/src/c/modules/QmuStatisticsx/QmuStatisticsx.h (revision 25638)
64+++ ../trunk-jpl/src/c/modules/QmuStatisticsx/QmuStatisticsx.h (revision 25639)
65@@ -6,6 +6,10 @@
66
67 #include "../../classes/classes.h"
68
69+#if MAC && !MAC_FMEMOPEN
70+#include "../../ext/fmemopen/fmemopen.h"
71+#endif
72+
73 int ComputeMeanVariance(Parameters* parameters,Results* results,int color, ISSM_MPI_Comm statcomm);
74 int ComputeSampleSeries(Parameters* parameters,Results* results,int color, ISSM_MPI_Comm statcomm);
75 int OutputStatistics(Parameters* parameters,Results* results,int color,ISSM_MPI_Comm statcomm);
76Index: ../trunk-jpl/src/c/Makefile.am
77===================================================================
78--- ../trunk-jpl/src/c/Makefile.am (revision 25638)
79+++ ../trunk-jpl/src/c/Makefile.am (revision 25639)
80@@ -20,8 +20,18 @@
81 #}}}
82
83 #Core sources
84+issm_sources =
85+
86+#GLIBC sources {{{
87+if MAC
88+if !MAC_FMEMOPEN
89+issm_sources += \
90+ ./ext/fmemopen/fmemopen.c
91+endif
92+endif
93+#}}}
94+
95 #BAMG sources {{{
96-issm_sources =
97 if BAMG
98 issm_sources += \
99 ./bamg/BamgGeom.cpp \
Note: See TracBrowser for help on using the repository browser.