Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[statet-users] trouble compiing rj on mac

Hi,

After following the instructions in https://www.eclipse.org/lists/statet-users/msg00004.html :

% where clang
/opt/homebrew/opt/llvm/bin/clang
/usr/bin/clang

But I still can't compile rj. Any idea what I should do?


The output is:

R version 4.2.3 (2023-03-15) -- "Shortstop Beagle"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> install.packages(c("rj", "rj.gd"), repos="https://download.walware.de/rj-4.0";) Warning: unable to access index for repository https://download.walware.de/rj-4.0/bin/macosx/big-sur-arm64/contrib/4.2:   cannot open URL 'https://download.walware.de/rj-4.0/bin/macosx/big-sur-arm64/contrib/4.2/PACKAGES'
Packages which are only available in source form, and may need
  compilation of C/C++/Fortran: ‘rj’ ‘rj.gd’
Do you want to attempt to install these from sources? (Yes/no/cancel)
installing the source packages ‘rj’, ‘rj.gd’

trying URL 'https://download.walware.de/rj-4.0/src/contrib/rj_4.0.8-4.tar.gz'
Content type 'application/x-gzip' length 370814 bytes (362 KB)
==================================================
downloaded 362 KB

trying URL 'https://download.walware.de/rj-4.0/src/contrib/rj.gd_4.0.8-1.tar.gz'
Content type 'application/x-gzip' length 104396 bytes (101 KB)
==================================================
downloaded 101 KB

* installing *source* package ‘rj’ ...
** using staged installation
checking R config... R config set
    R_HOME   : /Library/Frameworks/R.framework/Resources
checking for gcc... clang -arch arm64
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether clang -arch arm64 accepts -g... yes
checking for clang -arch arm64 option to accept ISO C89... none needed
checking Java support in R... ...
17.0.6
Java config set
    JAVA_HOME: /Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home
    JAVA     : /usr/bin/java
    JAVAC    : /usr/bin/javac
    JAVAC_FLAGS:  -h .
    JAVA_CPPFLAGS: -I/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/include/darwin     JAVA_LIBS: -L/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/server -ljvm
    JAR      : /usr/bin/jar

configure: creating ./config.status
config.status: creating src/Makevars
=== configuring in jri (/private/tmp/Rtmp3D9WIk/R.INSTALL6f973d3f3dc/rj/jri)
configure: running /bin/sh ./configure --disable-option-checking '--prefix=/usr/local'  --cache-file=/dev/null --srcdir=.
checking build system type... arm-apple-darwin22.3.0
checking host system type... arm-apple-darwin22.3.0
checking R config... checking for gcc... clang -arch arm64
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether clang -arch arm64 accepts -g... yes
checking for clang -arch arm64 option to accept ISO C89... none needed
checking how to run the C preprocessor... clang -arch arm64 -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for sys/types.h... (cached) yes
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking whether Java interpreter works... checking whether JNI programs can be compiled... yes
checking whether JNI programs can be run... yes
checking JNI data types... ok
checking whether Rinterface.h exports R_CStackXXX variables... yes
checking whether Rinterface.h exports R_SignalHandlers... yes
configure: creating ./config.status
config.status: creating src/Makefile
config.status: creating Makefile
config.status: creating run
config.status: creating src/config.h
** libs
(cd ../jri && make)
make -C src JRI.jar
/usr/bin/javac -h . -target 1.8 -source 1.8 -d . main/java/org/rosuda/JRI/Mutex.java main/java/org/rosuda/JRI/RBool.java main/java/org/rosuda/JRI/RConfig.java main/java/org/rosuda/JRI/RConsoleOutputStream.java main/java/org/rosuda/JRI/REXP.java main/java/org/rosuda/JRI/RFactor.java main/java/org/rosuda/JRI/RList.java main/java/org/rosuda/JRI/RMainLoopCallbacksUtf8.java main/java/org/rosuda/JRI/RVector.java main/java/org/rosuda/JRI/Rengine.java main/java/org/rosuda/JRI/package-info.java warning: [options] bootstrap class path not set in conjunction with -source 8
Note: main/java/org/rosuda/JRI/REXP.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 warning
clang -arch arm64 -c -o Rengine.o Rengine.c -g -Iinclude -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -falign-functions=64 -Wall -g -O2 -I/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/include/darwin -fno-common -I/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/include/darwin -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include clang -arch arm64 -c -o jri.o jri.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -falign-functions=64 -Wall -g -O2 -I/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/include/darwin -fno-common -I/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/include/darwin -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include clang -arch arm64 -c -o Rcallbacks.o Rcallbacks.c -g -Iinclude -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -falign-functions=64 -Wall -g -O2 -I/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/include/darwin -fno-common -I/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/include/darwin -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include clang -arch arm64 -c -o Rinit.o Rinit.c -g -Iinclude -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -falign-functions=64 -Wall -g -O2 -I/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/include/darwin -fno-common -I/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/include/darwin -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include clang -arch arm64 -c -o Rengine-sysutils.o Rengine-sysutils.c -g -Iinclude  -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -falign-functions=64 -Wall -g -O2 -I/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/include/darwin -fno-common -I/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/include/darwin clang -arch arm64 -c -o globals.o globals.c -g -Iinclude -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -falign-functions=64 -Wall -g -O2 -I/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/include/darwin -fno-common -I/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/include/darwin clang -arch arm64 -c -o rjava.o rjava.c -g -Iinclude -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -falign-functions=64 -Wall -g -O2 -I/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/include/darwin -fno-common -I/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/include/darwin clang -arch arm64 -c -o rjutil.o rjutil.c -g -Iinclude -DRIF_HAS_CSTACK -DRIF_HAS_RSIGHAND -DHAVE_CONFIG_H -falign-functions=64 -Wall -g -O2 -I/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/include/darwin -fno-common -I/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/include/darwin -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include
rjutil.c:143:26: warning: shifting a negative signed value
      is undefined [-Wshift-negative-value]
  ...^ ((((char)0xF0 << 6 ^ (char)0x80) << 6 ^ (char)0x80) << 6 ^ (char)0x80);
          ~~~~~~~~~~ ^
rjutil.c:143:64: warning: shifting a negative signed value
      is undefined [-Wshift-negative-value]
  ...^ ((((char)0xF0 << 6 ^ (char)0x80) << 6 ^ (char)0x80) << 6 ^ (char)0x80);
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
rjutil.c:152:24: warning: shifting a negative signed value
      is undefined [-Wshift-negative-value]
  ...^ (((char)0xE0 << 6 ^ (char)0x80) << 6 ^ (char)0x80);
         ~~~~~~~~~~ ^
rjutil.c:159:22: warning: shifting a negative signed value
      is undefined [-Wshift-negative-value]
  ...^ ((char)0xC0 << 6 ^ (char)0x80);
        ~~~~~~~~~~ ^
4 warnings generated.
clang -arch arm64 -o libjri.jnilib Rengine.o jri.o Rcallbacks.o Rinit.o Rengine-sysutils.o globals.o rjava.o rjutil.o  -dynamiclib -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Java/JavaVirtualMachines/jdk-17.jdk/Contents/Home/lib/server -ljvm -L/opt/R/arm64/lib -F/Library/Frameworks/R.framework/.. -framework R -L/opt/R/arm64/lib -lpcre2-8 -llzma -lbz2 -lz -licucore -ldl -lm -liconv
ld: library not found for -lpcre2-8
clang-15: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [libjri.jnilib] Error 1
make[1]: *** [src/JRI.jar] Error 2
make: *** [jri] Error 2
ERROR: compilation failed for package ‘rj’
* removing ‘/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/rj’
ERROR: dependency ‘rj’ is not available for package ‘rj.gd’
* removing ‘/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/rj.gd’

The downloaded source packages are in
    ‘/private/tmp/Rtmp1gK1gI/downloaded_packages’
Warning messages:
1: In install.packages(c("rj", "rj.gd"), repos = "https://download.walware.de/rj-4.0";) :
  installation of package ‘rj’ had non-zero exit status
2: In install.packages(c("rj", "rj.gd"), repos = "https://download.walware.de/rj-4.0";) :
  installation of package ‘rj.gd’ had non-zero exit status



Back to the top