From de1e16f07d86518e86328cfe6e0f534ace273db5 Mon Sep 17 00:00:00 2001 From: helloworld664 <3226476857@qq.com> Date: Wed, 24 Sep 2025 19:18:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9pnetcdf=E4=B8=8Ebisheng?= =?UTF-8?q?=E4=B8=8D=E9=80=82=E9=85=8D=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package/pnetcdf/1.11.2/install.sh | 18 +++++++++++++++++- package/pnetcdf/1.12.1/install.sh | 18 +++++++++++++++++- package/pnetcdf/1.12.3/install.sh | 18 +++++++++++++++++- package/pnetcdf/1.9.0/install.sh | 18 +++++++++++++++++- 4 files changed, 68 insertions(+), 4 deletions(-) diff --git a/package/pnetcdf/1.11.2/install.sh b/package/pnetcdf/1.11.2/install.sh index e281cea5..130bb992 100755 --- a/package/pnetcdf/1.11.2/install.sh +++ b/package/pnetcdf/1.11.2/install.sh @@ -8,6 +8,22 @@ cd ${JARVIS_TMP} rm -rf pnetcdf-${pnetcdf_ver} tar zxvf ${JARVIS_DOWNLOAD}/pnetcdf-${pnetcdf_ver}.tar.gz cd pnetcdf-${pnetcdf_ver} -./configure --prefix=$1 --enable-shared --enable-fortran --enable-large-file-test FFLAGS="-fallow-argument-mismatch" FCFLAGS="-fallow-argument-mismatch" +use_gcc=0 +which_mpicc=`which mpicc 2> /dev/null 1> /dev/null` +which_ret=$? +if [ "$which_ret" -eq "0" ]; then + if [ "`mpicc --version | grep gcc`" ]; then + use_gcc=1 + fi +fi +FFLAGS="" +FCFLAGS="" +if [ "$use_gcc" -eq "1" ]; then + if [ "`$CC --version | grep gcc | grep -oP \"\)\s*\K[0-9]+(?=\.)\"`" -ge '10' ]; then + FFLAGS="-fallow-argument-mismatch" + FCFLAGS="-fallow-argument-mismatch" + fi +fi +./configure --prefix=$1 --enable-shared --enable-fortran --enable-large-file-test FFLAGS="$FFLAGS" FCFLAGS="$FCFLAGS" make -j16 make install diff --git a/package/pnetcdf/1.12.1/install.sh b/package/pnetcdf/1.12.1/install.sh index 86deafa8..997edbea 100755 --- a/package/pnetcdf/1.12.1/install.sh +++ b/package/pnetcdf/1.12.1/install.sh @@ -7,6 +7,22 @@ cd ${JARVIS_TMP} rm -rf pnetcdf-${pnetcdf_version} tar zxvf ${JARVIS_DOWNLOAD}/pnetcdf-${pnetcdf_version}.tar.gz cd pnetcdf-${pnetcdf_version} -./configure --prefix=$1 --build=aarch64-linux --enable-shared --enable-fortran --enable-large-file-test FFLAGS="-fallow-argument-mismatch" FCFLAGS="-fallow-argument-mismatch" +use_gcc=0 +which_mpicc=`which mpicc 2> /dev/null 1> /dev/null` +which_ret=$? +if [ "$which_ret" -eq "0" ]; then + if [ "`mpicc --version | grep gcc`" ]; then + use_gcc=1 + fi +fi +FFLAGS="" +FCFLAGS="" +if [ "$use_gcc" -eq "1" ]; then + if [ "`$CC --version | grep gcc | grep -oP \"\)\s*\K[0-9]+(?=\.)\"`" -ge '10' ]; then + FFLAGS="-fallow-argument-mismatch" + FCFLAGS="-fallow-argument-mismatch" + fi +fi +./configure --prefix=$1 --build=aarch64-linux --enable-shared --enable-fortran --enable-large-file-test FFLAGS="$FFLAGS" FCFLAGS="$FCFLAGS" make -j16 make install diff --git a/package/pnetcdf/1.12.3/install.sh b/package/pnetcdf/1.12.3/install.sh index 4ef2f59d..7852f8e1 100755 --- a/package/pnetcdf/1.12.3/install.sh +++ b/package/pnetcdf/1.12.3/install.sh @@ -6,6 +6,22 @@ pnetcdf_version='1.12.3' cd ${JARVIS_TMP} tar zxvf ${JARVIS_DOWNLOAD}/pnetcdf-${pnetcdf_version}.tar.gz cd pnetcdf-${pnetcdf_version} -./configure --prefix=$1 --build=aarch64-linux --enable-shared --enable-fortran --enable-large-file-test CFLAGS="-fPIC -DPIC" CXXFLAGS="-fPIC -DPIC" FCFLAGS="-fPIC" FFLAGS="-fPIC" CC=mpicc CXX=mpicxx FC=mpifort F77=mpifort FFLAGS="-fallow-argument-mismatch" FCFLAGS="-fallow-argument-mismatch" +use_gcc=0 +which_mpicc=`which mpicc 2> /dev/null 1> /dev/null` +which_ret=$? +if [ "$which_ret" -eq "0" ]; then + if [ "`mpicc --version | grep gcc`" ]; then + use_gcc=1 + fi +fi +FFLAGS="-fPIC" +FCFLAGS="-fPIC" +if [ "$use_gcc" -eq "1" ]; then + if [ "`$CC --version | grep gcc | grep -oP \"\)\s*\K[0-9]+(?=\.)\"`" -ge '10' ]; then + FFLAGS="$FFLAGS -fallow-argument-mismatch" + FCFLAGS="$FCFLAGS -fallow-argument-mismatch" + fi +fi +./configure --prefix=$1 --build=aarch64-linux --enable-shared --enable-fortran --enable-large-file-test CFLAGS="-fPIC -DPIC" CXXFLAGS="-fPIC -DPIC" CC=mpicc CXX=mpicxx FC=mpifort F77=mpifort FFLAGS="$FFLAGS" FCFLAGS="$FCFLAGS" make -j16 make install diff --git a/package/pnetcdf/1.9.0/install.sh b/package/pnetcdf/1.9.0/install.sh index c3f8cd14..e910f9e7 100644 --- a/package/pnetcdf/1.9.0/install.sh +++ b/package/pnetcdf/1.9.0/install.sh @@ -8,6 +8,22 @@ cd ${JARVIS_TMP} rm -rf pnetcdf-${pnetcdf_ver} tar zxvf ${JARVIS_DOWNLOAD}/parallel-netcdf-1.9.0.tar.gz cd parallel-netcdf-1.9.0 -./configure --prefix=$1 --enable-shared --enable-fortran --enable-large-file-test FFLAGS="-fallow-argument-mismatch" FCFLAGS="-fallow-argument-mismatch" +use_gcc=0 +which_mpicc=`which mpicc 2> /dev/null 1> /dev/null` +which_ret=$? +if [ "$which_ret" -eq "0" ]; then + if [ "`mpicc --version | grep gcc`" ]; then + use_gcc=1 + fi +fi +FFLAGS="" +FCFLAGS="" +if [ "$use_gcc" -eq "1" ]; then + if [ "`$CC --version | grep gcc | grep -oP \"\)\s*\K[0-9]+(?=\.)\"`" -ge '10' ]; then + FFLAGS="-fallow-argument-mismatch" + FCFLAGS="-fallow-argument-mismatch" + fi +fi +./configure --prefix=$1 --enable-shared --enable-fortran --enable-large-file-test FFLAGS="$FFLAGS" FCFLAGS="$FCFLAGS" make -j16 make install \ No newline at end of file -- Gitee