[libcxx-commits] [pstl] r368285 - [pstl] Error out when the backend is left unspecified

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Mon Aug 12 08:40:42 PDT 2019



> On Aug 9, 2019, at 04:13, Eric Fiselier <eric at efcs.ca> wrote:
> 
> If I understand this correctly, the headers now require CMake build and configuration steps before
> they've valid?
> 
> Code should be valid at rest -- without any intervention, configuration, setup, or build steps.

I strongly disagree. Our libraries inherently need to be configured, and having defaults that appear to just work (but aren't necessarily what you want) is harmful. We have plenty of those in libc++ (like that ABI library you use or whether per-TU insulation is provided) and I won't repeat that mistake in pstl. If you want convenience (which is a 100% fine goal), having a pre-populated CMake cache for common configurations is the way to go.

Louis

>  
> /Eric
> 
> 
> 
> On Thu, Aug 8, 2019 at 8:42 AM Louis Dionne via libcxx-commits <libcxx-commits at lists.llvm.org <mailto:libcxx-commits at lists.llvm.org>> wrote:
> Author: ldionne
> Date: Thu Aug  8 05:43:13 2019
> New Revision: 368285
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=368285&view=rev <http://llvm.org/viewvc/llvm-project?rev=368285&view=rev>
> Log:
> [pstl] Error out when the backend is left unspecified
> 
> Instead of silently falling back to the serial backend, it's better if
> we fail loudly when the parallel backend is left unspecified. Since we
> have a __pstl_config_site header, a backend should always be specified.
> 
> Modified:
>     pstl/trunk/include/pstl/internal/pstl_config.h
> 
> Modified: pstl/trunk/include/pstl/internal/pstl_config.h
> URL: http://llvm.org/viewvc/llvm-project/pstl/trunk/include/pstl/internal/pstl_config.h?rev=368285&r1=368284&r2=368285&view=diff <http://llvm.org/viewvc/llvm-project/pstl/trunk/include/pstl/internal/pstl_config.h?rev=368285&r1=368284&r2=368285&view=diff>
> ==============================================================================
> --- pstl/trunk/include/pstl/internal/pstl_config.h (original)
> +++ pstl/trunk/include/pstl/internal/pstl_config.h Thu Aug  8 05:43:13 2019
> @@ -19,9 +19,7 @@
>  #define _PSTL_VERSION_PATCH (_PSTL_VERSION % 10)
> 
>  #if !defined(_PSTL_PAR_BACKEND_SERIAL) && !defined(_PSTL_PAR_BACKEND_TBB)
> -// TODO: In the future, we need to handle this setting using a configure-time
> -//       option and something like a __config_site header.
> -#    define _PSTL_PAR_BACKEND_SERIAL
> +#    error "A parallel backend must be specified"
>  #endif
> 
>  // Check the user-defined macro for warnings
> 
> 
> _______________________________________________
> libcxx-commits mailing list
> libcxx-commits at lists.llvm.org <mailto:libcxx-commits at lists.llvm.org>
> https://lists.llvm.org/cgi-bin/mailman/listinfo/libcxx-commits <https://lists.llvm.org/cgi-bin/mailman/listinfo/libcxx-commits>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20190812/4a859a86/attachment.html>


More information about the libcxx-commits mailing list