On Tue, 2010-04-27 at 19:47 -0400, Alexander Hansen wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On 4/27/10 7:26 PM, PFudd wrote:
> > Hi..
> > 
> > I was having this problem, and I finally found the answer when I noticed
> > that there were perl cgi scripts successfully using DBD::mysql while I
> > was getting the '_mysql_init not found' error with the command line.
> > 
> > The problem is the environment variable VERSIONER_PERL_PREFER_32_BIT.
> > When it is set to 'yes', I get the error, but when it's unset or 'no',
> > everything works.  This variable is set in /sw/etc/profile.d/fink.sh and
> > fink.csh, and it's one of the few situations where a fink change affects
> > the rest of the operating system.
> > 
> > As for how to remedy the problem, I haven't figured that part out yet.
> > Do I have to rebuild fink from scratch in 64 bit mode?
> > 
> > Thanks!
> > 
> > 
> 
> Hard to say, given that you haven't actually told us anything other than
> that you had "this problem" (which doesn't appear to be that mentioned
> in the subject).  Nor did you mention what OS you're on (we'll assume
> you're on 32-bit Fink on 10.6).
> 
> Not using 32-bit Fink would be one solution, I guess.

I apologize, my reply to Oliver Niehuis's thread entitled "Re:
[Fink-beginners] dbd-mysql-pm5100 installation problem" from yesterday
was not clear enough.

I was having the exact same problem, also on SnowLeopard.  I could not
install the dbd-mysql-pm5100 package, due to the error:

Can't load
'/sw/lib/perl5/5.10.0/darwin-thread-multi-2level/auto/DBI/DBI.bundle'
for module DBI:
dlopen(/sw/lib/perl5/5.10.0/darwin-thread-multi-2level/auto/DBI/DBI.bundle,
1): no suitable image found.  Did find:
        /sw/lib/perl5/5.10.0/darwin-thread-multi-2level/auto/DBI/DBI.bundle:
mach-o, but wrong architecture at
/System/Library/Perl/5.10.0/darwin-thread-multi-2level/DynaLoader.pm
line 207.

This problem (no suitable image found, due to wrong architecture) also
occurred when trying to compile gd-graph-pm588 a couple of weeks ago,
but we worked around the problem by giving up and using an older
computer running Leopard.

Trying to reinstall DBD::mysql was just one step in a long, tedious,
confusing, frustrating and altogether f***ed up debugging process:

1. Try to run a vendor's command-line perl program that happens to use
mysql through DBI, although such use is buried deep in one of the
vendor's modules.

2. Get error message:

------
dyld: lazy symbol binding failed: Symbol not found: _mysql_init
  Referenced
from: 
/Library/Perl/5.10.0/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle
  Expected in: flat namespace

dyld: Symbol not found: _mysql_init
  Referenced
from: 
/Library/Perl/5.10.0/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle
  Expected in: flat namespace

Trace/BPT trap
-------

3. Uninstall DBI and DBD::mysql from system perl directories. 

4. Install DBI and fail to install DBD::mysql from fink (compile error
seen above by me and Oliver).

5. Install mysql from fink despite mysql being installed on system by
Apple.  I really don't want to damage the system version.

6. Try installing DBI and DBD::mysql from CPAN.  Much hilarity ensues
when CPAN is upgraded.  Versions of packages are stale in the system
perl and fink perl directories, and newer modules refuse to install
unless you upgrade zip and compress to their latest versions.  Chances
of finding all versions that have been tucked away in special
directories: slim.  Found that adding -j8 in CPAN configuration causes
all compiles to fail.  After all that, DBD::mysql still doesn't install.

7. Considered downloading .dpkg from official mysql site, then
rebuilding DBI and DBD::mysql.

8. Customer complains that the web server is down (due to DBD::mysql not
being installed)

9. Restore the /Library/Perl directories to the way they were before.
Why is there a /System/Library/Perl and /Library/Perl directory tree?
Do they want to drive sysadmins to drink?

10. Web server starts working again, command line programs still not
working.  Command line programs called from a test CGI script work. (!!)

11. Careful trial and error of:
  a. deleting all environment variables from the test CGI script
  b. adding back just the essential ones: PATH and PERL5LIB (for the
vendor's packages)
  c. trying one variable from the command line environment at a time
until the CGI script can no longer run the command line program
  d. finding that VERSIONER_PERL_PREFER_32_BIT=yes is the guilty party

12. Looking for VERSIONER_PERL_PREFER_32_BIT in my startup files
and /etc directory tree was fruitless.

13. In a moment of clarity, check /sw/etc directory tree: found it!

14. unsetenv VERSIONER_PERL_PREFER_32_BIT makes command line programs
work.

15. Find someone to tell this to.

Anyhoo, yes, the problem is that #$%#$ environment variable.  It's set
by Fink, and affects non-fink programs started from the command line.
The web server is unaffected, since it doesn't run
the /sw/etc/profile.d/fink.sh file; that server is started from launchd.

The problem (bad architecture) Oliver had is one of the steps listed
above (#4), and is intimately related to that environment variable.
It's possible that he's installing dbd-mysql-pm5100 in an effort to
solve the same problem I encountered (the system DBD::mysql doesn't
work, gives _mysql_init not found error).  The process of uninstalling
and reinstalling things in an effort to get the architecture consistent
was suggested by various articles found via Google, and didn't work.

Does that spell things out enough?



------------------------------------------------------------------------------
_______________________________________________
Fink-beginners mailing list
[email protected]
http://news.gmane.org/gmane.os.apple.fink.beginners

Reply via email to