Skip to content

Instantly share code, notes, and snippets.

@lindenb
Last active February 19, 2024 12:18
Show Gist options
  • Save lindenb/e8659d53d5ccdcaa5cdef1e7b2602a61 to your computer and use it in GitHub Desktop.
Save lindenb/e8659d53d5ccdcaa5cdef1e7b2602a61 to your computer and use it in GitHub Desktop.
compile R as library

MOTIVATION

I'm trying to compile #RStat as a static library with the -fPIC flag (so I can use it within #java #jni)

DOWNLOAD AND COMPILE

rm -rvf  "TMP/R-4.3.2" TMP/jeter.tar.gz
mkdir -p TMP/R-4.3.2/lib/
wget -O TMP/jeter.tar.gz "https://pbil.univ-lyon1.fr/CRAN/src/base/R-4/R-4.3.2.tar.gz"
cd TMP && tar xfz jeter.tar.gz && rm jeter.tar.gz &&  cd R-4.3.2 && \
    CPICFLAGS=fpic FPICFLAGS=fpic CXXPICFLAGS=fpic SHLIB_LDFLAGS=shared  SHLIB_CXXLDFLAGS=shared  ./configure --enable-R-static-lib --prefix=/path/to/TMP --with-x=no --disable-BLAS-shlib && make 

ERROR


configure: WARNING: you cannot build info or HTML versions of the R manuals
configure: WARNING: you cannot build PDF versions of the R manuals
configure: WARNING: you cannot build PDF versions of vignettes and help pages
make[1]: Entering directory 'R-4.3.2'
configure.ac:278: error: possibly undefined macro: AM_CONDITIONAL
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.ac:870: error: possibly undefined macro: AC_DISABLE_STATIC
configure.ac:2226: error: possibly undefined macro: AM_LANGINFO_CODESET
configure.ac:2876: error: possibly undefined macro: AM_NLS
configure.ac:2880: error: possibly undefined macro: AM_GNU_GETTEXT_VERSION
configure.ac:2881: error: possibly undefined macro: AM_GNU_GETTEXT
make[1]: *** [Makefile:49: configure] Error 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment