Projects
Home     Blog     Install     New Ticket     View Tickets     Browse Source

Ticket #54 (reopened defect)

Opened 8 months ago

Last modified 5 weeks ago

build on Leopard fails on readline

Reported by: edarocket@… Owned by: lsansonetti@…
Priority: blocker Milestone:
Component: MacRuby Keywords: readline
Cc:

Description

I am running Leopard 10.5.2. I have readline5.2 installed in /usr/local with patch #12 added to allow for Darwin9. I configured MacRuby0.1 with the following command:

./configure --enable-framework --enable-fat-binary --program-prefix=mac --prefix=/usr/local --with-readline-dir=/usr/local

I get the following error during make:

compiling readline gcc -I. -I../../.ext/include/universal-darwin9.0 -I..//.././include -I..//.././ext/readline -DRUBY_EXTCONF_H=\"extconf.h\" -I/usr/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -g -O2 -I/usr/include/libxml2 -g -O2 -arch ppc -arch i386 -fno-common -pipe -fno-common -arch ppc -arch i386 -o readline.o -c readline.c readline.c: In function ‘filename_completion_proc_call’: readline.c:669: error: ‘filename_completion_function’ undeclared (first use in this function) readline.c:669: error: (Each undeclared identifier is reported only once readline.c:669: error: for each function it appears in.) readline.c:669: warning: assignment makes pointer from integer without a cast readline.c: In function ‘username_completion_proc_call’: readline.c:694: error: ‘username_completion_function’ undeclared (first use in this function) readline.c:694: warning: assignment makes pointer from integer without a cast readline.c: In function ‘filename_completion_proc_call’: readline.c:669: error: ‘filename_completion_function’ undeclared (first use in this function) readline.c:669: error: (Each undeclared identifier is reported only once readline.c:669: error: for each function it appears in.) readline.c:669: warning: assignment makes pointer from integer without a cast readline.c: In function ‘username_completion_proc_call’: readline.c:694: error: ‘username_completion_function’ undeclared (first use in this function) readline.c:694: warning: assignment makes pointer from integer without a cast lipo: can't open input file: /var/folders/qi/qiRsmsrKFyGifWoVhWoCz++++TM/-Tmp-//ccyYzZ4h.out (No such file or directory) make[1]: *** [readline.o] Error 1 make: *** [all] Error 1

This is similar to Ticket #5, which was closed with a "wontfix" status. I tried this on several machines with a similar /usr/local set-up, several build attempts, and several Google searches. I'm running out of ideas.

Thanks,

RyanR>

Change History

  Changed 8 months ago by eloy.de.enige@…

This is most probably a problem that your readline isn't build as a fat binary and so you can't build fat binaries that link against it. These problems are always easily recognizable by:

lipo: can't open input file: /var/folders/qi/qiRsmsrKFyGifWoVhWoCz++++TM/-Tmp-//ccyYzZ4h.out (No such file or directory)

You can check this yourself with file. If I use it on the default readline:

% file /usr/lib/libreadline.dylib 
/usr/lib/libreadline.dylib: Mach-O universal binary with 4 architectures
/usr/lib/libreadline.dylib (for architecture ppc7400):	Mach-O dynamically linked shared library ppc
/usr/lib/libreadline.dylib (for architecture ppc64):	Mach-O 64-bit dynamically linked shared library ppc64
/usr/lib/libreadline.dylib (for architecture i386):	Mach-O dynamically linked shared library i386
/usr/lib/libreadline.dylib (for architecture x86_64):	Mach-O 64-bit dynamically linked shared library x86_64

As you can see there's support for the archs ppc & i386 which are necessary to build macruby as a fat binary.

Long story short: Either recompile your readline as a fat binary OR don't use --enable-fat-binary and only build for your native arch.

  Changed 8 months ago by edarocket@…

That was most certainly it, Eloy! Thanks a ton.

I configured MacRuby without the --enable-fat-binary flag and pointed it to my single architecture readline build --with-readline-dir=/usr/local, and now I'm running MacRuby!

Now I just need to figure out where my project templates went...

Thanks again!

RyanR>

  Changed 8 months ago by lsansonetti@…

  • status changed from new to closed
  • resolution set to invalid

Okay, I assume this problem is fixed then. Thanks Eloy for the help!

  Changed 7 months ago by encytemedia@…

Just wanted to add a comment on this. I ran into the exact same issue. Compiling readline myself and specifying the directory didn't help. However, I just decided to go with the macports version. It turned out I needed to install readline and sqlite3 and configure:

sudo port -f uninstall readline
sudo port -f uninstall sqlite3
sudo port install readline
sudo port install sqlite3
autoconf
./configure --enable-framework --program-prefix=mac --with-readline-dir=/opt/local
sudo make install

follow-up: ↓ 6   Changed 6 months ago by edarocket@…

Now that MacRuby is built using Rake, I am not sure how to specify build options. Therefore, I am getting the exact same error that Eloy picked up on previously:

lipo: can't open input file: /var/folders/qi/qiRsmsrKFyGifWoVhWoCz++++TM/-Tmp-//ccNzT4hX.out (No such file or directory)

Rather than bother you immediately, I tried his initial suggestion, i.e. I tried to recompile readline-5.2 as a fat binary:

$ pwd
/usr/local/src/readline-5.2
$ make distclean
$ ./configure --prefix=/usr/local --enable-fat-binary

I then went back to MacRuby, ran 'rake clean' and 'rake', but still received the same error. So then I ran his check suggestion:

$ file /usr/local/lib/libreadline.dylib 
/usr/local/lib/libreadline.dylib: Mach-O dynamically linked shared library i386

So apparently I did not successfully rebuild readline as a fat binary. Can someone assist me with this problem?

in reply to: ↑ 5   Changed 3 months ago by lwu.two@…

Replying to edarocket@…:

Now that MacRuby is built using Rake, I am not sure how to specify build options. Therefore, I am getting the exact same error that Eloy picked up on previously: So apparently I did not successfully rebuild readline as a fat binary. Can someone assist me with this problem?

I had the same problem under Leopard & MacPorts.

Try patching line 346 of Rakefile to be

  CONFIG["CFLAGS"] = "-fno-common -pipe $(cflags) -disable-fat-binary"

  Changed 3 months ago by lsansonetti@…

  • status changed from closed to reopened
  • resolution invalid deleted

Looks like the problem is not fixed after all, reopening... #132 is a dup.

  Changed 5 weeks ago by eloy.de.enige@…

Wow, hadn't noticed so much new comments :-).

@Laurent: This really isn't a real problem with MacRuby, it's just that the stuff people have installed/compiled is not correct for MacRuby is trying to build. Maybe we should provide a rake task like: build:native / build:universal ? This way it's easier for people to at least get to a working solution.

@edarocket I'm fairly certain that that's not the way readline should be configure to get a UB… Maybe check how macports would build it.

Note: See TracTickets for help on using tickets.