Skip to content

Commit

Permalink
fix Fedora build issue related to #9
Browse files Browse the repository at this point in the history
pachadotdev committed Dec 17, 2024
1 parent 0a131b8 commit f51bb93
Showing 2 changed files with 18 additions and 3 deletions.
10 changes: 9 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
# cpp11armadillo 0.4.1

* Modified configure file. It used `--cppflags` for compiling against `libR`,
which not everyone has. Now it uses `--cflags` to solve build issues with
MacPorts and Fedora.
* Includes parts of the official Armadillo documentation in the vignettes but
adapted to working with R.
* Thanks a lot to @barracuda156 and @bastistician for reporting the issue.

# cpp11armadillo 0.4.0

* Uses Armadillo 14.2.2 for C++15 compatibility.
* Adds a configure file to check the compatibility between the C++ compiler and
Armadillo.
* Provides additional Econometrics examples.

# cpp11armadillo 0.3.5

11 changes: 9 additions & 2 deletions configure
Original file line number Diff line number Diff line change
@@ -3,7 +3,8 @@
# We make sure that the R and Armadillo bindings are compatible (i.e., messages)
# this is why we add the R and cpp11 path
CXX=`${R_HOME}/bin/R CMD config CXX`
R_INCLUDE_PATH=`${R_HOME}/bin/R CMD config --cppflags`
R_INCLUDE_PATH=`${R_HOME}/bin/R CMD config --cflags`
R_INCLUDE_DIR=`${R_HOME}/bin/R CMD config --ldflags | sed 's/-L[^ ]*//g' | sed 's/-lR//g'`
CPP11_INCLUDE_PATH=`${R_HOME}/bin/Rscript -e "cat(system.file('include', package = 'cpp11'))"`

# Check if CPP11_INCLUDE_PATH is empty
@@ -12,11 +13,17 @@ if [ -z "$CPP11_INCLUDE_PATH" ]; then
exit 1
fi

PKG_CFLAGS="-I./inst/include ${R_INCLUDE_PATH} -I${CPP11_INCLUDE_PATH}"
# Manually specify the R include path if --cflags does not provide it
if [ "$R_INCLUDE_PATH" = "ERROR: no information for variable '--cflags'" ]; then
R_INCLUDE_PATH="-I/usr/share/R/include"
fi

PKG_CFLAGS="-I./inst/include ${R_INCLUDE_PATH} -I${R_INCLUDE_DIR} -I${CPP11_INCLUDE_PATH}"

# Debugging: Print the values of the variables
echo "CXX: ${CXX}"
echo "R_INCLUDE_PATH: ${R_INCLUDE_PATH}"
echo "R_INCLUDE_DIR: ${R_INCLUDE_DIR}"
echo "CPP11_INCLUDE_PATH: ${CPP11_INCLUDE_PATH}"
echo "PKG_CFLAGS: ${PKG_CFLAGS}"

0 comments on commit f51bb93

Please sign in to comment.