diff --git a/.travis.yml b/.travis.yml index fc2e133418..9baca70c17 100644 --- a/.travis.yml +++ b/.travis.yml @@ -57,6 +57,7 @@ jobs: - SCRIPT_FLAGS='-uim' - PIP_PACKAGES='cython~=0.29 netcdf4~=1.5 sympy~=1.5' - LD_LIBRARY_PATH=$HOME/local/lib:$LD_LIBRARY_PATH + - BOUT_TEST_TIMEOUT="5m" - *petsc_vars - name: "GCC 7" addons: @@ -75,7 +76,7 @@ jobs: env: - *default_env - CONFIGURE_OPTIONS="--enable-shared --with-petsc --with-slepc --with-sundials=$HOME/local" - - SCRIPT_FLAGS="-uim -t python -t shared" + - SCRIPT_FLAGS="-uim -t shared -t python" - name: "4to5 test" env: - *default_env @@ -97,7 +98,7 @@ jobs: - mkdir build && cd build - cmake .. -DUSE_PETSC=ON -DUSE_SLEPC=ON -DUSE_SUNDIALS=ON -DSUNDIALS_ROOT="$HOME/local" -DENABLE_OPENMP=ON - cmake --build . - - ctest --output-on-failure + - ctest --output-on-failure --timeout 300 #CLANG - name: "Clang" env: @@ -162,6 +163,15 @@ script: # Configure, compile and run test_suite - "./.travis_script.sh ${SCRIPT_FLAGS}" +# sleep a little bit after the build finishes to try and make sure stdout gets flushed +after_failure: + - echo "Build failed!" + - sleep 5 + +after_success: + - echo "Build passed!" + - sleep 1 + notifications: # Send a notification to the BOUT++ Slack team slack: diff --git a/.travis_script.sh b/.travis_script.sh index dacdb50842..e2b331165e 100755 --- a/.travis_script.sh +++ b/.travis_script.sh @@ -38,7 +38,7 @@ do TESTS=1 ;; t) ### Set target to build - MAIN_TARGET="$OPTARG" + MAIN_TARGET="$MAIN_TARGET $OPTARG" ;; 5) ### Run the update to version 5 script UPDATE_SCRIPT=1 @@ -98,6 +98,7 @@ export PYTHONPATH=$(pwd)/tools/pylib/:$PYTHONPATH for target in ${MAIN_TARGET[@]} do make_exit=0 + echo "make $target" time make $target || make_exit=$? if [[ $make_exit -gt 0 ]]; then make clean > /dev/null diff --git a/CHANGELOG.md b/CHANGELOG.md index eca5605d60..f267292d93 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,31 @@ -# Change Log +# Changelog + +## [v4.3.2](https://github.com/boutproject/BOUT-dev/tree/v4.3.2) (2020-10-19) + +[Full Changelog](https://github.com/boutproject/BOUT-dev/compare/v4.3.1...v4.3.2) + +**Merged pull requests:** + +- Make output nicer + add info about timeout'ed tests [\#2120](https://github.com/boutproject/BOUT-dev/pull/2120) ([dschwoerer](https://github.com/dschwoerer)) +- Add timeout to tests [\#2118](https://github.com/boutproject/BOUT-dev/pull/2118) ([ZedThree](https://github.com/ZedThree)) +- Fix reading/writing `std::string` attributes when using HDF5 [\#2116](https://github.com/boutproject/BOUT-dev/pull/2116) ([ZedThree](https://github.com/ZedThree)) +- Rename death tests according to gtest recommendations [\#2115](https://github.com/boutproject/BOUT-dev/pull/2115) ([ZedThree](https://github.com/ZedThree)) +- Update breathe for readthedocs [\#2114](https://github.com/boutproject/BOUT-dev/pull/2114) ([ZedThree](https://github.com/ZedThree)) +- Fix `Div_par` when using more than one y guard cell [\#2113](https://github.com/boutproject/BOUT-dev/pull/2113) ([ZedThree](https://github.com/ZedThree)) +- Update documentation on processor splitting and advanced installation [\#2109](https://github.com/boutproject/BOUT-dev/pull/2109) ([ZedThree](https://github.com/ZedThree)) +- Soname v4.3.2 [\#2108](https://github.com/boutproject/BOUT-dev/pull/2108) ([dschwoerer](https://github.com/dschwoerer)) +- Add configure option to use system mpark.variant [\#2107](https://github.com/boutproject/BOUT-dev/pull/2107) ([dschwoerer](https://github.com/dschwoerer)) +- CI: Turn off patch coverage check [\#2103](https://github.com/boutproject/BOUT-dev/pull/2103) ([ZedThree](https://github.com/ZedThree)) +- Make examples relocatable [\#2100](https://github.com/boutproject/BOUT-dev/pull/2100) ([dschwoerer](https://github.com/dschwoerer)) +- Handle FieldPerps in `Datafile::varAdded()` and `Datafile::varPtr()` [\#2093](https://github.com/boutproject/BOUT-dev/pull/2093) ([johnomotani](https://github.com/johnomotani)) +- Correct `Grad2_par2` implementation in `InvertParCR` [\#2076](https://github.com/boutproject/BOUT-dev/pull/2076) ([johnomotani](https://github.com/johnomotani)) +- Enable staggered versions of `SplitFluxDerivativeType` [\#2058](https://github.com/boutproject/BOUT-dev/pull/2058) ([johnomotani](https://github.com/johnomotani)) +- Fixes for `tokamak-2fluid` example [\#2043](https://github.com/boutproject/BOUT-dev/pull/2043) ([johnomotani](https://github.com/johnomotani)) +- Add location checks to `Div_par_K_Grad_par` [\#2039](https://github.com/boutproject/BOUT-dev/pull/2039) ([bshanahan](https://github.com/bshanahan)) +- Add clang-format bot command for pull requests [\#2032](https://github.com/boutproject/BOUT-dev/pull/2032) ([ZedThree](https://github.com/ZedThree)) +- Update the staggered grids section of the manual [\#2029](https://github.com/boutproject/BOUT-dev/pull/2029) ([johnomotani](https://github.com/johnomotani)) +- Make dz in boutcore a property [\#2024](https://github.com/boutproject/BOUT-dev/pull/2024) ([dschwoerer](https://github.com/dschwoerer)) +- Prevent deadlock in downloading mpark [\#2017](https://github.com/boutproject/BOUT-dev/pull/2017) ([dschwoerer](https://github.com/dschwoerer)) ## [v4.3.1](https://github.com/boutproject/BOUT-dev/tree/v4.3.1) (2020-03-27) @@ -1417,6 +1444,3 @@ \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)* - - -\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)* diff --git a/CITATION.bib b/CITATION.bib index 3dbec8f0fc..97b7b54657 100644 --- a/CITATION.bib +++ b/CITATION.bib @@ -1,4 +1,4 @@ -@misc{BOUTv4-3-1, +@misc{BOUTv4-3-2, author = { Benjamin Daniel Dudson and Peter Alec Hill and @@ -48,8 +48,8 @@ @misc{BOUTv4-3-1 }, title = {{BOUT++}}, month = {10}, -year = {2019}, -doi = {10.5281/zenodo.3727089}, +year = {2020}, +doi = {10.5281/zenodo.4046792}, url = {https://github.com/boutproject/BOUT-dev} } diff --git a/CITATION.cff b/CITATION.cff index 06bfd91129..02aab4eed8 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -154,11 +154,11 @@ authors: - family-names: Wang given-names: Zhanhui -version: 4.3.1 -date-released: 2020-03-27 +version: 4.3.2 +date-released: 2020-10-19 repository-code: https://github.com/boutproject/BOUT-dev url: http://boutproject.github.io/ -doi: 10.5281/zenodo.3727089 +doi: 10.5281/zenodo.4046792 license: 'LGPL-3.0-or-later' references: - type: article diff --git a/CMakeLists.txt b/CMakeLists.txt index b909ab6482..f5b0a7c3fe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ endif() project(BOUT++ DESCRIPTION "Fluid PDE solver framework" - VERSION 4.2.2 + VERSION 4.3.2 LANGUAGES CXX) # This might not be entirely sensible, but helps CMake to find the diff --git a/change_summary.md b/change_summary.md index fc45be88cc..65e70d538b 100644 --- a/change_summary.md +++ b/change_summary.md @@ -3,6 +3,19 @@ This is a slightly more readable, and therefore incomplete, summary of the changes from the full [changelog](CHANGELOG.md) +4.3.2 is a bugfix release: +- Make downloading the submodules a bit nicer, including an option for + using non-bundled versions when using `configure` +- Make `dz` in the Python API a property +- Make `Div_par_K_Grad_par` check the staggered location of its inputs +- Enable split-flux derivatives on staggered fields +- Fix `Grad2_par2` implementation in `InvertParCR` +- Fix an issue writing `FieldPerp`s +- Make it easier to compile the examples with different versions of + BOUT++, plus fixes for the `tokamak-2fluid` example +- Fix `Div_par` when using more than one y-guard cell +- Fix an issue with text attributes in HDF5 files + 4.3.1 is a bugfix release, with a few minor fixes to library code, notably: - Fix the creation of the `RGN_OUTER_X` region diff --git a/configure b/configure index 0cbc8b1c4c..0debf10336 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for BOUT++ 4.3.1. +# Generated by GNU Autoconf 2.69 for BOUT++ 4.3.2. # # Report bugs to . # @@ -580,8 +580,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='BOUT++' PACKAGE_TARNAME='bout--' -PACKAGE_VERSION='4.3.1' -PACKAGE_STRING='BOUT++ 4.3.1' +PACKAGE_VERSION='4.3.2' +PACKAGE_STRING='BOUT++ 4.3.2' PACKAGE_BUGREPORT='bd512@york.ac.uk' PACKAGE_URL='' @@ -649,6 +649,8 @@ BOUT_VERSION PYTHONCONFIGPATH IDLCONFIGPATH PREFIX +OWN_MPARK +MPARK_INCLUDE MPARK_VARIANT_INCLUDE_PATH BOUT_INCLUDE_PATH BOUT_LIB_PATH @@ -671,11 +673,11 @@ build_vendor build_cpu build XGETTEXT_EXTRA_OPTIONS +MSGMERGE_FOR_MSGFMT_OPTION MSGMERGE XGETTEXT_015 XGETTEXT GMSGFMT_015 -MSGFMT_015 GMSGFMT MSGFMT GETTEXT_MACRO_VERSION @@ -808,6 +810,7 @@ with_pvode with_mumps with_arkode with_scorep +with_system_mpark enable_warnings enable_checks enable_signal @@ -1392,7 +1395,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures BOUT++ 4.3.1 to adapt to many kinds of systems. +\`configure' configures BOUT++ 4.3.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1457,7 +1460,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of BOUT++ 4.3.1:";; + short | recursive ) echo "Configuration of BOUT++ 4.3.2:";; esac cat <<\_ACEOF @@ -1500,6 +1503,8 @@ Optional Packages: --with-mumps Link with MUMPS library for direct matrix inversions --with-arkode Use the SUNDIALS ARKODE solver --with-scorep Enable support for scorep based instrumentation + --with-system-mpark Use mpark.variant already installed rather then the + bundled one --with-openmp-schedule=static/dynamic/guided/auto Set OpenMP schedule (default: static) --with-gcov=GCOV use given GCOV for coverage (GCOV=gcov). @@ -1601,7 +1606,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -BOUT++ configure 4.3.1 +BOUT++ configure 4.3.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2182,7 +2187,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by BOUT++ $as_me 4.3.1, which was +It was created by BOUT++ $as_me 4.3.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2649,6 +2654,14 @@ else fi +# Check whether --with-system_mpark was given. +if test "${with_system_mpark+set}" = set; then : + withval=$with_system_mpark; +else + with_system_mpark=auto +fi + + # Check whether --enable-warnings was given. if test "${enable_warnings+set}" = set; then : @@ -12482,6 +12495,88 @@ $as_echo "$as_me: Scorep support disabled" >&6;} fi +############################################################# +# Check for mpark.variant +############################################################# + +if test ".$with_system_mpark" = "no"; then : + + SYSTEM_HAS_MPARK=no + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mpark.variant" >&5 +$as_echo_n "checking for mpark.variant... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + + #include "mpark/variant.hpp" + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SYSTEM_HAS_MPARK=yes +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SYSTEM_HAS_MPARK=no + if test "$with_system_mpark" = "yes"; then : + + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "*** System mpark.variant not found - but requested to use +See \`config.log' for more details" "$LINENO" 5; } + +fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi + +if test "$SYSTEM_HAS_MPARK" = "yes"; then : + + MPARK_VARIANT_INCLUDE_PATH= + MPARK_INCLUDE= + OWN_MPARK= + +else + + if test -d externalpackages/mpark.variant/include; then : + +else + if test -d .git && which git; then : + + make -f makefile.submodules mpark_submodule || \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "*** Could not download mpark.variant +See \`config.log' for more details" "$LINENO" 5; } + +else + + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "mpark.variant not found. Please install mpark.variant or use the official releases. +See \`config.log' for more details" "$LINENO" 5; } + +fi + +fi + + MPARK_VARIANT_INCLUDE_PATH="$PWD/externalpackages/mpark.variant/include" + MPARK_INCLUDE="-I$MPARK_VARIANT_INCLUDE_PATH" + OWN_MPARK=yes + +fi ############################################################# # Download + Build PVODE '98 ############################################################# @@ -12581,7 +12676,7 @@ $as_echo "$USE_NLS" >&6; } - GETTEXT_MACRO_VERSION=0.19 + GETTEXT_MACRO_VERSION=0.20 @@ -12696,12 +12791,7 @@ fi - case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in - '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;; - *) MSGFMT_015=$MSGFMT ;; - esac - - case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in + case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;; *) GMSGFMT_015=$GMSGFMT ;; esac @@ -12853,7 +12943,15 @@ $as_echo "no" >&6; } fi - test -n "$localedir" || localedir='${datadir}/locale' + if LC_ALL=C $MSGMERGE --help | grep ' --for-msgfmt ' >/dev/null; then + MSGMERGE_FOR_MSGFMT_OPTION='--for-msgfmt' + else + if LC_ALL=C $MSGMERGE --help | grep ' --no-fuzzy-matching ' >/dev/null; then + MSGMERGE_FOR_MSGFMT_OPTION='--no-fuzzy-matching --no-location --quiet' + else + MSGMERGE_FOR_MSGFMT_OPTION='--no-location --quiet' + fi + fi test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS= @@ -12971,38 +13069,12 @@ if test "${PATH_SEPARATOR+set}" != set; then } fi -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. +if test -n "$LD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld" >&5 +$as_echo_n "checking for ld... " >&6; } +elif test "$GCC" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [\\/]* | ?:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'` - while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } @@ -13010,44 +13082,129 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi -if ${acl_cv_path_LD+:} false; then : +if test -n "$LD"; then + # Let the user override the test with a path. + : +else + if ${acl_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else - if test -z "$LD"; then - acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$acl_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - acl_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some variants of GNU ld only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$acl_cv_path_LD" -v 2>&1 &5 | tr -d '\015'` ;; + *) + acl_output=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $acl_output in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + acl_output=`echo "$acl_output" | sed 's%\\\\%/%g'` + while echo "$acl_output" | grep "$re_direlt" > /dev/null 2>&1; do + acl_output=`echo $acl_output | sed "s%$re_direlt%/%"` + done + # Got the pathname. No search in PATH is needed. + acl_cv_path_LD="$acl_output" + ac_prog= + ;; + "") + # If it fails, then pretend we aren't using GCC. + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; esac fi - done - IFS="$acl_save_ifs" + if test -n "$ac_prog"; then + # Search for $ac_prog in $PATH. + acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$acl_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + acl_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$acl_cv_path_LD" -v 2>&1 conftest.$ac_ext +/* end confdefs.h. */ +#if defined __powerpc64__ || defined _ARCH_PPC64 + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + # The compiler produces 64-bit code. Add option '-b64' so that the + # linker groks 64-bit object files. + case "$acl_cv_path_LD " in + *" -b64 "*) ;; + *) acl_cv_path_LD="$acl_cv_path_LD -b64" ;; + esac + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ;; + sparc64-*-netbsd*) + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __sparcv9 || defined __arch64__ + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + else - acl_cv_path_LD="$LD" # Let the user override the test with a path. + # The compiler produces 32-bit code. Add option '-m elf32_sparc' + # so that the linker groks 32-bit object files. + case "$acl_cv_path_LD " in + *" -m elf32_sparc "*) ;; + *) acl_cv_path_LD="$acl_cv_path_LD -m elf32_sparc" ;; + esac + fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ;; + esac + fi -LD="$acl_cv_path_LD" + LD="$acl_cv_path_LD" +fi if test -n "$LD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } + as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 fi -test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${acl_cv_prog_gnu_ld+:} false; then : @@ -13104,67 +13261,412 @@ fi - acl_libdirstem=lib - acl_libdirstem2= - case "$host_os" in - solaris*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit host" >&5 -$as_echo_n "checking for 64-bit host... " >&6; } -if ${gl_cv_solaris_64bit+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking 32-bit host C ABI" >&5 +$as_echo_n "checking 32-bit host C ABI... " >&6; } +if ${gl_cv_host_cpu_c_abi_32bit+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + if test -n "$gl_cv_host_cpu_c_abi"; then + case "$gl_cv_host_cpu_c_abi" in + i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc) + gl_cv_host_cpu_c_abi_32bit=yes ;; + x86_64 | alpha | arm64 | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 ) + gl_cv_host_cpu_c_abi_32bit=no ;; + *) + gl_cv_host_cpu_c_abi_32bit=unknown ;; + esac + else + case "$host_cpu" in + + # CPUs that only support a 32-bit ABI. + arc \ + | bfin \ + | cris* \ + | csky \ + | epiphany \ + | ft32 \ + | h8300 \ + | m68k \ + | microblaze | microblazeel \ + | nds32 | nds32le | nds32be \ + | nios2 | nios2eb | nios2el \ + | or1k* \ + | or32 \ + | sh | sh1234 | sh1234elb \ + | tic6x \ + | xtensa* ) + gl_cv_host_cpu_c_abi_32bit=yes + ;; + + # CPUs that only support a 64-bit ABI. + alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \ + | mmix ) + gl_cv_host_cpu_c_abi_32bit=no + ;; + + i[34567]86 ) + gl_cv_host_cpu_c_abi_32bit=yes + ;; + + x86_64 ) + # On x86_64 systems, the C compiler may be generating code in one of + # these ABIs: + # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64. + # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64 + # with native Windows (mingw, MSVC). + # - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32. + # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +#if (defined __x86_64__ || defined __amd64__ \ + || defined _M_X64 || defined _M_AMD64) \ + && !(defined __ILP32__ || defined _ILP32) + int ok; + #else + error fail + #endif -#ifdef _LP64 -sixtyfour bits -#endif +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + gl_cv_host_cpu_c_abi_32bit=no +else + gl_cv_host_cpu_c_abi_32bit=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ;; + + arm* | aarch64 ) + # Assume arm with EABI. + # On arm64 systems, the C compiler may be generating code in one of + # these ABIs: + # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64. + # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32. + # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __aarch64__ && !(defined __ILP32__ || defined _ILP32) + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + gl_cv_host_cpu_c_abi_32bit=no +else + gl_cv_host_cpu_c_abi_32bit=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ;; + + hppa1.0 | hppa1.1 | hppa2.0* | hppa64 ) + # On hppa, the C compiler may be generating 32-bit code or 64-bit + # code. In the latter case, it defines _LP64 and __LP64__. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __LP64__ + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + gl_cv_host_cpu_c_abi_32bit=no +else + gl_cv_host_cpu_c_abi_32bit=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ;; + + ia64* ) + # On ia64 on HP-UX, the C compiler may be generating 64-bit code or + # 32-bit code. In the latter case, it defines _ILP32. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef _ILP32 + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + gl_cv_host_cpu_c_abi_32bit=yes +else + gl_cv_host_cpu_c_abi_32bit=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ;; + + mips* ) + # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this + # at 32. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64) + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + gl_cv_host_cpu_c_abi_32bit=no +else + gl_cv_host_cpu_c_abi_32bit=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ;; + + powerpc* ) + # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD. + # No need to distinguish them here; the caller may distinguish + # them based on the OS. + # On powerpc64 systems, the C compiler may still be generating + # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may + # be generating 64-bit code. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __powerpc64__ || defined _ARCH_PPC64 + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + gl_cv_host_cpu_c_abi_32bit=no +else + gl_cv_host_cpu_c_abi_32bit=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ;; + + rs6000 ) + gl_cv_host_cpu_c_abi_32bit=yes + ;; + + riscv32 | riscv64 ) + # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d. + # Size of 'long' and 'void *': + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __LP64__ + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + gl_cv_host_cpu_c_abi_32bit=no +else + gl_cv_host_cpu_c_abi_32bit=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ;; + + s390* ) + # On s390x, the C compiler may be generating 64-bit (= s390x) code + # or 31-bit (= s390) code. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __LP64__ || defined __s390x__ + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + gl_cv_host_cpu_c_abi_32bit=no +else + gl_cv_host_cpu_c_abi_32bit=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ;; + + sparc | sparc64 ) + # UltraSPARCs running Linux have `uname -m` = "sparc64", but the + # C compiler still generates 32-bit code. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#if defined __sparcv9 || defined __arch64__ + int ok; + #else + error fail + #endif + +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + gl_cv_host_cpu_c_abi_32bit=no +else + gl_cv_host_cpu_c_abi_32bit=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ;; + + *) + gl_cv_host_cpu_c_abi_32bit=unknown + ;; + esac + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_host_cpu_c_abi_32bit" >&5 +$as_echo "$gl_cv_host_cpu_c_abi_32bit" >&6; } + + HOST_CPU_C_ABI_32BIT="$gl_cv_host_cpu_c_abi_32bit" + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ELF binary format" >&5 +$as_echo_n "checking for ELF binary format... " >&6; } +if ${gl_cv_elf+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __ELF__ + Extensible Linking Format + #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "sixtyfour bits" >/dev/null 2>&1; then : - gl_cv_solaris_64bit=yes + $EGREP "Extensible Linking Format" >/dev/null 2>&1; then : + gl_cv_elf=yes else - gl_cv_solaris_64bit=no + gl_cv_elf=no fi rm -f conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_solaris_64bit" >&5 -$as_echo "$gl_cv_solaris_64bit" >&6; } - if test $gl_cv_solaris_64bit = yes; then - acl_libdirstem=lib/64 - case "$host_cpu" in - sparc*) acl_libdirstem2=lib/sparcv9 ;; - i*86 | x86_64) acl_libdirstem2=lib/amd64 ;; - esac - fi - ;; - *) - searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` - if test -n "$searchpath"; then - acl_save_IFS="${IFS= }"; IFS=":" - for searchdir in $searchpath; do - if test -d "$searchdir"; then - case "$searchdir" in - */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; - */../ | */.. ) - # Better ignore directories of this form. They are misleading. - ;; - *) searchdir=`cd "$searchdir" && pwd` - case "$searchdir" in - */lib64 ) acl_libdirstem=lib64 ;; - esac ;; - esac - fi - done - IFS="$acl_save_IFS" - fi - ;; - esac - test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_elf" >&5 +$as_echo "$gl_cv_elf" >&6; } + if test $gl_cv_elf; then + # Extract the ELF class of a file (5th byte) in decimal. + # Cf. https://en.wikipedia.org/wiki/Executable_and_Linkable_Format#File_header + if od -A x < /dev/null >/dev/null 2>/dev/null; then + # Use POSIX od. + func_elfclass () + { + od -A n -t d1 -j 4 -N 1 + } + else + # Use BSD hexdump. + func_elfclass () + { + dd bs=1 count=1 skip=4 2>/dev/null | hexdump -e '1/1 "%3d "' + echo + } + fi + case $HOST_CPU_C_ABI_32BIT in + yes) + # 32-bit ABI. + acl_is_expected_elfclass () + { + test "`func_elfclass | sed -e 's/[ ]//g'`" = 1 + } + ;; + no) + # 64-bit ABI. + acl_is_expected_elfclass () + { + test "`func_elfclass | sed -e 's/[ ]//g'`" = 2 + } + ;; + *) + # Unknown. + acl_is_expected_elfclass () + { + : + } + ;; + esac + else + acl_is_expected_elfclass () + { + : + } + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the common suffixes of directories in the library search path" >&5 +$as_echo_n "checking for the common suffixes of directories in the library search path... " >&6; } +if ${acl_cv_libdirstems+:} false; then : + $as_echo_n "(cached) " >&6 +else + acl_libdirstem=lib + acl_libdirstem2= + acl_libdirstem3= + case "$host_os" in + solaris*) + if test $HOST_CPU_C_ABI_32BIT = no; then + acl_libdirstem2=lib/64 + case "$host_cpu" in + sparc*) acl_libdirstem3=lib/sparcv9 ;; + i*86 | x86_64) acl_libdirstem3=lib/amd64 ;; + esac + fi + ;; + *) + searchpath=`(LC_ALL=C $CC $CPPFLAGS $CFLAGS -print-search-dirs) 2>/dev/null \ + | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` + if test $HOST_CPU_C_ABI_32BIT != no; then + # 32-bit or unknown ABI. + if test -d /usr/lib32; then + acl_libdirstem2=lib32 + fi + fi + if test $HOST_CPU_C_ABI_32BIT != yes; then + # 64-bit or unknown ABI. + if test -d /usr/lib64; then + acl_libdirstem3=lib64 + fi + fi + if test -n "$searchpath"; then + acl_save_IFS="${IFS= }"; IFS=":" + for searchdir in $searchpath; do + if test -d "$searchdir"; then + case "$searchdir" in + */lib32/ | */lib32 ) acl_libdirstem2=lib32 ;; + */lib64/ | */lib64 ) acl_libdirstem3=lib64 ;; + */../ | */.. ) + # Better ignore directories of this form. They are misleading. + ;; + *) searchdir=`cd "$searchdir" && pwd` + case "$searchdir" in + */lib32 ) acl_libdirstem2=lib32 ;; + */lib64 ) acl_libdirstem3=lib64 ;; + esac ;; + esac + fi + done + IFS="$acl_save_IFS" + if test $HOST_CPU_C_ABI_32BIT = yes; then + # 32-bit ABI. + acl_libdirstem3= + fi + if test $HOST_CPU_C_ABI_32BIT = no; then + # 64-bit ABI. + acl_libdirstem2= + fi + fi + ;; + esac + test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem" + test -n "$acl_libdirstem3" || acl_libdirstem3="$acl_libdirstem" + acl_cv_libdirstems="$acl_libdirstem,$acl_libdirstem2,$acl_libdirstem3" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_libdirstems" >&5 +$as_echo "$acl_cv_libdirstems" >&6; } + acl_libdirstem=`echo "$acl_cv_libdirstems" | sed -e 's/,.*//'` + acl_libdirstem2=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,//' -e 's/,.*//'` + acl_libdirstem3=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,[^,]*,//' -e 's/,.*//'` @@ -13185,6 +13687,8 @@ $as_echo "$gl_cv_solaris_64bit" >&6; } eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" + eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\" + eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" @@ -13205,6 +13709,8 @@ if test "${with_libiconv_prefix+set}" = set; then : eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" + eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\" + eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" @@ -13212,15 +13718,19 @@ if test "${with_libiconv_prefix+set}" = set; then : else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" - if test "$acl_libdirstem2" != "$acl_libdirstem" \ - && ! test -d "$withval/$acl_libdirstem"; then - additional_libdir="$withval/$acl_libdirstem2" - fi + additional_libdir2="$withval/$acl_libdirstem2" + additional_libdir3="$withval/$acl_libdirstem3" fi fi fi + if test "X$additional_libdir2" = "X$additional_libdir"; then + additional_libdir2= + fi + if test "X$additional_libdir3" = "X$additional_libdir"; then + additional_libdir3= + fi LIBICONV= LTLIBICONV= INCICONV= @@ -13266,45 +13776,51 @@ fi shrext= fi if test $use_additional = yes; then - dir="$additional_libdir" - if test -n "$acl_shlibext"; then - if test -f "$dir/$libname$shrext"; then - found_dir="$dir" - found_so="$dir/$libname$shrext" - else - if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then - ver=`(cd "$dir" && \ - for f in "$libname$shrext".*; do echo "$f"; done \ - | sed -e "s,^$libname$shrext\\\\.,," \ - | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ - | sed 1q ) 2>/dev/null` - if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then - found_dir="$dir" - found_so="$dir/$libname$shrext.$ver" + for additional_libdir_variable in additional_libdir additional_libdir2 additional_libdir3; do + if test "X$found_dir" = "X"; then + eval dir=\$$additional_libdir_variable + if test -n "$dir"; then + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi fi - else - eval library_names=\"$acl_library_names_spec\" - for f in $library_names; do - if test -f "$dir/$f"; then + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then found_dir="$dir" - found_so="$dir/$f" - break + found_a="$dir/$libname.$acl_libext" fi - done + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi fi fi - fi - if test "X$found_dir" = "X"; then - if test -f "$dir/$libname.$acl_libext"; then - found_dir="$dir" - found_a="$dir/$libname.$acl_libext" - fi - fi - if test "X$found_dir" != "X"; then - if test -f "$dir/$libname.la"; then - found_la="$dir/$libname.la" - fi - fi + done fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIBICONV; do @@ -13321,7 +13837,7 @@ fi -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$acl_shlibext"; then - if test -f "$dir/$libname$shrext"; then + if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else @@ -13331,14 +13847,14 @@ fi | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` - if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do - if test -f "$dir/$f"; then + if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break @@ -13348,7 +13864,7 @@ fi fi fi if test "X$found_dir" = "X"; then - if test -f "$dir/$libname.$acl_libext"; then + if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi @@ -13370,7 +13886,8 @@ fi if test "X$found_so" != "X"; then if test "$enable_rpath" = no \ || test "X$found_dir" = "X/usr/$acl_libdirstem" \ - || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then + || test "X$found_dir" = "X/usr/$acl_libdirstem2" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem3"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else haveit= @@ -13449,6 +13966,13 @@ fi fi additional_includedir="$basedir/include" ;; + */$acl_libdirstem3 | */$acl_libdirstem3/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem3/"'*$,,'` + if test "$name" = 'iconv'; then + LIBICONV_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; esac if test "X$additional_includedir" != "X"; then if test "X$additional_includedir" != "X/usr/include"; then @@ -13494,12 +14018,14 @@ fi for dep in $dependency_libs; do case "$dep" in -L*) - additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` - if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ - && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then + dependency_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$dependency_libdir" != "X/usr/$acl_libdirstem" \ + && test "X$dependency_libdir" != "X/usr/$acl_libdirstem2" \ + && test "X$dependency_libdir" != "X/usr/$acl_libdirstem3"; then haveit= - if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ - || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then + if test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem2" \ + || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem3"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; @@ -13518,14 +14044,14 @@ fi exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" - if test "X$x" = "X-L$additional_libdir"; then + if test "X$x" = "X-L$dependency_libdir"; then haveit=yes break fi done if test -z "$haveit"; then - if test -d "$additional_libdir"; then - LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" + if test -d "$dependency_libdir"; then + LIBICONV="${LIBICONV}${LIBICONV:+ }-L$dependency_libdir" fi fi haveit= @@ -13539,14 +14065,14 @@ fi exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" - if test "X$x" = "X-L$additional_libdir"; then + if test "X$x" = "X-L$dependency_libdir"; then haveit=yes break fi done if test -z "$haveit"; then - if test -d "$additional_libdir"; then - LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" + if test -d "$dependency_libdir"; then + LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$dependency_libdir" fi fi fi @@ -13650,8 +14176,6 @@ fi - - @@ -13689,9 +14213,9 @@ $as_echo "$gt_cv_func_CFPreferencesCopyAppValue" >&6; } $as_echo "#define HAVE_CFPREFERENCESCOPYAPPVALUE 1" >>confdefs.h fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyCurrent" >&5 -$as_echo_n "checking for CFLocaleCopyCurrent... " >&6; } -if ${gt_cv_func_CFLocaleCopyCurrent+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyPreferredLanguages" >&5 +$as_echo_n "checking for CFLocaleCopyPreferredLanguages... " >&6; } +if ${gt_cv_func_CFLocaleCopyPreferredLanguages+:} false; then : $as_echo_n "(cached) " >&6 else gt_save_LIBS="$LIBS" @@ -13702,29 +14226,30 @@ else int main () { -CFLocaleCopyCurrent(); +CFLocaleCopyPreferredLanguages(); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : - gt_cv_func_CFLocaleCopyCurrent=yes + gt_cv_func_CFLocaleCopyPreferredLanguages=yes else - gt_cv_func_CFLocaleCopyCurrent=no + gt_cv_func_CFLocaleCopyPreferredLanguages=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$gt_save_LIBS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFLocaleCopyCurrent" >&5 -$as_echo "$gt_cv_func_CFLocaleCopyCurrent" >&6; } - if test $gt_cv_func_CFLocaleCopyCurrent = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFLocaleCopyPreferredLanguages" >&5 +$as_echo "$gt_cv_func_CFLocaleCopyPreferredLanguages" >&6; } + if test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then -$as_echo "#define HAVE_CFLOCALECOPYCURRENT 1" >>confdefs.h +$as_echo "#define HAVE_CFLOCALECOPYPREFERREDLANGUAGES 1" >>confdefs.h fi INTL_MACOSX_LIBS= - if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then + if test $gt_cv_func_CFPreferencesCopyAppValue = yes \ + || test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" fi @@ -14012,15 +14537,27 @@ int result = 0; #endif /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is provided. */ - if (/* Try standardized names. */ - iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) - /* Try IRIX, OSF/1 names. */ - && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) - /* Try AIX names. */ - && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) - /* Try HP-UX names. */ - && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) - result |= 16; + { + /* Try standardized names. */ + iconv_t cd1 = iconv_open ("UTF-8", "EUC-JP"); + /* Try IRIX, OSF/1 names. */ + iconv_t cd2 = iconv_open ("UTF-8", "eucJP"); + /* Try AIX names. */ + iconv_t cd3 = iconv_open ("UTF-8", "IBM-eucJP"); + /* Try HP-UX names. */ + iconv_t cd4 = iconv_open ("utf8", "eucJP"); + if (cd1 == (iconv_t)(-1) && cd2 == (iconv_t)(-1) + && cd3 == (iconv_t)(-1) && cd4 == (iconv_t)(-1)) + result |= 16; + if (cd1 != (iconv_t)(-1)) + iconv_close (cd1); + if (cd2 != (iconv_t)(-1)) + iconv_close (cd2); + if (cd3 != (iconv_t)(-1)) + iconv_close (cd3); + if (cd4 != (iconv_t)(-1)) + iconv_close (cd4); + } return result; ; @@ -14073,7 +14610,6 @@ $as_echo "$LIBICONV" >&6; } - use_additional=yes acl_save_prefix="$prefix" @@ -14083,6 +14619,8 @@ $as_echo "$LIBICONV" >&6; } eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" + eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\" + eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" @@ -14103,6 +14641,8 @@ if test "${with_libintl_prefix+set}" = set; then : eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" + eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\" + eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" @@ -14110,15 +14650,19 @@ if test "${with_libintl_prefix+set}" = set; then : else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" - if test "$acl_libdirstem2" != "$acl_libdirstem" \ - && ! test -d "$withval/$acl_libdirstem"; then - additional_libdir="$withval/$acl_libdirstem2" - fi + additional_libdir2="$withval/$acl_libdirstem2" + additional_libdir3="$withval/$acl_libdirstem3" fi fi fi + if test "X$additional_libdir2" = "X$additional_libdir"; then + additional_libdir2= + fi + if test "X$additional_libdir3" = "X$additional_libdir"; then + additional_libdir3= + fi LIBINTL= LTLIBINTL= INCINTL= @@ -14164,45 +14708,51 @@ fi shrext= fi if test $use_additional = yes; then - dir="$additional_libdir" - if test -n "$acl_shlibext"; then - if test -f "$dir/$libname$shrext"; then - found_dir="$dir" - found_so="$dir/$libname$shrext" - else - if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then - ver=`(cd "$dir" && \ - for f in "$libname$shrext".*; do echo "$f"; done \ - | sed -e "s,^$libname$shrext\\\\.,," \ - | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ - | sed 1q ) 2>/dev/null` - if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then - found_dir="$dir" - found_so="$dir/$libname$shrext.$ver" + for additional_libdir_variable in additional_libdir additional_libdir2 additional_libdir3; do + if test "X$found_dir" = "X"; then + eval dir=\$$additional_libdir_variable + if test -n "$dir"; then + if test -n "$acl_shlibext"; then + if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then + found_dir="$dir" + found_so="$dir/$libname$shrext" + else + if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then + ver=`(cd "$dir" && \ + for f in "$libname$shrext".*; do echo "$f"; done \ + | sed -e "s,^$libname$shrext\\\\.,," \ + | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ + | sed 1q ) 2>/dev/null` + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then + found_dir="$dir" + found_so="$dir/$libname$shrext.$ver" + fi + else + eval library_names=\"$acl_library_names_spec\" + for f in $library_names; do + if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then + found_dir="$dir" + found_so="$dir/$f" + break + fi + done + fi + fi fi - else - eval library_names=\"$acl_library_names_spec\" - for f in $library_names; do - if test -f "$dir/$f"; then + if test "X$found_dir" = "X"; then + if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then found_dir="$dir" - found_so="$dir/$f" - break + found_a="$dir/$libname.$acl_libext" fi - done + fi + if test "X$found_dir" != "X"; then + if test -f "$dir/$libname.la"; then + found_la="$dir/$libname.la" + fi + fi fi fi - fi - if test "X$found_dir" = "X"; then - if test -f "$dir/$libname.$acl_libext"; then - found_dir="$dir" - found_a="$dir/$libname.$acl_libext" - fi - fi - if test "X$found_dir" != "X"; then - if test -f "$dir/$libname.la"; then - found_la="$dir/$libname.la" - fi - fi + done fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIBINTL; do @@ -14219,7 +14769,7 @@ fi -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$acl_shlibext"; then - if test -f "$dir/$libname$shrext"; then + if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else @@ -14229,14 +14779,14 @@ fi | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` - if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then + if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do - if test -f "$dir/$f"; then + if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break @@ -14246,7 +14796,7 @@ fi fi fi if test "X$found_dir" = "X"; then - if test -f "$dir/$libname.$acl_libext"; then + if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi @@ -14268,7 +14818,8 @@ fi if test "X$found_so" != "X"; then if test "$enable_rpath" = no \ || test "X$found_dir" = "X/usr/$acl_libdirstem" \ - || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then + || test "X$found_dir" = "X/usr/$acl_libdirstem2" \ + || test "X$found_dir" = "X/usr/$acl_libdirstem3"; then LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so" else haveit= @@ -14347,6 +14898,13 @@ fi fi additional_includedir="$basedir/include" ;; + */$acl_libdirstem3 | */$acl_libdirstem3/) + basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem3/"'*$,,'` + if test "$name" = 'intl'; then + LIBINTL_PREFIX="$basedir" + fi + additional_includedir="$basedir/include" + ;; esac if test "X$additional_includedir" != "X"; then if test "X$additional_includedir" != "X/usr/include"; then @@ -14392,12 +14950,14 @@ fi for dep in $dependency_libs; do case "$dep" in -L*) - additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` - if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \ - && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then + dependency_libdir=`echo "X$dep" | sed -e 's/^X-L//'` + if test "X$dependency_libdir" != "X/usr/$acl_libdirstem" \ + && test "X$dependency_libdir" != "X/usr/$acl_libdirstem2" \ + && test "X$dependency_libdir" != "X/usr/$acl_libdirstem3"; then haveit= - if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \ - || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then + if test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem" \ + || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem2" \ + || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem3"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; @@ -14416,14 +14976,14 @@ fi exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" - if test "X$x" = "X-L$additional_libdir"; then + if test "X$x" = "X-L$dependency_libdir"; then haveit=yes break fi done if test -z "$haveit"; then - if test -d "$additional_libdir"; then - LIBINTL="${LIBINTL}${LIBINTL:+ }-L$additional_libdir" + if test -d "$dependency_libdir"; then + LIBINTL="${LIBINTL}${LIBINTL:+ }-L$dependency_libdir" fi fi haveit= @@ -14437,14 +14997,14 @@ fi exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" - if test "X$x" = "X-L$additional_libdir"; then + if test "X$x" = "X-L$dependency_libdir"; then haveit=yes break fi done if test -z "$haveit"; then - if test -d "$additional_libdir"; then - LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$additional_libdir" + if test -d "$dependency_libdir"; then + LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$dependency_libdir" fi fi fi @@ -14527,7 +15087,6 @@ fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libintl" >&5 $as_echo_n "checking for GNU gettext in libintl... " >&6; } if eval \${$gt_func_gnugettext_libintl+:} false; then : @@ -15365,7 +15924,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by BOUT++ $as_me 4.3.1, which was +This file was extended by BOUT++ $as_me 4.3.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15422,7 +15981,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -BOUT++ config.status 4.3.1 +BOUT++ config.status 4.3.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -15531,9 +16090,8 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # INIT-COMMANDS # # Capture the value of obsolete ALL_LINGUAS because we need it to compute - # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it - # from automake < 1.5. - eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' + # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. + OBSOLETE_ALL_LINGUAS="$ALL_LINGUAS" # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" @@ -16014,14 +16572,11 @@ $as_echo "$as_me: executing $ac_file commands" >&6;} if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi - ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` - # Hide the ALL_LINGUAS assignment from automake < 1.5. - eval 'ALL_LINGUAS''=$ALL_LINGUAS_' + ALL_LINGUAS=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. - # Hide the ALL_LINGUAS assignment from automake < 1.5. - eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' + ALL_LINGUAS=$OBSOLETE_ALL_LINGUAS fi # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) @@ -16151,7 +16706,8 @@ CONFIG_LDFLAGS=`$MAKE ldflags -f output.make` # If make install is run then that replaces these paths BOUT_LIB_PATH=$PWD/lib BOUT_INCLUDE_PATH=$PWD/include -MPARK_VARIANT_INCLUDE_PATH=$PWD/externalpackages/mpark.variant/include + + @@ -16734,7 +17290,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by BOUT++ $as_me 4.3.1, which was +This file was extended by BOUT++ $as_me 4.3.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -16791,7 +17347,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -BOUT++ config.status 4.3.1 +BOUT++ config.status 4.3.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -16900,9 +17456,8 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # INIT-COMMANDS # # Capture the value of obsolete ALL_LINGUAS because we need it to compute - # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it - # from automake < 1.5. - eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"' + # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. + OBSOLETE_ALL_LINGUAS="$ALL_LINGUAS" # Capture the value of LINGUAS because we need it to compute CATALOGS. LINGUAS="${LINGUAS-%UNSET%}" @@ -17384,14 +17939,11 @@ $as_echo "$as_me: executing $ac_file commands" >&6;} if test -n "$OBSOLETE_ALL_LINGUAS"; then test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete" fi - ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` - # Hide the ALL_LINGUAS assignment from automake < 1.5. - eval 'ALL_LINGUAS''=$ALL_LINGUAS_' + ALL_LINGUAS=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"` POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS" else # The set of available languages was given in configure.in. - # Hide the ALL_LINGUAS assignment from automake < 1.5. - eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS' + ALL_LINGUAS=$OBSOLETE_ALL_LINGUAS fi # Compute POFILES # as $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po) diff --git a/configure.ac b/configure.ac index 95d78630c4..55f93fdae1 100644 --- a/configure.ac +++ b/configure.ac @@ -32,7 +32,7 @@ # AC_PREREQ([2.69]) -AC_INIT([BOUT++],[4.3.1],[bd512@york.ac.uk]) +AC_INIT([BOUT++],[4.3.2],[bd512@york.ac.uk]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([m4]) @@ -62,6 +62,8 @@ AC_ARG_WITH(arkode, [AS_HELP_STRING([--with-arkode], [Use the SUNDIALS ARKODE solver])],,[]) AC_ARG_WITH(scorep, [AS_HELP_STRING([--with-scorep], [Enable support for scorep based instrumentation])],,[with_scorep=no]) +AC_ARG_WITH(system_mpark, [AS_HELP_STRING([--with-system-mpark], + [Use mpark.variant already installed rather then the bundled one])],,[with_system_mpark=auto]) dnl --with-hdf5 flags are set in AX_LIB_{PARALLEL}HDF5 @@ -1138,6 +1140,45 @@ Please supply the path using --with-scorep=/path/to/scorep]) AC_MSG_NOTICE([Scorep support disabled]) ]) +############################################################# +# Check for mpark.variant +############################################################# + +AS_IF([test ".$with_system_mpark" = "no"], [ + SYSTEM_HAS_MPARK=no +], [ + AC_MSG_CHECKING([for mpark.variant]) + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([ + #include "mpark/variant.hpp" + ], [])], + [AC_MSG_RESULT([yes]) + SYSTEM_HAS_MPARK=yes], + [AC_MSG_RESULT([no]) + SYSTEM_HAS_MPARK=no + AS_IF([test "$with_system_mpark" = "yes"], [ + AC_MSG_FAILURE([*** System mpark.variant not found - but requested to use]) + ])]) +]) + +AS_IF([test "$SYSTEM_HAS_MPARK" = "yes"], [ + MPARK_VARIANT_INCLUDE_PATH= + MPARK_INCLUDE= + OWN_MPARK= +], [ + AS_IF([test -d externalpackages/mpark.variant/include], [], + [ AS_IF([test -d .git && which git], [ + make -f makefile.submodules mpark_submodule || \ + AC_MSG_FAILURE([*** Could not download mpark.variant]) + ], [ + AC_MSG_FAILURE([mpark.variant not found. Please install mpark.variant or use the official releases.]) + ]) + ]) + + MPARK_VARIANT_INCLUDE_PATH="$PWD/externalpackages/mpark.variant/include" + MPARK_INCLUDE="-I$MPARK_VARIANT_INCLUDE_PATH" + OWN_MPARK=yes +]) ############################################################# # Download + Build PVODE '98 ############################################################# @@ -1305,10 +1346,11 @@ AC_SUBST(CONFIG_LDFLAGS) # If make install is run then that replaces these paths BOUT_LIB_PATH=$PWD/lib BOUT_INCLUDE_PATH=$PWD/include -MPARK_VARIANT_INCLUDE_PATH=$PWD/externalpackages/mpark.variant/include AC_SUBST(BOUT_LIB_PATH) AC_SUBST(BOUT_INCLUDE_PATH) AC_SUBST(MPARK_VARIANT_INCLUDE_PATH) +AC_SUBST(MPARK_INCLUDE) +AC_SUBST(OWN_MPARK) AC_SUBST(PREFIX) AC_SUBST(IDLCONFIGPATH) diff --git a/examples/tokamak-2fluid/2fluid.cxx b/examples/tokamak-2fluid/2fluid.cxx index 0ba9a84a0c..e09f6936f4 100644 --- a/examples/tokamak-2fluid/2fluid.cxx +++ b/examples/tokamak-2fluid/2fluid.cxx @@ -333,16 +333,18 @@ class TwoFluid : public PhysicsModel { output.write(" ****NOTE: input from BOUT, Z length needs to be divided by %e\n", hthe0/rho_s); } - //////////////////////////////////////////////////////// - // SHIFTED GRIDS LOCATION - - // Velocities defined on cell boundaries - Vi.setLocation(CELL_YLOW); - Ajpar.setLocation(CELL_YLOW); - - // Apar and jpar too - Apar.setLocation(CELL_YLOW); - jpar.setLocation(CELL_YLOW); + if (stagger) { + //////////////////////////////////////////////////////// + // SHIFTED GRIDS LOCATION + + // Velocities defined on cell boundaries + Vi.setLocation(CELL_YLOW); + Ajpar.setLocation(CELL_YLOW); + + // Apar and jpar too + Apar.setLocation(CELL_YLOW); + jpar.setLocation(CELL_YLOW); + } //////////////////////////////////////////////////////// // NORMALISE QUANTITIES @@ -496,8 +498,13 @@ class TwoFluid : public PhysicsModel { if (! (estatic || ZeroElMass)) { // Create a solver for the electromagnetic potential - aparSolver = Laplacian::create(&options["aparSolver"]); - acoef = (-0.5 * beta_p / fmei) * Ni0; + aparSolver = Laplacian::create(&options["aparSolver"], + stagger ? CELL_YLOW : CELL_CENTRE); + if (stagger) { + acoef = (-0.5 * beta_p / fmei) * interp_to(Ni0, CELL_YLOW); + } else { + acoef = (-0.5 * beta_p / fmei) * Ni0; + } aparSolver->setCoefA(acoef); } @@ -575,7 +582,11 @@ class TwoFluid : public PhysicsModel { //////////////////////////////////////////////////////// // Update non-linear coefficients on the mesh - nu = nu_hat * Nit / pow(Tet,1.5); + if (stagger) { + nu = nu_hat * interp_to(Nit / pow(Tet,1.5), CELL_YLOW); + } else { + nu = nu_hat * Nit / pow(Tet,1.5); + } mu_i = mui_hat * Nit / sqrt(Tit); kapa_Te = 3.2*(1./fmei)*(wci/nueix)*pow(Tet,2.5); kapa_Ti = 3.9*(wci/nuiix)*pow(Tit,2.5); @@ -589,16 +600,16 @@ class TwoFluid : public PhysicsModel { // Set jpar,Ve,Ajpar neglecting the electron inertia term // Calculate Jpar, communicating across processors if (!stagger) { - jpar = -(Ni0*Grad_par(phi, CELL_YLOW)) / (fmei*0.51*nu); + jpar = -(Ni0*Grad_par(phi)) / (fmei*0.51*nu); if (OhmPe) { - jpar += (Te0*Grad_par(Ni, CELL_YLOW)) / (fmei*0.51*nu); + jpar += (Te0*Grad_par(Ni)) / (fmei*0.51*nu); } } else { - jpar = -(Ni0*Grad_par_LtoC(phi))/(fmei*0.51*nu); + jpar = -(interp_to(Ni0, CELL_YLOW)*Grad_par_CtoL(phi))/(fmei*0.51*nu); if (OhmPe) { - jpar += (Te0*Grad_par_LtoC(Ni)) / (fmei*0.51*nu); + jpar += (interp_to(Te0, CELL_YLOW)*Grad_par_CtoL(Ni)) / (fmei*0.51*nu); } } @@ -606,12 +617,20 @@ class TwoFluid : public PhysicsModel { mesh->communicate(jpar); jpar.applyBoundary(); - Ve = Vi - jpar/Ni0; + if (!stagger) { + Ve = Vi - jpar/Ni0; + } else { + Ve = Vi - jpar/interp_to(Ni0, CELL_YLOW); + } Ajpar = Ve; } else { Ve = Ajpar + Apar; - jpar = Ni0*(Vi - Ve); + if (!stagger) { + jpar = Ni0*(Vi - Ve); + } else { + jpar = interp_to(Ni0, CELL_YLOW)*(Vi - Ve); + } } //////////////////////////////////////////////////////// @@ -647,7 +666,7 @@ class TwoFluid : public PhysicsModel { if (ni_jpar1) { if (stagger) { - ddt(Ni) += Div_par_CtoL(jpar); + ddt(Ni) += Div_par_LtoC(jpar); } else { ddt(Ni) += Div_par(jpar); } @@ -808,9 +827,9 @@ class TwoFluid : public PhysicsModel { if (rho_jpar1) { if (stagger) { - ddt(rho) += SQ(coord->Bxy)*Div_par_CtoL(jpar); + ddt(rho) += SQ(coord->Bxy)*Div_par_LtoC(jpar); } else { - ddt(rho) += SQ(coord->Bxy)*Div_par(jpar, CELL_CENTRE); + ddt(rho) += SQ(coord->Bxy)*Div_par(jpar); } } @@ -832,20 +851,24 @@ class TwoFluid : public PhysicsModel { //ddt(Ajpar) -= (1./fmei)*1.71*Grad_par(Te); if (stagger) { - ddt(Ajpar) += (1./fmei)*Grad_par_LtoC(phi); // Right-hand differencing + ddt(Ajpar) += (1./fmei)*Grad_par_CtoL(phi); // Right-hand differencing } else { - ddt(Ajpar) += (1./fmei)*Grad_par(phi, CELL_YLOW); + ddt(Ajpar) += (1./fmei)*Grad_par(phi); } if (OhmPe) { if (stagger) { - ddt(Ajpar) -= (1./fmei)*(Tet/Nit)*Grad_par_LtoC(Ni); + ddt(Ajpar) -= (1./fmei)*(Tet/Nit)*Grad_par_CtoL(Ni); } else { - ddt(Ajpar) -= (1./fmei)*(Te0/Ni0)*Grad_par(Ni, CELL_YLOW); + ddt(Ajpar) -= (1./fmei)*(Te0/Ni0)*Grad_par(Ni); } } - ddt(Ajpar) += 0.51*interp_to(nu, CELL_YLOW)*jpar/Ni0; + if (stagger) { + ddt(Ajpar) += 0.51*nu*jpar/interp_to(Ni0, CELL_YLOW); + } else { + ddt(Ajpar) += 0.51*nu*jpar/Ni0; + } if(lowPass_z > 0) ddt(Ajpar) = lowPass(ddt(Ajpar), lowPass_z); diff --git a/examples/tokamak-2fluid/data/BOUT.inp b/examples/tokamak-2fluid/data/BOUT.inp index 177769693d..ef4a53a251 100644 --- a/examples/tokamak-2fluid/data/BOUT.inp +++ b/examples/tokamak-2fluid/data/BOUT.inp @@ -8,10 +8,9 @@ NOUT = 200 # number of time-steps TIMESTEP = 1e1 # time between outputs -ShiftXderivs = false # use shifted radial derivatives? TwistShift = false # use twist-shift condition? -MZ = 33 # number of points in z direction (2^n + 1) +MZ = 32 # number of points in z direction (2^n) ZMIN = 0.0 ZMAX = 0.0202509 # 1e1 / 4.938060e+02 @@ -24,9 +23,8 @@ grid="data/uedge.grd.nc" dump_format = "nc" # Set extension for dump files (nc = NetCDF) -NXPE = 2 - -#StaggerGrids = true +[mesh] +StaggerGrids = true ################################################## # derivative methods diff --git a/locale/de/libbout.po b/locale/de/libbout.po index 0955c0b559..fdbcb327da 100644 --- a/locale/de/libbout.po +++ b/locale/de/libbout.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: BOUT++ 4.2.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-19 12:25+0000\n" +"POT-Creation-Date: 2020-09-23 17:43+0100\n" "PO-Revision-Date: 2020-03-19 12:42+0000\n" "Last-Translator: David \n" "Language-Team: German\n" @@ -185,10 +185,10 @@ msgstr "\tOpenMP Parallelisierung mit %d Threads ist aktiviert\n" #. Mark the option as used #. Option not found -#: ../include/options.hxx:406 ../include/options.hxx:438 -#: ../include/options.hxx:460 ../include/options.hxx:635 #: ../src/sys/options.cxx:183 ../src/sys/options.cxx:238 #: ../src/sys/options.cxx:280 ../src/sys/options.cxx:319 +#: ../include/options.hxx:406 ../include/options.hxx:438 +#: ../include/options.hxx:460 ../include/options.hxx:635 msgid "\tOption " msgstr "\tOption " @@ -367,7 +367,7 @@ msgstr "" msgid "Command line" msgstr "Befehlszeile" -#: ../tests/unit/src/test_bout++.cxx:300 ../src/bout++.cxx:374 +#: ../src/bout++.cxx:374 ../tests/unit/src/test_bout++.cxx:300 msgid "Compile-time options:\n" msgstr "Kompiliert mit:\n" @@ -695,7 +695,7 @@ msgstr "Die Region '%s' ist bereits vorhanden in der regionMap3D" msgid "Trying to add an already existing region %s to regionMapPerp" msgstr "Die Region '%s' ist bereits vorhanden in der regionMapPerp" -#: ../src/mesh/coordinates.cxx:1140 +#: ../src/mesh/coordinates.cxx:1207 msgid "" "Unrecognised paralleltransform option.\n" "Valid choices are 'identity', 'shifted', 'fci'" @@ -792,21 +792,21 @@ msgstr "" "WARNUNG: Anzahl der toroidalen Punkte sollte 2^n für effiziente FFTs sein. " "Ändere MZ (%d) falls FFTs verwendet werden\n" -#: ../src/mesh/coordinates.cxx:430 +#: ../src/mesh/coordinates.cxx:440 msgid "WARNING: extrapolating input mesh quantities into x-boundary cells\n" msgstr "" -#: ../src/mesh/coordinates.cxx:217 +#: ../src/mesh/coordinates.cxx:219 msgid "" "WARNING: extrapolating input mesh quantities into x-boundary cells. Set " "option extrapolate_x=false to disable this.\n" msgstr "" -#: ../src/mesh/coordinates.cxx:435 +#: ../src/mesh/coordinates.cxx:445 msgid "WARNING: extrapolating input mesh quantities into y-boundary cells\n" msgstr "" -#: ../src/mesh/coordinates.cxx:222 +#: ../src/mesh/coordinates.cxx:224 msgid "" "WARNING: extrapolating input mesh quantities into y-boundary cells. Set " "option extrapolate_y=false to disable this.\n" diff --git a/locale/es/libbout.po b/locale/es/libbout.po index c2be227210..9d8c83eb8f 100644 --- a/locale/es/libbout.po +++ b/locale/es/libbout.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: BOUT++ 4.2.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-19 12:26+0000\n" +"POT-Creation-Date: 2020-09-23 17:43+0100\n" "PO-Revision-Date: 2019-02-11 12:46+0900\n" "Last-Translator: Marta \n" "Language-Team: Spanish\n" @@ -182,10 +182,10 @@ msgstr "\tParalelización en OpenMP activada, usando %d procesos (`threads`)\n" #. Mark the option as used #. Option not found -#: ../include/options.hxx:406 ../include/options.hxx:438 -#: ../include/options.hxx:460 ../include/options.hxx:635 #: ../src/sys/options.cxx:183 ../src/sys/options.cxx:238 #: ../src/sys/options.cxx:280 ../src/sys/options.cxx:319 +#: ../include/options.hxx:406 ../include/options.hxx:438 +#: ../include/options.hxx:460 ../include/options.hxx:635 msgid "\tOption " msgstr "\tOpción " @@ -363,7 +363,7 @@ msgstr "" msgid "Command line" msgstr "Línea de comandos" -#: ../tests/unit/src/test_bout++.cxx:300 ../src/bout++.cxx:374 +#: ../src/bout++.cxx:374 ../tests/unit/src/test_bout++.cxx:300 msgid "Compile-time options:\n" msgstr "Opciones de tiempo de compilación:\n" @@ -688,7 +688,7 @@ msgstr "Intentando añadir una región ya existente %s a regionMap3D" msgid "Trying to add an already existing region %s to regionMapPerp" msgstr "Intentando añadir una región ya existente %s a regionMapPerp" -#: ../src/mesh/coordinates.cxx:1140 +#: ../src/mesh/coordinates.cxx:1207 msgid "" "Unrecognised paralleltransform option.\n" "Valid choices are 'identity', 'shifted', 'fci'" @@ -786,21 +786,21 @@ msgstr "" "WARNING: el número de puntos toroidales debería ser 2^n para una FFT " "eficiente -- considere cambiar MZ si se usan FFTs\n" -#: ../src/mesh/coordinates.cxx:430 +#: ../src/mesh/coordinates.cxx:440 msgid "WARNING: extrapolating input mesh quantities into x-boundary cells\n" msgstr "" -#: ../src/mesh/coordinates.cxx:217 +#: ../src/mesh/coordinates.cxx:219 msgid "" "WARNING: extrapolating input mesh quantities into x-boundary cells. Set " "option extrapolate_x=false to disable this.\n" msgstr "" -#: ../src/mesh/coordinates.cxx:435 +#: ../src/mesh/coordinates.cxx:445 msgid "WARNING: extrapolating input mesh quantities into y-boundary cells\n" msgstr "" -#: ../src/mesh/coordinates.cxx:222 +#: ../src/mesh/coordinates.cxx:224 msgid "" "WARNING: extrapolating input mesh quantities into y-boundary cells. Set " "option extrapolate_y=false to disable this.\n" diff --git a/locale/fr/libbout.po b/locale/fr/libbout.po index 0c38795c4e..77e116472a 100644 --- a/locale/fr/libbout.po +++ b/locale/fr/libbout.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: BOUT++ 4.2.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-19 12:26+0000\n" +"POT-Creation-Date: 2020-09-23 17:43+0100\n" "PO-Revision-Date: 2018-10-21 22:46+0100\n" "Last-Translator: \n" "Language-Team: French\n" @@ -163,10 +163,10 @@ msgstr "" #. Mark the option as used #. Option not found -#: ../include/options.hxx:406 ../include/options.hxx:438 -#: ../include/options.hxx:460 ../include/options.hxx:635 #: ../src/sys/options.cxx:183 ../src/sys/options.cxx:238 #: ../src/sys/options.cxx:280 ../src/sys/options.cxx:319 +#: ../include/options.hxx:406 ../include/options.hxx:438 +#: ../include/options.hxx:460 ../include/options.hxx:635 msgid "\tOption " msgstr "" @@ -327,7 +327,7 @@ msgstr "" msgid "Command line" msgstr "" -#: ../tests/unit/src/test_bout++.cxx:300 ../src/bout++.cxx:374 +#: ../src/bout++.cxx:374 ../tests/unit/src/test_bout++.cxx:300 msgid "Compile-time options:\n" msgstr "" @@ -627,7 +627,7 @@ msgstr "" msgid "Trying to add an already existing region %s to regionMapPerp" msgstr "" -#: ../src/mesh/coordinates.cxx:1140 +#: ../src/mesh/coordinates.cxx:1207 msgid "" "Unrecognised paralleltransform option.\n" "Valid choices are 'identity', 'shifted', 'fci'" @@ -718,21 +718,21 @@ msgid "" "performance -- consider changing MZ (%d) if using FFTs\n" msgstr "" -#: ../src/mesh/coordinates.cxx:430 +#: ../src/mesh/coordinates.cxx:440 msgid "WARNING: extrapolating input mesh quantities into x-boundary cells\n" msgstr "" -#: ../src/mesh/coordinates.cxx:217 +#: ../src/mesh/coordinates.cxx:219 msgid "" "WARNING: extrapolating input mesh quantities into x-boundary cells. Set " "option extrapolate_x=false to disable this.\n" msgstr "" -#: ../src/mesh/coordinates.cxx:435 +#: ../src/mesh/coordinates.cxx:445 msgid "WARNING: extrapolating input mesh quantities into y-boundary cells\n" msgstr "" -#: ../src/mesh/coordinates.cxx:222 +#: ../src/mesh/coordinates.cxx:224 msgid "" "WARNING: extrapolating input mesh quantities into y-boundary cells. Set " "option extrapolate_y=false to disable this.\n" diff --git a/locale/libbout.pot b/locale/libbout.pot index 800e98f0c9..8f47324593 100644 --- a/locale/libbout.pot +++ b/locale/libbout.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-19 12:30+0000\n" +"POT-Creation-Date: 2020-09-23 17:43+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -161,10 +161,10 @@ msgstr "" #. Mark the option as used #. Option not found -#: ../include/options.hxx:406 ../include/options.hxx:438 -#: ../include/options.hxx:460 ../include/options.hxx:635 #: ../src/sys/options.cxx:183 ../src/sys/options.cxx:238 #: ../src/sys/options.cxx:280 ../src/sys/options.cxx:319 +#: ../include/options.hxx:406 ../include/options.hxx:438 +#: ../include/options.hxx:460 ../include/options.hxx:635 msgid "\tOption " msgstr "" @@ -319,7 +319,7 @@ msgstr "" msgid "Command line" msgstr "" -#: ../tests/unit/src/test_bout++.cxx:300 ../src/bout++.cxx:374 +#: ../src/bout++.cxx:374 ../tests/unit/src/test_bout++.cxx:300 msgid "Compile-time options:\n" msgstr "" @@ -616,7 +616,7 @@ msgstr "" msgid "Trying to add an already existing region %s to regionMapPerp" msgstr "" -#: ../src/mesh/coordinates.cxx:1140 +#: ../src/mesh/coordinates.cxx:1207 msgid "" "Unrecognised paralleltransform option.\n" "Valid choices are 'identity', 'shifted', 'fci'" @@ -707,21 +707,21 @@ msgid "" "performance -- consider changing MZ (%d) if using FFTs\n" msgstr "" -#: ../src/mesh/coordinates.cxx:430 +#: ../src/mesh/coordinates.cxx:440 msgid "WARNING: extrapolating input mesh quantities into x-boundary cells\n" msgstr "" -#: ../src/mesh/coordinates.cxx:217 +#: ../src/mesh/coordinates.cxx:219 msgid "" "WARNING: extrapolating input mesh quantities into x-boundary cells. Set " "option extrapolate_x=false to disable this.\n" msgstr "" -#: ../src/mesh/coordinates.cxx:435 +#: ../src/mesh/coordinates.cxx:445 msgid "WARNING: extrapolating input mesh quantities into y-boundary cells\n" msgstr "" -#: ../src/mesh/coordinates.cxx:222 +#: ../src/mesh/coordinates.cxx:224 msgid "" "WARNING: extrapolating input mesh quantities into y-boundary cells. Set " "option extrapolate_y=false to disable this.\n" diff --git a/locale/zh_CN/libbout.po b/locale/zh_CN/libbout.po index 1a1b28c39a..5ba45f343c 100644 --- a/locale/zh_CN/libbout.po +++ b/locale/zh_CN/libbout.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: BOUT++ 4.2.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-19 12:26+0000\n" +"POT-Creation-Date: 2020-09-23 17:43+0100\n" "PO-Revision-Date: 2018-10-22 22:56+0100\n" "Last-Translator: \n" "Language-Team: Chinese (simplified)\n" @@ -162,10 +162,10 @@ msgstr "" #. Mark the option as used #. Option not found -#: ../include/options.hxx:406 ../include/options.hxx:438 -#: ../include/options.hxx:460 ../include/options.hxx:635 #: ../src/sys/options.cxx:183 ../src/sys/options.cxx:238 #: ../src/sys/options.cxx:280 ../src/sys/options.cxx:319 +#: ../include/options.hxx:406 ../include/options.hxx:438 +#: ../include/options.hxx:460 ../include/options.hxx:635 msgid "\tOption " msgstr "\t选项 " @@ -327,7 +327,7 @@ msgstr "" msgid "Command line" msgstr "" -#: ../tests/unit/src/test_bout++.cxx:300 ../src/bout++.cxx:374 +#: ../src/bout++.cxx:374 ../tests/unit/src/test_bout++.cxx:300 msgid "Compile-time options:\n" msgstr "" @@ -626,7 +626,7 @@ msgstr "" msgid "Trying to add an already existing region %s to regionMapPerp" msgstr "" -#: ../src/mesh/coordinates.cxx:1140 +#: ../src/mesh/coordinates.cxx:1207 msgid "" "Unrecognised paralleltransform option.\n" "Valid choices are 'identity', 'shifted', 'fci'" @@ -717,21 +717,21 @@ msgid "" "performance -- consider changing MZ (%d) if using FFTs\n" msgstr "" -#: ../src/mesh/coordinates.cxx:430 +#: ../src/mesh/coordinates.cxx:440 msgid "WARNING: extrapolating input mesh quantities into x-boundary cells\n" msgstr "" -#: ../src/mesh/coordinates.cxx:217 +#: ../src/mesh/coordinates.cxx:219 msgid "" "WARNING: extrapolating input mesh quantities into x-boundary cells. Set " "option extrapolate_x=false to disable this.\n" msgstr "" -#: ../src/mesh/coordinates.cxx:435 +#: ../src/mesh/coordinates.cxx:445 msgid "WARNING: extrapolating input mesh quantities into y-boundary cells\n" msgstr "" -#: ../src/mesh/coordinates.cxx:222 +#: ../src/mesh/coordinates.cxx:224 msgid "" "WARNING: extrapolating input mesh quantities into y-boundary cells. Set " "option extrapolate_y=false to disable this.\n" diff --git a/locale/zh_TW/libbout.po b/locale/zh_TW/libbout.po index a66c48322d..8667fbedee 100644 --- a/locale/zh_TW/libbout.po +++ b/locale/zh_TW/libbout.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: BOUT++ 4.2.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-03-19 12:26+0000\n" +"POT-Creation-Date: 2020-09-23 17:43+0100\n" "PO-Revision-Date: 2018-10-22 22:56+0100\n" "Last-Translator: \n" "Language-Team: Chinese (traditional)\n" @@ -160,10 +160,10 @@ msgstr "\t啟用OpenMP並行化。 使用%d個線程\n" #. Mark the option as used #. Option not found -#: ../include/options.hxx:406 ../include/options.hxx:438 -#: ../include/options.hxx:460 ../include/options.hxx:635 #: ../src/sys/options.cxx:183 ../src/sys/options.cxx:238 #: ../src/sys/options.cxx:280 ../src/sys/options.cxx:319 +#: ../include/options.hxx:406 ../include/options.hxx:438 +#: ../include/options.hxx:460 ../include/options.hxx:635 msgid "\tOption " msgstr "\t選項 " @@ -326,7 +326,7 @@ msgstr "" msgid "Command line" msgstr "" -#: ../tests/unit/src/test_bout++.cxx:300 ../src/bout++.cxx:374 +#: ../src/bout++.cxx:374 ../tests/unit/src/test_bout++.cxx:300 msgid "Compile-time options:\n" msgstr "編譯選項:\n" @@ -632,7 +632,7 @@ msgstr "" msgid "Trying to add an already existing region %s to regionMapPerp" msgstr "" -#: ../src/mesh/coordinates.cxx:1140 +#: ../src/mesh/coordinates.cxx:1207 msgid "" "Unrecognised paralleltransform option.\n" "Valid choices are 'identity', 'shifted', 'fci'" @@ -723,21 +723,21 @@ msgid "" "performance -- consider changing MZ (%d) if using FFTs\n" msgstr "" -#: ../src/mesh/coordinates.cxx:430 +#: ../src/mesh/coordinates.cxx:440 msgid "WARNING: extrapolating input mesh quantities into x-boundary cells\n" msgstr "" -#: ../src/mesh/coordinates.cxx:217 +#: ../src/mesh/coordinates.cxx:219 msgid "" "WARNING: extrapolating input mesh quantities into x-boundary cells. Set " "option extrapolate_x=false to disable this.\n" msgstr "" -#: ../src/mesh/coordinates.cxx:435 +#: ../src/mesh/coordinates.cxx:445 msgid "WARNING: extrapolating input mesh quantities into y-boundary cells\n" msgstr "" -#: ../src/mesh/coordinates.cxx:222 +#: ../src/mesh/coordinates.cxx:224 msgid "" "WARNING: extrapolating input mesh quantities into y-boundary cells. Set " "option extrapolate_y=false to disable this.\n" diff --git a/make.config.in b/make.config.in index 4f4c153e65..78e6d495ae 100644 --- a/make.config.in +++ b/make.config.in @@ -92,7 +92,7 @@ LIB_SO = $(BOUT_LIB_PATH)/libbout++.so endif MPARK_VARIANT_INCLUDE_PATH=@MPARK_VARIANT_INCLUDE_PATH@ -BOUT_INCLUDE = -I$(BOUT_INCLUDE_PATH) $(CXXINCLUDE) $(EXTRA_INCS) -I$(MPARK_VARIANT_INCLUDE_PATH) +BOUT_INCLUDE = -I$(BOUT_INCLUDE_PATH) $(CXXINCLUDE) $(EXTRA_INCS) @MPARK_INCLUDE@ BOUT_LIBS = -lm -L$(BOUT_LIB_PATH) -lbout++ $(EXTRA_LIBS) CHANGED = $(shell find -f $(BOUT_TOP)/include $(BOUT_TOP)/src -type f \( -name \*.cxx -or -name \*.h \) -newer $(LIB) -print 2> /dev/null) @@ -163,11 +163,14 @@ install: libfast $(PRE_INSTALL) # Pre-install commands follow. $(NORMAL_INSTALL) # Normal commands follow. - $(MKDIR) $(INSTALL_INCLUDE_PATH)/{,pvode,bout/sys,bout/invert,mpark} + $(MKDIR) $(INSTALL_INCLUDE_PATH)/{,pvode,bout/sys,bout/invert} $(MKDIR) $(DESTDIR)/{@libdir@,@bindir@,@datadir@/bout++/idllib} $(MKDIR) $(DESTDIR)/@datadir@/bout++/pylib/{boutdata,boututils} $(INSTALL_DATA) include/*.hxx $(INSTALL_INCLUDE_PATH) +ifeq ("@OWN_MPARK@", "yes") + $(MKDIR) $(INSTALL_INCLUDE_PATH)/mpark $(INSTALL_DATA) $(MPARK_VARIANT_INCLUDE_PATH)/mpark/*.hpp $(INSTALL_INCLUDE_PATH)/mpark +endif $(INSTALL_DATA) include/pvode/*.h $(INSTALL_INCLUDE_PATH)/pvode/ $(INSTALL_DATA) include/bout/*.hxx $(INSTALL_INCLUDE_PATH)/bout/ $(INSTALL_DATA) include/bout/sys/*.hxx $(INSTALL_INCLUDE_PATH)/bout/sys/ @@ -191,13 +194,17 @@ install: libfast sed -i "s|^BOUT_CONFIG_FILE=.*|BOUT_CONFIG_FILE=@includedir@/bout++/make.config|" $(DESTDIR)@bindir@/bout-config sed -i "s|^idlpath=.*|idlpath=@datadir@/bout++/idllib/|" $(DESTDIR)@bindir@/bout-config sed -i "s|^pythonpath=.*|pythonpath=@datadir@/bout++/pylib/|" $(DESTDIR)@bindir@/bout-config +ifeq ("@OWN_MPARK@", "yes") sed -i "s|^MPARK_VARIANT_INCLUDE_PATH=.*|MPARK_VARIANT_INCLUDE_PATH=@includedir@/bout++|" $(DESTDIR)@bindir@/bout-config +endif @# Modify paths in the make.config file sed -i "s|^BOUT_INCLUDE_PATH=.*|BOUT_INCLUDE_PATH=@includedir@/bout++|" $(INSTALL_INCLUDE_PATH)/make.config sed -i "s|^BOUT_LIB_PATH=.*|BOUT_LIB_PATH=@libdir@|" $(INSTALL_INCLUDE_PATH)/make.config sed -i "s|^BOUT_CONFIG_FILE=.*|BOUT_CONFIG_FILE=@includedir@/bout++/make.config|" $(INSTALL_INCLUDE_PATH)/make.config +ifeq ("@OWN_MPARK@", "yes") sed -i "s|^MPARK_VARIANT_INCLUDE_PATH=.*|MPARK_VARIANT_INCLUDE_PATH=@includedir@/bout++|" $(INSTALL_INCLUDE_PATH)/make.config +endif # Set the make.config as released, so the library isn't rebuild. This way the .a file doesn't need to be preserved/installed sed -i '26 i RELEASED = yes' $(INSTALL_INCLUDE_PATH)/make.config @@ -223,17 +230,10 @@ uninstall: # Builds the library with $(OBJ) which is defined from the SOURCEC variable #################################################################### -MPARK_VARIANT_SENTINEL = $(MPARK_VARIANT_INCLUDE_PATH)/mpark/variant.hpp -$(MPARK_VARIANT_SENTINEL): - @echo "Downloading mpark.variant" - @lock=$(BOUT_TOP)/externalpackages/.get.mpark ;ex=0; mkdir $$lock && { \ - git submodule update --init --recursive $(BOUT_TOP)/externalpackages/mpark.variant \ - ;ex=$$? ; rmdir $$lock ; } || \ - { c=0;while test -d $$lock ; do sleep .1 ;c=$$((c+1)); \ - test $$c -gt 600 && echo "time-out - maybe remove $$lock?" && ex=1; done ; } ; exit $$ex +# Rules for downloading submodules +include $(BOUT_TOP)/makefile.submodules ifeq ("$(TARGET)", "libfast") -libfast: | $(MPARK_VARIANT_SENTINEL) libfast: makefile $(BOUT_CONFIG_FILE) $(BOUT_TOP)/include $(OBJ) $(DIRS) endif diff --git a/makefile b/makefile index b51413e743..6b7926d240 100644 --- a/makefile +++ b/makefile @@ -11,12 +11,12 @@ shared: libfast @echo $(BOUT_FLAGS) | grep -i pic > /dev/null 2>&1 || (echo "not compiled with PIC support - reconfigure with --enable-shared" ;exit 1) @#$(CXX) -shared -o $(LIB_SO) $(shell find $(BOUT_TOP)/src -name \*.o -type f -print 2> /dev/null) -L $(BOUT_TOP)/lib -Wl,--whole-archive -lpvode -lpvpre -Wl,--no-whole-archive @$(RM) $(BOUT_TOP)/lib/*.so* - @$(CXX) -shared -Wl,-soname,libbout++.so.$(BOUT_VERSION) -o $(LIB_SO).$(BOUT_VERSION) $(shell find $(BOUT_TOP)/src -name \*.o -type f -print 2> /dev/null) + @$(CXX) -shared -Wl,-soname,libbout++.so.4.3.1 -o $(LIB_SO).4.3.1 $(shell find $(BOUT_TOP)/src -name \*.o -type f -print 2> /dev/null) @$(CXX) -shared -Wl,-soname,libpvode.so.1.0.0 -o $(BOUT_TOP)/lib/libpvode_.so -L $(BOUT_TOP)/lib -Wl,--whole-archive -lpvode -Wl,--no-whole-archive @$(CXX) -shared -Wl,-soname,libpvpre.so.1.0.0 -o $(BOUT_TOP)/lib/libpvpre_.so -L $(BOUT_TOP)/lib -Wl,--whole-archive -lpvpre -Wl,--no-whole-archive @mv $(BOUT_TOP)/lib/libpvode_.so $(BOUT_TOP)/lib/libpvode.so.1.0.0 @mv $(BOUT_TOP)/lib/libpvpre_.so $(BOUT_TOP)/lib/libpvpre.so.1.0.0 - @ln -s libbout++.so.$(BOUT_VERSION) $(LIB_SO) + @ln -s libbout++.so.4.3.1 $(LIB_SO) @ln -s libpvode.so.1.0.0 lib/libpvode.so @ln -s libpvpre.so.1.0.0 lib/libpvpre.so diff --git a/makefile.submodules b/makefile.submodules new file mode 100644 index 0000000000..51a3d5c446 --- /dev/null +++ b/makefile.submodules @@ -0,0 +1,9 @@ +# This is in a separate file so that we can download the submodules at +# configure-time, as well as exposing a nice target if things go wrong +# afterwards (for example, after changing branches) + +submodules: mpark_submodule + +mpark_submodule: + @echo "Downloading mpark.variant" + git submodule update --init --recursive $(PWD)/externalpackages/mpark.variant diff --git a/manual/RELEASE_HOWTO.md b/manual/RELEASE_HOWTO.md index a414789a41..98278367f2 100644 --- a/manual/RELEASE_HOWTO.md +++ b/manual/RELEASE_HOWTO.md @@ -48,6 +48,7 @@ Before merging PR: - Save draft - [ ] Change DOI in [`CITATION.cff`][citation] to new DOI - [ ] Change date-released in [`CITATION.cff`][citation] +- [ ] Check `abidiff` to see if `soname` needs bumping in `makefile`: - [ ] Change version number in: - [ ] [`configure.ac`][configure]: `AC_INIT` - [ ] [`CITATION.cff`][citation]: `version` diff --git a/manual/doxygen/Doxyfile b/manual/doxygen/Doxyfile index 5bc687f780..622a6e79d8 100644 --- a/manual/doxygen/Doxyfile +++ b/manual/doxygen/Doxyfile @@ -38,7 +38,7 @@ PROJECT_NAME = BOUT++ # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 4.3.1 +PROJECT_NUMBER = 4.3.2 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/manual/doxygen/Doxyfile_readthedocs b/manual/doxygen/Doxyfile_readthedocs index da3204e72f..678e33034d 100644 --- a/manual/doxygen/Doxyfile_readthedocs +++ b/manual/doxygen/Doxyfile_readthedocs @@ -38,7 +38,7 @@ PROJECT_NAME = BOUT++ # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 4.3.1 +PROJECT_NUMBER = 4.3.2 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/manual/sphinx/conf.py b/manual/sphinx/conf.py index 4eac6ce259..5d9dc280cd 100755 --- a/manual/sphinx/conf.py +++ b/manual/sphinx/conf.py @@ -133,7 +133,7 @@ def __getattr__(cls, name): # The short X.Y version. version = '4.3' # The full version, including alpha/beta/rc tags. -release = '4.3.1' +release = '4.3.2' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/manual/sphinx/requirements.txt b/manual/sphinx/requirements.txt index 49311794a0..6d5c75fb9e 100644 --- a/manual/sphinx/requirements.txt +++ b/manual/sphinx/requirements.txt @@ -1,2 +1,2 @@ -breathe==4.12.0 -future==0.16.0 +breathe~=4.12 +future~=0.16 diff --git a/manual/sphinx/user_docs/advanced_install.rst b/manual/sphinx/user_docs/advanced_install.rst index f777260719..a5dff385a5 100644 --- a/manual/sphinx/user_docs/advanced_install.rst +++ b/manual/sphinx/user_docs/advanced_install.rst @@ -192,27 +192,35 @@ File formats BOUT++ can currently use two different file formats: NetCDF-4_, and HDF5_ and experimental support for parallel flavours of both. NetCDF is a widely used format and so has many more tools for viewing and -manipulating files. In particular, the NetCDF-4 library can produce -files in either NetCDF3 “classic” format, which is backwards-compatible -with NetCDF libraries since 1994 (version 2.3), or in the newer NetCDF4 -format, which is based on (and compatible with) HDF5. HDF5 is another -widely used format. If you have multiple libraries installed then BOUT++ -can use them simultaneously, for example reading in grid files in NetCDF -format, but writing output data in HDF5 format. +manipulating files. HDF5 is another widely used format. If you have +multiple libraries installed then BOUT++ can use them simultaneously, +for example reading in grid files in NetCDF format, but writing output +data in HDF5 format. .. _NetCDF-4: https://www.unidata.ucar.edu/software/netcdf/ .. _HDF5: https://www.hdfgroup.org/HDF5/ -To enable NetCDF support, you will need to install NetCDF version 4.0.1 -or later. Note that although the NetCDF-4 library is used for the C++ -interface, by default BOUT++ writes the “classic” format. Because of -this, you don’t need to install zlib or HDF5 for BOUT++ NetCDF support -to work. If you want to output to HDF5 then you need to first install -the zlib and HDF5 libraries, and then compile NetCDF with HDF5 support. -When NetCDF is installed, a script ``nc-config`` should be put into -somewhere on the path. If this is found then configure should have all -the settings it needs. If this isn’t found then configure will search -for the NetCDF include and library files. +BOUT++ will try to use NetCDF by default. It will look for +``ncxx4-config`` or ``nc-config`` in your ``$PATH``. If it cannot find +the libraries, or finds a different version than the one you want, you +can point it at the correct version using:: + + ./configure --with-netcdf=/path/to/ncxx4-config + +where ``/path/to/ncxx4-config`` is the location of the +``ncxx4-config`` tool (``nc-config`` will also work, but +``ncxx4-config`` is preferred). + +To use HDF5, you will need to explicitly enable it:: + + ./configure --with-hdf5 + +BOUT++ will look for ``h5cc`` in your ``$PATH``. Similar to NetCDF, +you can pass the location of the particular version you wish to use +with:: + + ./configure --with-hdf5=/path/to/h5cc + .. _sec-netcdf-from-source: @@ -223,12 +231,12 @@ The latest versions of NetCDF have separated out the C++ API from the main C library. As a result, you will need to download and install both. Download the latest versions of the NetCDF-C and NetCDF-4 C++ libraries from https://www.unidata.ucar.edu/downloads/netcdf. As of -January 2017, these are versions 4.4.1.1 and 4.3.0 respectively. +September 2020, these are versions 4.7.4 and 4.3.1 respectively. Untar the file and ’cd’ into the resulting directory:: - $ tar -xzvf netcdf-4.4.1.1.tar.gz - $ cd netcdf-4.4.1.1 + $ tar -xzvf netcdf-4.7.4.tar.gz + $ cd netcdf-4.7.4 Then run ``configure``, ``make`` and ``make install``:: @@ -244,8 +252,8 @@ Sometimes configure can fail, in which case try disabling Fortran:: Similarly for the C++ API:: - $ tar -xzvf netcdf-cxx4-4.3.0.tar.gz - $ cd netcdf-cxx4-4.3.0 + $ tar -xzvf netcdf-cxx4-4.3.1.tar.gz + $ cd netcdf-cxx4-4.3.1 $ ./configure --prefix=$HOME/local $ make $ make install @@ -330,30 +338,25 @@ solver. Currently, BOUT++ also supports the SUNDIALS solvers CVODE, IDA and ARKODE which are available from https://computation.llnl.gov/casc/sundials/main.html. -.. note:: BOUT++ currently supports SUNDIALS > 2.6, up to 4.1.0 as of - March 2019. It is advisable to use the highest possible +.. note:: BOUT++ currently supports SUNDIALS > 2.6, up to 5.4.0 as of + September 2020. It is advisable to use the highest possible version -In order for a smooth install it is recommended to install SUNDIALS -from an install directory. The full installation guide is found in the -downloaded ``.tar.gz``, but we will provide a step-by-step guide to -install it and make it compatible with BOUT++ here:: +The full installation guide is found in the downloaded ``.tar.gz``, +but we will provide a step-by-step guide to install it and make it +compatible with BOUT++ here:: - $ cd ~ - $ mkdir -p install/sundials-install - $ cd install/sundials-install - $ # Move the downloaded sundials-4.1.0.tar.gz to sundials-install - $ tar -xzvf sundials-4.1.0.tar.gz + $ tar -xzvf sundials-5.4.0.tar.gz + $ cd sundials-5.4.0 $ mkdir build && cd build - $ cmake \ + $ cmake .. \ -DCMAKE_INSTALL_PREFIX=$HOME/local \ -DLAPACK_ENABLE=ON \ -DOPENMP_ENABLE=ON \ -DMPI_ENABLE=ON \ -DCMAKE_C_COMPILER=$(which mpicc) \ -DCMAKE_CXX_COMPILER=$(which mpicxx) \ - ../sundials-4.1.0 $ make $ make test @@ -364,9 +367,7 @@ solver, which evolves a system of the form :math:`\mathbf{f}(\mathbf{u},\dot{\mathbf{u}},t) = 0`. This allows algebraic constraints on variables to be specified. -To configure BOUT++ with SUNDIALS only (see section -:ref:`sec-PETSc-install` on how to build PETSc with SUNDIALS), go to -the root directory of BOUT++ and type:: +Use the ``--with-sundials`` option to configure BOUT++ with SUNDIALS:: $ ./configure --with-sundials=/path/to/sundials/install @@ -382,17 +383,15 @@ BOUT++ can use PETSc https://www.mcs.anl.gov/petsc/ for time-integration and for solving elliptic problems, such as inverting Poisson and Helmholtz equations. -Currently, BOUT++ supports PETSc versions 3.4 - 3.9. To install PETSc -version 3.4.5, use the following steps:: +Currently, BOUT++ supports PETSc versions 3.7 - 3.13. To install PETSc +version 3.13, use the following steps:: $ cd ~ - $ wget http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-3.4.5.tar.gz - $ tar -xzvf petsc-3.4.5.tar.gz - $ # Optional - $ # rm petsc-3.4.5.tar.gz - $ cd petsc-3.4.5 + $ wget http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-3.13.4.tar.gz + $ tar -xzvf petsc-3.13.4.tar.gz + $ cd petsc-3.13.4 -To build PETSc without SUNDIALS, configure with:: +Use the following configure options to ensure PETSc is compatible with BOUT++:: $ ./configure \ --with-clanguage=cxx \ @@ -401,12 +400,11 @@ To build PETSc without SUNDIALS, configure with:: --with-scalar-type=real \ --with-shared-libraries=0 -Add ``--with-debugging=yes`` to ``./configure`` in order to allow -debugging. +You may also wish to add ``--with-debugging=yes`` to ``./configure`` +in order to allow debugging. -.. note:: To build PETSc with SUNDIALS, install SUNDIALS as explained - in section :ref:`sec-sundials`, and append ``./configure`` - with ``--with-sundials-dir=$HOME/local`` +.. note:: If you build BOUT++ using a standalone version of SUNDIALS, + it is advisable to not also build PETSc with SUNDIALS. .. note:: It is also possible to get PETSc to download and install MUMPS (see :ref:`sec-MUMPS`), by adding:: @@ -423,24 +421,24 @@ debugging. To make PETSc, type:: - $ make PETSC_DIR=$HOME/petsc-3.4.5 PETSC_ARCH=arch-linux2-cxx-debug all + $ make PETSC_DIR=$HOME/petsc-3.13.4 PETSC_ARCH=arch-linux2-cxx-debug all Should BLAS, LAPACK, or any other packages be missing, you will get an error, and a suggestion that you can append ``--download-name-of-package`` to the ``./configure`` line. You may want to test that everything is configured properly. To do this, type:: - $ make PETSC_DIR=$HOME/petsc-3.4.5 PETSC_ARCH=arch-linux2-cxx-debug test + $ make PETSC_DIR=$HOME/petsc-3.13.4 PETSC_ARCH=arch-linux2-cxx-debug test To use PETSc, you have to define the ``PETSC_DIR`` and ``PETSC_ARCH`` environment variables to match how PETSc was built:: - $ export PETSC_DIR=$HOME/petsc-3.4.5 + $ export PETSC_DIR=$HOME/petsc-3.13.4 $ export PETSC_ARCH=arch-linux2-cxx-debug and add to your startup file ``$HOME/.bashrc``:: - export PETSC_DIR=$HOME/petsc-3.4.5 + export PETSC_DIR=$HOME/petsc-3.13.4 export PETSC_ARCH=arch-linux2-cxx-debug To configure BOUT++ with PETSc, go to the BOUT++ root directory, and @@ -782,7 +780,7 @@ When using the ``xlC`` compiler, an error may occur:: The workaround is to change line 428 of ``externalpackages/mpark.variant/include/mpark/lib.hpp`` from:: - + #ifdef MPARK_TYPE_PACK_ELEMENT to:: @@ -791,3 +789,33 @@ to:: This will force an alternate implementation of type_pack_element to be defined. See also https://software.intel.com/en-us/forums/intel-c-compiler/topic/501502 + + +Compiling fails after changing branch +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +If compiling fails after changing branch, for example from ``master`` +to ``next``, with an error like the following:: + + $ make + Downloading mpark.variant + You need to run this command from the toplevel of the working tree. + make[2]: *** [BOUT-dev/externalpackages/mpark.variant/include/mpark/variant.hpp] Error 1 + make[1]: *** [field] Error 2 + make: *** [src] Error 2 + +it's possible something has gone wrong with the submodules. To fix, +just run ``make submodules``:: + + $ make submodules + Downloading mpark.variant + git submodule update --init --recursive /home/peter/Codes/BOUT-dev/externalpackages/mpark.variant + Submodule path 'externalpackages/mpark.variant': checked out '0b488da9bebac980e7ba0e158a959c956a449676' + +If you regularly work on two different branches and need to run ``make +submodules`` a lot, you may consider telling git to automatically +update the submodules:: + + git config submodule.recurse=true + +This requires ``git >= 2.14``. diff --git a/manual/sphinx/user_docs/bout_options.rst b/manual/sphinx/user_docs/bout_options.rst index 500b1ccc46..864afa088e 100644 --- a/manual/sphinx/user_docs/bout_options.rst +++ b/manual/sphinx/user_docs/bout_options.rst @@ -239,12 +239,23 @@ of the input file (see :ref:`sec-gridgen` for more information): .. code-block:: cfg [mesh] - nx = 16 # Number of points in X + nx = 20 # Number of points in X ny = 16 # Number of points in Y nz = 32 # Number of points in Z +Due to historical reasons, ``nx`` is defined differently to ``ny`` and ``nz``: + +- ``nx`` is the number of points in X **including** the boundaries +- ``ny`` and ``nz`` are the number of points in Y and Z **not including** the + boundaries + +The default number of boundary points in X is 2, so taking into account the +boundary at each end of the domain, ``nx`` usually means "the number of interior +grid points in X plus four". In the example above, both X and Y have 16 interior +grid points. + It is recommended, but not necessary, that this be :math:`\texttt{nz} -= 2^n`, i.e. :math:`1,2,4,8,\ldots`. This is because FFTs are usually += 2^n`, that is :math:`1,2,4,8,\ldots`. This is because FFTs are usually slightly faster with power-of-two length arrays, and FFTs are used quite frequently in many models. @@ -303,6 +314,34 @@ given, ``NXPE`` takes precedence and ``NYPE`` is ignored): NYPE = 1 # Set number of Y processors +When choosing ``NXPE`` or ``NYPE``, they must also obey some constraints: + +- ``NXPE`` must be a factor of the number of grid points in the x-direction + + - That is, ``(nx - 4) / NXPE`` must be an integer, assuming the usual two + boundary points + +- ``NYPE`` must be a factor of the number of grid points in the y-direction + + - That is, ``ny / NYPE`` must be an integer + +- For more general topologies, the number of points per processor ``ny / NYPE`` + must also be a factor of the number of points in each region. For example, in + the usual tokamak topologies: + + - in single-null there are two divertor leg and one core regions + - in double-null there are four divertor leg, one inner core and one outer + core regions + +Please note that here "core" means "core and adjacent SOL". See +:ref:`sec-bout-topology` for a more detailed explanation of these regions. + +When BOUT++ automatically chooses ``NXPE`` and ``NYPE`` it finds all valid pairs +which give ``total number of processors == NPES = NXPE * NYPE`` and also satisfy +the constraints above. It then chooses the pair that makes the grid on each +processor as close to square as possible (technically it chooses the pair that +minimises ``abs(sqrt(NPES * (nx - 4) / ny) - NXPE)``). + If you need to specify complex input values, e.g. numerical values from experiment, you may want to use a grid file. The grid file to use is specified relative to the root directory where the simulation is diff --git a/manual/sphinx/user_docs/installing.rst b/manual/sphinx/user_docs/installing.rst index 9fa56195ff..917f8a54ec 100644 --- a/manual/sphinx/user_docs/installing.rst +++ b/manual/sphinx/user_docs/installing.rst @@ -89,11 +89,11 @@ the "shared" directory. If this is successful, then you can skip to section :ref:`sec-running`. - Obtaining BOUT++ ----------------- - .. _sec-obtainbout: +Obtaining BOUT++ +---------------- + BOUT++ is hosted publicly on github at https://github.com/boutproject/BOUT-dev. You can the latest stable version from https://github.com/boutproject/BOUT-dev/releases. If you diff --git a/output.make b/output.make index 84e7b9ca18..dd7699b65f 100644 --- a/output.make +++ b/output.make @@ -1,3 +1,4 @@ +BOUT_TOP ?= . include make.config diff --git a/src/fileio/impls/hdf5/h5_format.cxx b/src/fileio/impls/hdf5/h5_format.cxx index 92d5db3b8f..cbdd97d154 100644 --- a/src/fileio/impls/hdf5/h5_format.cxx +++ b/src/fileio/impls/hdf5/h5_format.cxx @@ -1227,7 +1227,11 @@ void H5Format::setAttribute(const hid_t &dataSet, const std::string &attrname, if (myatt_in < 0) throw BoutException("Failed to create attribute"); } - if (H5Awrite(myatt_in, variable_length_string_type, &text) < 0) + // Need to pass `const char**` to HDF5 for reasons, and + // `&text.c_str()` isn't valid (can't take address of an + // r-value/temporary), so we need an intermediate variable + const char* c_text = text.c_str(); + if (H5Awrite(myatt_in, variable_length_string_type, &c_text) < 0) throw BoutException("Failed to write attribute"); if (H5Sclose(attribute_dataspace) < 0) @@ -1367,9 +1371,14 @@ bool H5Format::getAttribute(const hid_t &dataSet, const std::string &attrname, s if (H5Tset_size(variable_length_string_type, H5T_VARIABLE) < 0) throw BoutException("Failed to create string type"); - // Read attribute - if (H5Aread(myatt, variable_length_string_type, &text) < 0) + // Read attribute: Need to pass `char**` to HDF5 for reasons, but + // luckliy it will allocate c_text for us + char* c_text; + if (H5Aread(myatt, variable_length_string_type, &c_text) < 0) throw BoutException("Failed to read attribute"); + text = c_text; + // Release resources allocated by HDF5 + free(c_text); if (H5Tclose(variable_length_string_type) < 0) throw BoutException("Failed to close variable_length_string_type"); diff --git a/src/mesh/coordinates.cxx b/src/mesh/coordinates.cxx index 5e4f0bbffb..3bd1fac7ec 100644 --- a/src/mesh/coordinates.cxx +++ b/src/mesh/coordinates.cxx @@ -1307,8 +1307,10 @@ Field3D Coordinates::Div_par(const Field3D& f, CELL_LOC outloc, // Need to modify yup and ydown fields Field3D f_B = f / Bxy_floc; f_B.splitParallelSlices(); - f_B.yup() = f.yup() / Bxy_floc; - f_B.ydown() = f.ydown() / Bxy_floc; + for (int i = 0; i < f.getMesh()->ystart; ++i) { + f_B.yup(i) = f.yup(i) / Bxy_floc; + f_B.ydown(i) = f.ydown(i) / Bxy_floc; + } return Bxy * Grad_par(f_B, outloc, method); } diff --git a/tests/integrated/test_suite b/tests/integrated/test_suite index e8c40911be..68dd4f3b3a 100755 --- a/tests/integrated/test_suite +++ b/tests/integrated/test_suite @@ -89,7 +89,9 @@ if args.get_list: ################################################################## # Run the actual test -command = './runtest' if not args.make else 'make' +# Kill tests that take longer than 10 minutes (default) +timeout = os.environ.get("BOUT_TEST_TIMEOUT", "10m" if not args.all_tests else "30m") +command = 'timeout {} ./runtest'.format(timeout) if not args.make else 'make' savepath = os.getcwd() # Save current working directory failed = [] @@ -120,13 +122,18 @@ for t in tests: # Run test, piping stdout so it is not sent to console status, out = shell(command, pipe=True) - if status != 0: - # ❌ Failed - print(u"\u274C", end='') # No newline - failed.append((t, out)) - else: + if status == 0: # ✓ Passed print(u"\u2713", end='') # No newline + else: + if status == 124: + # 💤 timeout + print(u"\U0001f4a4", end='') # No newline + out += "\n(It is likely that a timeout occured)" + else: + # ❌ Failed + print(u"\u274C", end='') # No newline + failed.append((t, out)) print(" %7.3f s" % (time.time() - start_time_)) sys.stdout.flush() # Make sure '✓' or '❌' is flushed diff --git a/tests/unit/src/test_bout++.cxx b/tests/unit/src/test_bout++.cxx index 533b4ab6c6..050901ddb8 100644 --- a/tests/unit/src/test_bout++.cxx +++ b/tests/unit/src/test_bout++.cxx @@ -18,7 +18,7 @@ std::vector get_c_string_vector(std::vector& vec_args) { return c_args; } -TEST(ParseCommandLineArgs, HelpShortOption) { +TEST(ParseCommandLineArgsDeathTest, HelpShortOption) { std::vector v_args{"test", "-h"}; auto c_args = get_c_string_vector(v_args); char** argv = c_args.data(); @@ -32,7 +32,7 @@ TEST(ParseCommandLineArgs, HelpShortOption) { std::cout.rdbuf(cout_buf); } -TEST(ParseCommandLineArgs, HelpLongOption) { +TEST(ParseCommandLineArgsDeathTest, HelpLongOption) { std::vector v_args{"test", "--help"}; auto c_args = get_c_string_vector(v_args); char** argv = c_args.data(); @@ -333,7 +333,9 @@ class SignalHandlerTest : public ::testing::Test { } }; -TEST_F(SignalHandlerTest, SegFault) { +using SignalHandlerTestDeathTest = SignalHandlerTest; + +TEST_F(SignalHandlerTestDeathTest, SegFault) { bout::experimental::setupSignalHandler(bout::experimental::defaultSignalHandler); // This test is *incredibly* expensive, maybe as much as 1s, so only test the one signal EXPECT_DEATH(std::raise(SIGSEGV), "SEGMENTATION FAULT"); diff --git a/tools/pylib/_boutcore_build/boutcore.pyx.in b/tools/pylib/_boutcore_build/boutcore.pyx.in index 3338db15bd..ab6229e6e5 100755 --- a/tools/pylib/_boutcore_build/boutcore.pyx.in +++ b/tools/pylib/_boutcore_build/boutcore.pyx.in @@ -41,6 +41,7 @@ inc_dirs="${numpyheader%/*/*} $inc_dirs" # Main file cat <