slow startup for xemacs on Darwin
Richard Cook
rcook at llnl.gov
Mon Jul 26 17:10:55 EDT 2010
If I build using your flags it works for me. So it seems that linking in the wrong X11 libs is the problem here and it's a MacPorts issue.
On Jul 24, 2010, at 8:06 AM, robert delius royar wrote:
> Fri, 23 Jul 2010 (18:00 -0700 UTC) Richard Cook wrote:
>
>> YES IT WOULD! Hmm. That's likely to be the problem. But why is a text editor checking the network again? Anyhow, I did hack the source of process-unix.c: unix_canonicalize_host_name()
>>
>> Changed
>>
>> LISP_STRING_TO_EXTERNAL (host, ext_host, Qnative);
>> + if (strstr(ext_host, "/tmp/launch") != NULL) {
>> + ext_host = strdup("localhost");
>> + }
>> retval = getaddrinfo (ext_host, NULL, &hints, &res);
>>
>> Yes, it's a hack, but it works. Of course it seems the correct fix is to point at the XQuartz X11 libraries instead of something dragged into /opt/local/lib:
>
> All of the statements below are about
> XEmacs 21.5 (beta29) "garbanzo" fca0cf0971de configured for `powerpc-apple-darwin9.8.0'.
> or
> XEmacs 21.5-b29 "garbanzo" fca0cf0971de configured for `i386-apple-darwin10.4.0'.
>
> I believe that the library interference is at the root of your problem.
> I use some macports libraries, but I do not switch out the ones that
> Xquartz or the system supplies. I compile it for Leopard G5 and i386
> and for SL i386. I use the i386 version from SL at home and work and
> the i386 Leopard at work. I run a local DNS at home for my network
> (helps the TiVo and iPods). Each machine has a dedicated IP that my two
> routers respect. I use host information files in /var/named. At school
> all the DNS is handled by my school's network admins. I do not see a
> slowdown for starting XEmacs on any of my systems. [I used also to run
> XEmacs on an EeePC Linux system with basically the same configuration).
>
> Here are some outputs (on my Leopard G5) for variables that relate to
> x-display DEVICE and hostname:
> (system-name)
> "grendel.frinabulax.org"
> (device-list)
> (#<x-device on "/tmp/launch-Z1M232/org.x:0.0" 0x2>)
>
> Here is the bash routine in my XEmacs build script for use on an Intel
> machine (Snow Leopard version):
>
> WK_ACONFIG () {
> if [ "$MACHTYPE" = "powerpc" ] ; then
> echo "Will not configure the i386 build for a powerpc,"
> echo "using the work config instead."
> WK_CONFIG
> else
> export PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig
> RM_Installation
> if [ "${XEMACS_CONFIGURE}" ] ; then
> ./configure "${XEMACS_CONFIGURE}"
> else
> export CFLAGS="-arch i386"
> export LDFLAGS='-L/usr/lib -lncurses -lz -L/opt/X11/lib -lpng -lXpm
> -lXft -lXrender -lXt -lXext -lX11 -lSM -lICE -lfontconfig
> -L/opt/local/lib -lgmp -ltiff -ljpeg -lesd'
> ./configure --with-mule \
> --with-scrollbars=lucid --with-widgets=athena --with-athena=xaw --with-dialogs=athena \
> --without-error-checking --with-bignum=gmp \
> --prefix=${ParentPath} --with-png --with-jpeg --with-tiff \
> --with-xim=no --enable-sound=none,esd --disable-xfs \
> --enable-dump-in-exec --with-compiler=gcc-4.2 \
> --disable-kkcc --without-ipv6-cname --without-ldap \
> --with-xft=emacs,gauges,tabs --with-union-type --enable-optimization
> fi
> fi
> }
>
> Note that on Leopard, I use a routine that has -L/usr/X11/lib
> rather than -L/opt/X11/lib. I compile the source in my home directory
> and set $ParentPath to /Users/royar/usr/local
>
> Here is the output from otool -l on my Snow Leopard MBP:
> grendal% otool -L ~/usr/local/bin/xemacs-21.5-b29
> /Users/royar/usr/local/bin/xemacs-21.5-b29:
> /usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)
> /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)
> /opt/X11/lib/libpng14.14.dylib (compatibility version 18.0.0, current version 18.0.0)
> /opt/X11/lib/libXpm.4.dylib (compatibility version 16.0.0, current version 16.0.0)
> /opt/X11/lib/libXft.2.dylib (compatibility version 4.0.0, current version 4.13.0)
> /opt/X11/lib/libXrender.1.dylib (compatibility version 5.0.0, current version 5.0.0)
> /opt/X11/lib/libXt.6.dylib (compatibility version 7.0.0, current version 7.0.0)
> /opt/X11/lib/libXext.6.dylib (compatibility version 11.0.0, current version 11.0.0)
> /opt/X11/lib/libX11.6.dylib (compatibility version 10.0.0, current version 10.0.0)
> /opt/X11/lib/libSM.6.dylib (compatibility version 7.0.0, current version 7.1.0)
> /opt/X11/lib/libICE.6.dylib (compatibility version 10.0.0, current version 10.0.0)
> /opt/X11/lib/libfontconfig.1.dylib (compatibility version 6.0.0, current version 6.3.0)
> /opt/local/lib/libgmp.10.dylib (compatibility version 11.0.0, current version 11.1.0)
> /opt/local/lib/libtiff.3.dylib (compatibility version 13.0.0, current version 13.4.0)
> /opt/local/lib/libjpeg.8.dylib (compatibility version 9.0.0, current version 9.2.0)
> /opt/local/lib/libesd.0.dylib (compatibility version 3.0.0, current version 3.39.0)
> /usr/lib/libexpat.1.dylib (compatibility version 7.0.0, current version 7.2.0)
> /usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
> /opt/X11/lib/libfreetype.6.dylib (compatibility version 12.0.0, current version 12.1.0)
> /opt/X11/lib/libxcb.1.dylib (compatibility version 3.0.0, current version 3.0.0)
> /opt/X11/lib/libXau.6.dylib (compatibility version 7.0.0, current version 7.0.0)
> /opt/X11/lib/libXdmcp.6.dylib (compatibility version 7.0.0, current version 7.0.0)
> /opt/X11/lib/libXaw.7.dylib (compatibility version 8.0.0, current version 8.0.0)
> /opt/X11/lib/libXmu.6.dylib (compatibility version 9.0.0, current version 9.0.0)
> /opt/local/lib/libgdbm.3.dylib (compatibility version 4.0.0, current version 4.0.0)
> /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio (compatibility version 1.0.0, current version 1.0.0)
> /opt/local/lib/libaudiofile.0.dylib (compatibility version 1.0.0, current version 1.2.0)
> /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.0)
> /opt/local/lib/libintl.8.dylib (compatibility version 10.0.0, current version 10.1.0)
>
> Hope this helps.
>
>> cook47 at rcmac (xemacs-21.5.29-without-ipv6-cname): otool -L /opt/local/bin/xemacs
>> /opt/local/bin/xemacs:
>> /opt/local/lib/libXaw3d.8.dylib (compatibility version 8.0.0, current version 8.0.0)
>> /opt/local/lib/libtiff.3.dylib (compatibility version 13.0.0, current version 13.4.0)
>> /opt/local/lib/libpng12.0.dylib (compatibility version 45.0.0, current version 45.0.0)
>> /opt/local/lib/libjpeg.8.dylib (compatibility version 9.0.0, current version 9.2.0)
>> /opt/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
>> /opt/local/lib/libcompface.0.dylib (compatibility version 1.5.2, current version 1.5.2)
>> /opt/local/lib/libXpm.4.dylib (compatibility version 16.0.0, current version 16.0.0)
>> /opt/local/lib/libXmu.6.dylib (compatibility version 9.0.0, current version 9.0.0)
>> /opt/local/lib/libXt.6.dylib (compatibility version 7.0.0, current version 7.0.0)
>> /opt/local/lib/libXext.6.dylib (compatibility version 11.0.0, current version 11.0.0)
>> /opt/local/lib/libX11.6.dylib (compatibility version 10.0.0, current version 10.0.0)
>>
>> I tried setting DYLD_LIBRARY_PATH to /usr/X11/lib but then I get an error when I run /opt/local/bin/xemacs:
>>
>> dyld: Library not loaded: /opt/local/lib/libpng12.0.dylib
>> Referenced from: /opt/local/bin/xemacs
>> Reason: Incompatible library version: xemacs requires version 45.0.0 or later, but libpng12.0.dylib provides version 42.0.0
>> Trace/BPT trap
>>
>>
>>
>> On Jul 23, 2010, at 5:45 PM, Hamish Macdonald wrote:
>>
>>> Would the MacPorts version of xemacs be using its own libX11 rather than the one provided by Mac OS X? That would be dumb......
>>>
>>> On Fri, Jul 23, 2010 at 8:41 PM, Hamish Macdonald <hamishimac at gmail.com> wrote:
>>> On Fri, Jul 23, 2010 at 8:09 PM, Richard Cook <rcook at llnl.gov> wrote:
>>> I actually found out what xemacs is doing. It is calling
>>> getaddrinfo("/tmp/launch-gcmVOm/org.macosforge.xquartz", ...);
>>> That comes from the DISPLAY name. Why is it doing this, and can I tell it not to? On Mac OS X, this is the weird name that DISPLAY gets set to to get direct rendering. It does not work to set DISPLAY to ":0". I don't want to use DISPLAY="rcmac.llnl.gov:0" because that will cause it to hit the NIC instead of go straight to the card for rendering.
>>>
>>> Hmm... Just checked on my Mac. The display name is set to "/tmp/launch-TkSI95/org.x:0". That's a really curious format for a "local" display string. On my Mac, when I run "xterm" under X, that file is a local socket. A local transport mechanism like that should really not have a colon in it. This appears to confuse some software into thinking it is a "hostname:0" display variable format, so it tries to lookup "hostname".
>>>
>>> I still agree with others that your DNS is broken; if it cannot come back and tell you quickly that the hostname "/tmp/launch-gcmVOm/org.macosforge.xquartz" can't be resolved, its broken.
>>>
>>> However, I wonder why xemacs is trying to resolve this address. Local X applications on my system don't appear to do a DNS lookup when I use a display name like "/tmp/foo/bar/baz:0", so why does xemacs? Is it possible that either XEmacs is not using the locally installed XLIB library? Is XEmacs performing its own interpretation of the DISPLAY environment variable (that would be a bad idea).
>>>
>>> Regards,
>>> Hamish.
>>>
>>
>>
>
> --
> Dr. Robert Delius Royar Associate Professor of English
> Morehead State University Morehead, Kentucky
>
> _______________________________________________
> XEmacs-Beta mailing list
> XEmacs-Beta at calypso.tux.org
> http://*calypso.tux.org/mailman/listinfo/xemacs-beta
>
--
✐Richard Cook
✇ Lawrence Livermore National Laboratory
Bldg-453 Rm-4024, Mail Stop L-557
7000 East Avenue, Livermore, CA, 94550, USA
☎ (office) (925) 423-9605
☎ (fax) (925) 423-6961
---
Information Management & Graphics Grp., Services & Development Div., Integrated Computing & Communications Dept.
(opinions expressed herein are mine and not those of LLNL)
More information about the XEmacs-Beta
mailing list