Changeset 13756
- Timestamp:
- 10/19/12 16:01:23 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/m4/issm_options.m4
r13748 r13756 230 230 AS_HELP_STRING([--with-python-dir=DIR], [python root directory.]), 231 231 [PYTHON_ROOT=$withval],[PYTHON_ROOT=""]) 232 232 233 AC_MSG_CHECKING(for python) 233 234 234 if test -d "$PYTHON_ROOT"; then 235 AC_MSG_RESULT($HAVE_PYTHON)236 dnl defaults237 HAVE_PYTHON3="no"238 235 HAVE_PYTHON="yes" 239 AC_MSG_RESULT($HAVE_PYTHON) 240 241 AC_ARG_WITH([python-version], 242 AS_HELP_STRING([--with-python-version = PYTHONVERSION],[python version.]), 243 [PYTHONVERSION=$withval],[PYTHONVERSION=""]) 236 AC_DEFINE([_HAVE_PYTHON_],[1],[with Python in ISSM src]) 237 else 238 HAVE_PYTHON=no 239 fi 240 AC_MSG_RESULT($HAVE_PYTHON) 241 242 dnl get python version 243 if test "$HAVE_PYTHON" = "yes"; then 244 244 AC_MSG_CHECKING(for python version) 245 dnl Query Python for its version number. Getting [:3] seems to be 246 dnl the best way to do this; it's what "site.py" does in the standard 247 dnl library. 248 PYTHON_VERSION=$($PYTHON_ROOT/bin/python -c "import sys; print sys.version[[:3]]") 249 AC_MSG_RESULT($PYTHON_VERSION) 245 250 246 251 dnl recover major: 247 PYTHON_MAJOR=${PYTHONVERSION%.*} 248 252 PYTHON_MAJOR=${PYTHON_VERSION%.*} 249 253 if test x$PYTHON_MAJOR = x3; then 250 254 dnl are we running python 3? … … 252 256 fi 253 257 AC_DEFINE_UNQUOTED([_PYTHON_MAJOR_],$PYTHON_MAJOR,[python version major]) 254 AC_MSG_RESULT($PYTHON_MAJOR)255 258 256 259 PYTHONINCL=-I$PYTHON_ROOT/include … … 270 273 esac 271 274 272 AC_DEFINE([_HAVE_PYTHON_],[1],[with Python in ISSM src])273 275 AC_SUBST([PYTHONINCL]) 274 276 AC_SUBST([PYTHONLIB]) … … 276 278 AC_SUBST([PYTHONWRAPPEREXT]) 277 279 AC_SUBST([PYTHONLINK]) 278 else279 HAVE_PYTHON=no280 AC_MSG_RESULT($HAVE_PYTHON)281 280 fi 282 281 AM_CONDITIONAL([PYTHON], [test x$HAVE_PYTHON = xyes]) … … 455 454 AM_CONDITIONAL([ROSE], [test x$HAVE_ROSE = xyes]) 456 455 AC_MSG_RESULT($HAVE_ROSE) 457 dnl }}}458 dnl metis{{{459 AC_ARG_WITH([metis-dir],460 AS_HELP_STRING([--with-metis-dir=DIR],[metis root directory. necessary for serial build]),461 [METIS_ROOT=$withval],[METIS_ROOT=""])462 463 AC_MSG_CHECKING(for metis headers and libraries in $METIS_ROOT)464 465 if test -d "$METIS_ROOT"; then466 467 dnl first figure out version of metis: does the VERSION file exist?468 if test -e "$METIS_ROOT/VERSION"; then469 METIS_VERSION=4470 else471 METIS_VERSION=5472 fi473 474 dnl defaults475 HAVE_METIS=yes476 477 if test "$METIS_VERSION" = "4" ; then478 479 METISINCL=-I"$METIS_ROOT/Lib"480 case "${host_os}" in481 *cygwin*)482 METISLIB="-LIBPATH:\"$METIS_ROOT\" libmetis.lib"483 ;;484 *linux*)485 METISLIB=-L"$METIS_ROOT/ -lmetis"486 ;;487 *darwin*)488 METISLIB=-L"$METIS_ROOT/ -lmetis"489 ;;490 esac491 492 AC_DEFINE([_METIS_VERSION_],[4],[ Metis version number])493 fi494 if test "$METIS_VERSION" = "5" ; then495 496 case "${host_os}" in497 *cygwin*)498 METISLIB="-LIBPATH:\"$METIS_ROOT\" libmetis.lib"499 ;;500 *linux*)501 METISLIB=-L"$METIS_ROOT/lib -lmetis"502 ;;503 *darwin*)504 METISLIB=-L"$METIS_ROOT/lib -lmetis"505 ;;506 esac507 508 METISINCL=-I"$METIS_ROOT/include"509 AC_DEFINE([_METIS_VERSION_],[5],[ Metis version number])510 fi511 512 AC_DEFINE([_HAVE_METIS_],[1],[with Metis in ISSM src])513 AC_SUBST([METISINCL])514 AC_SUBST([METISLIB])515 else516 HAVE_METIS=no517 fi518 AM_CONDITIONAL([METIS], [test x$HAVE_METIS = xyes])519 AC_MSG_RESULT($HAVE_METIS)520 456 dnl }}} 521 457 dnl mpi{{{ … … 595 531 else 596 532 PETSCLIB="-link -LIBPATH:\"$PETSC_ROOT/lib\" libpetsc.lib" 533 if test $PETSC_MAJOR -gt 3 || test $PETSC_MINOR -ge 3; then PETSCLIB+=" libmetis.lib"; fi 597 534 fi 598 535 ;; … … 602 539 else 603 540 PETSCLIB="-L$PETSC_ROOT/lib -lpetsc -ldl" 541 if test $PETSC_MAJOR -gt 3 || test $PETSC_MINOR -ge 3; then PETSCLIB+=" -lmetis"; fi 604 542 fi 605 543 ;; … … 609 547 else 610 548 PETSCLIB="-L$PETSC_ROOT/lib -lpetsc" 549 if test $PETSC_MAJOR -gt 3 || test $PETSC_MINOR -ge 3; then PETSCLIB+=" -lmetis"; fi 611 550 fi 612 551 ;; … … 622 561 AM_CONDITIONAL([PETSC], [test x$HAVE_PETSC = xyes]) 623 562 AC_MSG_RESULT($HAVE_PETSC) 563 dnl }}} 564 dnl metis{{{ 565 if test "$HAVE_PETSC" = "yes" && test "x$PETSC_MAJOR" = "x3" && test $PETSC_MINOR -ge 3; then 566 567 dnl in petsc >=3.3, metis is provided 568 HAVE_METIS="yes" 569 AC_DEFINE([_METIS_VERSION_],[5],[ Metis version number]) 570 AC_DEFINE([_HAVE_METIS_],[1],[with Metis in ISSM src]) 571 else 572 AC_ARG_WITH([metis-dir], 573 AS_HELP_STRING([--with-metis-dir=DIR],[metis root directory. necessary for serial build]), 574 [METIS_ROOT=$withval],[METIS_ROOT=""]) 575 576 AC_MSG_CHECKING(for metis headers and libraries in $METIS_ROOT) 577 578 if test -d "$METIS_ROOT"; then 579 580 dnl first figure out version of metis: does the VERSION file exist? 581 if test -e "$METIS_ROOT/VERSION"; then 582 METIS_VERSION=4 583 else 584 METIS_VERSION=5 585 fi 586 587 dnl defaults 588 HAVE_METIS=yes 589 590 if test "$METIS_VERSION" = "4" ; then 591 592 METISINCL=-I"$METIS_ROOT/Lib" 593 case "${host_os}" in 594 *cygwin*) 595 METISLIB="-LIBPATH:\"$METIS_ROOT\" libmetis.lib" 596 ;; 597 *linux*) 598 METISLIB=-L"$METIS_ROOT/ -lmetis" 599 ;; 600 *darwin*) 601 METISLIB=-L"$METIS_ROOT/ -lmetis" 602 ;; 603 esac 604 605 AC_DEFINE([_METIS_VERSION_],[4],[ Metis version number]) 606 fi 607 if test "$METIS_VERSION" = "5" ; then 608 609 case "${host_os}" in 610 *cygwin*) 611 METISLIB="-LIBPATH:\"$METIS_ROOT\" libmetis.lib" 612 ;; 613 *linux*) 614 METISLIB=-L"$METIS_ROOT/lib -lmetis" 615 ;; 616 *darwin*) 617 METISLIB=-L"$METIS_ROOT/lib -lmetis" 618 ;; 619 esac 620 621 METISINCL=-I"$METIS_ROOT/include" 622 AC_DEFINE([_METIS_VERSION_],[5],[ Metis version number]) 623 fi 624 625 AC_DEFINE([_HAVE_METIS_],[1],[with Metis in ISSM src]) 626 AC_SUBST([METISINCL]) 627 AC_SUBST([METISLIB]) 628 else 629 HAVE_METIS=no 630 fi 631 AC_MSG_RESULT($HAVE_METIS) 632 fi 633 AM_CONDITIONAL([METIS], [test x$HAVE_METIS = xyes]) 624 634 dnl }}} 625 635 dnl tao{{{ … … 1355 1365 fi 1356 1366 1357 dnl check that we have python version if python compile is specified1358 if test "$HAVE_PYTHON" = "yes" && test "$PYTHONVERSION" = "" ; then1359 AC_MSG_ERROR([need python-version if python compile is required!]);1360 fi1361 1362 1367 dnl check that if we have MPI, we have metis 1363 1368 if test "$HAVE_METIS" = "yes" && test "$HAVE_MPI" = "no" ; then 1364 1369 AC_MSG_ERROR([need mpi if using the metis partitioner!]); 1365 1370 fi 1366 1367 1368 1369 1370 1371 1371 1372 AC_MSG_RESULT(done) … … 1425 1426 AC_MSG_RESULT($USE_64BIT_INDICES) 1426 1427 dnl }}} 1427 dnl circular-dependency{{{1428 AC_ARG_WITH([circular-dependency],1429 AS_HELP_STRING([--with-circular-dependency = bool],[do we look for circular dependencies, default "yes", ex: --with-circular-dependency="no"]),1430 [CIRCULAR_DEPENDENCIES=$withval],[CIRCULAR_DEPENDENCIES=yes])1431 AC_MSG_CHECKING(for circular dependencies)1432 AM_CONDITIONAL([CIRCULAR_DEPENDENCIES], [test x$CIRCULAR_DEPENDENCIES = xyes])1433 AC_MSG_RESULT($CIRCULAR_DEPENDENCIES)1434 1435 dnl }}}1436 1428 ])
Note:
See TracChangeset
for help on using the changeset viewer.