diff --git a/.github/workflows/clang-check.yml b/.github/workflows/clang-check.yml new file mode 100644 index 0000000..2b68224 --- /dev/null +++ b/.github/workflows/clang-check.yml @@ -0,0 +1,69 @@ +name: clang-test +on: + push: + +jobs: + clang-test: + runs-on: ubuntu-latest + name: clang-${{ matrix.compiler }}-R-${{matrix.R}} + strategy: + fail-fast: false + matrix: + compiler: + - llvm-16.0.6 + - llvm-17.0.6 + - llvm-18.1.8 + - llvm-19.1.0 + - llvm-20.0.0 + R: ['release', 'devel'] + steps: + - uses: actions/checkout@v3 + - name: Cache + uses: actions/cache@v3 + with: + path: | + ./build/ + ~/vcpkg + ~/.cache/vcpkg/archives + ${{ env.LOCALAPPDATA }}/vcpkg/archives + ${{ env.APPDATA }}/vcpkg/archives + ${{ env.XDG_CACHE_HOME }}/vcpkg/archives + ~/.cache/ccache + ~/.ccache + ~/.config/ccache + ~/Library/Caches/ccache + ${{ env.LOCALAPPDATA }}/ccache + ${{ env.XDG_CACHE_HOME }}/ccache + key: ${{ runner.os }}-${{ matrix.compiler }}-${{ env.BUILD_TYPE }}-${{ hashFiles('**/CMakeLists.txt', './vcpkg.json') }} + restore-keys: | + ${{ runner.os }}-${{ env.BUILD_TYPE }}- + - uses: awalsh128/cache-apt-pkgs-action@latest + with: + packages: | + cmake cmake-data gsl dh-elpa-helper libcmark-gfm-extensions0.29.0.gfm.3 + libcmark-gfm0.29.0.gfm.3 libcurl4-openssl-dev libjsoncpp25 librhash0 + pandoc pandoc-data texlive-latex-base texlive-latex-recommended + texlive-fonts-recommended + - name: Setup Cpp (C++ / C) + uses: aminya/setup-cpp@v1 + with: + compiler: ${{ matrix.compiler }} + cmake: true + cache-tools: true + llvm: true + make: true + - uses: r-lib/actions/setup-r@v2 + with: + r-version: ${{matrix.R}} + install-r: true + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::rcmdcheck, any::roxygen2 + needs: check + - name: Build and Check ToxicR + run: | + r_output=$(R CMD build .) + package_name=$(echo "$r_output" | sed -n "s/.*building ‘\([^’]*\.tar\.gz\)’.*/\1/p") + R CMD check --as-cran --no-manual $package_name + shell: bash + working-directory: "." diff --git a/DESCRIPTION b/DESCRIPTION index 43c94f8..d0166c4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -75,8 +75,7 @@ URL: https://github.com/NIEHS/ToxicR LazyData: true Imports: Rcpp (>= 1.0.0), ggplot2 (>= 3.3.2), shiny (>= 1.5.0), coda (>= 0.19-4), scales (>= 1.1.1), forcats, ggridges (>= 0.5.3), - doBy (>= 4.6.11), multcomp (>= 1.4), dplyr (>= 1.0.7), remotes, - mvtnorm + doBy (>= 4.6.11), multcomp (>= 1.4), dplyr (>= 1.0.7), remotes LinkingTo: Rcpp, RcppEigen, RcppGSL RoxygenNote: 7.3.2 Encoding: UTF-8 diff --git a/configure b/configure index 9eb77a1..dde606b 100755 --- a/configure +++ b/configure @@ -3495,11 +3495,14 @@ fi if test x"${have_cmake}" == x"no"; then - . src/scripts/cmake_install.sh - if test -z "${CMAKE_BIN}"; then - ## also error to end configure here - as_fn_error $? "Could not find 'cmake'." "$LINENO" 5 - fi + + if test x"${OS_FLAG}" == x"Linux"; then + . src/scripts/cmake_install.sh + if test -z "${CMAKE_BIN}"; then + ## also error to end configure here + as_fn_error $? "Could not find 'cmake'." "$LINENO" 5 + fi + fi fi ## 'uname -m' on M1 give x86_64 which is ... not helping machine=`"${R_HOME}/bin/Rscript" -e 'cat(Sys.info()["machine"])'` diff --git a/configure.ac b/configure.ac index e486c60..4bf1608 100644 --- a/configure.ac +++ b/configure.ac @@ -78,11 +78,14 @@ if test x"${need_to_build}" != x"no"; then AC_PATH_PROG(have_cmake, cmake, no) if test x"${have_cmake}" == x"no"; then - . src/scripts/cmake_install.sh - if test -z "${CMAKE_BIN}"; then - ## also error to end configure here - AC_MSG_ERROR([Could not find 'cmake'.]) - fi + + if test x"${OS_FLAG}" == x"Linux"; then + . src/scripts/cmake_install.sh + if test -z "${CMAKE_BIN}"; then + ## also error to end configure here + AC_MSG_ERROR([Could not find 'cmake'.]) + fi + fi fi ## 'uname -m' on M1 give x86_64 which is ... not helping machine=`"${R_HOME}/bin/Rscript" -e 'cat(Sys.info()[["machine"]])'` diff --git a/src/Makevars.in b/src/Makevars.in index ffc7731..223faad 100644 --- a/src/Makevars.in +++ b/src/Makevars.in @@ -1,5 +1,5 @@ PKG_CXXFLAGS=-I./code_base -I./include @OPENMP@ @NLOPT_CPPFLAGS@ @GSL_CPPFLAGS@ -DR_COMPILATION -DNO_OMP -DEIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS -PKG_LIBS=$(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) @NLOPT_LIBS@ @GSL_LIBS@ @OPENMP@ +PKG_LIBS=$(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) @NLOPT_LIBS@ @GSL_LIBS@ @OPENMP@ # Debug / clear eigen warnings from compilation #PKG_CXXFLAGS+=-Wno-ignored-attributes -DToxicR_DEBUG diff --git a/src/Makevars.win b/src/Makevars.win index 54da0f5..41961ac 100644 --- a/src/Makevars.win +++ b/src/Makevars.win @@ -1,4 +1,4 @@ -PKG_CPPFLAGS=$(SHLIB_OPENMP_CXXFLAGS) -I../windows/gsl-2.7/include -I../windows/nlopt-2.7.1/include -I./ -I./code_base -I./include -DR_COMPILATION -ftree-vectorize -Os -femulated-tls -DNO_OMP -DEIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS +PKG_CXXFLAGS=$(SHLIB_OPENMP_CXXFLAGS) -I../windows/gsl-2.7/include -I../windows/nlopt-2.7.1/include -I./ -I./code_base -I./include -DR_COMPILATION -ftree-vectorize -Os -femulated-tls -DNO_OMP -DEIGEN_PERMANENTLY_DISABLE_STUPID_WARNINGS PKG_LIBS=$(SHLIB_OPENMP_CXXFLAGS) -L../windows/nlopt-2.7.1/lib${R_ARCH}${CRT} -L../windows/gsl-2.7/lib${R_ARCH}${CRT} -lgsl -lgslcblas -lnlopt # Debug / clear eigen warnings from compilation #PKG_CPPFLAGS += -Wno-ignored-attributes -DToxicR_DEBUG -g -O0