R software broadcast 0.2.0.1 ships a macOS build fix
The November 28 patch switches internal storage to C arrays and explicitly includes the standard C++ headers used by the package.
A source patch for macOS compilation
The broadcast package for R reached CRAN in version 0.2.0.1 on November 28 at 11:40:07 UTC, or 14:40:07 in Istanbul. Maintainer Tony Wilkes recorded a macOS compilation problem on CRAN and replaced internal uses of std::array with C arrays. The release notes also record explicit includes for the standard C++ headers used by the source. CRANberries independently compares the archive with 0.2.0. The package release confirms the source changes. Installation still depends on the user's build environment and R version.
Expansion across array dimensions
The package implements NumPy-like broadcasting for arrays in R, including atomic and recursive arrays. Broadcasting lets an operation use a compatible shorter dimension without requiring the caller to write out all the repeated inputs. For a matrix with three rows and two columns, the caller could supply a separate centre value for each column in a one-row array. Check the shape and column order before comparing the result. Compatible dimensions alone do not confirm that a value was assigned to the intended column.
Direct standard library includes
A source file may have compiled because another header happened to make a standard library declaration available. The same indirect relationship can differ across build environments. Explicit includes make the direct dependencies visible in the source. The change from std::array is a separate implementation detail recorded in the same patch. A build log can confirm whether compilation completed for a particular machine. A small numerical example can then check whether the installed package retains the behaviour used by the surrounding R application.
Source and binary availability
A published source archive and a ready-made binary for a particular R and operating system combination are separate distribution steps. When building from the source archive, record the compiler and platform alongside the package version. A project locked to the previous dependency will continue to use it until the environment changes. Compare results on supported operating systems if a workflow crosses platforms. Keep a record of the installed version and how it was obtained when sharing a build issue.
A small regression example with known values
Take a matrix with values 2, 4, and 6 in the first column and 5, 8, and 11 in the second. Subtract the column centres, 4 and 8, using a shape that aligns the two columns. The first column should become minus two, zero, and two. The second should contain minus three, zero, and three. Test the shape as well as the values. The patch addresses a reported source build problem. This numerical example gives a separate check for work that relies on broadcasting.
Archive photo · Seasider53 / Wikimedia Commons ↗ · CC BY 4.0 · Archive photograph illustrating Mac hardware. It does not identify the build machine. Resized and converted to WebP.
Sources and verification
- Primary sourceCRAN ↗
- Reporting / cross-checkCRANberries ↗
- BackgroundNumPy belgeleri ↗
Reader discussion
Which alternative architecture would you try for the same problem?
No comments yet. Be the first to contribute.
Write a comment