Skip to content

Build error - not sure where to look

6 messages · David Winsemius, Simon Urbanek, Ben Madin

#
G'day all,

this is hopefully straightforward, but I'm not sure where to look.

I am trying to build the surveillance package (which is excluded from the binaries because of a memory problem). I have successfully built it previously on Snow Leopard, but I have recently upgraded to Lion (7.3). I have installed the developer tools and the gfortran from r.research.att.com

When I use the GUI it gets this far :

* installing *source* package ?surveillance? ...
** package ?surveillance? successfully unpacked and MD5 sums checked
** Creating default NAMESPACE file
** libs
*** arch - i386
sh: make: command not found
ERROR: compilation failed for package ?surveillance?
R version 2.14.1 Patched (2012-02-16 r58370)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)

locale:
[1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     


thinking that this might be an architecture issue (I'm in R64 and it's trying to build -386) I try from the command line using --no-multiarch, but it fails saying no such file or directory (output below). Knowing just enough to be dangerous, I think that it means the lines in the src file stcd-assuncaocorea.h :

#include <list>
#include <valarray>

are trying to include some sort of resource (library?), but not looking in the right place. This being the case, I'm not sure how to direct it to the right place, nor where that place is. 

If I'm correct, can someone please help me with this?

cheers

Ben



$ R CMD INSTALL --no-multiarch --build -d surveillance_1.2-1.tar.gz 
processing ?surveillance_1.2-1.tar.gz?
a file
* installing to library ?/Library/Frameworks/R.framework/Versions/2.14/Resources/library?
* build_help_types=
* DBG: 'R CMD INSTALL' now doing do_install()
* created lock directory ?/Library/Frameworks/R.framework/Versions/2.14/Resources/library/00LOCK-surveillance?
* installing *source* package ?surveillance? ...
** package ?surveillance? successfully unpacked and MD5 sums checked
** Creating default NAMESPACE file
** libs
*** arch - x86_64
about to run R CMD SHLIB -o surveillance.so stcd-assuncaocorrea.cc surveillance.c twins.cc
g++ -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64  -I/usr/local/include    -fPIC  -g -O2 -c stcd-assuncaocorrea.cc -o stcd-assuncaocorrea.o
In file included from stcd-assuncaocorrea.cc:8:
stcd-assuncaocorrea.h:14:16: error: list: No such file or directory
stcd-assuncaocorrea.h:15:20: error: valarray: No such file or directory
stcd-assuncaocorrea.cc:9:17: error: cmath: No such file or directory
stcd-assuncaocorrea.cc:10:20: error: iostream: No such file or directory
In file included from stcd-assuncaocorrea.cc:8:
stcd-assuncaocorrea.h:25: error: expected initializer before ?<? token
stcd-assuncaocorrea.h:33: error: ?SVEventLst? was not declared in this scope
stcd-assuncaocorrea.h:33: error: ?ev? was not declared in this scope
stcd-assuncaocorrea.h:34: error: expected primary-expression before ?const?
stcd-assuncaocorrea.h:34: error: expected primary-expression before ?const?
stcd-assuncaocorrea.h:35: error: expected primary-expression before ?const?
stcd-assuncaocorrea.h:35: error: expected primary-expression before ?double?
stcd-assuncaocorrea.h:36: error: expected primary-expression before ?const?
stcd-assuncaocorrea.h:36: error: ?valarray? is not a member of ?std?
stcd-assuncaocorrea.h:36: error: expected primary-expression before ?double?
stcd-assuncaocorrea.h:36: error: initializer expression list treated as compound expression
stcd-assuncaocorrea.h:37: error: ?SVEventLst? was not declared in this scope
stcd-assuncaocorrea.h:37: error: ?ev? was not declared in this scope
stcd-assuncaocorrea.h:37: error: expected primary-expression before ?const?
stcd-assuncaocorrea.h:37: error: expected primary-expression before ?const?
stcd-assuncaocorrea.h:38: error: ?valarray? is not a member of ?std?
stcd-assuncaocorrea.h:38: error: expected primary-expression before ?double?
stcd-assuncaocorrea.h:38: error: expected primary-expression before ?unsigned?
stcd-assuncaocorrea.h:38: error: initializer expression list treated as compound expression
stcd-assuncaocorrea.cc:61: error: redefinition of ?int SistemadeVigilancia?
stcd-assuncaocorrea.h:33: error: ?int SistemadeVigilancia? previously defined here
stcd-assuncaocorrea.cc:61: error: ?SVEventLst? was not declared in this scope
stcd-assuncaocorrea.cc:61: error: ?ev? was not declared in this scope
stcd-assuncaocorrea.cc:62: error: expected primary-expression before ?const?
stcd-assuncaocorrea.cc:62: error: expected primary-expression before ?const?
stcd-assuncaocorrea.cc:63: error: expected primary-expression before ?const?
stcd-assuncaocorrea.cc:63: error: expected primary-expression before ?double?
stcd-assuncaocorrea.cc:64: error: expected primary-expression before ?const?
stcd-assuncaocorrea.cc:64: error: ?valarray? is not a member of ?std?
stcd-assuncaocorrea.cc:64: error: expected primary-expression before ?double?
make: *** [stcd-assuncaocorrea.o] Error 1
ERROR: compilation failed for package ?surveillance?
* removing ?/Library/Frameworks/R.framework/Versions/2.14/Resources/library/surveillance?
#
On Mar 3, 2012, at 11:06 PM, Ben Madin wrote:

            
Because it says that make is not found it would suggest that you need  
to provide more details about which version and where the developer  
tools were installed. I'm wondering if the PATH for R may not include  
the proper location.

This package also require package:spc. The one that was used when I  
just compiled from source on a Leopard machine was spc_0.4.1.
David Winsemius, MD
West Hartford, CT
#
Further to this, I am starting to think I missed some thing else : attempting to compile rgeos gives me :

install.packages(c('/Users/benmadin/Desktop/rgeos_0.2-3.tar.gz'), type='soruce', configure.args = '--with-geos-config=/Library/Frameworks/GEOS.framework/unix/bin/geos-config', repos=NULL)
* installing *source* package ?rgeos? ...
** package ?rgeos? successfully unpacked and MD5 sums checked
geos-config: /Library/Frameworks/GEOS.framework/unix/bin/geos-config
GEOS: 3.3.2dev
./configure: line 1263: test: 332dev: integer expression expected
CPPFLAGS: -I/Library/Frameworks/GEOS.framework/Versions/3/unix/include
LIBS: -L/Library/Frameworks/GEOS.framework/Versions/3/unix/lib -lgeos
configure: creating ./config.status
config.status: creating src/Makevars
** libs
*** arch - x86_64
gcc -arch x86_64 -std=gnu99 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -I/Library/Frameworks/GEOS.framework/Versions/3/unix/include -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.14/Resources/library/sp/include"   -fPIC  -g -O2 -c init.c -o init.o
In file included from init.c:1:
/Library/Frameworks/R.framework/Resources/include/R.h:28:20: error: stdlib.h: No such file or directory
/Library/Frameworks/R.framework/Resources/include/R.h:29:73: error: stdio.h: No such file or directory
In file included from /Library/Frameworks/R.framework/Resources/include/R.h:30,
                 from init.c:1:
/Developer/usr/bin/../lib/gcc/i686-apple-darwin10/4.2.1/include/limits.h:10:25: error: limits.h: No such file or directory
In file included from init.c:1:
/Library/Frameworks/R.framework/Resources/include/R.h:31:18: error: math.h: No such file or directory
In file included from /Library/Frameworks/R.framework/Resources/include/R.h:44,
                 from init.c:1:
/Library/Frameworks/R.framework/Resources/include/R_ext/RS.h:24:39: error: string.h: No such file or directory
In file included from init.c:2:
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:801: error: expected declaration specifiers or ?...? before ?FILE?
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:804: error: expected declaration specifiers or ?...? before ?FILE?
make: *** [init.o] Error 1
ERROR: compilation failed for package ?rgeos?
* removing ?/Library/Frameworks/R.framework/Versions/2.14/Resources/library/rgeos?
Warning message:
In install.packages(c("/Users/benmadin/Desktop/rgeos_0.2-3.tar.gz"),  :
  installation of package ?/Users/benmadin/Desktop/rgeos_0.2-3.tar.gz? had non-zero exit status


NB: this is a different message to if I do it in the GUI :

install.packages(c('/Users/benmadin/Desktop/rgeos_0.2-3.tar.gz'), type='soruce', configure.args = '--with-geos-config=/Library/Frameworks/GEOS.framework/unix/bin/geos-config', repos=NULL)
* installing *source* package ?rgeos? ...
** package ?rgeos? successfully unpacked and MD5 sums checked
geos-config: /Library/Frameworks/GEOS.framework/unix/bin/geos-config
GEOS: 3.3.2dev
./configure: line 1263: test: 332dev: integer expression expected
CPPFLAGS: -I/Library/Frameworks/GEOS.framework/Versions/3/unix/include
LIBS: -L/Library/Frameworks/GEOS.framework/Versions/3/unix/lib -lgeos
configure: creating ./config.status
config.status: creating src/Makevars
** libs
*** arch - x86_64
sh: make: command not found
ERROR: compilation failed for package ?rgeos?
* removing ?/Library/Frameworks/R.framework/Versions/2.14/Resources/library/rgeos?
Warning message:
In install.packages(c("/Users/benmadin/Desktop/rgeos_0.2-3.tar.gz"),  :
  installation of package ?/Users/benmadin/Desktop/rgeos_0.2-3.tar.gz? had non-zero exit status



So I don't understand why different problems for each, and why problems at all. If any can suggest anything, I'd be very grateful.

FWIW - I installed the new Xcode, but still have the old one - is that likely to cause problems?

cheers

Ben
On 04/03/2012, at 12:06 PM, Ben Madin wrote:

            
#
On Mar 3, 2012, at 11:06 PM, Ben Madin wrote:

            
You don't have Xcode command line tools installed. Note that Xcode 4.3 and later no longer work since they do not install tools in the system anymore. You can modify your PATH to include the tools that are now inside Xcode.app, but probably easier is to install the command line tools (either from Xcode's Preferences or from ADC).

Cheers,
Simon
#
Thanks David,
On 04/03/2012, at 12:58 PM, David Winsemius wrote:

            
My lack of low-level understanding may well be at fault here by the path for r do you mean this result from the Sys.getenv() call

in the GUI:      PATH    "/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin" 
in which case - none of them have a make in the them. There are however 'make' commands in :
/Developer/usr/bin (the old Xcode)
and
/Applications/Xcode.app/Contents/Developer/usr (I'm guessing the new one for Lion)


In the terminal 

PATH 
"/Library/Frameworks/PROJ.framework/Programs:/Library/Frameworks/GDAL.framework/Programs:/Library/Frameworks/MapServer.framework/Programs:/usr/local/pgsql/bin:/usr/local/mysql/bin:/usr/local/zend/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin:/Developer/usr/bin:." 

Which I guess explains the different error messages: So I added the new Xcode location to the system path, and re-ran R in the terminal and tried again :

still no joy - still can't find stdlib.h etc. Is there something else I've missed?


cheers

Ben
* installing *source* package ?rgeos? ...
** package ?rgeos? successfully unpacked and MD5 sums checked
geos-config: /Library/Frameworks/GEOS.framework/unix/bin/geos-config
GEOS: 3.3.2dev
./configure: line 1263: test: 332dev: integer expression expected
CPPFLAGS: -I/Library/Frameworks/GEOS.framework/Versions/3/unix/include
LIBS: -L/Library/Frameworks/GEOS.framework/Versions/3/unix/lib -lgeos
configure: creating ./config.status
config.status: creating src/Makevars
** libs
*** arch - x86_64
gcc -arch x86_64 -std=gnu99 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -I/Library/Frameworks/GEOS.framework/Versions/3/unix/include -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.14/Resources/library/sp/include"   -fPIC  -g -O2 -c init.c -o init.o
In file included from init.c:1:
/Library/Frameworks/R.framework/Resources/include/R.h:28:20: error: stdlib.h: No such file or directory
/Library/Frameworks/R.framework/Resources/include/R.h:29:73: error: stdio.h: No such file or directory
In file included from /Library/Frameworks/R.framework/Resources/include/R.h:30,
                 from init.c:1:
/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/include/limits.h:15:25: error: limits.h: No such file or directory
In file included from init.c:1:
/Library/Frameworks/R.framework/Resources/include/R.h:31:18: error: math.h: No such file or directory
In file included from /Library/Frameworks/R.framework/Resources/include/R.h:44,
                 from init.c:1:
/Library/Frameworks/R.framework/Resources/include/R_ext/RS.h:24:39: error: string.h: No such file or directory
In file included from init.c:2:
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:801: error: expected declaration specifiers or ?...? before ?FILE?
/Library/Frameworks/R.framework/Resources/include/Rinternals.h:804: error: expected declaration specifiers or ?...? before ?FILE?
make: *** [init.o] Error 1
ERROR: compilation failed for package ?rgeos?
* removing ?/Library/Frameworks/R.framework/Versions/2.14/Resources/library/rgeos?
Warning message:
In install.packages(c("/Users/benmadin/Desktop/rgeos_0.2-3.tar.gz"),  :
  installation of package ?/Users/benmadin/Desktop/rgeos_0.2-3.tar.gz? had non-zero exit status



Sys.getenv()
                                       __CF_USER_TEXT_ENCODING 
                                                  "0x1F5:0:15" 
                                    Apple_PubSub_Socket_Render 
                                   "/tmp/launch-zsxAK5/Render" 
                                        Apple_Ubiquity_Message 
                   "/tmp/launch-7y6sZQ/Apple_Ubiquity_Message" 
                                                  COMMAND_MODE 
                                                    "unix2003" 
                                                       DISPLAY 
                                  "/tmp/launch-kge8iE/org.x:0" 
                                                        EDITOR 
                                                          "vi" 
                                                          HOME 
                                             "/Users/benmadin" 
                                                          LANG 
                                                 "en_AU.UTF-8" 
                                                          LN_S 
                                                       "ln -s" 
                                                       LOGNAME 
                                                    "benmadin" 
                                                          MAKE 
                                                        "make" 
                                                         PAGER 
                                               "/usr/bin/less" 
                                                          PATH 
                "/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin" 
                                                        R_ARCH 
                                                     "/x86_64" 
                                                     R_BROWSER 
                                               "/usr/bin/open" 
                                                     R_BZIPCMD 
                                              "/usr/bin/bzip2" 
                                                     R_DOC_DIR 
               "/Library/Frameworks/R.framework/Resources/doc" 
                                            R_GUI_APP_REVISION 
                                                        "6086" 
                                             R_GUI_APP_VERSION 
                                                        "1.44" 
                                                     R_GZIPCMD 
                                               "/usr/bin/gzip" 
                                                        R_HOME 
                   "/Library/Frameworks/R.framework/Resources" 
                                                 R_INCLUDE_DIR 
           "/Library/Frameworks/R.framework/Resources/include" 
                                                   R_LIBS_SITE 
                                                            "" 
                                                   R_LIBS_USER 
                                    "~/Library/R/2.14/library" 
                                                   R_PAPERSIZE 
                                                          "a4" 
                                                   R_PDFVIEWER 
                                               "/usr/bin/open" 
                                                    R_PLATFORM 
                                    "x86_64-apple-darwin9.8.0" 
                                                    R_PRINTCMD 
                                                         "lpr" 
                                                        R_QPDF 
          "/Library/Frameworks/R.framework/Resources/bin/qpdf" 
                                                      R_RD4DVI 
                                                          "ae" 
                                                      R_RD4PDF 
                                     "times,inconsolata,hyper" 
                                              R_SESSION_TMPDIR 
"/var/folders/sh/gwpnxgts1m9f3km36qr5wn600000gn/T//RtmpYZESBS" 
                                                   R_SHARE_DIR 
             "/Library/Frameworks/R.framework/Resources/share" 
                                                  R_SYSTEM_ABI 
                                      "osx,gcc,gxx,gfortran,?" 
                                                 R_TEXI2DVICMD 
                                           "/usr/bin/texi2dvi" 
                                                    R_UNZIPCMD 
                                              "/usr/bin/unzip" 
                                                      R_ZIPCMD 
                                                "/usr/bin/zip" 
                                                           SED 
                                                "/usr/bin/sed" 
                                                         SHELL 
                                                   "/bin/bash" 
                                                 SSH_AUTH_SOCK 
                                "/tmp/launch-nTCbsk/Listeners" 
                                                           TAR 
                                             "/usr/bin/gnutar" 
                                                        TMPDIR 
           "/var/folders/sh/gwpnxgts1m9f3km36qr5wn600000gn/T/" 
                                                          USER 
                                                    "benmadin"
#
Thanks Simon,
On 04/03/2012, at 1:24 PM, Simon Urbanek wrote:

            
That nailed it - I installed the command line tools, (the delay was the ADC network being down) and both rgeos and surveillance built successfully!

cheers

Ben