Skip to content

🛠️ Minimum CXXSTD #89

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 40 commits into from
Mar 23, 2025
Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
a32840e
:Bug: Update Makevars
serkor1 Mar 20, 2025
adcc731
:rocket: Confusion Matrix Updated
serkor1 Mar 20, 2025
8828ec2
:books: Updated RcppExports.*
serkor1 Mar 20, 2025
a0370aa
:bug: Bug-fix in cmatrix
serkor1 Mar 20, 2025
5177141
:books: Refactored baccuraccy()
serkor1 Mar 20, 2025
451ce70
:hammer: macOS gcc (possible) fix
serkor1 Mar 20, 2025
418a730
:books: Added C++23 path to gcc
serkor1 Mar 20, 2025
63ede97
:hammer: Re-created symbolic links to gcc-14
serkor1 Mar 21, 2025
5dd54d8
:hammer: Autoconf support
serkor1 Mar 22, 2025
deef3b9
:hammer: readded gcc-tools for macOS
serkor1 Mar 22, 2025
3e380cf
:hammer: Removed llvm installation
serkor1 Mar 22, 2025
cf24393
:hammer: Old setup from Main
serkor1 Mar 22, 2025
8a5ceb5
:hammer: Reset GHA
serkor1 Mar 22, 2025
1fd2a2b
:hammer: Updated autoconf.ac
serkor1 Mar 22, 2025
f454c24
.... Something about line-endings lol
serkor1 Mar 22, 2025
e6a31c6
:hammer: Updated .gitattributes
serkor1 Mar 22, 2025
9633df4
LF
serkor1 Mar 22, 2025
34c4104
:hammer: Shooting in the dark...
serkor1 Mar 22, 2025
19b49e6
:books: Updated DESCRIPTION
serkor1 Mar 22, 2025
df8a2d9
:hammer: Windows configure
serkor1 Mar 22, 2025
662d30a
:books: Documented configure.win
serkor1 Mar 22, 2025
473f2ab
:hammer: Updated SystemRequirements
serkor1 Mar 22, 2025
909945f
:hammer: Added R v4.0.0 on GHA for Windows
serkor1 Mar 22, 2025
be25dff
:hammer: Updated configure.win
serkor1 Mar 22, 2025
36ba912
:hammer: Streamline variables
serkor1 Mar 22, 2025
b7de14e
:bug: Added if-else statements on includes
serkor1 Mar 22, 2025
b1d6155
:hammer: Enable all workflows + R 4.0.0
serkor1 Mar 22, 2025
1f498a6
:hammer: Updated cleanup script
serkor1 Mar 22, 2025
c7fdeb3
:hammer: Increased R version requirement and expanded tests.
serkor1 Mar 22, 2025
ebe162f
:hammer: Added cleanup.win
serkor1 Mar 22, 2025
0b6d75f
:hammer: Removed SystemRequirements
serkor1 Mar 23, 2025
be2d92d
:books: Updated DESCRIPTION
serkor1 Mar 23, 2025
dee1aac
:hammer: Reduced the R CMD check coverage
serkor1 Mar 23, 2025
7374678
:hammer: Corrected typos and reconfigured
serkor1 Mar 23, 2025
47bfbaa
:hammer: Fixed balanced accuracy
serkor1 Mar 23, 2025
73b756b
:hammer: Remove Makevars-step
serkor1 Mar 23, 2025
96e35c5
:hammer: Disable OpenMP availability check
serkor1 Mar 23, 2025
c3788c6
:hammer: Possible fix to gcc-fails
serkor1 Mar 23, 2025
5b478eb
:hammer: Reformatted .yaml
serkor1 Mar 23, 2025
6a0bf5a
:hammer: Yeah, no - still broken
serkor1 Mar 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ README_files
NEWS_cache
NEWS_files
^CRAN-SUBMISSION$
m4
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* text=auto
*.ac text eol=lf
39 changes: 4 additions & 35 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,15 @@ jobs:
- {os: ubuntu-latest, r: 'devel', compiler: 'default', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release', compiler: 'default'}
- {os: ubuntu-latest, r: 'oldrel-1', compiler: 'default'}
- {os: ubuntu-latest, r: 'oldrel-2', compiler: 'default'}
- {os: ubuntu-latest, r: 'oldrel-3', compiler: 'default'}

# Windows
- {os: windows-latest, r: 'devel', compiler: 'default'}
- {os: windows-latest, r: 'release', compiler: 'default'}
- {os: windows-latest, r: 'oldrel-1', compiler: 'default'}


# macOS Clang
- {os: macos-latest, r: 'devel', compiler: 'clang'}
- {os: macos-latest, r: 'release', compiler: 'clang'}
Expand Down Expand Up @@ -95,6 +98,7 @@ jobs:
CXX14=${GCC_PATH}/bin/${GXX_BIN}
CXX17=${GCC_PATH}/bin/${GXX_BIN}
CXX20=${GCC_PATH}/bin/${GXX_BIN}
CXX23=${GCC_PATH}/bin/${GXX_BIN}

OMP_LIB=${OMP_PATH}/lib
OMP_INC=${OMP_PATH}/include
Expand All @@ -110,41 +114,6 @@ jobs:
LDFLAGS += -L$(brew --prefix gettext)/lib -lintl


# Fortran configuration
FC=$(brew --prefix gfortran)/bin/gfortran
F77=$(brew --prefix gfortran)/bin/gfortran
FLIBS=-L$(brew --prefix gfortran)/lib -lgfortran -lquadmath
EOF

- name: Configure Makevars (macOS-clang)
if: runner.os == 'macOS' && matrix.config.compiler == 'clang'
run: |
mkdir -p ~/.R
GCC_PATH=$(brew --prefix gcc)
SDK_PATH=$(xcrun --show-sdk-path)

GCC_BIN=gcc-14
GXX_BIN=g++-14

cat << EOF > ~/.R/Makevars
# Compiler settings
CC=${GCC_PATH}/bin/${GCC_BIN}
CXX=${GCC_PATH}/bin/${GXX_BIN}
CXX11=${GCC_PATH}/bin/${GXX_BIN}
CXX14=${GCC_PATH}/bin/${GXX_BIN}
CXX17=${GCC_PATH}/bin/${GXX_BIN}
CXX20=${GCC_PATH}/bin/${GXX_BIN}

# Compiler flags
CPPFLAGS=-isysroot ${SDK_PATH}
CFLAGS=-O3 -pedantic
CXXFLAGS=-O3 -pedantic

# Linker flags
LDFLAGS=-L${GCC_PATH}/lib -lgfortran -lm -isysroot ${SDK_PATH}
CPPFLAGS += -I$(brew --prefix gettext)/include
LDFLAGS += -L$(brew --prefix gettext)/lib -lintl

# Fortran configuration
FC=$(brew --prefix gfortran)/bin/gfortran
F77=$(brew --prefix gfortran)/bin/gfortran
Expand Down
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,15 @@ inst/doc
cran_comments.md
cran-comments.md
/.quarto/

# ignore configure
# artefacts
autom4te.cache
config.log
config.status
configure~

# ignore makevars
# this is autogenerated on
# build
src/Makevars
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Authors@R: c(
)
Description:
Performance evaluation metrics for supervised and unsupervised machine learning, statistical learning and artificial intelligence applications. Core computations are implemented in 'C++' for scalability and efficiency.
SystemRequirements: C++17
License: GPL (>= 3)
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
Expand All @@ -30,7 +31,7 @@ Imports:
lattice,
Rcpp
Depends:
R (>= 4.3)
R (>= 4.0.0)
URL: https://serkor1.github.io/SLmetrics/, https://github.com/serkor1/SLmetrics
BugReports: https://github.com/serkor1/SLmetrics/issues
LazyData: true
Expand Down
10 changes: 5 additions & 5 deletions R/RcppExports.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@ accuracy.cmatrix <- function(x, ...) {
#' @method baccuracy factor
#' @export
baccuracy.factor <- function(actual, predicted, adjust = FALSE, na.rm = TRUE, ...) {
.Call(`_SLmetrics_BalancedAccuracy`, actual, predicted, adjust, na_rm = na.rm)
.Call(`_SLmetrics_balanced_accuracy`, actual, predicted, adjust, na_rm = na.rm)
}

#' @rdname baccuracy
#' @method weighted.baccuracy factor
#' @export
weighted.baccuracy.factor <- function(actual, predicted, w, adjust = FALSE, na.rm = TRUE, ...) {
.Call(`_SLmetrics_weighted_BalancedAccuracy`, actual, predicted, w, adjust, na_rm = na.rm)
.Call(`_SLmetrics_weighted_balanced_accuracy`, actual, predicted, w, adjust, na_rm = na.rm)
}

#' @rdname baccuracy
#' @method baccuracy cmatrix
#' @export
baccuracy.cmatrix <- function(x, adjust = FALSE, na.rm = TRUE, ...) {
.Call(`_SLmetrics_cmatrix_BalancedAccuracy`, x, adjust, na_rm = na.rm)
.Call(`_SLmetrics_cmatrix_balanced_accuracy`, x, adjust, na_rm = na.rm)
}

#' @rdname ckappa
Expand Down Expand Up @@ -68,14 +68,14 @@ ckappa.cmatrix <- function(x, beta = 0.0, ...) {
#' @method cmatrix factor
#' @export
cmatrix.factor <- function(actual, predicted, ...) {
.Call(`_SLmetrics_UnweightedConfusionMatrix`, actual, predicted)
.Call(`_SLmetrics_confusion_matrix`, actual, predicted)
}

#' @rdname cmatrix
#' @method weighted.cmatrix factor
#' @export
weighted.cmatrix.factor <- function(actual, predicted, w, ...) {
.Call(`_SLmetrics_WeightedConfusionMatrix`, actual, predicted, w)
.Call(`_SLmetrics_weighted_confusion_matrix`, actual, predicted, w)
}

#' @rdname dor
Expand Down
5 changes: 5 additions & 0 deletions cleanup
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh

rm -f config.*
rm -f src/Makevars
rm -rf autom4te.cache
7 changes: 7 additions & 0 deletions cleanup.win
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env sh

rm -f config.*
rm -f src/Makevars.win
rm -f test_cpp_version.cpp
rm -f test_cpp_version.exe
rm -rf autom4te.cache
Loading
Loading