PolMine / RcppCWB

'Rcpp' Bindings for the 'Corpus Workbench' (CWB)
Other
2 stars 3 forks source link

Cannot configure compiler on arm64 (CRAN test fails) #66

Closed ablaette closed 2 years ago

ablaette commented 2 years ago

The CRAN test machine for arm64 macOS builds reports the following failure to build RcppCWB:

* installing *source* package ‘RcppCWB’ ...
** package ‘RcppCWB’ successfully unpacked and MD5 sums checked
** using staged installation
* operating system detected for CWB configuration: Darwin
* compiling for darwin-arm64
* using CWB platform configuration file: darwin-arm64
* adapt CWB configuration file to use compiler: clang -arch arm64
* using pkg-config to check whether glib-2.0 is available ... yes
* using pkg-config to get linker flags for glib-2.0: -L/opt/R/arm64/lib -lglib-2.0 -lintl -liconv -lm -Wl,-framework,CoreFoundation -Wl,-framework,Carbon -Wl,-framework,Foundation -Wl,-framework,AppKit -lpcre
* check whether pcre is available ... yes (version: 8.45)
* checking whether pcretest is available to check unicode properties support ... yes
* check whether pcre has been configured with unicode properties support ... yes
* using pcre-config to get libdirs for pcre: -L/opt/R/arm64/lib -lpcre
* using pcre-config to get cflags for pcre: -I/opt/R/arm64/include -DPCRE_STATIC
* using build directory: /Volumes/Builds/packages/big-sur-arm64/results/4.1/RcppCWB.Rcheck/00_pkg_src/RcppCWB
** libs
clang++ -arch arm64 -std=gnu++14 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/Volumes/Builds/packages/big-sur-arm64/results/4.1/RcppCWB.Rcheck/00_pkg_src/RcppCWB/src/cwb/cqp -I/Volumes/Builds/packages/big-sur-arm64/results/4.1/RcppCWB.Rcheck/00_pkg_src/RcppCWB/src/cwb/cl -I/Volumes/Builds/packages/big-sur-arm64/results/4.1/RcppCWB.Rcheck/00_pkg_src/RcppCWB/src/cwb/CQi -I/opt/R/arm64/include -DPCRE_STATIC -I'/Volumes/Builds/packages/big-sur-arm64/Rlib/4.1/Rcpp/include' -I/opt/R/arm64/include   -fPIC  -falign-functions=64 -Wall -g -O2  -c RcppExports.cpp -o RcppExports.o
clang++ -arch arm64 -std=gnu++14 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/Volumes/Builds/packages/big-sur-arm64/results/4.1/RcppCWB.Rcheck/00_pkg_src/RcppCWB/src/cwb/cqp -I/Volumes/Builds/packages/big-sur-arm64/results/4.1/RcppCWB.Rcheck/00_pkg_src/RcppCWB/src/cwb/cl -I/Volumes/Builds/packages/big-sur-arm64/results/4.1/RcppCWB.Rcheck/00_pkg_src/RcppCWB/src/cwb/CQi -I/opt/R/arm64/include -DPCRE_STATIC -I'/Volumes/Builds/packages/big-sur-arm64/Rlib/4.1/Rcpp/include' -I/opt/R/arm64/include   -fPIC  -falign-functions=64 -Wall -g -O2  -c addons.cpp -o addons.o
clang++ -arch arm64 -std=gnu++14 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/Volumes/Builds/packages/big-sur-arm64/results/4.1/RcppCWB.Rcheck/00_pkg_src/RcppCWB/src/cwb/cqp -I/Volumes/Builds/packages/big-sur-arm64/results/4.1/RcppCWB.Rcheck/00_pkg_src/RcppCWB/src/cwb/cl -I/Volumes/Builds/packages/big-sur-arm64/results/4.1/RcppCWB.Rcheck/00_pkg_src/RcppCWB/src/cwb/CQi -I/opt/R/arm64/include -DPCRE_STATIC -I'/Volumes/Builds/packages/big-sur-arm64/Rlib/4.1/Rcpp/include' -I/opt/R/arm64/include   -fPIC  -falign-functions=64 -Wall -g -O2  -c cl.cpp -o cl.o
clang++ -arch arm64 -std=gnu++14 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/Volumes/Builds/packages/big-sur-arm64/results/4.1/RcppCWB.Rcheck/00_pkg_src/RcppCWB/src/cwb/cqp -I/Volumes/Builds/packages/big-sur-arm64/results/4.1/RcppCWB.Rcheck/00_pkg_src/RcppCWB/src/cwb/cl -I/Volumes/Builds/packages/big-sur-arm64/results/4.1/RcppCWB.Rcheck/00_pkg_src/RcppCWB/src/cwb/CQi -I/opt/R/arm64/include -DPCRE_STATIC -I'/Volumes/Builds/packages/big-sur-arm64/Rlib/4.1/Rcpp/include' -I/opt/R/arm64/include   -fPIC  -falign-functions=64 -Wall -g -O2  -c cqp.cpp -o cqp.o
clang++ -arch arm64 -std=gnu++14 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/Volumes/Builds/packages/big-sur-arm64/results/4.1/RcppCWB.Rcheck/00_pkg_src/RcppCWB/src/cwb/cqp -I/Volumes/Builds/packages/big-sur-arm64/results/4.1/RcppCWB.Rcheck/00_pkg_src/RcppCWB/src/cwb/cl -I/Volumes/Builds/packages/big-sur-arm64/results/4.1/RcppCWB.Rcheck/00_pkg_src/RcppCWB/src/cwb/CQi -I/opt/R/arm64/include -DPCRE_STATIC -I'/Volumes/Builds/packages/big-sur-arm64/Rlib/4.1/Rcpp/include' -I/opt/R/arm64/include   -fPIC  -falign-functions=64 -Wall -g -O2  -c utils.cpp -o utils.o
cd cwb; R_PACKAGE_SOURCE=/Volumes/Builds/packages/big-sur-arm64/results/4.1/RcppCWB.Rcheck/00_pkg_src/RcppCWB/src/cwb PKG_CONFIG_PATH=/opt/R/arm64/lib/pkgconfig:/opt/R/arm64/share/pkgconfig:/usr/lib/pkgconfig:/opt/X11/lib/pkgconfig:/opt/X11/share/pkgconfig make clean
for i in cl cqp ; do if [ -f "$i/Makefile" ]; then cd $i; make clean; cd ..; fi; done;
rm -f *.o libcl.a registry.output *~
rm -f cqp cqpcl cqpserver  *.o ../CQi/*.o parser.output *~ ../CQi/*~
# TODO what is "parser.output" ? 
rm -f *~ config/*/*~ CQi/*~ CQi/*.o technical/*~ TAGS
rm -f -rf build
cd cwb; R_PACKAGE_SOURCE=/Volumes/Builds/packages/big-sur-arm64/results/4.1/RcppCWB.Rcheck/00_pkg_src/RcppCWB/src/cwb PKG_CONFIG_PATH=/opt/R/arm64/lib/pkgconfig:/opt/R/arm64/share/pkgconfig:/usr/lib/pkgconfig:/opt/X11/lib/pkgconfig:/opt/X11/share/pkgconfig make depend
for i in cl cqp  ; do cd $i; make depend.mk; cd ..; done;
make[2]: `depend.mk' is up to date.
make[2]: `depend.mk' is up to date.
cd cwb; R_PACKAGE_SOURCE=/Volumes/Builds/packages/big-sur-arm64/results/4.1/RcppCWB.Rcheck/00_pkg_src/RcppCWB/src/cwb PKG_CONFIG_PATH=/opt/R/arm64/lib/pkgconfig:/opt/R/arm64/share/pkgconfig:/usr/lib/pkgconfig:/opt/X11/lib/pkgconfig:/opt/X11/share/pkgconfig make cl
--------------------------------- BUILDING CORPUS LIBRARY (CL)
cd cl; make
gcc -c  -o globals.o -Wall -O3 -arch arm64 -mtune=native   -DUSE_TERMCAP -DCOMPILE_DATE=\""Tue Aug 30 09:34:32 NZST 2022"\" -DCWB_VERSION=\"3.4.33\" -DPCRE_STATIC -I/opt/R/arm64/include/glib-2.0 -I/opt/R/arm64/lib/glib-2.0/include -I/opt/R/arm64/include -I/opt/R/arm64/include -DPCRE_STATIC   globals.c
gcc: error: this compiler does not support arm64
make[2]: *** [globals.o] Error 1
make[1]: *** [cl] Error 2
make: *** [libcl.a] Error 2
ERROR: compilation failed for package ‘RcppCWB’
* removing ‘/Volumes/Builds/packages/big-sur-arm64/results/4.1/RcppCWB.Rcheck/RcppCWB’

The crucial part is "gcc: error: this compiler does not support arm64" and is is obvious that the compiler ready for arm64 is clang++ but that the CWB scripts run gcc.

ablaette commented 2 years ago

I thought I had addressed this before, but there are three building blocks that prevented the configured compiler to be passed:

The fix will work for macOS, but before a release, we need to ensure that there are no unintended negative side effects ...