Skip to content

question about installing from source

6 messages · Mark Daniel Ward, Roger Koenker, Simon Urbanek

#
I am trying to install the Rcartogram library.  I've never had trouble doing 
this before, but I recently upgraded to Snow Leopard, which may be causing a 
problem.  I do have FFTW3 installed on my machine, and I've never had trouble 
with it before either.  I even tried installing FFTW3 again, but this did not 
seem to fix the problem.

Here is the error I get when trying to install the Rcartogram library from 
Omegahat.  If anyone has any suggestions, I would really appreciate it.

#######################################################################
type="source")
trying URL 'http://www.omegahat.org/R/src/contrib/Rcartogram_0.2-2.tar.gz'
Content type 'application/x-gzip' length 123576 bytes (120 Kb)
opened URL
==================================================
downloaded 120 Kb

* Installing *source* package ?Rcartogram? ...
checking for pkg-config... no
Looking for fftw3 files in /usr/local
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
Can compile with fftw3.h
checking for fftw_malloc in -lfftw3... yes
Trying to link against libfftw3
Can link against libfftw3
configure: creating ./config.status
config.status: creating src/Makevars
** libs
** arch - i386
gcc -arch i386 -std=gnu99 -I/Library/Frameworks/R.framework/Resources/include -
I/Library/Frameworks/R.framework/Resources/include/i386 -I/usr/local/include/ -
DNOPROGRESS -I/usr/local/include    -fPIC  -g -O2 -c Rcart.c -o Rcart.o
gcc -arch i386 -std=gnu99 -I/Library/Frameworks/R.framework/Resources/include -
I/Library/Frameworks/R.framework/Resources/include/i386 -I/usr/local/include/ -
DNOPROGRESS -I/usr/local/include    -fPIC  -g -O2 -c cart.c -o cart.o
gcc -arch i386 -std=gnu99 -dynamiclib -Wl,-headerpad_max_install_names -mmacosx-
version-min=10.4 -undefined dynamic_lookup -single_module -multiply_defined 
suppress -L/usr/local/lib -o Rcartogram.so Rcart.o cart.o -L/usr/local/lib -
lfftw3 -lfftw3 -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework 
-Wl,CoreFoundation
ld: warning: in /usr/local/lib/libfftw3.a, file is not of required architecture
ld: warning: duplicate dylib /usr/local/lib/libgcc_s.1.dylib
** R
** data
** demo
** preparing package for lazy loading
** help
*** installing help indices
 >>> Building/Updating help pages for package 'Rcartogram'
     Formats: text html latex example 
  addBoundary                       text    html    latex   example
  cartogram                         text    html    latex   example
  uspop                             text    html    latex   example
** building package indices ...
* DONE (Rcartogram)

The downloaded packages are in
	?/private/var/folders/bP/bPCSLe+IHZab-XXPI9KflE+++TM/-Tmp-
/RtmpZhzOMh/downloaded_packages?
Updating HTML index of packages in '.Library'
#
worked for me on a SL machine after I reinstalled fftw3 using
./configure --enable-shared as suggested by Duncan.  Here is
the configure output, in case it would help:

* installing to library '/Library/Frameworks/R.framework/Resources/ 
library'
* installing *source* package 'Rcartogram' ...
checking for pkg-config... no
Looking for fftw3 files in /usr/local
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
Can compile with fftw3.h
checking for fftw_malloc in -lfftw3... yes
Trying to link against libfftw3
Can link against libfftw3
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/usr/local/include/ -DNOPROGRESS -I/usr/local/include    - 
fPIC  -g -O2 -c Rcart.c -o Rcart.o
gcc -arch x86_64 -std=gnu99 -I/Library/Frameworks/R.framework/ 
Resources/include -I/Library/Frameworks/R.framework/Resources/include/ 
x86_64 -I/usr/local/include/ -DNOPROGRESS -I/usr/local/include    - 
fPIC  -g -O2 -c cart.c -o cart.o
gcc -arch x86_64 -std=gnu99 -dynamiclib -Wl,- 
headerpad_max_install_names -undefined dynamic_lookup -single_module - 
multiply_defined suppress -L/usr/local/lib -o Rcartogram.so Rcart.o  
cart.o -L/usr/local/lib -lfftw3 -lfftw3 -F/Library/Frameworks/ 
R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation

url:    www.econ.uiuc.edu/~roger            Roger Koenker
email    rkoenker at uiuc.edu            Department of Economics
vox:     217-333-4558                University of Illinois
fax:       217-244-6678                Urbana, IL 61801
On Oct 20, 2009, at 10:44 PM, Mark Daniel Ward wrote:

            
#
On Oct 20, 2009, at 11:44 PM, Mark Daniel Ward wrote:

            
You have compiled FFTW3 for 64-bit (the default on SL) yet you're  
trying to use it in 32-bit R. So either use 64-bit R (R --arch=x86_64)  
or compile FFTW3 for 32-bit (i.e., don't forget to add -arch i386 to  
CC and/or other compilers that may be needed).

Cheers,
Simon
#
Roger,
On Oct 21, 2009, at 9:04 , Roger Koenker wrote:

            
yes, but you're using 64-bit R, however, Mark used 32-bit (look at his  
"arch" in the output and yours) -- that's the difference. Dynamic or  
static plays no role (in fact static has usually better performance)  
-- the only important part is --with-pic (on some archs).

Cheers,
Simon
#
FWIW a 4-way universal FFTW is now available from
http://r.research.att.com/libs/
so you don't have to compile your own (just make sure you delete  
previous dynamic builds if you had any!). It works with both 32-bit  
and 64-bit R on both Leopard and Snow Leopard.

Cheers,
Simon
On Oct 20, 2009, at 23:44 , Mark Daniel Ward wrote:

            
#
Dear Roger and Simon,
Thank you for the advice about the difference in the compile options for 
different architectures. I used the link Simon provided:
http://r.research.att.com/libs/
I successfully installed the pre-compiled FFTW from their website, and 
subsequently I was able to install the Rcartogram perfectly. This is great!!
Thank you both for your kind help. This was an incentive for me to 
finally join the Mac list for R users too (I'm already subscribed to 
some of the other R lists).
Mark
Mark Daniel Ward wrote: