Skip to content

Problem building 1.5.0 from sources

4 messages · Don MacQueen, Luke Tierney, Jan de Leeuw

#
I have Jan de Leeuw's build of Darwin R 1.5.0 installed and running 
happily; thank you very much.

I would also like to be able to build from sources. I do this on a 
Solaris machine at work, but haven't been able to do it on either of 
two OS X machines.

I've included a ton of output below, but here's one error message 
from the make step that may be a major clue:
     symbol _tgoto used from dynamic library 
/usr/lib/libm.dylib(tgoto.o) not from earlier dynamic library 
/sw/lib/libncurses.dylib.5(lib_tgoto.o)
which suggests a version mismatch. /usr/lib/libm.dylib is from the 
Developer Tools.

There are also many error messages of this form:

/usr/bin/ld: warning unused multiple definitions of symbol _matherr
arithmetic.o definition of _matherr in section (__TEXT,__text)
/usr/lib/libm.dylib(s_matherr.o) unused definition of _matherr
/usr/bin/ld: warning unused multiple definitions of symbol _regerror
regex.o definition of _regerror in section (__TEXT,__text)
/usr/lib/libm.dylib(regerror.o) unused definition of _regerror

What am I doing wrong? Or what's wrong with what's installed in my system?

Thanks for any suggestions.
-Don


I am inclined to infer that since I previously installed R 1.4.1 from 
fink I already have all extra libraries and whatnot that R needs, 
installed from fink. And everything in fink that I believe R uses is 
up to date.

David Richmond forwarded a tip from Luke and Stefano that I'm sure 
cleared up some problems. But not all.


configure command  (I actually tried it first with the LDFLAGS and 
CPPFLAGS supplied in config.site, makes no difference):
         ../source/configure --prefix=/Users/macq/R/R-1.5.0 
CPPFLAGS="-I/sw/include" LDFLAGS="-L/sw/lib" 
--with-tcl-config=/sw/lib/tclConfig.sh 
--with-tk-config=/sw/lib/tkConfig.sh > & dhm.config.log

Output from configure doesn't have any messages that I can recognize 
as indicating trouble.
(I compared my Makeconf file with David's and there are only trivial 
differences; thank you David)

What version of the Developer Tools should I have??? I have the 
December 2001, which as far as I know is the latest non-beta version.
Should I have used fink to remove 1.4.1 first?


The output from make starts with this:

make[1]: Nothing to be done for `R'.
make[1]: Nothing to be done for `R'.
make[2]: Nothing to be done for `R'.
make[1]: Nothing to be done for `R'.
mkdir -p -- ../share/R
mkdir -p -- ../share/make

[already, this is puzzling; "Nothing to be done" makes no sense when 
nothing has been done yet except configure]

Output from make looks good for quite a while. Then:

cc -no-cpp-precomp -I. -I../../src/include 
-I../../../source/src/include -I/sw/include -DHAVE_CONFIG_H   -g -O2 
-c ../../../source/src/main/names.c -o names.o
In file included from ../../../source/src/main/names.c:27:
../../../source/src/include/Defn.h:385: warning: variable `R_FunTab' 
is implicitly extern

and still later

cc -no-cpp-precomp -I. -I../../src/include 
-I../../../source/src/include -I/sw/include -DHAVE_CONFIG_H   -g -O2 
-c ../../../source/src/main/names.c -o names.o
In file included from ../../../source/src/main/names.c:27:
../../../source/src/include/Defn.h:385: warning: variable `R_FunTab' 
is implicitly extern

Then towards the end a whole slew of bad looking messages:

cc  -L/sw/lib -o R.bin  CConverters.o Rdynload.o RNG.o apply.o 
arithmetic.o array.o attrib.o base.o bind.o builtin.o character.o 
coerce.o colors.o complex.o connections.o context.o cov.o cum.o dcf.o 
datetime.o debug.o devPS.o devPicTeX.o deparse.o deriv.o devices.o 
dotcode.o dounzip.o dstruct.o duplicate.o engine.o envir.o errors.o 
eval.o format.o fourier.o gram.o gram-ex.o graphics.o identical.o 
internet.o iosupport.o lapack.o list.o logic.o main.o match.o 
memory.o model.o names.o objects.o optim.o optimize.o options.o par.o 
paste.o platform.o plot.o plot3d.o plotmath.o print.o printarray.o 
printvector.o printutils.o qsort.o random.o regex.o relop.o 
saveload.o scan.o seq.o serialize.o size.o sort.o source.o split.o 
sprintf.o subassign.o subscript.o subset.o summary.o unique.o util.o 
version.o vfonts.o xxxpr.o ../unix/libunix.a ../appl/libappl.a 
../nmath/libnmath.a  -lf77blas -latlas -L/sw/lib -lreadline -ldl 
-lncurses -lm -lg2c -lcc_dynamic -lSystem   -lbz2 -lz -lreadline -ldl 
-lncurses -lm
/usr/bin/ld: warning multiple definitions of symbol _regcomp
regex.o definition of _regcomp in section (__TEXT,__text)
/usr/lib/libm.dylib(regcomp.o) definition of _regcomp
/usr/bin/ld: warning multiple definitions of symbol _regexec
regex.o definition of _regexec in section (__TEXT,__text)
/usr/lib/libm.dylib(regexec.o) definition of _regexec
/usr/bin/ld: warning multiple definitions of symbol _regfree
regex.o definition of _regfree in section (__TEXT,__text)
/usr/lib/libm.dylib(regfree.o) definition of _regfree
/usr/bin/ld: warning multiple definitions of symbol _UP
/sw/lib/libreadline.dylib(terminal.so) definition of _UP
/usr/lib/libm.dylib(curses.o) definition of _UP
/usr/bin/ld: warning multiple definitions of symbol _PC
/sw/lib/libreadline.dylib(terminal.so) definition of _PC
/usr/lib/libm.dylib(curses.o) definition of _PC
/usr/bin/ld: warning multiple definitions of symbol _BC
/sw/lib/libreadline.dylib(terminal.so) definition of _BC
/usr/lib/libm.dylib(curses.o) definition of _BC
/usr/bin/ld: warning suggest use of -bind_at_load, as lazy binding 
may result in errors or different symbols being used
symbol _tgoto used from dynamic library /usr/lib/libm.dylib(tgoto.o) 
not from earlier dynamic library 
/sw/lib/libncurses.dylib.5(lib_tgoto.o)
symbol _tputs used from dynamic library /usr/lib/libm.dylib(tputs.o) 
not from earlier dynamic library 
/sw/lib/libncurses.dylib.5(lib_tputs.o)
symbol _ospeed used from dynamic library /usr/lib/libm.dylib(tputs.o) 
not from earlier dynamic library 
/sw/lib/libncurses.dylib.5(lib_tputs.o)
symbol _tgetflag used from dynamic library 
/usr/lib/libm.dylib(termcap.o) not from earlier dynamic library 
/sw/lib/libncurses.dylib.5(lib_termcap.o)
symbol _tgetent used from dynamic library 
/usr/lib/libm.dylib(termcap.o) not from earlier dynamic library 
/sw/lib/libncurses.dylib.5(lib_termcap.o)
symbol _tgetnum used from dynamic library 
/usr/lib/libm.dylib(termcap.o) not from earlier dynamic library 
/sw/lib/libncurses.dylib.5(lib_termcap.o)
symbol _tgetstr used from dynamic library 
/usr/lib/libm.dylib(termcap.o) not from earlier dynamic library 
/sw/lib/libncurses.dylib.5(lib_termcap.o)
symbol _curscr used from dynamic library 
/usr/lib/libm.dylib(curses.o) not from earlier dynamic library 
/sw/lib/libncurses.dylib.5(lib_data.o)
symbol _stdscr used from dynamic library 
/usr/lib/libm.dylib(curses.o) not from earlier dynamic library 
/sw/lib/libncurses.dylib.5(lib_data.o)
symbol _COLS used from dynamic library /usr/lib/libm.dylib(curses.o) 
not from earlier dynamic library 
/sw/lib/libncurses.dylib.5(lib_setup.o)
symbol _LINES used from dynamic library /usr/lib/libm.dylib(curses.o) 
not from earlier dynamic library 
/sw/lib/libncurses.dylib.5(lib_setup.o)
/usr/bin/ld: warning unused multiple definitions of symbol _matherr
arithmetic.o definition of _matherr in section (__TEXT,__text)
/usr/lib/libm.dylib(s_matherr.o) unused definition of _matherr
/usr/bin/ld: warning unused multiple definitions of symbol _regerror
regex.o definition of _regerror in section (__TEXT,__text)
/usr/lib/libm.dylib(regerror.o) unused definition of _regerror
/usr/bin/ld: warning unused multiple definitions of symbol _signgam
"link editor" definition of _signgam in section (__DATA,__common)
/usr/lib/libm.dylib(s_signgam.o) unused definition of _signgam
/usr/bin/ld: warning unused multiple definitions of symbol _BC
/sw/lib/libreadline.dylib(terminal.so) definition of _BC
/sw/lib/libncurses.dylib(lib_termcap.o) unused definition of _BC
/usr/bin/ld: warning unused multiple definitions of symbol _PC
/sw/lib/libreadline.dylib(terminal.so) definition of _PC
/sw/lib/libncurses.dylib(lib_tputs.o) unused definition of _PC
/usr/bin/ld: warning unused multiple definitions of symbol _UP
/sw/lib/libreadline.dylib(terminal.so) definition of _UP
/sw/lib/libncurses.dylib(lib_termcap.o) unused definition of _UP
/usr/bin/ld: warning unused multiple definitions of symbol _tgoto
/usr/lib/libm.dylib(tgoto.o) definition of _tgoto
/sw/lib/libncurses.dylib(lib_tgoto.o) unused definition of _tgoto
/usr/bin/ld: warning unused multiple definitions of symbol _tputs
/usr/lib/libm.dylib(tputs.o) definition of _tputs
/sw/lib/libncurses.dylib(lib_tputs.o) unused definition of _tputs
/usr/bin/ld: warning unused multiple definitions of symbol _ospeed
/usr/lib/libm.dylib(tputs.o) definition of _ospeed
/sw/lib/libncurses.dylib(lib_tputs.o) unused definition of _ospeed
/usr/bin/ld: warning unused multiple definitions of symbol _tgetflag
/usr/lib/libm.dylib(termcap.o) definition of _tgetflag
/sw/lib/libncurses.dylib(lib_termcap.o) unused definition of _tgetflag
/usr/bin/ld: warning unused multiple definitions of symbol _tgetent
/usr/lib/libm.dylib(termcap.o) definition of _tgetent
/sw/lib/libncurses.dylib(lib_termcap.o) unused definition of _tgetent
/usr/bin/ld: warning unused multiple definitions of symbol _tgetnum
/usr/lib/libm.dylib(termcap.o) definition of _tgetnum
/sw/lib/libncurses.dylib(lib_termcap.o) unused definition of _tgetnum
/usr/bin/ld: warning unused multiple definitions of symbol _tgetstr
/usr/lib/libm.dylib(termcap.o) definition of _tgetstr
/sw/lib/libncurses.dylib(lib_termcap.o) unused definition of _tgetstr
/usr/bin/ld: warning unused multiple definitions of symbol _curscr
/usr/lib/libm.dylib(curses.o) definition of _curscr
/sw/lib/libncurses.dylib(lib_data.o) unused definition of _curscr
/usr/bin/ld: warning unused multiple definitions of symbol _stdscr
/usr/lib/libm.dylib(curses.o) definition of _stdscr
/sw/lib/libncurses.dylib(lib_data.o) unused definition of _stdscr
/usr/bin/ld: warning unused multiple definitions of symbol _COLS
/usr/lib/libm.dylib(curses.o) definition of _COLS
/sw/lib/libncurses.dylib(lib_setup.o) unused definition of _COLS
/usr/bin/ld: warning unused multiple definitions of symbol _LINES
/usr/lib/libm.dylib(curses.o) definition of _LINES
/sw/lib/libncurses.dylib(lib_setup.o) unused definition of _LINES

and a bit later

cc -bundle -bundle_loader ../../../bin/R.bin -L/sw/lib -o R_X11.so 
dataentry.lo devX11.lo rotated.lo rbitmap.lo  -lSM -lICE 
-L/usr/X11R6/lib -lX11   -ljpeg -lpng -lz  -lbz2 -lz -lreadline -ldl 
-lncurses -lm
/usr/bin/ld: warning multiple definitions of symbol _regcomp
../../../bin/R.bin definition of _regcomp
/usr/lib/libm.dylib(regcomp.o) definition of _regcomp

And finally at the end:

cc -no-cpp-precomp -I../../../../include -I/sw/include 
-I/usr/X11R6/include -I/sw/include   -fno-common  -g -O2 -c 
../../../../../source/src/library/tcltk/src/tcltk.c -o tcltk.o
cc -bundle -bundle_loader ../../../../bin/R.bin  -o tcltk.so tcltk.o 
-L/sw/lib -lm
/usr/bin/ld: Undefined symbols:
_TclFreeObj
_Tcl_CreateCommand
_Tcl_CreateInterp
_Tcl_DoOneEvent
_Tcl_Eval
_Tcl_GetDoubleFromObj
_Tcl_GetIntFromObj
_Tcl_GetObjResult
_Tcl_GetString
_Tcl_GetVar2Ex
_Tcl_Init
_Tcl_ListObjAppendElement
_Tcl_ListObjGetElements
_Tcl_NewDoubleObj
_Tcl_NewIntObj
_Tcl_NewObj
_Tcl_SetResult
_Tcl_SetStringObj
_Tcl_SetVar2Ex
_Tcl_StaticPackage
_Tk_Init
_Tk_SafeInit
/usr/bin/ld: warning unused multiple definitions of symbol _matherr
../../../../bin/R.bin definition of _matherr
/usr/lib/libm.dylib(s_matherr.o) unused definition of _matherr
/usr/bin/ld: warning unused multiple definitions of symbol _regcomp
../../../../bin/R.bin definition of _regcomp
/usr/lib/libm.dylib(regcomp.o) unused definition of _regcomp
/usr/bin/ld: warning unused multiple definitions of symbol _regerror
../../../../bin/R.bin definition of _regerror
/usr/lib/libm.dylib(regerror.o) unused definition of _regerror
/usr/bin/ld: warning unused multiple definitions of symbol _regexec
../../../../bin/R.bin definition of _regexec
/usr/lib/libm.dylib(regexec.o) unused definition of _regexec
/usr/bin/ld: warning unused multiple definitions of symbol _regfree
../../../../bin/R.bin definition of _regfree
/usr/lib/libm.dylib(regfree.o) unused definition of _regfree
/usr/bin/ld: warning unused multiple definitions of symbol _signgam
../../../../bin/R.bin definition of _signgam
/usr/lib/libm.dylib(s_signgam.o) unused definition of _signgam
make[5]: *** [tcltk.so] Error 1
make[4]: *** [all] Error 2
make[3]: *** [all] Error 1
make[2]: *** [R] Error 1
make[1]: *** [R] Error 1
make: *** [R] Error 1
#
On Thu, May 16, 2002 at 06:52:00AM -0700, Don MacQueen wrote:
It looks to me that the only place you actually fail is at the end in
building tcltk.  I think this means methods has been built, and as
that runs R for dumping methods it should mean that you have a
functioning R at this point.  You might check that.

Look at the second cc line below, the one that creates tcltk.so:
You can see that it is not linking in the tcl and tk libraries, which
explains the unresolved symbols.  What you need to figure out is why
it is not linking in those libraries.  Looking at the way the make
file is constructed it would appear that configure has gotten confused
into thinkining you have tcl/tk but at the same time not being able to
find the libraries.

I would try starting from scratch with a clean untar of the sources.
Then try to build without Tcl/TK support and make sure that works.
Then see if you can configure it to use tcl/tk.  Look carefully at
what configure reports in config.log and see if you can make sense of
that.

On my system, which uses a fairly bleeding edge fink, I have three
tcltk packages: tcltk, tcltk-dev, and tcltk-shlibs.  The fink folks
seem to have been rearrranging the way they pack these things
recently, so there is a possibility that you have not go al the stuff
you need to build with tcltk--you might check that your packages are
up to date.

One other point to be aware of on Mac OS X, though it does not seem to
be the issue here, is that Mac OS X uses a rather idiosyncratic way of
managing shared libraries.  Some would argue that their mechanism is
highly advanced and superior to anything else out there; others might
give a less complementary description.  At any rate, there is a slew
of environment variables that control how dynamic linking works (see
man dyld).  There is also a fink package, libxpg4 that seems to set
two of these, DYLD_INSERT_LIBRARIES and DYLD_FORCE_FLAT_NAMESPACE.
Unfortunately R will not run when DYLD_FORCE_FLAT_NAMESPACE is set
because of a variable defined both in libcurses and libreadline.4.2.
This may be a transient issue, and may not apply if you are using a
more stable version of fink, but the point is: be aware that setting
of the DYLD_??? variables given in man dyld may affect whether R runs
or not, so check for these if you have problems.

luke
#
a. see if libxpg4 is installed by fink. if it is, remove it.
b. start a new shell
c. rebuild tcltk from fink, just to be sure
d. get a fresh R-1.5.0
e. do a configure/make

the regular expression  etc warnings are harmless
On Thursday, May 16, 2002, at 06:52 AM, Don MacQueen wrote:

            
===
Jan de Leeuw; Professor and Chair, UCLA Department of Statistics;
US mail: 9432 Boelter Hall, Box 951554, Los Angeles, CA 90095-1554
phone (310)-825-9550;  fax (310)-206-5658;  email: deleeuw@stat.ucla.edu
homepage: http://www.stat.ucla.edu/~deleeuw
========================================================
           No matter where you go, there you are. --- Buckaroo Banzai
                    http://www.stat.ucla.edu/~deleeuw/sounds/nomatter.au
========================================================
#
I'm not having much success here. Well, some.

As Luke suggested, building without tcltk is successful.

But I can't get tcltk support.

I have run fink selfupdate, and updated tcltk from fink:

lib[171]% fink list | grep tcl
     blt             2.4y-1      Toolkit for tcl/tk
  i  tcltk           8.3.3-6     Tcl (Tool Command Language, pronounced tick...

My "fink list" doesn't show tcltk-shlibs. Is it neccesary? Is it in unstable?


Here are more details. The bottom line is, I've tried a variety of 
configuration options, described below, but none have worked.

Perhaps someone could send me a copy of config.log from a successful 
build with tcltk support?

Thanks
-Don

In config.site I have

    CPPFLAGS='-I/sw/include'
    LDFLAGS='-L/sw/lib'
and
    TCLTK_LIBS='-L/sw/lib'
    TCLTK_CPPFLAGS='-I/sw/include'

In  /sw/lib there is plenty of tcl/tk stuff

lib[175]% pwd
/sw/lib
lib[176]% ls *tcl*
libtcl.dylib@     libtclstub.a@    tclConfig.sh
libtcl8.3.dylib*  libtclstub8.3.a

tcl:
./         history.tcl  ldAix       package.tcl   tclIndex
../        http1.0/     ldAout.tcl  parray.tcl    tcltest1.0/
auto.tcl   http2.3/     msgcat1.1/  safe.tcl      word.tcl
encoding/  init.tcl     opt0.4/     tclAppInit.c

tcl8.3:
/         history.tcl  ldAix       package.tcl   tclIndex
../        http1.0/     ldAout.tcl  parray.tcl    tcltest1.0/
auto.tcl   http2.3/     msgcat1.1/  safe.tcl      word.tcl
encoding/  init.tcl     opt0.4/     tclAppInit.c

I have tried it with and without these two configure options:
    --with-tcl-config=/sw/lib/tclConfig.sh
    --with-tk-config=/sw/lib/tkConfig.sh

Something that doesn't look right is this, from config.log
   ac_cv_env_TCLTK_CPPFLAGS_set=''
   ac_cv_env_TCLTK_CPPFLAGS_value=''
   ac_cv_env_TCLTK_LIBS_set=''
   ac_cv_env_TCLTK_LIBS_value=''
despite having set them in config.site. Adding them to the configure 
command line changes those lines in config.log, but make still 
doesn't succeed.


Error messages in the output from make, like before, start with
cc -no-cpp-precomp -I../../../../include -I/sw/include 
-I/usr/X11R6/include -I/sw/include   -fno-common  -g -O2 -c 
../../../../../source/src/library/tcltk/src/tcltk.c -o tcltk.o
cc -bundle -bundle_loader ../../../../bin/R.bin  -o tcltk.so tcltk.o 
-L/sw/lib -lm
/usr/bin/ld: Undefined symbols:
_TclFreeObj
_Tcl_CreateCommand
_Tcl_CreateInterp


Looking for some of the undefined symbols, they seem to be there, 
though I don't know what the "T" and "U" codes indicate.

lib[177]% nm libtcl.dylib | grep Tcl_CreateC
0000d5a8 T _Tcl_CreateCommand
00036500 T _Tcl_CreateChannel
0003ad80 T _Tcl_CreateChannelHandler
00035e5c T _Tcl_CreateCloseHandler
          U _Tcl_CreateCloseHandler
          U _Tcl_CreateCommand
          U _Tcl_CreateChannel
          U _Tcl_CreateChannelHandler
          U _Tcl_CreateCloseHandler
          U _Tcl_CreateCommand
          U _Tcl_CreateChannel
          U _Tcl_CreateChannel


lib[178]% nm libtcl.dylib | grep Tcl_CreateI
0000c840 T _Tcl_CreateInterp
          U _Tcl_CreateInterp
          U _Tcl_CreateInterp
          U _Tcl_CreateInterp