Skip to content

chore(c++): Upgrade c++ compiler from c++11 to c++14#205

Open
tonywu1999 wants to merge 2 commits intodevelfrom
fix-cplusplus
Open

chore(c++): Upgrade c++ compiler from c++11 to c++14#205
tonywu1999 wants to merge 2 commits intodevelfrom
fix-cplusplus

Conversation

@tonywu1999
Copy link
Copy Markdown
Contributor

@tonywu1999 tonywu1999 commented Apr 29, 2026

RcppCore/RcppArmadillo#475

PR Type

Other, Enhancement


Description

  • Upgrade package C++ standard to C++14

  • Update native build configuration in Makevars


Diagram Walkthrough

flowchart LR
  mv["src/Makevars"]
  c11["C++11 standard"]
  c14["C++14 standard"]
  mv -- "changes `CXX_STD` from" --> c11
  mv -- "updates build target to" --> c14
Loading

File Walkthrough

Relevant files
Configuration changes
Makevars
Raise native compilation standard to C++14                             

src/Makevars

  • Change CXX_STD from CXX11 to CXX14
  • Keep existing OpenMP and BLAS/LAPACK flags unchanged
+1/-1     

Motivation and Context

This PR upgrades the C++ compiler standard requirement for the MSstats package from C++11 to C++14. The MSstats package implements statistical analysis for proteomics experiments using C++ via Rcpp and RcppArmadillo. Upgrading to C++14 enables access to more modern C++ language features and aligns the project with contemporary compiler standards, which are now widely supported across major platforms and build environments.

Changes

  • Updated src/Makevars to set CXX_STD = CXX14 (previously CXX_STD = CXX11)
    • This change applies to the main Unix/Linux build configuration
    • The corresponding Windows build file src/Makevars.win was not modified and remains at the previous standard

Unit Tests

No unit tests were added or modified. The existing tinytest suite in inst/tinytest/ should continue to validate the package functionality under the new C++14 standard without requiring changes.

Coding Guidelines

No coding guideline violations identified. The build configuration change is a standard practice for upgrading C++ compiler support and does not introduce any stylistic or structural concerns.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 29, 2026

📝 Walkthrough

Walkthrough

The build configuration updates the C++ compilation standard from C++11 to C++14 by modifying the CXX_STD variable in the project's Makevars file.

Changes

Cohort / File(s) Summary
Build Configuration
src/Makevars
C++ standard updated from CXX11 to CXX14.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~1 minute

Poem

🐰 From eleven to fourteen, we hop along,
C++ standards growing strong!
Modern features, cleaner code,
Down the compilation road,
A rabbit's cheer for progress made!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning PR description lacks required sections per the repository template including detailed Changes list, Testing information, and incomplete pre-review checklist. Complete the PR description by adding: (1) Detailed bullet-point list of changes in the Changes section, (2) Testing section describing any tests added/modified, (3) Checkmark all applicable checklist items. Reference the repository's CONTRIBUTING guidelines.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: upgrading the C++ standard from C++11 to C++14 in the build configuration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-cplusplus

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ No major issues detected

@github-actions
Copy link
Copy Markdown

PR Code Suggestions ✨

No code suggestions found for the PR.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/Makevars`:
- Line 1: Update the Windows Makevars to use the same C++ standard as the Unix
Makevars by changing the CXX_STD assignment in the Makevars.win file from CXX11
to CXX14 (i.e., set "CXX_STD = CXX14"); also update the package metadata by
adding a SystemRequirements entry "SystemRequirements: C++14" to DESCRIPTION to
document the C++14 requirement.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8f2e87e7-967a-4322-9bff-5a8eb984cb3f

📥 Commits

Reviewing files that changed from the base of the PR and between 63e8635 and 1f0efb0.

📒 Files selected for processing (1)
  • src/Makevars

Comment thread src/Makevars
@@ -1,3 +1,3 @@
CXX_STD = CXX11
CXX_STD = CXX14
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Read-only checks for C++14 alignment

set -euo pipefail

echo "== DESCRIPTION: C++ / system requirements =="
fd -i '^DESCRIPTION$' -x sh -c 'echo "-- {}"; rg -n "SystemRequirements|C\\+\\+|Depends" "{}" || true'

echo
echo "== CI workflows: R/toolchain matrix and std references =="
fd -i '.*\\.(yml|yaml)$' .github 2>/dev/null | xargs -r rg -n "r-version|matrix|CXX11|CXX14|CXX17|ubuntu|macos|windows" || true

echo
echo "== Build files: conflicting hardcoded std flags =="
rg -n --iglob '*Makevars*' --iglob 'Makefile*' --iglob '*.mk' --iglob '*.cmake' "std=c\\+\\+|CXX11|CXX14|CXX17"

Repository: Vitek-Lab/MSstats

Length of output: 323


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== src/Makevars content ==="
cat -n src/Makevars

echo
echo "=== src/Makevars.win content (if exists) ==="
if [ -f src/Makevars.win ]; then
  cat -n src/Makevars.win
else
  echo "File does not exist"
fi

echo
echo "=== Search for all Makevars* files ==="
fd -i makevars

echo
echo "=== DESCRIPTION file (full content) ==="
cat -n DESCRIPTION

Repository: Vitek-Lab/MSstats

Length of output: 2772


Update src/Makevars.win to match C++14 standard.

The PR updated src/Makevars to CXX_STD = CXX14, but src/Makevars.win still declares CXX_STD = CXX11. This platform inconsistency will cause Windows builds to use a different compiler standard than Unix/Linux/macOS builds, risking compilation failures or divergent behavior across platforms.

Platform mismatch detail
src/Makevars:     CXX_STD = CXX14
src/Makevars.win: CXX_STD = CXX11  ← Must be updated to CXX14

Also add SystemRequirements: C++14 to the DESCRIPTION file to document this requirement explicitly.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/Makevars` at line 1, Update the Windows Makevars to use the same C++
standard as the Unix Makevars by changing the CXX_STD assignment in the
Makevars.win file from CXX11 to CXX14 (i.e., set "CXX_STD = CXX14"); also update
the package metadata by adding a SystemRequirements entry "SystemRequirements:
C++14" to DESCRIPTION to document the C++14 requirement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant