{"action":"created","issue":{"url":"https://api.github.com/repos/Unidata/netcdf-c/issues/494","repository_url":"https://api.github.com/repos/Unidata/netcdf-c","labels_url":"https://api.github.com/repos/Unidata/netcdf-c/issues/494/labels{/name}","comments_url":"https://api.github.com/repos/Unidata/netcdf-c/issues/494/comments","events_url":"https://api.github.com/repos/Unidata/netcdf-c/issues/494/events","html_url":"https://github.com/Unidata/netcdf-c/issues/494","id":261338873,"number":494,"title":"configure should error out if --enable-pnetcdf/parallel4 is specified by user, but can't be built","user":{"login":"edhartnett","id":4533212,"avatar_url":"https://avatars3.githubusercontent.com/u/4533212?v=4","gravatar_id":"","url":"https://api.github.com/users/edhartnett","html_url":"https://github.com/edhartnett","followers_url":"https://api.github.com/users/edhartnett/followers","following_url":"https://api.github.com/users/edhartnett/following{/other_user}","gists_url":"https://api.github.com/users/edhartnett/gists{/gist_id}","starred_url":"https://api.github.com/users/edhartnett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edhartnett/subscriptions","organizations_url":"https://api.github.com/users/edhartnett/orgs","repos_url":"https://api.github.com/users/edhartnett/repos","events_url":"https://api.github.com/users/edhartnett/events{/privacy}","received_events_url":"https://api.github.com/users/edhartnett/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2017-09-28T14:27:47Z","updated_at":"2017-10-26T11:45:19Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"There are at least some cases (--enable-pnetcdf) in which the user request for pnetcdf is overridden by the configure file. If the user requests pnetcdf, and pnetcdf is not found, then the configure issues a warning and builds without pnetcdf.\r\n\r\nThis is incorrect behavior. If the user passes an unknown --enable-something, it should be ignored. but if a known --enable is passed, and cannot be satisfied, then configure should error out.\r\n\r\nThe reason is that sysadmins may believe they are building with support for pnetcdf, and not look at any output, except that the build succeeded.\r\n\r\nThe code in configure.ac looks like this:\r\n```\r\nif test \"x$pnetcdf_conflict\" = xyes ; then\r\n  AC_MSG_WARN([Cannot link to pnetcdf library, --enable-pnetcdf disabled.])\r\n  enable_pnetcdf=no\r\nfi\r\n\r\n```\r\nThe AC_MSG_WARN should be changed to AC_MSG_ERROR().\r\n\r\nNote that in other cases (HDF4 for example), the configure file errors out (correctly) if requested libraries are not found.\r\n\r\n```\r\n   # If the user wants hdf4 built in, check it out.\r\n   if test \"x$enable_hdf4\" = xyes; then\r\n      AC_CHECK_HEADERS([mfhdf.h], [], [nc_mfhdf_h_missing=yes])\r\n      if test \"x$nc_mfhdf_h_missing\" = xyes; then\r\n         AC_MSG_ERROR([Cannot find mfhdf.h, yet --enable-hdf4 was used.])\r\n      fi\r\n      AC_CHECK_LIB([df], [Hclose], [], [AC_MSG_ERROR([Can't find or link to the hdf4 df library. See config.log for errors.])])\r\n      AC_CHECK_LIB([mfhdf], [SDcreate], [], [AC_MSG_ERROR([Can't find or link to the hdf4 mfhdf library. See config.log for errors.])])\r\n\r\n     AC_CHECK_LIB([jpeg], [jpeg_set_quality], [], [AC_MSG_ERROR([Can't find or link to the jpeg library (required by hdf4). See config.log for errors.])])\r\n\r\n      AC_DEFINE([USE_HDF4], [1], [if true, use HDF4 too])\r\n   fi\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/Unidata/netcdf-c/issues/comments/339639667","html_url":"https://github.com/Unidata/netcdf-c/issues/494#issuecomment-339639667","issue_url":"https://api.github.com/repos/Unidata/netcdf-c/issues/494","id":339639667,"user":{"login":"edhartnett","id":4533212,"avatar_url":"https://avatars3.githubusercontent.com/u/4533212?v=4","gravatar_id":"","url":"https://api.github.com/users/edhartnett","html_url":"https://github.com/edhartnett","followers_url":"https://api.github.com/users/edhartnett/followers","following_url":"https://api.github.com/users/edhartnett/following{/other_user}","gists_url":"https://api.github.com/users/edhartnett/gists{/gist_id}","starred_url":"https://api.github.com/users/edhartnett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edhartnett/subscriptions","organizations_url":"https://api.github.com/users/edhartnett/orgs","repos_url":"https://api.github.com/users/edhartnett/repos","events_url":"https://api.github.com/users/edhartnett/events{/privacy}","received_events_url":"https://api.github.com/users/edhartnett/received_events","type":"User","site_admin":false},"created_at":"2017-10-26T11:45:19Z","updated_at":"2017-10-26T11:45:19Z","author_association":"CONTRIBUTOR","body":"The --enable-parallel4 issue is a little more complex and I want to make sure I understand what is going on.\r\n\r\nThe configure.ac currently contains:\r\n\r\n```\r\n# Should we suppress parallel io for netcdf-4?\r\nif test \"x$enable_netcdf_4\" = xyes ; then\r\n     AC_MSG_CHECKING([whether parallel I/O is enabled for netcdf-4])\r\n     AC_ARG_ENABLE([parallel4], [AS_HELP_STRING([--disable-parallel4],\r\n                                          [disable parallel I/O for netcdf-4, even if it's enabled in libhdf5]  )])\r\n  test \"x$enable_parallel4\" = xno || enable_parallel4=yes\r\n  AC_MSG_RESULT($enable_parallel4)\r\nelse\r\n  enable_parallel4=no\r\nfi\r\nif test \"x$hdf5_parallel\" = xno; then\r\n  # hdf5 does not support parallel io, so disable parallel4\r\n  enable_parallel4=no\r\n  AC_MSG_WARN([Parallel io disabled for netcdf-4 because hdf5 does not support])\r\nfi\r\n\r\n```\r\n\r\nOne problem here is that we are going to show a warning when there is no problem for every non-parallel build. There is no need to warn that HDF5 is not parallel when the user has not specified any parallel options.\r\n\r\nSo I think the behavior we want is:\r\nif enable-parallel4 is specified, and parallel IO is not available, then configure should error out.\r\nif disable-parallel4 is specified, parallel IO should be disabled if available, ignored otherwise.\r\n\r\nCurrently enable-parallel is true by default. I suspect what we want is only to make it true by default if there are parallel features available (i.e. HDF5 supports parallel IO, or pnetcdf is being used).\r\n\r\nI will look into this and try to find the autoconf-ish way to do this.\r\n"}}
{"actor":{"display_login":"edhartnett"}}