Skip to content

Commit

Permalink
Merge pull request #22 from SciomeLLC/nlopt-update
Browse files Browse the repository at this point in the history
Only install missing cmake on Linux systems
  • Loading branch information
wheelemw authored Nov 13, 2024
2 parents 0b65773 + 85c04a6 commit c6140d2
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 14 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/clang-check.yml
Original file line number Diff line number Diff line change
@@ -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: "."
3 changes: 1 addition & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 8 additions & 5 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -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"])'`
Expand Down
13 changes: 8 additions & 5 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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"]])'`
Expand Down
2 changes: 1 addition & 1 deletion src/Makevars.in
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Makevars.win
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit c6140d2

Please sign in to comment.