Still Cairo installation issue - r

I also faced an error during Cairo library installation in R. Please, see the messages below.
I get this error:
> install.packages('Cairo')
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 86982 100 86982 0 0 389k 0 --:--:-- --:--:-- --:--:-- 389k
* installing *source* package ‘Cairo’ ...
** package ‘Cairo’ successfully unpacked and MD5 sums checked
checking for gcc... x86_64-conda_cos6-linux-gnu-cc
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 x86_64-conda_cos6-linux-gnu-cc accepts -g... yes
checking for x86_64-conda_cos6-linux-gnu-cc option to accept ISO C89... none needed
checking how to run the C preprocessor... x86_64-conda_cos6-linux-gnu-cc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/wait.h that is POSIX.1 compatible... 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 for string.h... (cached) yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking for pkg-config... /usr/bin/pkg-config
checking whether pkg-config knows about cairo... yes
checking for configurable backends... cairo cairo-ft cairo-pdf cairo-png cairo-ps cairo-xlib cairo-xlib-xrender
configure: CAIRO_CFLAGS=-I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12
checking if R was compiled with the RConn patch... no
checking cairo.h usability... yes
checking cairo.h presence... yes
checking for cairo.h... yes
checking for PNG support in Cairo... yes
checking for ATS font support in Cairo... no
configure: CAIRO_LIBS=-lfreetype -lz -lpng12 -lz -lcairo -lXext -lXrender -lX11
checking for library containing deflate... no
checking whether Cairo programs can be compiled... configure: error: Cannot compile a simple Cairo program. See config.log for details.
ERROR: configuration failed for package ‘Cairo’
* removing ‘/home/ubuntu/anaconda3/lib/R/library/Cairo’
The downloaded source packages are in
‘/tmp/RtmpAuSLZy/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("Cairo") :
installation of package ‘Cairo’ had non-zero exit status
While session info gives this:
R version 3.4.3 (2017-11-30)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.6 LTS
Matrix products: default
BLAS: /home/ubuntu/anaconda3/lib/R/lib/libRblas.so
LAPACK: /home/ubuntu/anaconda3/lib/R/lib/libRlapack.so
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] RevoUtils_10.0.8
loaded via a namespace (and not attached):
[1] compiler_3.4.3 tools_3.4.3
And capabilities shows I have Cairo available.
> capabilities()
jpeg png tiff tcltk X11 aqua
TRUE TRUE TRUE TRUE FALSE FALSE
http/ftp sockets libxml fifo cledit iconv
TRUE TRUE TRUE TRUE TRUE TRUE
NLS profmem cairo ICU long.double libcurl
TRUE TRUE TRUE TRUE TRUE TRUE
I believe I read all the corresponding topics and librairo2-dev is already installed:
libcairo2-dev is already the newest version (1.14.6-1).
And, I believe, the .log file:
## --------- ##
## Platform. ##
## --------- ##
hostname = ip-172-31-30-74
uname -m = x86_64
uname -r = 4.4.0-1069-aws
uname -s = Linux
uname -v = #79-Ubuntu SMP Mon Sep 24 15:01:41 UTC 2018
/usr/bin/uname -p = unknown
/bin/uname -X = unknown
/bin/arch = unknown
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown
PATH: /home/ubuntu/bin
PATH: /home/ubuntu/.local/bin
PATH: /home/ubuntu/anaconda3/bin
PATH: /home/ubuntu/software/sratoolkit.2.9.0-ubuntu64/bin
PATH: /home/ubuntu/anaconda2/bin
PATH: /home/ubuntu/chenlab_v2/pipeline/bulk_rna_seq/code
PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /sbin
PATH: /bin
PATH: /usr/games
PATH: /usr/local/games
PATH: /snap/bin
## ----------- ##
## Core tests. ##
## ----------- ##
configure:2155: checking for gcc
configure:2171: found /home/ubuntu/anaconda3/bin/gcc
configure:2182: result: gcc
configure:2411: checking for C compiler version
configure:2420: gcc --version >&5
gcc (crosstool-NG fa8859cb) 7.2.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
configure:2431: $? = 0
configure:2420: gcc -v >&5
Reading specs from /home/ubuntu/anaconda3/bin/../lib/gcc/x86_64-conda_cos6-linux-gnu/7.2.0/specs
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/home/ubuntu/anaconda3/bin/../libexec/gcc/x86_64-conda_cos6-linux-gnu/7.2.0/lto-wrapper
Target: x86_64-conda_cos6-linux-gnu
Configured with: /opt/conda/conda-bld/compilers_linux-64_1520532893746/work/.build/src/gcc-7.2.0/configure --build=x86_64-build_pc-linux-gnu --host=x86_64-build_pc-linux-gnu --tar
get=x86_64-conda_cos6-linux-gnu --prefix=/opt/conda/conda-bld/compilers_linux-64_1520532893746/work/gcc_built --with-sysroot=/opt/conda/conda-bld/compilers_linux-64_1520532893746/
work/gcc_built/x86_64-conda_cos6-linux-gnu/sysroot --enable-languages=c,c++,fortran,objc,obj-c++ --with-pkgversion='crosstool-NG fa8859cb' --enable-__cxa_atexit --disable-libmudfl
ap --enable-libgomp --disable-libssp --enable-libquadmath --enable-libquadmath-support --enable-libsanitizer --enable-libmpx --with-gmp=/opt/conda/conda-bld/compilers_linux-64_152
0532893746/work/.build/x86_64-conda_cos6-linux-gnu/buildtools --with-mpfr=/opt/conda/conda-bld/compilers_linux-64_1520532893746/work/.build/x86_64-conda_cos6-linux-gnu/buildtools
--with-mpc=/opt/conda/conda-bld/compilers_linux-64_1520532893746/work/.build/x86_64-conda_cos6-linux-gnu/buildtools --with-isl=/opt/conda/conda-bld/compilers_linux-64_152053289374
6/work/.build/x86_64-conda_cos6-linux-gnu/buildtools --enable-lto --enable-threads=posix --enable-target-optspace --enable-plugin --enable-gold --disable-nls --disable-multilib --
with-local-prefix=/opt/conda/conda-bld/compilers_linux-64_1520532893746/work/gcc_built/x86_64-conda_cos6-linux-gnu/sysroot --enable-long-long --enable-default-pie
Thread model: posix
gcc version 7.2.0 (crosstool-NG fa8859cb)
configure:2431: $? = 0
configure:2420: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:2431: $? = 1
configure:2420: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'; did you mean '--version'?
gcc: fatal error: no input files
compilation terminated.
configure:2431: $? = 1
configure:2451: checking whether the C compiler works
configure:2473: gcc -L/home/ubuntu/anaconda3/lib conftest.c >&5
configure:2477: $? = 0
configure:2525: result: yes
configure:2528: checking for C compiler default output file name
configure:2530: result: a.out
configure:2536: checking for suffix of executables
configure:2543: gcc -o conftest -L/home/ubuntu/anaconda3/lib conftest.c >&5
configure:2547: $? = 0
configure:2569: result:
configure:2591: checking whether we are cross compiling
configure:2599: gcc -o conftest -L/home/ubuntu/anaconda3/lib conftest.c >&5
configure:2603: $? = 0
configure:2610: ./conftest
configure:2614: $? = 0
configure:2629: result: no
configure:2634: checking for suffix of object files
configure:2656: gcc -c conftest.c >&5
configure:2660: $? = 0
configure:2681: result: o
configure:2685: checking whether we are using the GNU C compiler
configure:2704: gcc -c conftest.c >&5
configure:2704: $? = 0
configure:2713: result: yes
configure:2722: checking whether gcc accepts -g
configure:2742: gcc -c -g conftest.c >&5
configure:2742: $? = 0
configure:2783: result: yes
configure:2800: checking for gcc option to accept ISO C89
configure:2863: gcc -c -g -O2 conftest.c >&5
configure:2863: $? = 0
configure:2876: result: none needed
configure:2897: checking for gzeof in -lz
configure:2922: gcc -o conftest -g -O2 -L/home/ubuntu/anaconda3/lib conftest.c -lz >&5
/home/ubuntu/anaconda3/lib/libz.so: undefined reference to `memcpy#GLIBC_2.14'
collect2: error: ld returned 1 exit status
configure:2922: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h. */
|
| /* Override any GCC internal prototype to avoid an error.
| Use char because int might match the return type of a GCC
| builtin and then its argument prototype would still apply. */
| #ifdef __cplusplus
| extern "C"
| #endif
| char gzeof ();
| int
| main ()
| {
| return gzeof ();
| ;
| return 0;
| }
configure:2931: result: yes
configure:2949: checking how to run the C preprocessor
configure:2980: gcc -E conftest.c
configure:2980: $? = 0
configure:2994: gcc -E conftest.c
conftest.c:10:10: fatal error: ac_nonexistent.h: No such file or directory
#include <ac_nonexistent.h>
^~~~~~~~~~~~~~~~~~
compilation terminated.
configure:2994: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define HAVE_LIBZ 1
| /* end confdefs.h. */
| #include <ac_nonexistent.h>
configure:3019: result: gcc -E
configure:3039: gcc -E conftest.c
configure:3039: $? = 0
configure:3053: gcc -E conftest.c
conftest.c:10:10: fatal error: ac_nonexistent.h: No such file or directory
#include <ac_nonexistent.h>
^~~~~~~~~~~~~~~~~~
compilation terminated.
configure:3053: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define HAVE_LIBZ 1
| /* end confdefs.h. */
| #include <ac_nonexistent.h>
configure:3082: checking for grep that handles long lines and -e
configure:3140: result: /bin/grep
configure:3145: checking for egrep
configure:3207: result: /bin/grep -E
configure:3212: checking for ANSI C header files
configure:3232: gcc -c -g -O2 conftest.c >&5
configure:3232: $? = 0
configure:3305: gcc -o conftest -g -O2 -L/home/ubuntu/anaconda3/lib conftest.c -lz >&5
/home/ubuntu/anaconda3/lib/libz.so: undefined reference to `memcpy#GLIBC_2.14'
collect2: error: ld returned 1 exit status
configure:3305: $? = 1
configure: program exited with status 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define HAVE_LIBZ 1
| /* end confdefs.h. */
| #include <ctype.h>
| #include <stdlib.h>
| #if ((' ' & 0x0FF) == 0x020)
| # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
| # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
| #else
| # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') || ('j' <= (c) && (c) <= 'r') || ('s' <= (c) && (c) <= 'z'))
| # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
| #endif
|
| #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
| int
| main ()
| {
| int i;
| for (i = 0; i < 256; i++)
| if (XOR (islower (i), ISLOWER (i))
| || toupper (i) != TOUPPER (i))
| return 2;
| return 0;
| }
configure:3316: result: no
configure:3329: checking for sys/types.h
configure:3329: gcc -c -g -O2 conftest.c >&5
configure:3329: $? = 0
configure:3329: result: yes
configure:3329: checking for sys/stat.h
configure:3329: gcc -c -g -O2 conftest.c >&5
configure:3329: $? = 0
configure:3329: result: yes
configure:3329: checking for stdlib.h
configure:3329: gcc -c -g -O2 conftest.c >&5
configure:3329: $? = 0
configure:3329: result: yes
configure:3329: checking for string.h
configure:3329: gcc -c -g -O2 conftest.c >&5
configure:3329: $? = 0
configure:3329: result: yes
configure:3329: checking for memory.h
configure:3329: gcc -c -g -O2 conftest.c >&5
configure:3329: $? = 0
configure:3329: result: yes
configure:3329: checking for strings.h
configure:3329: gcc -c -g -O2 conftest.c >&5
configure:3329: $? = 0
configure:3329: result: yes
configure:3329: checking for inttypes.h
configure:3329: gcc -c -g -O2 conftest.c >&5
configure:3329: $? = 0
configure:3329: result: yes
configure:3329: checking for stdint.h
configure:3329: gcc -c -g -O2 conftest.c >&5
configure:3329: $? = 0
configure:3329: result: yes
configure:3329: checking for unistd.h
configure:3329: gcc -c -g -O2 conftest.c >&5
configure:3329: $? = 0
configure:3329: result: yes
configure:3345: checking size of unsigned long
configure:3350: gcc -o conftest -g -O2 -L/home/ubuntu/anaconda3/lib conftest.c -lz >&5
/home/ubuntu/anaconda3/lib/libz.so: undefined reference to `memcpy#GLIBC_2.14'
collect2: error: ld returned 1 exit status
configure:3350: $? = 1
configure: program exited with status 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define HAVE_LIBZ 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| /* end confdefs.h. */
| #include <stdio.h>
| #ifdef HAVE_SYS_TYPES_H
| # include <sys/types.h>
| #endif
| #ifdef HAVE_SYS_STAT_H
| # include <sys/stat.h>
| #endif
| #ifdef STDC_HEADERS
| # include <stdlib.h>
| # include <stddef.h>
| #else
| # ifdef HAVE_STDLIB_H
| # include <stdlib.h>
| # endif
| #endif
| #ifdef HAVE_STRING_H
| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
| # include <memory.h>
| # endif
| # include <string.h>
| #endif
| #ifdef HAVE_STRINGS_H
| # include <strings.h>
| #endif
| #ifdef HAVE_INTTYPES_H
| # include <inttypes.h>
| #endif
| #ifdef HAVE_STDINT_H
| # include <stdint.h>
| #endif
| #ifdef HAVE_UNISTD_H
| # include <unistd.h>
| #endif
| static long int longval () { return (long int) (sizeof (unsigned long)); }
| static unsigned long int ulongval () { return (long int) (sizeof (unsigned long)); }
| #include <stdio.h>
| #include <stdlib.h>
| int
| main ()
| {
|
| FILE *f = fopen ("conftest.val", "w");
| if (! f)
| return 1;
| if (((long int) (sizeof (unsigned long))) < 0)
| {
| long int i = longval ();
| if (i != ((long int) (sizeof (unsigned long))))
| return 1;
| fprintf (f, "%ld", i);
| }
| else
| {
| unsigned long int i = ulongval ();
| if (i != ((long int) (sizeof (unsigned long))))
| return 1;
| fprintf (f, "%lu", i);
| }
| /* Do not output a trailing newline, as this causes \r\n confusion
| on some platforms. */
| return ferror (f) || fclose (f) != 0;
|
| ;
| return 0;
| }
configure:3364: result: 0
configure:3527: creating ./config.status
## ---------------------- ##
## Running config.status. ##
## ---------------------- ##
This file was extended by config.status, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES =
CONFIG_HEADERS =
CONFIG_LINKS =
CONFIG_COMMANDS =
$ ./config.status
on ip-172-31-30-74
config.status:723: creating src/Makevars
## ---------------- ##
## Cache variables. ##
## ---------------- ##
ac_cv_c_compiler_gnu=yes
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_LDFLAGS_set=set
ac_cv_env_LDFLAGS_value=-L/home/ubuntu/anaconda3/lib
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_header_inttypes_h=yes
ac_cv_header_memory_h=yes
ac_cv_header_stdc=no
ac_cv_header_stdint_h=yes
ac_cv_header_stdlib_h=yes
ac_cv_header_string_h=yes
ac_cv_header_strings_h=yes
ac_cv_header_sys_stat_h=yes
ac_cv_header_sys_types_h=yes
ac_cv_header_unistd_h=yes
ac_cv_lib_z_gzeof=yes
ac_cv_objext=o
ac_cv_path_EGREP='/bin/grep -E'
ac_cv_path_GREP=/bin/grep
ac_cv_prog_CPP='gcc -E'
ac_cv_prog_ac_ct_CC=gcc
ac_cv_prog_cc_c89=
ac_cv_prog_cc_g=yes
ac_cv_sizeof_unsigned_long=0
## ----------------- ##
## Output variables. ##
## ----------------- ##
CC='gcc'
CFLAGS='-g -O2'
CPP='gcc -E'
CPPFLAGS=''
DEFS='-DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DHAVE_LIBZ=1 -DHAVE_SYS_TYPES_H=1 -DHAVE
_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DSIZEOF_UNSIGNED_LONG=0'
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP='/bin/grep -E'
EXEEXT=''
GREP='/bin/grep'
LDFLAGS='-L/home/ubuntu/anaconda3/lib'
LIBOBJS=''
LIBS='-lz '
LTLIBOBJS=''
OBJEXT='o'
PACKAGE_BUGREPORT=''
PACKAGE_NAME=''
PACKAGE_STRING=''
PACKAGE_TARNAME=''
PACKAGE_URL=''
PACKAGE_VERSION=''
PATH_SEPARATOR=':'
SHELL='/bin/bash'
ac_ct_CC='gcc'
bindir='${exec_prefix}/bin'
build_alias=''
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE}'
dvidir='${docdir}'
exec_prefix='${prefix}'
host_alias=''
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='/usr/local'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''
## ----------- ##
## confdefs.h. ##
## ----------- ##
/* confdefs.h */
#define PACKAGE_NAME ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define PACKAGE_STRING ""
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""
#define HAVE_LIBZ 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRING_H 1
#define HAVE_MEMORY_H 1
#define HAVE_STRINGS_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_STDINT_H 1
#define HAVE_UNISTD_H 1
#define SIZEOF_UNSIGNED_LONG 0
configure: exit 0
I would greatly appreciate if someone will be able to help. Thank you in advance.

Related

Error compiling a QT app for Windows with Github Actions

Im trying to make Github Actions compile my project on windows, but it is failing. When compiling in my machine, it compiles fine. Why does it fail on Github Actions?
I have also tried installing QT using jurplel/install-qt-action#v2.5.3, but I get the same error
The project compiles fine for Mac and Linux
Compile Output:
Info: creating stash file D:\a\dsda-launcher\dsda-launcher\dsda-launcher\build\.qmake.stash
24
C:/ProgramData/Chocolatey/lib/make/tools/install/bin/make.exe -f Makefile.Release
25
make[1]: Entering directory 'D:/a/dsda-launcher/dsda-launcher/dsda-launcher/build'
26
'C:\Qt\5.15.2\mingw81_64\bin\uic.exe' ../mainwindow.ui -o ui_mainwindow.h
27
g++ -c -fno-keep-inline-dllexport -O2 -std=gnu++11 -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DAPP_NAME=dsda-launcher -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CONCURRENT_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I../../dsda-launcher -I. -IC:/Qt/5.15.2/mingw81_64/include -IC:/Qt/5.15.2/mingw81_64/include/QtWidgets -IC:/Qt/5.15.2/mingw81_64/include/QtGui -IC:/Qt/5.15.2/mingw81_64/include/QtANGLE -IC:/Qt/5.15.2/mingw81_64/include/QtNetwork -IC:/Qt/5.15.2/mingw81_64/include/QtConcurrent -IC:/Qt/5.15.2/mingw81_64/include/QtCore -Irelease -I. -I/include -IC:/Qt/5.15.2/mingw81_64/mkspecs/win32-g++ -o release/main.o ../main.cpp
28
g++ -c -fno-keep-inline-dllexport -O2 -std=gnu++11 -Wall -Wextra -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DAPP_NAME=dsda-launcher -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CONCURRENT_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I../../dsda-launcher -I. -IC:/Qt/5.15.2/mingw81_64/include -IC:/Qt/5.15.2/mingw81_64/include/QtWidgets -IC:/Qt/5.15.2/mingw81_64/include/QtGui -IC:/Qt/5.15.2/mingw81_64/include/QtANGLE -IC:/Qt/5.15.2/mingw81_64/include/QtNetwork -IC:/Qt/5.15.2/mingw81_64/include/QtConcurrent -IC:/Qt/5.15.2/mingw81_64/include/QtCore -Irelease -I. -I/include -IC:/Qt/5.15.2/mingw81_64/mkspecs/win32-g++ -o release/mainwindow.o ../mainwindow.cpp
29
../mainwindow.cpp: In function 'QString lowerCase(std::__cxx11::string)':
30
../mainwindow.cpp:77:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long long unsigned int'} [-Wsign-compare]
31
for(int i=0;i<word.length();i++)
32
~^~~~~~~~~~~~~~
33
../mainwindow.cpp: In constructor 'MainWindow::MainWindow(QWidget*)':
34
../mainwindow.cpp:211:34: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long long unsigned int'} [-Wsign-compare]
35
for(int i=0;i<tp.length();i++) // Loop the chars to find the 4 quotes
36
~^~~~~~~~~~~~
37
../mainwindow.cpp:266:42: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long long unsigned int'} [-Wsign-compare]
38
for(int i=0;i<tp.length();i++)
39
~^~~~~~~~~~~~
40
../mainwindow.cpp:308:46: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long long unsigned int'} [-Wsign-compare]
41
for(int i=0;i<tp.length();i++)
42
~^~~~~~~~~~~~
43
../mainwindow.cpp: In member function 'void MainWindow::on_LaunchGameButton_clicked(bool, bool)':
44
../mainwindow.cpp:881:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long long unsigned int'} [-Wsign-compare]
45
for(int i=0; i<dehFiles.length();i++)
46
~^~~~~~~~~~~~~~~~~~
47
../mainwindow.cpp:893:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long long unsigned int'} [-Wsign-compare]
48
for(int i=0; i<files.length();i++)
49
~^~~~~~~~~~~~~~~
50
In file included from C:/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/x86_64-w64-mingw32/include/windows.h:65,
51
from ../mainwindow.cpp:1068:
52
C:/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/x86_64-w64-mingw32/include/excpt.h:14:8: error: expected unqualified-id before string constant
53
extern "C" {
54
^~~
55
In file included from C:/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/x86_64-w64-mingw32/include/minwindef.h:6,
56
from C:/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/x86_64-w64-mingw32/include/windef.h:8,
57
from C:/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/x86_64-w64-mingw32/include/windows.h:69,
58
from ../mainwindow.cpp:1068:
59
C:/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/x86_64-w64-mingw32/include/specstrings.h:18:8: error: expected unqualified-id before string constant
60
extern "C" {
61
^~~
62
In file included from C:/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/x86_64-w64-mingw32/include/windef.h:8,
63
from C:/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/x86_64-w64-mingw32/include/windows.h:69,
64
from ../mainwindow.cpp:1068:
65
C:/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/x86_64-w64-mingw32/include/minwindef.h:19:8: error: expected unqualified-id before string constant
66
extern "C" {
67
^~~
68
In file included from C:/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/x86intrin.h:27,
69
from C:/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/x86_64-w64-mingw32/include/winnt.h:1554,
70
from C:/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/x86_64-w64-mingw32/include/minwindef.h:163,
71
from C:/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/x86_64-w64-mingw32/include/windef.h:8,
72
from C:/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/x86_64-w64-mingw32/include/windows.h:69,
73
from ../mainwindow.cpp:1068:
74
C:/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/ia32intrin.h:55:25: error: expected '}' before end of line
75
#pragma GCC push_options
76
^
77
../mainwindow.cpp:751:1: note: to match this '{'
78
{
79
^
80
In file included from C:/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/x86intrin.h:27,
81
from C:/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/x86_64-w64-mingw32/include/winnt.h:1554,
82
from C:/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/x86_64-w64-mingw32/include/minwindef.h:163,
83
from C:/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/x86_64-w64-mingw32/include/windef.h:8,
84
from C:/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/x86_64-w64-mingw32/include/windows.h:69,
85
from ../mainwindow.cpp:1068:
86
C:/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/ia32intrin.h: At global scope:
87
C:/ProgramData/Chocolatey/lib/mingw/tools/install/mingw64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/ia32intrin.h:55:25: error: expected declaration before end of line
88
#pragma GCC push_options
89
^
90
make[1]: *** [Makefile.Release:725: release/mainwindow.o] Error 1
91
make[1]: Leaving directory 'D:/a/dsda-launcher/dsda-launcher/dsda-launcher/build'
92
make: *** [Makefile:45: release] Error 2
Github Actions code:
steps:
- name: Install qt
run: |
choco install qt5-default
- uses: actions/checkout#v2
- name: build
run: |
C:\Qt\5.15.2\mingw81_64\bin\qmake.exe ..
make.exe
Found the solution. I had to call #include <windows.h> before including any other header. I don't know why, but it works.
https://forum.qt.io/topic/38780/solved-errors-with-windows-h

Errors while installing R packages

While installing R packages into solaris server, we got the below error:
"/R-3.6.1/R-3.6.1/include" is present in our server, where as while installing the package, some script is executing internally and looking for "I/R-3.6.1/R-3.6.1/include", its not found.
I"/R-3.6.1/R-3.6.1/include" -DNDEBUG -I../inst/include/ -I/usr/local/include -KPIC -c api.cpp -o api.o
sh: I/R-3.6.1/R-3.6.1/include: not found
make: Fatal error: Command failed for target `Rcpp.so'
ERROR: compilation failed for package 'Rcpp'
Full install.packages() output:
installing *source* package 'Rcpp' ...
** package 'Rcpp' successfully unpacked and MD5 sums checked
** using staged installation
** libs
I"/R-3.6.1/R-3.6.1/include" -DNDEBUG -I../inst/include/ -I/usr/local/include -KPIC -c api.cpp -o api.o
sh: I/R-3.6.1/R-3.6.1/include: not found
*** Error code 127 (ignored)
I"/R-3.6.1/R-3.6.1/include" -DNDEBUG -I../inst/include/ -I/usr/local/include -KPIC -c attributes.cpp -o attributes.o
sh: I/R-3.6.1/R-3.6.1/include: not found
*** Error code 127 (ignored)
I"/R-3.6.1/R-3.6.1/include" -DNDEBUG -I../inst/include/ -I/usr/local/include -KPIC -c barrier.cpp -o barrier.o
sh: I/R-3.6.1/R-3.6.1/include: not found
*** Error code 127 (ignored)
I"/R-3.6.1/R-3.6.1/include" -DNDEBUG -I../inst/include/ -I/usr/local/include -KPIC -c date.cpp -o date.o
sh: I/R-3.6.1/R-3.6.1/include: not found
*** Error code 127 (ignored)
I"/R-3.6.1/R-3.6.1/include" -DNDEBUG -I../inst/include/ -I/usr/local/include -KPIC -c module.cpp -o module.o
sh: I/R-3.6.1/R-3.6.1/include: not found
*** Error code 127 (ignored)
I"/R-3.6.1/R-3.6.1/include" -DNDEBUG -I../inst/include/ -I/usr/local/include -KPIC -c rcpp_init.cpp -o rcpp_init.o
sh: I/R-3.6.1/R-3.6.1/include: not found
*** Error code 127 (ignored)
-shared -L/usr/local/lib -o Rcpp.so api.o attributes.o barrier.o date.o module.o rcpp_init.o
sh: line 2: -shared: not found
*** Error code 127
The following command caused the error:
if test "zapi.o attributes.o barrier.o date.o module.o rcpp_init.o" != "z"; then \
echo -shared -L/usr/local/lib -o Rcpp.so api.o attributes.o barrier.o date.o module.o rcpp_init.o ; \
-shared -L/usr/local/lib -o Rcpp.so api.o attributes.o barrier.o date.o module.o rcpp_init.o ; \
fi
make: Fatal error: Command failed for target `Rcpp.so'
ERROR: compilation failed for package 'Rcpp'
* removing '/R-3.6.1/R-3.6.1/library/Rcpp'
makeconf entries as follows: (we have altered the CXX, CXX11, CXX14)
enter code here
# etc/Makeconf. Generated from Makeconf.in by configure.
#
# ${R_HOME}/etc/Makeconf
#
# R was configured using the following call
# (not including env. vars and site configuration)
# configure
## This fails if it contains spaces, or if it is quoted
include $(R_SHARE_DIR)/make/vars.mk
AR = ar
BLAS_LIBS = -L"$(R_HOME)/lib$(R_ARCH)" -lRblas
C_VISIBILITY = -fvisibility=hidden
CC = gcc -std=gnu99
CFLAGS = -g -O2 $(LTO)
CPICFLAGS = -fPIC
CPPFLAGS = -I/usr/local/include
CXX = /opt/csw/gcc4/bin
CXXCPP = /lib/cpp
CXXFLAGS = $(LTO)
CXXPICFLAGS = -KPIC
CXX98 =
CXX98FLAGS = $(LTO)
CXX98PICFLAGS =
CXX98STD =
CXX11 = /opt/csw/gcc4/bin
CXX11FLAGS = $(LTO)
CXX11PICFLAGS =
CXX11STD =
CXX14 = /opt/csw/gcc4/bin
CXX14FLAGS = $(LTO)
CXX14PICFLAGS =
CXX14STD =
CXX17 =
CXX17FLAGS = $(LTO)
CXX17PICFLAGS =
CXX17STD =
CXX_VISIBILITY =
DYLIB_EXT = .so
DYLIB_LD = $(CC)
DYLIB_LDFLAGS = -shared -fopenmp# $(CFLAGS) $(CPICFLAGS)
DYLIB_LINK = $(DYLIB_LD) $(DYLIB_LDFLAGS) $(LDFLAGS)
ECHO = echo
ECHO_C = \c
ECHO_N =
ECHO_T =
F_VISIBILITY = -fvisibility=hidden
## FC is the compiler used for all Fortran as from R 3.6.0
FC = gfortran
FCFLAGS = -g -O2 $(LTO)
## additional libs needed when linking with $(FC), e.g. on some Oracle compilers
FCLIBS_XTRA =
FFLAGS = -g -O2 $(LTO)
FLIBS = -lgfortran -lm -R/opt/csw/lib
FPICFLAGS = -fPIC
FOUNDATION_CPPFLAGS =
FOUNDATION_LIBS =
JAR =
JAVA = /usr/bin/java
JAVAC =
JAVAH =
## JAVA_HOME might be used in the next three.
## They are for packages 'JavaGD' and 'rJava'
JAVA_HOME = /usr/jdk/instances/jdk1.8.0/jre
JAVA_CPPFLAGS =
JAVA_LIBS =
JAVA_LD_LIBRARY_PATH =
LAPACK_LIBS = -L"$(R_HOME)/lib$(R_ARCH)" -lRlapack
LDFLAGS = -L/usr/local/lib
## we only need this is if it is external, as otherwise link to R
LIBINTL=
LIBM = -lm
LIBR0 =
LIBR1 =
LIBR =
LIBS = -lpcre -llzma -lbz2 -lz -lnsl -lsocket -lrt -lsunmath -ldl -lm -liconv -licuuc -licui18n
## needed by R CMD config
LIBnn = lib
LIBTOOL = $(SHELL) "$(R_HOME)/bin/libtool"
LTO =
## needed to build applications linking to static libR
MAIN_LD = $(CC)
MAIN_LDFLAGS = -fopenmp
MAIN_LINK = $(MAIN_LD) $(MAIN_LDFLAGS) $(LDFLAGS)
MKINSTALLDIRS = "$(R_HOME)/bin/mkinstalldirs"
OBJC =
OBJCFLAGS = $(LTO)
OBJC_LIBS =
OBJCXX =
R_ARCH =
RANLIB = ranlib
SAFE_FFLAGS = -g -O2
SED = /usr/xpg4/bin/sed
SHELL = /bin/sh
SHLIB_CFLAGS =
SHLIB_CXXFLAGS =
SHLIB_CXXLD = $(CXX)
SHLIB_CXXLDFLAGS = -shared
SHLIB_CXX98LD = $(CXX98) $(CXX98STD)
SHLIB_CXX98LDFLAGS = -shared
SHLIB_CXX11LD = $(CXX11) $(CXX11STD)
SHLIB_CXX11LDFLAGS = -shared
SHLIB_CXX14LD = $(CXX14) $(CXX14STD)
SHLIB_CXX14LDFLAGS = -shared
SHLIB_CXX17LD = $(CXX17) $(CXX17STD)
SHLIB_CXX17LDFLAGS = -shared
SHLIB_EXT = .so
SHLIB_FFLAGS =
SHLIB_LD = $(CC)
SHLIB_LDFLAGS = -shared# $(CFLAGS) $(CPICFLAGS)
SHLIB_LIBADD =
## We want to ensure libR is picked up from $(R_HOME)/lib
## before e.g. /usr/local/lib if a version is already installed.
SHLIB_LINK = $(SHLIB_LD) $(SHLIB_LDFLAGS) $(LIBR0) $(LDFLAGS)
SHLIB_OPENMP_CFLAGS = -fopenmp
SHLIB_OPENMP_CXXFLAGS =
SHLIB_OPENMP_FFLAGS = -fopenmp
STRIP_STATIC_LIB =
STRIP_SHARED_LIB =
TCLTK_CPPFLAGS = -I/usr/include
TCLTK_LIBS =
YACC = yacc
## Legacy settings: no longer used by R as of 3.6.0
## Setting FC often sets F77 (on Solaris make even if set)
## so must follow FC in this file.
F77 = gfortran
FCPICFLAGS = -fPIC
F77_VISIBILITY = -fvisibility=hidden
SHLIB_FCLD = $(FC)
SHLIB_FCLDFLAGS = -shared
SHLIB_OPENMP_FCFLAGS = -fopenmp
## for linking to libR.a
STATIC_LIBR = # "$(R_HOME)/lib$(R_ARCH)/libR.a" $(BLAS_LIBS) $(FLIBS) $(LIBINTL) -lreadline -lncurses $(LIBS)
## These are recorded as macros for legacy use in packages
## set on AIX, formerly for old glibc (-D__NO_MATH_INLINES)
R_XTRA_CFLAGS =
## was formerly set on HP-UX
R_XTRA_CPPFLAGS = -I"$(R_INCLUDE_DIR)" -DNDEBUG
## currently unset
R_XTRA_CXXFLAGS =
## used for gfortran in R > 3.6.0
R_XTRA_FFLAGS =
## SHLIB_CFLAGS SHLIB_CXXFLAGS SHLIB_FFLAGS are apparently currently unused
## SHLIB_CXXFLAGS is undocumented, there is no SHLIB_FCFLAGS
ALL_CFLAGS = $(PKG_CFLAGS) $(CPICFLAGS) $(SHLIB_CFLAGS) $(CFLAGS)
ALL_CPPFLAGS = -I"$(R_INCLUDE_DIR)" -DNDEBUG $(PKG_CPPFLAGS) $(CLINK_CPPFLAGS) $(CPPFLAGS)
ALL_CXXFLAGS = $(PKG_CXXFLAGS) $(CXXPICFLAGS) $(SHLIB_CXXFLAGS) $(CXXFLAGS)
ALL_OBJCFLAGS = $(PKG_OBJCFLAGS) $(CPICFLAGS) $(SHLIB_CFLAGS) $(OBJCFLAGS)
ALL_OBJCXXFLAGS = $(PKG_OBJCXXFLAGS) $(CXXPICFLAGS) $(SHLIB_CXXFLAGS) $(OBJCXXFLAGS)
ALL_FFLAGS = $(PKG_FFLAGS) $(FPICFLAGS) $(SHLIB_FFLAGS) $(FFLAGS)
## can be overridden by R CMD SHLIB
P_FCFLAGS = $(PKG_FFLAGS)
ALL_FCFLAGS = $(P_FCFLAGS) $(FPICFLAGS) $(SHLIB_FFLAGS) $(FCFLAGS)
## LIBR here as a couple of packages use this without SHLIB_LINK
ALL_LIBS = $(PKG_LIBS) $(SHLIB_LIBADD) $(LIBR)# $(LIBINTL)
.SUFFIXES:
.SUFFIXES: .c .cc .cpp .d .f .f90 .f95 .m .mm .M .o
.c.o:
$(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c $< -o $#
.c.d:
#echo "making $# from $<"
#$(CC) -MM $(ALL_CPPFLAGS) $< > $#
.m.d:
#echo > $#
.cc.o:
$(CXX) $(ALL_CPPFLAGS) $(ALL_CXXFLAGS) -c $< -o $#
.cpp.o:
$(CXX) $(ALL_CPPFLAGS) $(ALL_CXXFLAGS) -c $< -o $#
.cc.d:
#echo > $#
.cpp.d:
#echo > $#
.m.o:
$(OBJC) $(ALL_CPPFLAGS) $(ALL_OBJCFLAGS) -c $< -o $#
.mm.o:
$(OBJCXX) $(ALL_CPPFLAGS) $(ALL_OBJCXXFLAGS) -c $< -o $#
.M.o:
$(OBJCXX) $(ALL_CPPFLAGS) $(ALL_OBJCXXFLAGS) -c $< -o $#
.f.o:
$(FC) $(ALL_FFLAGS) -c $< -o $#
## #FCFLAGS_f9x# are flags needed to recognise the extensions
.f95.o:
$(FC) $(ALL_FCFLAGS) -c $< -o $#
.f90.o:
$(FC) $(ALL_FCFLAGS) -c $< -o $#
Let's look at some parts of the posted Makeconf file:
CC = gcc -std=gnu99
CFLAGS = -g -O2 $(LTO)
CPICFLAGS = -fPIC
CPPFLAGS = -I/usr/local/include
This part dealing with C looks fine.
CXX = /opt/csw/gcc4/bin
CXXCPP = /lib/cpp
CXXFLAGS = $(LTO)
CXXPICFLAGS = -KPIC
The value of CXX must be the executable for the C++ compiler, optionally with full path if it is not in $PATH. For example, I have
CXX = g++ -std=gnu++11
(Note that C++11 is the default nowadays.)
For CXXFLAGS you should add optimization. A good starting point could be
CXXFLAGS = -g -O2 $(LTO)
Finally CXXPICFLAGS is wrong for your compiler. -fpic should work.
Assuming you are using the same compiler for all C++ versions, the CXXnn* variables are straightforward:
CXXnn gets the compiler (without any additional flags)
CXXnnFLAGS and CXXnnPICFLAGS is the same as CXXFLAGS and CXXPICFLAGS
CXXnnSTD gets the compiler flags necessary to activate that particular standard, e.g. CXX98STD = -std=gnu++98 or CXX11STD = -std=gnu++11
Leave all fields empty, if your compiler does not support the standard version, e.g. gcc v4 does not support C++17, and C++14 might be only partial as "C++1y"

error: C compiler cannot create executables

I am trying to install Rcplex in R on a macbook and I'm following the instruction at this link http://jrzubizarreta.com/INSTALL.
On terminal, in the folder where the unzipped Rcplex directory is, I typed
cd /Library/Frameworks/R.framework/Versions/3.4/Resources/library
R CMD INSTALL --configure-args="PKG_CFLAGS='-m64 -fPIC' PKG_CPPFLAGS=-
I/Applications/CPLEX_Studio_Community129/cplex/include PKG_LIBS='-
l/Applications/CPLEX_Studio_Community129/cplex/examples/x86-64_osx/static_pic
-m64 -lm -lpthread -framework CoreFoundation -framework IOKit'" Rcplex
as by instructions. However, I get the following error:
configure: error: Could not link CPLEX library using -
L/Applications/CPLEX_Studio_Community129/cplex/examples/x86-64_osx/static_pic
-m64 -lm -lpthread -framework CoreFoundation -framework IOKit
The error persist if I use the sudo option before R CMD INSTALL [...].
The config.log states:
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by Rcplex configure 0.3.2, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ ./configure PKG_CFLAGS=-m64 -fPIC PKG_CPPFLAGS=-I/Applications/CPLEX_Studio_Community129/cplex/include PKG_LIBS=-L/Applications/CPLEX_Studio_Community129/cplex/examples/x86-64_osx/static_pic -m64 -lm -lpthread -framework CoreFoundation -framework IOKit
## --------- ##
## Platform. ##
## --------- ##
hostname = Michele.local
uname -m = x86_64
uname -r = 16.7.0
uname -s = Darwin
uname -v = Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64
/usr/bin/uname -p = i386
/bin/uname -X = unknown
/bin/arch = unknown
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
hostinfo = Mach kernel version:
Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64
Kernel configured for up to 4 processors.
2 processors are physically available.
4 processors are logically available.
Processor type: x86_64h (Intel x86-64h Haswell)
Processors active: 0 1 2 3
Primary memory available: 16.00 gigabytes
Default processor set: 365 tasks, 1663 threads, 4 processors
Load average: 2.45, Mach factor: 1.68
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown
PATH: /Users/ssandrews/anaconda/bin
PATH: /Library/Frameworks/Python.framework/Versions/2.7/bin
PATH: /Users/ssandrews/anaconda/bin
PATH: /Library/Frameworks/Python.framework/Versions/3.5/bin
PATH: /usr/local/bin
PATH: /usr/bin
PATH: /bin
PATH: /usr/sbin
PATH: /sbin
PATH: /opt/X11/bin
PATH: /Library/TeX/texbin
## ----------- ##
## Core tests. ##
## ----------- ##
configure:1631: checking for gcc
configure:1657: result: clang
configure:1901: checking for C compiler version
configure:1904: clang --version </dev/null >&5
Apple LLVM version 7.0.0 (clang-700.0.72)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
configure:1907: $? = 0
configure:1909: clang -v </dev/null >&5
Apple LLVM version 7.0.0 (clang-700.0.72)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
configure:1912: $? = 0
configure:1914: clang -V </dev/null >&5
clang: error: argument to '-V' is missing (expected 1 value)
clang: error: no input files
configure:1917: $? = 1
configure:1940: checking for C compiler default output file name
configure:1943: clang -Wall -g -O2 -I/usr/local/include conftest.c >&5
configure:1946: $? = 0
configure:1992: result: a.out
configure:1997: checking whether the C compiler works
configure:2003: ./a.out
configure:2006: $? = 0
configure:2023: result: yes
configure:2030: checking whether we are cross compiling
configure:2032: result: no
configure:2035: checking for suffix of executables
configure:2037: clang -o conftest -Wall -g -O2 -I/usr/local/include conftest.c >&5
configure:2040: $? = 0
configure:2065: result:
configure:2071: checking for suffix of object files
configure:2092: clang -c -Wall -g -O2 -I/usr/local/include conftest.c >&5
configure:2095: $? = 0
configure:2117: result: o
configure:2121: checking whether we are using the GNU C compiler
configure:2145: clang -c -Wall -g -O2 -I/usr/local/include conftest.c >&5
configure:2151: $? = 0
configure:2155: test -z
|| test ! -s conftest.err
configure:2158: $? = 0
configure:2161: test -s conftest.o
configure:2164: $? = 0
configure:2177: result: yes
configure:2183: checking whether clang accepts -g
configure:2204: clang -c -g -I/usr/local/include conftest.c >&5
configure:2210: $? = 0
configure:2214: test -z
|| test ! -s conftest.err
configure:2217: $? = 0
configure:2220: test -s conftest.o
configure:2223: $? = 0
configure:2234: result: yes
configure:2251: checking for clang option to accept ANSI C
configure:2321: clang -c -Wall -g -O2 -I/usr/local/include conftest.c >&5
configure:2327: $? = 0
configure:2331: test -z
|| test ! -s conftest.err
configure:2334: $? = 0
configure:2337: test -s conftest.o
configure:2340: $? = 0
configure:2358: result: none needed
configure:2376: clang -c -Wall -g -O2 -I/usr/local/include conftest.c >&5
conftest.c:2:3: error: unknown type name 'choke'
choke me
^
conftest.c:2:11: error: expected ';' after top level declarator
choke me
^
;
2 errors generated.
configure:2382: $? = 1
configure: failed program was:
| #ifndef __cplusplus
| choke me
| #endif
configure:2520: checking how to run the C preprocessor
configure:2638: result: clang -E
configure:2662: clang -E -I/usr/local/include conftest.c
configure:2668: $? = 0
configure:2700: clang -E -I/usr/local/include conftest.c
conftest.c:9:10: fatal error: 'ac_nonexistent.h' file not found
#include <ac_nonexistent.h>
^
1 error generated.
configure:2706: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "Rcplex"
| #define PACKAGE_TARNAME "rcplex"
| #define PACKAGE_VERSION "0.3.2"
| #define PACKAGE_STRING "Rcplex 0.3.2"
| #define PACKAGE_BUGREPORT ""
| /* end confdefs.h. */
| #include <ac_nonexistent.h>
configure:2756: checking for egrep
configure:2766: result: grep -E
configure:2771: checking for ANSI C header files
configure:2796: clang -c -Wall -g -O2 -m64 -fPIC -I/usr/local/include -I/Applications/CPLEX_Studio_Community129/cplex/include conftest.c >&5
configure:2802: $? = 0
configure:2806: test -z
|| test ! -s conftest.err
configure:2809: $? = 0
configure:2812: test -s conftest.o
configure:2815: $? = 0
configure:2904: clang -o conftest -Wall -g -O2 -m64 -fPIC -I/usr/local/include -I/Applications/CPLEX_Studio_Community129/cplex/include conftest.c -L/Applications/CPLEX_Studio_Community129/cplex/examples/x86-64_osx/static_pic -m64 -lm -lpthread -framework CoreFoundation -framework IOKit >&5
conftest.c:26:7: warning: implicitly declaring library function 'exit' with type 'void (int) __attribute__((noreturn))'
exit(2);
^
conftest.c:26:7: note: include the header <stdlib.h> or explicitly provide a declaration for 'exit'
1 warning generated.
configure:2907: $? = 0
configure:2909: ./conftest
configure:2912: $? = 0
configure:2927: result: yes
configure:2951: checking for sys/types.h
configure:2967: clang -c -Wall -g -O2 -m64 -fPIC -I/usr/local/include -I/Applications/CPLEX_Studio_Community129/cplex/include conftest.c >&5
configure:2973: $? = 0
configure:2977: test -z
|| test ! -s conftest.err
configure:2980: $? = 0
configure:2983: test -s conftest.o
configure:2986: $? = 0
configure:2997: result: yes
configure:2951: checking for sys/stat.h
configure:2967: clang -c -Wall -g -O2 -m64 -fPIC -I/usr/local/include -I/Applications/CPLEX_Studio_Community129/cplex/include conftest.c >&5
configure:2973: $? = 0
configure:2977: test -z
|| test ! -s conftest.err
configure:2980: $? = 0
configure:2983: test -s conftest.o
configure:2986: $? = 0
configure:2997: result: yes
configure:2951: checking for stdlib.h
configure:2967: clang -c -Wall -g -O2 -m64 -fPIC -I/usr/local/include -I/Applications/CPLEX_Studio_Community129/cplex/include conftest.c >&5
configure:2973: $? = 0
configure:2977: test -z
|| test ! -s conftest.err
configure:2980: $? = 0
configure:2983: test -s conftest.o
configure:2986: $? = 0
configure:2997: result: yes
configure:2951: checking for string.h
configure:2967: clang -c -Wall -g -O2 -m64 -fPIC -I/usr/local/include -I/Applications/CPLEX_Studio_Community129/cplex/include conftest.c >&5
configure:2973: $? = 0
configure:2977: test -z
|| test ! -s conftest.err
configure:2980: $? = 0
configure:2983: test -s conftest.o
configure:2986: $? = 0
configure:2997: result: yes
configure:2951: checking for memory.h
configure:2967: clang -c -Wall -g -O2 -m64 -fPIC -I/usr/local/include -I/Applications/CPLEX_Studio_Community129/cplex/include conftest.c >&5
configure:2973: $? = 0
configure:2977: test -z
|| test ! -s conftest.err
configure:2980: $? = 0
configure:2983: test -s conftest.o
configure:2986: $? = 0
configure:2997: result: yes
configure:2951: checking for strings.h
configure:2967: clang -c -Wall -g -O2 -m64 -fPIC -I/usr/local/include -I/Applications/CPLEX_Studio_Community129/cplex/include conftest.c >&5
configure:2973: $? = 0
configure:2977: test -z
|| test ! -s conftest.err
configure:2980: $? = 0
configure:2983: test -s conftest.o
configure:2986: $? = 0
configure:2997: result: yes
configure:2951: checking for inttypes.h
configure:2967: clang -c -Wall -g -O2 -m64 -fPIC -I/usr/local/include -I/Applications/CPLEX_Studio_Community129/cplex/include conftest.c >&5
configure:2973: $? = 0
configure:2977: test -z
|| test ! -s conftest.err
configure:2980: $? = 0
configure:2983: test -s conftest.o
configure:2986: $? = 0
configure:2997: result: yes
configure:2951: checking for stdint.h
configure:2967: clang -c -Wall -g -O2 -m64 -fPIC -I/usr/local/include -I/Applications/CPLEX_Studio_Community129/cplex/include conftest.c >&5
configure:2973: $? = 0
configure:2977: test -z
|| test ! -s conftest.err
configure:2980: $? = 0
configure:2983: test -s conftest.o
configure:2986: $? = 0
configure:2997: result: yes
configure:2951: checking for unistd.h
configure:2967: clang -c -Wall -g -O2 -m64 -fPIC -I/usr/local/include -I/Applications/CPLEX_Studio_Community129/cplex/include conftest.c >&5
configure:2973: $? = 0
configure:2977: test -z
|| test ! -s conftest.err
configure:2980: $? = 0
configure:2983: test -s conftest.o
configure:2986: $? = 0
configure:2997: result: yes
configure:3019: checking ilcplex/cplex.h usability
configure:3031: clang -c -Wall -g -O2 -m64 -fPIC -I/usr/local/include -I/Applications/CPLEX_Studio_Community129/cplex/include conftest.c >&5
configure:3037: $? = 0
configure:3041: test -z
|| test ! -s conftest.err
configure:3044: $? = 0
configure:3047: test -s conftest.o
configure:3050: $? = 0
configure:3060: result: yes
configure:3064: checking ilcplex/cplex.h presence
configure:3074: clang -E -I/usr/local/include -I/Applications/CPLEX_Studio_Community129/cplex/include conftest.c
configure:3080: $? = 0
configure:3100: result: yes
configure:3135: checking for ilcplex/cplex.h
configure:3142: result: yes
configure:3154: checking for library containing CPXversion
configure:3184: clang -o conftest -Wall -g -O2 -m64 -fPIC -I/usr/local/include -I/Applications/CPLEX_Studio_Community129/cplex/include conftest.c -L/Applications/CPLEX_Studio_Community129/cplex/examples/x86-64_osx/static_pic -m64 -lm -lpthread -framework CoreFoundation -framework IOKit >&5
Undefined symbols for architecture x86_64:
"_CPXversion", referenced from:
_main in conftest-074e04.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
configure:3190: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "Rcplex"
| #define PACKAGE_TARNAME "rcplex"
| #define PACKAGE_VERSION "0.3.2"
| #define PACKAGE_STRING "Rcplex 0.3.2"
| #define PACKAGE_BUGREPORT ""
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| /* end confdefs.h. */
|
| /* Override any gcc2 internal prototype to avoid an error. */
| #ifdef __cplusplus
| extern "C"
| #endif
| /* We use char because int might match the return type of a gcc2
| builtin and then its argument prototype would still apply. */
| char CPXversion ();
| int
| main ()
| {
| CPXversion ();
| ;
| return 0;
| }
configure:3239: clang -o conftest -Wall -g -O2 -m64 -fPIC -I/usr/local/include -I/Applications/CPLEX_Studio_Community129/cplex/include conftest.c -lcplex -L/Applications/CPLEX_Studio_Community129/cplex/examples/x86-64_osx/static_pic -m64 -lm -lpthread -framework CoreFoundation -framework IOKit >&5
ld: library not found for -lcplex
clang: error: linker command failed with exit code 1 (use -v to see invocation)
configure:3245: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME "Rcplex"
| #define PACKAGE_TARNAME "rcplex"
| #define PACKAGE_VERSION "0.3.2"
| #define PACKAGE_STRING "Rcplex 0.3.2"
| #define PACKAGE_BUGREPORT ""
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| /* end confdefs.h. */
|
| /* Override any gcc2 internal prototype to avoid an error. */
| #ifdef __cplusplus
| extern "C"
| #endif
| /* We use char because int might match the return type of a gcc2
| builtin and then its argument prototype would still apply. */
| char CPXversion ();
| int
| main ()
| {
| CPXversion ();
| ;
| return 0;
| }
configure:3273: result: no
configure:3279: error: Could not link CPLEX library using -L/Applications/CPLEX_Studio_Community129/cplex/examples/x86-64_osx/static_pic -m64 -lm -lpthread -framework CoreFoundation -framework IOKit
## ---------------- ##
## Cache variables. ##
## ---------------- ##
ac_cv_c_compiler_gnu=yes
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_exeext=
ac_cv_header_ilcplex_cplex_h=yes
ac_cv_header_inttypes_h=yes
ac_cv_header_memory_h=yes
ac_cv_header_stdc=yes
ac_cv_header_stdint_h=yes
ac_cv_header_stdlib_h=yes
ac_cv_header_string_h=yes
ac_cv_header_strings_h=yes
ac_cv_header_sys_stat_h=yes
ac_cv_header_sys_types_h=yes
ac_cv_header_unistd_h=yes
ac_cv_objext=o
ac_cv_prog_CPP='clang -E'
ac_cv_prog_ac_ct_CC=clang
ac_cv_prog_cc_g=yes
ac_cv_prog_cc_stdc=
ac_cv_prog_egrep='grep -E'
ac_cv_search_CPXversion=no
## ----------------- ##
## Output variables. ##
## ----------------- ##
AWK=''
CC='clang'
CFLAGS='-Wall -g -O2 -m64 -fPIC'
CPLEX_BIN=''
CPP='clang -E'
CPPFLAGS='-I/usr/local/include -I/Applications/CPLEX_Studio_Community129/cplex/include'
DEFS=''
ECHO_C='ECHO_N=''
ECHO_T=''
EGREP='grep -E'
EXEEXT=''
LDFLAGS=''
LIBOBJS=''
LIBS='-L/Applications/CPLEX_Studio_Community129/cplex/examples/x86-64_osx/static_pic -m64 -lm -lpthread -framework CoreFoundation -framework IOKit'
LTLIBOBJS=''
OBJEXT='o'
PACKAGE_BUGREPORT=''
PACKAGE_NAME='Rcplex'
PACKAGE_STRING='Rcplex 0.3.2'
PACKAGE_TARNAME='rcplex'
PACKAGE_VERSION='0.3.2'
PATH_SEPARATOR=':'
PKG_CFLAGS='-m64 -fPIC'
PKG_CPPFLAGS='-I/Applications/CPLEX_Studio_Community129/cplex/include'
PKG_LIBS='-L/Applications/CPLEX_Studio_Community129/cplex/examples/x86-64_osx/static_pic -m64 -lm -lpthread -framework CoreFoundation -framework IOKit'
SHELL='/bin/sh'
ac_ct_CC='clang'
bindir='${exec_prefix}/bin'
build_alias=''
datadir='${prefix}/share'
exec_prefix='NONE'
host_alias=''
includedir='${prefix}/include'
infodir='${prefix}/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localstatedir='${prefix}/var'
mandir='${prefix}/man'
oldincludedir='/usr/include'
prefix='NONE'
program_transform_name='s,x,x,'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''
## ----------- ##
## confdefs.h. ##
## ----------- ##
#define HAVE_INTTYPES_H 1
#define HAVE_MEMORY_H 1
#define HAVE_STDINT_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRINGS_H 1
#define HAVE_STRING_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_UNISTD_H 1
#define PACKAGE_BUGREPORT ""
#define PACKAGE_NAME "Rcplex"
#define PACKAGE_STRING "Rcplex 0.3.2"
#define PACKAGE_TARNAME "rcplex"
#define PACKAGE_VERSION "0.3.2"
#define STDC_HEADERS 1
configure: exit 1
The makefile carries the following information:
SYSTEM = x86-64_osx
LIBFORMAT = static_pic
#------------------------------------------------------------
#
# When you adapt this makefile to compile your CPLEX programs
# please copy this makefile and set CPLEXDIR and CONCERTDIR to
# the directories where CPLEX and CONCERT are installed.
#
#------------------------------------------------------------
CPLEXDIR = ../../..
CONCERTDIR = ../../../../concert
# ---------------------------------------------------------------------
# Compiler selection
# ---------------------------------------------------------------------
CCC = clang++ -O0
CC = clang -O0
JAVAC = javac
# ---------------------------------------------------------------------
# Compiler options
# ---------------------------------------------------------------------
CCOPT = -m64 -O -fPIC -fexceptions -DNDEBUG -DIL_STD -stdlib=libc++
COPT = -m64 -fPIC
JOPT = -classpath $(CPLEXDIR)/lib/cplex.jar -O
# ---------------------------------------------------------------------
# Link options and libraries
# ---------------------------------------------------------------------
CPLEXBINDIR = $(CPLEXDIR)/bin/$(BINDIST)
CPLEXJARDIR = $(CPLEXDIR)/lib/cplex.jar
CPLEXLIBDIR = $(CPLEXDIR)/lib/$(SYSTEM)/$(LIBFORMAT)
CONCERTLIBDIR = $(CONCERTDIR)/lib/$(SYSTEM)/$(LIBFORMAT)
# For dynamic linking
CPLEXBINDIR = $(CPLEXDIR)/bin/$(SYSTEM)
CPLEXLIB = cplex$(dynamic:yes=1290)
run = $(dynamic:yes=DYLD_LIBRARY_PATH=$(CPLEXBINDIR))
CCLNDIRS = -L$(CPLEXLIBDIR) -L$(CONCERTLIBDIR) $(dynamic:yes=-L$(CPLEXBINDIR))
CLNDIRS = -L$(CPLEXLIBDIR) $(dynamic:yes=-L$(CPLEXBINDIR))
CCLNFLAGS = -lconcert -lilocplex -l$(CPLEXLIB) -m64 -lm -lpthread -framework CoreFoundation -framework IOKit -stdlib=libc++
CLNFLAGS = -l$(CPLEXLIB) -m64 -lm -lpthread -framework CoreFoundation -framework IOKit
JAVA = java -d64 -Djava.library.path=$(CPLEXDIR)/bin/x86-64_osx -classpath $(CPLEXJARDIR):
all:
make all_c
make all_cpp
make all_java
execute: all
make execute_c
make execute_cpp
make execute_java
CONCERTINCDIR = $(CONCERTDIR)/include
CPLEXINCDIR = $(CPLEXDIR)/include
EXDIR = $(CPLEXDIR)/examples
EXINC = $(EXDIR)/include
EXDATA = $(EXDIR)/data
EXSRCC = $(EXDIR)/src/c
EXSRCCX = $(EXDIR)/src/c_x
EXSRCCPP = $(EXDIR)/src/cpp
EXSRCJAVA = $(EXDIR)/src/java
CFLAGS = $(COPT) -I$(CPLEXINCDIR)
CCFLAGS = $(CCOPT) -I$(CPLEXINCDIR) -I$(CONCERTINCDIR)
JCFLAGS = $(JOPT)
Any idea on how to fix this issue? Thank you
It says
error: unable to open output file '/Volumes/Andrews/R working
Could it be that the blank in the file/folder name causes trouble? Try to install into a path that does not have blanks in its name. And make sure that path exists and you have write permissions for it.
Update after question was updated with new error message: Now the error is this:
error: Could not link CPLEX library using -L/Applications/CPLEX_Studio_Community129/cplex/examples/x86-64_osx/static_pic -m64 -lm -lpthread -framework CoreFoundation -framework IOKit
This is the wrong path. The CPLEX libraries are not in examples/x86-64_osx/static_pic but are either in bin/x86-64_osx (dynamic library) or in lib/x86-64_osx/static_pic (static library). I don't know which of the two libraries is required, so just put both pathes into the configuration arguments (including the absolute path to your installation, of course). I am not sure whether you also have to put -lcplex or -lcplex129 (depending on whether the static or the dynamic library is required). So if you get the same error without putting these arguments, then try with them.

Setting up Rcpp GSL for windows

I am trying to set up Rcpp GSL for windows.. I read lot of post on the subject, but I have been unable to find a solution for a while now.. Sorry in advance..
So I am running R 3.1 on windows 8.1. Both Rcpp and Rcpp Armadillo are working fine..
R version 3.1.0 (2014-04-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252 LC_NUMERIC=C LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] RcppGSL_0.2.0 RcppArmadillo_0.4.300.0 Rcpp_0.11.1 foreign_0.8-61
loaded via a namespace (and not attached):
[1] tools_3.1.0
1) I made sure that there is no space in the R directory
2) I installed gnuwin32
3) I changed my Makevars.win
PKG_CPPFLAGS=-I$(LIB_GSL=C:/GnuWin32)/include -I../inst/include
PKG_LIBS=-L$(LIB_GSL=C:/GnuWin32)/lib -lgsl -lgslcblas $(shell "${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" -e "Rcpp:::LdFlags()")
4) Here is my Makeconf, but let's be honest here.. I have no idea what this is saying
#-*- Makefile -*-
# $(R_HOME}/etc$(R_ARCH)/Makeconf
# Hand-edited version for gnuwin32.
ifdef DEBUG
DLLFLAGS=
DEBUGFLAG=-gdwarf-2
else
DLLFLAGS=-s
DEBUGFLAG=
endif
DLLFLAGS+= -static-libgcc
LINKFLAGS+= -static-libgcc
## Things which are substituted by fixed/Makefile (and also -O2 -> -O2)
WIN = 64
BINPREF =
# SYMPAT = 's/^.* [BCDRT] _/ /p' for 32-bit
# SYMPAT = 's/^.* [BCDRT] / /p' for 64-bit
SYMPAT = 's/^.* [BCDRT] / /p'
IMPDIR = bin/x64
# flags for multilib builds, for compilers, dlltool and windres
M_ARCH = -m64
DT_ARCH = -m i386:x86-64 --as-flags --64
RC_ARCH = -F pe-x86-64
# Used by packages tcltk and tkrplot
TCL_HOME = $(R_HOME)/Tcl
LOCAL_SOFT = d:/RCompile/CRANpkg/extralibs64/local
ifneq ($(strip $(LOCAL_SOFT)),)
LOCAL_CPPFLAGS = -I"$(LOCAL_SOFT)/include"
LOCAL_LIBS = -L"$(LOCAL_SOFT)/lib$(R_ARCH)" -L"$(LOCAL_SOFT)/lib"
endif
DLLTOOL = $(BINPREF)dlltool --as $(BINPREF)as $(DT_ARCH)
DLLTOOLFLAGS = -k
NM = $(BINPREF)nm
RESCOMP = $(BINPREF)windres $(RC_ARCH)
## MAIN_LD needs to be set by the package
LINKER = $(MAIN_LD)
## as a default
DLL = $(CC)
## Things defined in Renviron on Unix
SED = sed
TAR = tar
## Things defined in MkRules
CAT = cat
CP = cp
MKDIR = mkdir
RM = rm -f
SORT = sort
## For use in packages
GRAPHAPP_LIB = -lRgraphapp
TCL_VERSION = 85
ZLIB_LIBS = -lRzlib
AR = $(BINPREF)ar
## Used by packages 'maps' and 'mapdata'
AWK = gawk
BLAS_LIBS = -L"$(R_HOME)/$(IMPDIR)" -lRblas
C_VISIBILITY =
CC = $(BINPREF)gcc $(M_ARCH)
CFLAGS = -O2 -Wall $(DEBUGFLAG) -std=gnu99 -mtune=core2
CPICFLAGS =
CPPFLAGS =
CXX = $(BINPREF)g++ $(M_ARCH)
CXXCPP = $(CXX) -E
CXXFLAGS = -O2 -Wall $(DEBUGFLAG) -mtune=core2
CXXPICFLAGS =
CXX1X = $(BINPREF)g++ $(M_ARCH)
CXX1XFLAGS = -O2 -Wall $(DEBUGFLAG) -mtune=core2
CXX1XPICFLAGS =
CXX1XSTD = -std=c++0x
DYLIB_EXT = .dll
DYLIB_LD = $(DLL)
DYLIB_LDFLAGS = -shared
DYLIB_LINK = $(DYLIB_LD) $(DYLIB_LDFLAGS) $(LDFLAGS)
ECHO = echo
ECHO_C =
ECHO_N = -n
ECHO_T =
FC = $(BINPREF)gfortran $(M_ARCH)
FCFLAGS = -O2 $(DEBUGFLAG) -mtune=core2
# additional libs needed when linking with $(FC), e.g. on Solaris
FCLIBS =
F77 = $(BINPREF)gfortran $(M_ARCH)
F77_VISIBILITY =
FFLAGS = -O2 $(DEBUGFLAG) -mtune=core2
FLIBS = -lgfortran
FCPICFLAGS =
FPICFLAGS =
FOUNDATION_CPPFLAGS =
FOUNDATION_LIBS =
JAR =
JAVA =
JAVAC =
JAVAH =
# JAVA_HOME =
# JAVA_LD_LIBRARY_PATH =
JAVA_LIBS = -L"$(JAVA_HOME)/bin/client" -ljvm -ljvm-w32
JAVA_CPPFLAGS = -I"$(JAVA_HOME)/../include" -I"$(JAVA_HOME)/../include/win32"
LAPACK_LIBS = -L"$(R_HOME)/$(IMPDIR)" -lRlapack
## we only need this is if it is external, as otherwise link to R
LIBINTL=
LIBM = -lm
LIBR = -L"$(R_HOME)/$(IMPDIR)" -lR
LIBS = -lm
## needed by R CMD config
LIBnn = lib
LIBTOOL =
LDFLAGS =
## needed to build applications linking to static libR
# MAIN_LD =
# MAIN_LDFLAGS =
# MAIN_LINK = $(MAIN_LD) $(MAIN_LDFLAGS) $(LDFLAGS)
# don't have this: would 'mkdir -p' do?
# MKINSTALLDIRS = $(R_HOME)/bin/mkinstalldirs
## There is no ObjC support in the recommended toolchain,
## but if a toolchain had support, this it what it would be.
OBJC = $(CC)
OBJCFLAGS = -O2
OBJC_LIBS = -lobjc
OBJCXX =
R_ARCH = /x64
RANLIB = $(BINPREF)ranlib
SAFE_FFLAGS = -O2 -ffloat-store
SED = sed
## it seems some makes (but not ours) get upset if SHELL is set.
# SHELL = /bin/sh
SHLIB_CFLAGS =
SHLIB_CXXFLAGS =
SHLIB_CXXLD = $(CXX)
## ideally -shared -static-libstdc++, but not for gcc 4.2.1
SHLIB_CXXLDFLAGS = -shared
SHLIB_CXX1XLD = $(CXX1X)
SHLIB_CXX1XLDFLAGS = -shared
SHLIB_EXT = .dll
SHLIB_FCLD = $(FC)
## ideally -shared -static-libgfortran, but not for gcc 4.2.1
SHLIB_FCLDFLAGS = -shared
SHLIB_FFLAGS =
SHLIB_LD = $(CC)
SHLIB_LDFLAGS = -shared
SHLIB_LIBADD =
SHLIB_LINK = $(SHLIB_LD) -Wl,--export-all-symbols $(SHLIB_LDFLAGS) $(LDFLAGS)
SHLIB_OPENMP_CFLAGS = -fopenmp
SHLIB_OPENMP_CXXFLAGS = -fopenmp
SHLIB_OPENMP_FCFLAGS = -fopenmp
SHLIB_OPENMP_FFLAGS = -fopenmp
SHLIB_PTHREAD_FLAGS = -pthread
STRIP_LIBS = $(BINPREF)strip --strip-unneeded
STRIP_STATIC_LIBS = $(BINPREF)strip --strip-debug
TCLTK_CPPFLAGS = -I "$(TCL_HOME)/include" -DWin32
TCLTK_LIBS = -L"$(TCL_HOME)/bin64" -ltcl$(TCL_VERSION) -ltk$(TCL_VERSION)
STATIC_LIBR =
R_XTRA_CFLAGS =
R_XTRA_CPPFLAGS = -I"$(R_HOME)/include" -DNDEBUG
R_XTRA_CXXFLAGS =
R_XTRA_FFLAGS =
ALL_CFLAGS = $(R_XTRA_CFLAGS) $(PKG_CFLAGS) $(CPICFLAGS) $(SHLIB_CFLAGS) $(CFLAGS)
ALL_CPPFLAGS = $(R_XTRA_CPPFLAGS) $(PKG_CPPFLAGS) $(CPPFLAGS) $($*-CPPFLAGS) $(CLINK_CPPFLAGS) $(LOCAL_CPPFLAGS)
ALL_CXXFLAGS = $(R_XTRA_CXXFLAGS) $(PKG_CXXFLAGS) $(CXXPICFLAGS) $(SHLIB_CXXFLAGS) $(CXXFLAGS)
ALL_OBJCFLAGS = $(PKG_OBJCFLAGS) $(CPICFLAGS) $(SHLIB_CFLAGS) $(OBJCFLAGS)
ALL_OBJCXXFLAGS = $(PKG_OBJCXXFLAGS) $(CXXPICFLAGS) $(SHLIB_CXXFLAGS) $(OBJCXXFLAGS)
ALL_FFLAGS = $(R_XTRA_FFLAGS) $(PKG_FFLAGS) $(FPICFLAGS) $(SHLIB_FFLAGS) $(FFLAGS)
ALL_LIBS = $(PKG_LIBS) $(LOCAL_LIBS) $(SHLIB_LIBADD) $(LIBR) $(LIBINTL)
.SUFFIXES:
.SUFFIXES: .c .cc .cpp .d .f .f90 .f95 .m .mm .M .o .a .def .dll .exe .rc
.c.o:
$(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -c $< -o $#
.c.d:
#echo "making $# from $<"
#$(CC) -std=gnu99 -MM $(ALL_CPPFLAGS) $< > $#
.cc.o:
$(CXX) $(ALL_CPPFLAGS) $(ALL_CXXFLAGS) -c $< -o $#
.cpp.o:
$(CXX) $(ALL_CPPFLAGS) $(ALL_CXXFLAGS) -c $< -o $#
.cc.d:
#echo "making $# from $<"
#$(CXX) -M $(ALL_CPPFLAGS) $< > $#
.cpp.d:
#echo "making $# from $<"
#$(CXX) -M $(ALL_CPPFLAGS) $< > $#
.m.o:
$(OBJC) $(ALL_CPPFLAGS) $(ALL_OBJCFLAGS) -c $< -o $#
.m.d:
#echo "making $# from $<"
#$(OBJC) -MM $(ALL_CPPFLAGS) $< > $#
.mm.o:
$(OBJCXX) $(ALL_CPPFLAGS) $(ALL_OBJCXXFLAGS) -c $< -o $#
.M.o:
$(OBJCXX) $(ALL_CPPFLAGS) $(ALL_OBJCXXFLAGS) -c $< -o $#
.f.o:
$(F77) $(ALL_FFLAGS) -c $< -o $#
.f95.o:
$(FC) $(PKG_FCFLAGS) $(FCPICFLAGS) $(FCFLAGS) -c $< -o $#
.f90.o:
$(FC) $(PKG_FCFLAGS) $(FCPICFLAGS) $(FCFLAGS) -c $< -o $#
%.exe:
$(LINKER) $(LINKFLAGS) $($*-LINKFLAGS) -o $# $^ $($*-LIBS) $(LOCAL_LIBS) $(LIBS)
%.dll:
#echo EXPORTS > $*.def
#$(NM) $^ | $(SED) -n $(SYMPAT) >> $*.def
$(SHLIB_LD) -shared $(DLLFLAGS) -o $# $*.def $^ $(ALL_LIBS)
#$(RM) $*.def
lib%.dll.a: %.def
$(DLLTOOL) $(DLLTOOLFLAGS) $($*-DLLTOOLFLAGS) --dllname $*.dll --input-def $*.def --output-lib $#
%.a:
#$(RM) $#
$(AR) crs $# $^
%.o: %.rc
$(RESCOMP) $(RESFLAGS) -i $< -o $#
5) I am just trying to reproduce the example in the GSL vignette
#include <RcppGSL.h>
#include <gsl/gsl_matrix.h>
#include <gsl/gsl_blas.h>
extern "C" SEXP colNorm(SEXP sM) {
try {
RcppGSL::matrix<double> M = sM; // create gsl data structures from SEXP
int k = M.ncol();
Rcpp::NumericVector n(k); // to store results
for (int j = 0; j < k; j++) {
RcppGSL::vector_view<double> colview = gsl_matrix_column (M, j);
n[j] = gsl_blas_dnrm2(colview);
}
M.free() ;
return n; // return vector
} catch( std::exception &ex ) {
forward_exception_to_r( ex );
} catch(...) {
::Rf_error( "c++ exception (unknown reason)" );
}
return R_NilValue; // -Wall
}
and I get this error
sourceCpp("gsltest.cpp")
g++ -m64 -I"C:/R/R-31~1.0/include" -DNDEBUG -I"C:/R/R-3.1.0/library/Rcpp/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall -mtune=core2 -c gsltest.cpp -o gsltest.o gsltest.cpp:1:21: fatal error: RcppGSL.h: No such file or directory compilation terminated. make: *** [gsltest.o] Error 1 Warning message: running command 'make -f "C:/R/R-31~1.0/etc/x64/Makeconf" -f "C:/R/R-31~1.0/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="sourceCpp_15178.dll" WIN=64 TCLBIN=64 OBJECTS="gsltest.o"' had status 2
Error in sourceCpp("gsltest.cpp") :
Error 1 occurred building shared library.
Thanks a lot..
For Windows users with the same problem, you need to follow these steps:
Install R, making sure there are no spaces in the path;
Install Rtools;
Download file local300.zip as suggested by Dirk. And unzip it in the R directory;
Edit the path (e.g. following general instructions shown here http://www.computerhope.com/issues/ch000549.htm) to add the link the directory of local300 as LIB_GSL
Edit your Makevars.win, and you are ready to go
PKG_CPPFLAGS=-I$(LIB_GSL)/include -I../inst/include
PKG_LIBS=-L$(LIB_GSL)/lib/x64 -lgsl -lgslcblas
When you use sourceCpp, if the RcppGSL package does a good job of defining its inline plugin, you need to add to pull in headers, etc ...
// [[Rcpp::depends(RcppGSL)]]
The clue is in what sourceCpp gives you, this below is an extract of what you posted:
g++ -m64 -I"C:/R/R-31~1.0/include" -DNDEBUG
-I"C:/R/R-3.1.0/library/Rcpp/include"
-I"d:/RCompile/CRANpkg/extralibs64/local/include"
-O2 -Wall -mtune=core2 -c gsltest.cpp -o gsltest.o
gsltest.cpp:1:21: fatal error: RcppGSL.h: No such file or directory
If it is too hard to locally build GSL, note that you can also download the actual prebuilt GSL library which CRAN itself uses from this page -- you want the (large-ish) file local300.zip.
It should then should be a matter of adjusting the ennvironment variable LIB_GSL used here:
edd#max:~$ cat svn/rcpp/pkg/RcppGSL/src/Makevars.win
## This assumes that the LIB_GSL variable points to working GSL libraries
PKG_CPPFLAGS=-I$(LIB_GSL)/include -I../inst/include
PKG_LIBS=-L$(LIB_GSL)/lib -lgsl -lgslcblas
edd#max:~$
where I have removed the now-redundant invocation of Rscript for the Rcpp library we no longer need.

Cannot install network-2.4.0.1 with cabal-install 1.11.0

I can't install a bunch of different things with cabal because they depend on network-2.4.0.1 which fails to install with:
Preprocessing library network-2.4.0.1...
Socket.hsc: In function ‘main’:
Socket.hsc:1054: error: invalid application of ‘sizeof’ to incomplete type ‘struct ucred’
Socket.hsc:1054: error: invalid application of ‘sizeof’ to incomplete type ‘struct ucred’
Socket.hsc:1054: error: invalid application of ‘sizeof’ to incomplete type ‘struct ucred’
Socket.hsc:1060: error: invalid use of undefined type ‘struct ucred’
Socket.hsc:1061: error: invalid use of undefined type ‘struct ucred’
Socket.hsc:1062: error: invalid use of undefined type ‘struct ucred’
compiling dist/build/Network/Socket_hsc_make.c failed (exit code 1)
Any clues on how to proceed? (Am using Haskell Platform 2012.2.0.0 on Ubuntu 10.04).
Some googling revealed this is an issue with cabal-install-1.11 but attempts to update that
are stymied by the dependency on ... network-2.4.0.1 !
Per #Yuras# suggestion, here's the output of cabal -v install network near the configure section:
checking for struct msghdr.msg_control... yes
checking for struct msghdr.msg_accrights... no
checking for struct sockaddr.sa_len... no
checking for in_addr_t in netinet/in.h... yes
checking for SO_PEERCRED and struct ucred in sys/socket.h... yes
checking for _head_libws2_32_a in -lws2_32... no
checking for getaddrinfo... yes
checking for gai_strerror... yes
checking whether AI_ADDRCONFIG is declared... yes
checking whether AI_ALL is declared... yes
checking whether AI_NUMERICSERV is declared... yes
checking whether AI_V4MAPPED is declared... yes
checking whether IPV6_V6ONLY is declared... yes
checking for sendfile in sys/sendfile.h... yes
checking for sendfile in sys/socket.h... no
checking for gethostent... yes
checking for accept4... yes
configure: creating ./config.status
Here's more information from the config.log. First the Output Variables
CFLAGS='-D_GNU_SOURCE -Wl,--hash-size=31 -Wl,--reduce-memory-overheads'
EXTRA_CPPFLAGS='-D_GNU_SOURCE'
and here's the bit about PEERCRED
configure:4301: checking for SO_PEERCRED and struct ucred in sys/socket.h
configure:4329: gcc -c -Wl,--hash-size=31 -Wl,--reduce-memory-overheads conftest.c >&5
conftest.c:39: error: storage size of 'u' isn't known
configure:4335: $? = 1
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "Haskell network package"
| #define PACKAGE_TARNAME "network"
| #define PACKAGE_VERSION "2.3.0.14"
| #define PACKAGE_STRING "Haskell network package 2.3.0.14"
| #define PACKAGE_BUGREPORT "libraries#haskell.org"
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_FCNTL_H 1
| #define HAVE_LIMITS_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_ARPA_INET_H 1
| #define HAVE_NETDB_H 1
| #define HAVE_NETINET_IN_H 1
| #define HAVE_NETINET_TCP_H 1
| #define HAVE_SYS_SOCKET_H 1
| #define HAVE_SYS_UIO_H 1
| #define HAVE_SYS_UN_H 1
| #define HAVE_READLINK 1
| #define HAVE_SYMLINK 1
| #define HAVE_STRUCT_MSGHDR_MSG_CONTROL 1
| #define HAVE_IN_ADDR_T 1
| /* end confdefs.h. */
| #include <sys/types.h>
| #include <sys/socket.h>
| #ifndef SO_PEERCRED
| # error no SO_PEERCRED
| #endif
| struct ucred u;
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:4378: gcc -c -D_GNU_SOURCE -Wl,--hash-size=31 -Wl,--reduce-memory-overheads conftest.c >&5
configure:4384: $? = 0
configure:4414: result: yes
Thanks!,
Ranjit.
There is a ticket, looks like it is you case. It is marked fixed.

Resources