Skip to content

Commit

Permalink
Fixes for CRAN
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Jan 31, 2020
1 parent 2eeaa47 commit ff86a90
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 11 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
^src/cld_3/protos/.*\.pb\.h$
^src/Makevars$
^src/libcld3/.*\.a$
^configure.log$
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ src/*.o
src/cld_3/protos/*.pb.h
src/cld_3/protos/*.pb.cc
src/Makevars
configure.log
5 changes: 2 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
Package: cld3
Type: Package
Title: Google's Compact Language Detector 3
Version: 1.2
Version: 1.3
Authors@R: c(
person("Jeroen", "Ooms", ,"jeroen@berkeley.edu", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-4035-0289")),
person("Google Inc", role = "cph", comment = "CLD3 C++ library")
)
person("Google Inc", role = "cph", comment = "CLD3 C++ library"))
Description: Google's Compact Language Detector 3 is a neural network model for language
identification and the successor of 'cld2' (available from CRAN). The algorithm is still
experimental and takes a novel approach to language detection with different properties
Expand Down
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
1.3
- Fix for CRAN: do not use CXXCPP

1.2
- Windows: update to protobuf 3.8.0 with support for GCC 8+
- Suppress warnings about pragmas in autogenerated protobuf headers
Expand Down
2 changes: 1 addition & 1 deletion cleanup
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
for file in src/cld_3/protos/*.proto; do
echo "#error This is a placeholder file." > ${file%.proto}.pb.cc
done
rm -f src/Makevars
rm -f src/Makevars configure.log
16 changes: 9 additions & 7 deletions configure
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Anticonf (tm) script by Jeroen Ooms (2017)
# Anticonf (tm) script by Jeroen Ooms (2020)
# This script will query 'pkg-config' for the required cflags and ldflags.
# If pkg-config is unavailable or does not find the library, try setting
# INCLUDE_DIR and LIB_DIR manually via e.g:
Expand Down Expand Up @@ -48,17 +48,17 @@ echo "Using PKG_CFLAGS=$PKG_CFLAGS"
echo "Using PKG_LIBS=$PKG_LIBS"

# Find compiler
CXXCPP=$(${R_HOME}/bin/R CMD config CXXCPP)
CXX=$(${R_HOME}/bin/R CMD config CXX)
CXXFLAGS=$(${R_HOME}/bin/R CMD config CXXFLAGS)
CPPFLAGS=$(${R_HOME}/bin/R CMD config CPPFLAGS)

# Test configuration
echo "#include $PKG_TEST_HEADER" | ${CXXCPP} ${CPPFLAGS} ${PKG_CFLAGS} ${CXXFLAGS} -xc++ - >/dev/null 2>&1
echo "#include $PKG_TEST_HEADER" | ${CXX} -E ${CPPFLAGS} ${PKG_CFLAGS} ${CXXFLAGS} -xc++ - >/dev/null 2>configure.log

# Customize the error
if [ $? -ne 0 ]; then
echo "------------------------- ANTICONF ERROR ---------------------------"
echo "Configuration failed because $PKG_CONFIG_NAME was not found. Try installing:"
echo "------------------------------[ ANTICONF ]-----------------------------"
echo "Configuration failed to find $PKG_CONFIG_NAME. Try installing:"
echo " * deb: $PKG_DEB_NAME (Debian, Ubuntu, etc)"
echo " * rpm: $PKG_RPM_NAME (Fedora, EPEL)"
echo " * csw: $PKG_CSW_NAME (Solaris)"
Expand All @@ -67,8 +67,10 @@ if [ $? -ne 0 ]; then
echo "PATH and PKG_CONFIG_PATH contains a $PKG_CONFIG_NAME.pc file. If pkg-config"
echo "is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:"
echo "R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'"
echo "--------------------------------------------------------------------"
exit 1;
echo "----------------------------[ ERROR MESSAGE ]----------------------------"
cat configure.log
echo "------------------------------------------------------------------------"
exit 1
fi

# Write to Makevars
Expand Down

0 comments on commit ff86a90

Please sign in to comment.