Changeset 25710
- Timestamp:
- 10/22/20 13:30:01 (4 years ago)
- Location:
- issm/trunk-jpl
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/externalpackages/petsc/install-3.14-mac.sh
r25672 r25710 39 39 --download-hdf5=1 40 40 41 42 41 # Compile and install 43 make 44 make install 42 if [ $# -eq 0 ]; then 43 make 44 make install 45 else 46 make -j $1 47 make -j $1 install 48 fi -
issm/trunk-jpl/m4/issm_options.m4
r25666 r25710 210 210 SYSTEM_FMEMOPEN=1 211 211 if test "${IS_MAC}" == "yes"; then 212 if [[ $(system_profiler SPSoftwareDataType | $(which grep)"System Version:" | sed -e "s/[[:space:]]*System Version: macOS //" | cut -d "." -f 2) -lt 13 ]]; then212 if [[ $(system_profiler SPSoftwareDataType | /usr/bin/grep "System Version:" | sed -e "s/[[:space:]]*System Version: macOS //" | cut -d "." -f 2) -lt 13 ]]; then 213 213 SYSTEM_FMEMOPEN=0 214 214 fi … … 378 378 *) 379 379 MATLABINCL="-I${MATLAB_ROOT}/extern/include" 380 MEXLINK=$(${MATLAB_ROOT}/bin/mex -v 2>&1 < /dev/null | grep LDFLAGS | sed -e "s/ LDFLAGS = //g")381 MEXLIB=$(${MATLAB_ROOT}/bin/mex -v 2>&1 < /dev/null | grep CXXLIBS | sed -e "s/ CXXLIBS = //g")382 MEXEXT=$(${MATLAB_ROOT}/bin/mex -v 2>&1 < /dev/null | grep LDEXTENSION | sed -e "s/ LDEXTENSION = //g")380 MEXLINK=$(${MATLAB_ROOT}/bin/mex -v 2>&1 < /dev/null | /usr/bin/grep LDFLAGS | sed -e "s/ LDFLAGS = //g") 381 MEXLIB=$(${MATLAB_ROOT}/bin/mex -v 2>&1 < /dev/null | /usr/bin/grep CXXLIBS | sed -e "s/ CXXLIBS = //g") 382 MEXEXT=$(${MATLAB_ROOT}/bin/mex -v 2>&1 < /dev/null | /usr/bin/grep LDEXTENSION | sed -e "s/ LDEXTENSION = //g") 383 383 dnl version 2014 and up 384 384 if test -z "${MEXEXT}"; then … … 387 387 ${MATLAB_ROOT}/bin/mex -v -lmex conftest.cpp > conftest.tmp 2>&1 388 388 rm -f conftest.cpp 389 MEXLINK=$(cat conftest.tmp | grep LDFLAGS | sed -e "s/LDFLAGS ://g")390 MEXLIB=$(cat conftest.tmp | grep LINKLIBS | sed -e "s/LINKLIBS ://g")391 MEXEXT=$(cat conftest.tmp | grep LDEXT | sed -e "s/LDEXT ://g" | awk '{print $[1]}')389 MEXLINK=$(cat conftest.tmp | /usr/bin/grep LDFLAGS | sed -e "s/LDFLAGS ://g") 390 MEXLIB=$(cat conftest.tmp | /usr/bin/grep LINKLIBS | sed -e "s/LINKLIBS ://g") 391 MEXEXT=$(cat conftest.tmp | /usr/bin/grep LDEXT | sed -e "s/LDEXT ://g" | awk '{print $[1]}') 392 392 if test -z "${MEXEXT}"; then 393 393 cat conftest.tmp … … 508 508 #BOOSTLIB="-L$BOOST_ROOT/lib -lboost_python" 509 509 AC_MSG_CHECKING(for Boost version) 510 BOOST_VERSION=`cat ${BOOST_ROOT}/include/boost/version.hpp | grep "#define BOOST_VERSION " | sed 's/.*BOOST_VERSION //'`510 BOOST_VERSION=`cat ${BOOST_ROOT}/include/boost/version.hpp | /usr/bin/grep "#define BOOST_VERSION " | sed 's/.*BOOST_VERSION //'` 511 511 BOOST_VERSION_MAJOR=`expr ${BOOST_VERSION} / 100000` 512 512 BOOST_VERSION_MINOR=`expr ${BOOST_VERSION} / 100 % 1000` … … 548 548 DAKOTA_VERSION_OUTPUT=`${DAKOTA_ROOT}/bin/dakota -v` 549 549 if test -n "${DAKOTA_VERSION_OUTPUT}"; then 550 DAKOTA_VERSION=`echo ${DAKOTA_VERSION_OUTPUT} grep "Dakota version" | sed 's/Dakota version //' | sed 's/ .*//'`550 DAKOTA_VERSION=`echo ${DAKOTA_VERSION_OUTPUT} /usr/bin/grep "Dakota version" | sed 's/Dakota version //' | sed 's/ .*//'` 551 551 elif test -f "${DAKOTA_ROOT}/VERSION"; then 552 DAKOTA_VERSION=`cat ${DAKOTA_ROOT}/VERSION | grep 'DAKOTA Version' | sed 's/.*DAKOTA Version //' | sed 's/ .*//'`552 DAKOTA_VERSION=`cat ${DAKOTA_ROOT}/VERSION | /usr/bin/grep 'DAKOTA Version' | sed 's/.*DAKOTA Version //' | sed 's/ .*//'` 553 553 elif test -f "${DAKOTA_ROOT}/../src/src/CommandLineHandler.C"; then 554 DAKOTA_VERSION=`cat ${DAKOTA_ROOT}/../src/src/CommandLineHandler.C | grep 'DAKOTA version' | grep 'release' |grep -v // | sed 's/.*DAKOTA version //' | sed 's/ .*//' `554 DAKOTA_VERSION=`cat ${DAKOTA_ROOT}/../src/src/CommandLineHandler.C | /usr/bin/grep 'DAKOTA version' | /usr/bin/grep 'release' | /usr/bin/grep -v // | sed 's/.*DAKOTA version //' | sed 's/ .*//' ` 555 555 elif test -f "${DAKOTA_ROOT}/../src/src/CommandLineHandler.cpp"; then 556 DAKOTA_VERSION=`cat ${DAKOTA_ROOT}/../src/src/CommandLineHandler.cpp | grep 'DAKOTA version' | grep 'release' |grep -v // | sed 's/.*DAKOTA version //' | sed 's/ .*//' `556 DAKOTA_VERSION=`cat ${DAKOTA_ROOT}/../src/src/CommandLineHandler.cpp | /usr/bin/grep 'DAKOTA version' | /usr/bin/grep 'release' | /usr/bin/grep -v // | sed 's/.*DAKOTA version //' | sed 's/ .*//' ` 557 557 else 558 558 AC_MSG_ERROR([Dakota CommandLineHandler.C or CommandLineHandler.cpp file not found to determine DAKOTA_VERSION!]); … … 1208 1208 dnl PETSc libraries and header files 1209 1209 if test "x${HAVE_PETSC}" == "xyes"; then 1210 AC_MSG_CHECKING(for PETSc version)1211 1210 if ! test -f "${PETSC_ROOT}/include/petscversion.h"; then 1212 1211 AC_MSG_ERROR([PETSc not instaled correctly: file (${PETSC_ROOT}/include/petscversion.h) does not exist!]); 1213 1212 fi 1214 PETSC_MAJOR=`cat ${PETSC_ROOT}/include/petscversion.h | grep "#define PETSC_VERSION_MAJOR" | sed 's/#define PETSC_VERSION_MAJOR//' | sed 's/ //g'` 1215 PETSC_MINOR=`cat ${PETSC_ROOT}/include/petscversion.h | grep "#define PETSC_VERSION_MINOR" | sed 's/#define PETSC_VERSION_MINOR//' | sed 's/ //g'` 1216 AC_DEFINE_UNQUOTED(_PETSC_MAJOR_, $PETSC_MAJOR, [PETSc version major]) 1217 AC_DEFINE_UNQUOTED(_PETSC_MINOR_, $PETSC_MINOR, [PETSc version minor]) 1213 1214 AC_MSG_CHECKING(for PETSc version) 1215 PETSC_MAJOR=`cat ${PETSC_ROOT}/include/petscversion.h | /usr/bin/grep "#define PETSC_VERSION_MAJOR" | sed 's/#define PETSC_VERSION_MAJOR//' | sed 's/ //g'` 1216 PETSC_MINOR=`cat ${PETSC_ROOT}/include/petscversion.h | /usr/bin/grep "#define PETSC_VERSION_MINOR" | sed 's/#define PETSC_VERSION_MINOR//' | sed 's/ //g'` 1217 AC_DEFINE_UNQUOTED([_PETSC_MAJOR_], [$PETSC_MAJOR], [PETSc version major]) 1218 AC_DEFINE_UNQUOTED([_PETSC_MINOR_], [$PETSC_MINOR], [PETSc version minor]) 1218 1219 AC_MSG_RESULT([${PETSC_MAJOR}.${PETSC_MINOR}]) 1219 1220 1220 dnl PETSC_VERSION_DATE_HG=`cat ${PETSC_ROOT}/include/petscversion.h | grep "#define PETSC_VERSION_DATE_HG" | sed 's/#define PETSC_VERSION_DATE_HG//' | sed 's/ //g' | sed -e 's/\"//g' `1221 PETSC_RELEASE=`cat ${PETSC_ROOT}/include/petscversion.h | grep "#define PETSC_VERSION_RELEASE" | sed 's/#define PETSC_VERSION_RELEASE//' | sed 's/ //g'`1222 1223 1221 AC_MSG_CHECKING(whether PETSc is the development version) 1224 dnl if test "x${PETSC_VERSION_DATE_HG}" == "xunknown"; then1222 PETSC_RELEASE=`cat ${PETSC_ROOT}/include/petscversion.h | /usr/bin/grep "#define PETSC_VERSION_RELEASE" | sed 's/#define PETSC_VERSION_RELEASE//' | sed 's/ //g'` 1225 1223 if test "${PETSC_RELEASE}" == "0"; then 1226 1224 AC_DEFINE([_HAVE_PETSCDEV_], [1], [with PETSc-dev]) … … 2212 2210 else 2213 2211 if test -f "${PETSC_ROOT}/conf/petscvariables"; then 2214 PETSC_REC_GRAPHICS_LIB=$(cat ${PETSC_ROOT}/conf/petscvariables | grep X_LIB)2212 PETSC_REC_GRAPHICS_LIB=$(cat ${PETSC_ROOT}/conf/petscvariables | /usr/bin/grep X_LIB) 2215 2213 AC_MSG_ERROR([Xlib (graphics library) provided (${GRAPHICS_LIB}) does not exist! PETSc suggests the following library: ${PETSC_REC_GRAPHICS_LIB}]); 2216 2214 fi … … 2351 2349 2352 2350 AC_MSG_CHECKING(for Gmsh version) 2353 GMSH_VERSION_MAJOR=`${GMSH_ROOT}/bin/gmsh -info | grep "Version" | sed -e "s/Version@<:@@<:@:blank:@:>@@:>@*:@<:@@<:@:blank:@:>@@:>@//" | cut -d "." -f 1`2351 GMSH_VERSION_MAJOR=`${GMSH_ROOT}/bin/gmsh -info | /usr/bin/grep "Version" | sed -e "s/Version@<:@@<:@:blank:@:>@@:>@*:@<:@@<:@:blank:@:>@@:>@//" | cut -d "." -f 1` 2354 2352 AC_MSG_RESULT([${GMSH_VERSION_MAJOR}]) 2355 2353 AC_DEFINE_UNQUOTED(_GMSH_VERSION_MAJOR_, $GMSH_VERSION_MAJOR, [Gmsh major version]) -
issm/trunk-jpl/src/c/cores/controltao_core.cpp
r20553 r25710 11 11 12 12 #if defined (_HAVE_TAO_) 13 #if defined (_HAVE_PETSC_) && (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 5) 13 #if defined _HAVE_PETSC_ 14 #include <petscversion.h> 15 #if PETSC_VERSION_LT(3,5,0) 14 16 #include <tao.h> 15 17 #else 16 18 #include <petsctao.h> 17 19 #endif 20 #endif 18 21 19 22 /*Local prototype*/ 20 #if defined (_HAVE_PETSC_) && (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 5)23 #if PETSC_VERSION_LT(3,5,0) 21 24 int FormFunctionGradient(TaoSolver,Vec,IssmDouble*,Vec,void*); 22 25 int IssmMonitor(TaoSolver,void*); … … 38 41 IssmDouble gatol,grtol,gttol; 39 42 AppCtx user; 40 #if defined (_HAVE_PETSC_) && (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 5)43 #if PETSC_VERSION_LT(3,5,0) 41 44 TaoSolver tao = 0; 42 45 #else … … 51 54 52 55 /*Initialize TAO*/ 53 #if defined (_HAVE_PETSC_) && (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 5)56 #if PETSC_VERSION_LT(3,5,0) 54 57 int argc; char **args=NULL; 55 58 PetscGetArgs(&argc,&args); … … 83 86 TaoSetMaximumFunctionEvaluations(tao,maxiter); 84 87 TaoSetMaximumIterations(tao,maxsteps); 85 #if (_PETSC_MAJOR_==3) && (_PETSC_MINOR_<7)88 #if PETSC_VERSION_LT(3,7,0) 86 89 TaoSetTolerances(tao,0,0,gatol,grtol,gttol); 87 90 #else … … 128 131 delete X; 129 132 TaoDestroy(&tao); 130 #if defined (_HAVE_PETSC_) && (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 5)133 #if PETSC_VERSION_LT(3,5,0) 131 134 TaoFinalize(); 132 135 #endif … … 135 138 } 136 139 137 #if defined (_HAVE_PETSC_) && (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 5)140 #if PETSC_VERSION_LT(3,5,0) 138 141 int FormFunctionGradient(TaoSolver tao, Vec Xpetsc, IssmDouble *fcn,Vec G,void *uservoid){ 139 142 #else … … 178 181 return 0; 179 182 } 180 #if defined (_HAVE_PETSC_) && (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 5)183 #if PETSC_VERSION_LT(3,5,0) 181 184 int IssmMonitor(TaoSolver tao, void *userCtx){ 182 185 #else -
issm/trunk-jpl/src/c/solutionsequences/solutionsequence_schurcg.cpp
r25539 r25710 13 13 14 14 #ifdef _HAVE_PETSC_ 15 15 #include <petscversion.h> 16 16 17 17 void SchurCGSolver(Vector<IssmDouble>** puf,Mat Kff, Vec pf, Vec uf0,IS isv,IS isp,Parameters* parameters){/*{{{*/ … … 44 44 int precond = 0; 45 45 46 #if _PETSC_MAJOR_ < 3 || (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 2)46 #if PETSC_VERSION_LT(3,2,0) 47 47 PetscTruth flag,flg; 48 48 #else … … 55 55 int maxiter; 56 56 57 #if _PETSC_MINOR_<757 #if PETSC_VERSION_LT(3,7,0) 58 58 PetscOptionsGetString(PETSC_NULL,"-ksp_type",ksp_type,49,&flg); 59 59 PetscOptionsGetString(PETSC_NULL,"-pc_type",pc_type,49,&flg); … … 88 88 * and I the Schur preconditioner (stored here, because the space was allocated either way) 89 89 * */ 90 #if _PETSC_MINOR_>890 #if PETSC_VERSION_GT(3,8,0) 91 91 MatCreateSubMatrix(Kff,isv,isv,MAT_INITIAL_MATRIX,&A); 92 92 MatCreateSubMatrix(Kff,isv,isp,MAT_INITIAL_MATRIX,&B); … … 99 99 100 100 /* Extract preconditioner matrix on the pressure space*/ 101 #if _PETSC_MINOR_>8101 #if PETSC_VERSION_GT(3,8,0) 102 102 MatCreateSubMatrix(Kff,isp,isp,MAT_INITIAL_MATRIX,&IP); 103 103 #else … … 146 146 /* Create KSP context */ 147 147 KSPCreate(IssmComm::GetComm(),&kspu); 148 #if (_PETSC_MAJOR_==3) && (_PETSC_MINOR_>=5)148 #if PETSC_VERSION_GE(3,5,0) 149 149 KSPSetOperators(kspu,A,A); 150 150 #else … … 264 264 /* Create KSP context */ 265 265 KSPCreate(IssmComm::GetComm(),&kspip); 266 #if (_PETSC_MAJOR_==3) && (_PETSC_MINOR_>=5)266 #if PETSC_VERSION_GE(3,5,0) 267 267 KSPSetOperators(kspip,IP,IP); 268 268 #else … … 539 539 540 540 /*Extract A, B, B^T */ 541 #if _PETSC_MINOR_>8541 #if PETSC_VERSION_GT(3,8,0) 542 542 MatCreateSubMatrix(Kff->pmatrix->matrix,isv,isv,MAT_INITIAL_MATRIX,&A); 543 543 MatCreateSubMatrix(Kff->pmatrix->matrix,isv,isp,MAT_INITIAL_MATRIX,&B); … … 742 742 743 743 /*Create pressure matrix of choice*/ 744 #if _PETSC_MINOR_<7744 #if PETSC_VERSION_LT(3,7,0) 745 745 PetscOptionsGetInt(PETSC_NULL,"-schur_pc",&precond,NULL); 746 746 #else … … 775 775 IS isv = NULL; 776 776 IS isp = NULL; 777 #if _PETSC_MAJOR_==3777 #if PETSC_VERSION_MAJOR==3 778 778 779 779 /*Make indices out of doftypes: */ -
issm/trunk-jpl/src/c/toolkits/petsc/objects/PetscSolver.cpp
r25390 r25710 8 8 #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!" 9 9 #endif 10 11 #include <petscversion.h> 10 12 11 13 #include "./PetscSolver.h" … … 47 49 int solver_type; 48 50 bool fromlocalsize = true; 49 #if _PETSC_MAJOR_ < 3 || (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 2)51 #if PETSC_VERSION_LT(3,2,0) 50 52 PetscTruth flag,flg; 51 53 #else … … 59 61 60 62 /*Display message*/ 61 #if _PETSC_MAJOR_ < 3 || (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 2)63 #if PETSC_VERSION_LT(3,2,0) 62 64 if(VerboseSolver())PetscOptionsPrint(stdout); 63 65 #else 64 #if _PETSC_MINOR_<766 #if PETSC_VERSION_LT(3,7,0) 65 67 if(VerboseSolver())PetscOptionsView(PETSC_VIEWER_STDOUT_WORLD); 66 68 #else … … 78 80 /*Initial guess */ 79 81 /*Now, check that we are not giving an initial guess to the solver, if we are running a direct solver: */ 80 #if _PETSC_MINOR_<782 #if PETSC_VERSION_LT(3,7,0) 81 83 PetscOptionsGetString(PETSC_NULL,"-ksp_type",ksp_type,49,&flg); 82 84 #else … … 107 109 /*Prepare solver*/ 108 110 KSPCreate(IssmComm::GetComm(),&ksp); 109 #if (_PETSC_MAJOR_==3) && (_PETSC_MINOR_>=5)111 #if PETSC_VERSION_GE(3,5,0) 110 112 KSPSetOperators(ksp,Kff,Kff); 111 113 #else … … 117 119 KSPGetPC(ksp,&pc); 118 120 if (solver_type==MUMPSPACKAGE_LU){ 119 #if (_PETSC_MAJOR_==3) && (_PETSC_MINOR_>=9)121 #if PETSC_VERSION_GE(3,9,0) 120 122 PCFactorSetMatSolverType(pc,MATSOLVERMUMPS); 121 123 #else … … 132 134 /*Set field splits: */ 133 135 KSPGetPC(ksp,&pc); 134 #if _PETSC_MINOR_==1136 #if (PETSC_VERSION_MAJOR == 3) && (PETSC_VERSION_MINOR == 1) 135 137 PCFieldSplitSetIS(pc,isv); 136 138 PCFieldSplitSetIS(pc,isp); … … 217 219 218 220 /*Create indices sets: */ 219 #if _PETSC_MAJOR_ < 3 || (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 2)221 #if PETSC_VERSION_LT(3,2,0) 220 222 ISCreateGeneral(IssmComm::GetComm(),pressure_num,pressure_indices,&isp); 221 223 ISCreateGeneral(IssmComm::GetComm(),velocity_num,velocity_indices,&isv); -
issm/trunk-jpl/src/c/toolkits/petsc/patches/KSPFree.cpp
r13784 r25710 10 10 11 11 /*Petsc includes: */ 12 #include <petscversion.h> 12 13 #include <petscmat.h> 13 14 #include <petscvec.h> … … 16 17 void KSPFree(KSP* pksp){ 17 18 18 #if _PETSC_MAJOR_ < 3 || (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 2)19 #if PETSC_VERSION_LT(3,2,0) 19 20 if(*pksp)KSPDestroy(*pksp); 20 21 *pksp=NULL; -
issm/trunk-jpl/src/c/toolkits/petsc/patches/MatFree.cpp
r13784 r25710 10 10 11 11 /*Petsc includes: */ 12 #include <petscversion.h> 12 13 #include <petscmat.h> 13 #include <petsc mat.h>14 #include <petscvec.h> 14 15 #include <petscksp.h> 15 16 16 17 void MatFree(Mat* pmat){ 17 18 18 #if _PETSC_MAJOR_ < 3 || (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 2)19 #if PETSC_VERSION_LT(3,2,0) 19 20 if(*pmat)MatDestroy(*pmat); 20 21 *pmat=NULL; -
issm/trunk-jpl/src/c/toolkits/petsc/patches/MatMultPatch.cpp
r15839 r25710 10 10 11 11 /*Petsc includes: */ 12 #include <petscversion.h> 12 13 #include <petscmat.h> 13 14 #include <petscvec.h> … … 35 36 VecRelocalize(&X_rel,X,n,comm); 36 37 MatMult(A,X_rel,AX); ; 37 #if _PETSC_MAJOR_ < 3 || (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 2)38 #if PETSC_VERSION_LT(3,2,0) 38 39 VecDestroy(X_rel); 39 40 #else -
issm/trunk-jpl/src/c/toolkits/petsc/patches/NewMat.cpp
r22560 r25710 10 10 11 11 /*Petsc includes: */ 12 #include <petscversion.h> 12 13 #include <petscmat.h> 13 14 #include <petscvec.h> … … 37 38 o_nz=(int)((double)nnz/(double)M/2.0); //number of non zeros per row/2 38 39 39 #if _PETSC_MAJOR_ == 3 && _PETSC_MINOR_ > 240 #if PETSC_VERSION_GT(3,2,0) 40 41 MatCreateAIJ(comm,m,n,M,N,d_nz,NULL,o_nz,NULL,&outmatrix); 41 42 #else … … 65 66 o_nz=(int)((double)nnz/(double)M/2.0); //number of non zeros per row/2 66 67 67 #if _PETSC_MAJOR_ == 3 && _PETSC_MINOR_ > 268 #if PETSC_VERSION_GT(3,2,0) 68 69 if(sparsity==1){ 69 70 MatCreateDense(comm,m,n,M,N,NULL,&outmatrix); … … 89 90 int d_nz,o_nz; 90 91 91 #if _PETSC_MAJOR_>= 392 #if defined(_HAVE_PETSCDEV_) || _PETSC_MINOR_>=492 #if PETSC_VERSION_MAJOR >= 3 93 #if defined(_HAVE_PETSCDEV_) || PETSC_VERSION_MINOR >=4 93 94 MatType type; 94 95 #else -
issm/trunk-jpl/src/c/toolkits/petsc/patches/PetscOptionsDetermineSolverType.cpp
r23161 r25710 10 10 11 11 /*Petsc includes: */ 12 #include "petscmat.h" 13 #include "petscvec.h" 14 #include "petscksp.h" 12 #include <petscversion.h> 13 #include <petscmat.h> 14 #include <petscvec.h> 15 #include <petscksp.h> 15 16 16 17 #include "./petscpatches.h" … … 21 22 22 23 char option[100]; 23 #if _PETSC_MAJOR_ < 3 || (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 2)24 #if PETSC_VERSION_LT(3,2,0) 24 25 PetscTruth flag; 25 26 #else … … 31 32 32 33 /*retrieve mat_type option: */ 33 #if (_PETSC_MAJOR_==3) && (_PETSC_MINOR_>=7)34 #if PETSC_VERSION_GE(3,7,0) 34 35 PetscOptionsGetString(NULL,PETSC_NULL,"-mat_type",&option[0],100,&flag); 35 36 #else … … 56 57 } 57 58 58 #if _PETSC_MAJOR_ >= 359 #if (_PETSC_MINOR_>=7)59 #if PETSC_VERSION_MAJOR >= 3 60 #if PETSC_VERSION_MINOR >= 7 60 61 PetscOptionsGetString(NULL,PETSC_NULL,"-pc_factor_mat_solver_package",&option[0],100,&flag); 61 62 #else … … 67 68 #endif 68 69 69 #if (_PETSC_MAJOR_==3) && (_PETSC_MINOR_>=7)70 #if PETSC_VERSION_GE(3,7,0) 70 71 PetscOptionsGetString(NULL,PETSC_NULL,"-issm_option_solver",&option[0],100,&flag); 71 72 #else -
issm/trunk-jpl/src/c/toolkits/petsc/patches/VecFree.cpp
r13784 r25710 10 10 11 11 /*Petsc includes: */ 12 #include <petscversion.h> 12 13 #include <petscmat.h> 13 14 #include <petscvec.h> … … 16 17 void VecFree(Vec* pvec){ 17 18 18 #if _PETSC_MAJOR_ < 3 || (_PETSC_MAJOR_ == 3 && _PETSC_MINOR_ < 2)19 #if PETSC_VERSION_LT(3,2,0) 19 20 if(*pvec)VecDestroy(*pvec); 20 21 #else -
issm/trunk-jpl/src/wrappers/IssmConfig/IssmConfig.h
r21086 r25710 48 48 #define VALUE pvalue 49 49 #define SVALUE psvalue 50 #define WRAPPER(modulename) extern "C" { int 50 #define WRAPPER(modulename) extern "C" { int IssmConfigModule(double* pvalue, char** psvalue, char* string) 51 51 #endif 52 52
Note:
See TracChangeset
for help on using the changeset viewer.