Cody Fendant has asked for the wisdom of the Perl Monks concerning the following question:

I have a very speedy new Apple computer, but installing modules has got a little weird.

I installed XAMPP, all good so far and the Perl at /Applications/XAMPP/bin/perl seems fine.

Platform: osname=darwin osvers=14.5.0 archname=darwin-thread-multi-2level uname='darwin xampps-mac.local 14.5.0 darwin kernel version 14.5.0 +: wed jul 29 02:26:53 pdt 2015; root:xnu-2782.40.9~1release_x86_64 x8 +6_64 ' config_args='-Dprefix=/Applications/XAMPP/xamppfiles -des -Dcc=gcc + -Dusethreads' hint=recommended useposix=true d_sigaction=define useithreads=define usemultiplicity=define use64bitint=define use64bitall=define uselongdouble=undef usemymalloc=n default_inc_excludes_dot=define Compiler: cc='gcc' ccflags ='-fno-common -DPERL_DARWIN -no-cpp-precomp -mmacosx-versi +on-min=10.10 -fno-strict-aliasing -pipe -fstack-protector-strong -DPE +RL_USE_SAFE_PUTENV' optimize='-O3' cppflags='-no-cpp-precomp -fno-common -DPERL_DARWIN -no-cpp-precom +p -mmacosx-version-min=10.10 -fno-strict-aliasing -pipe -fstack-prote +ctor-strong' ccversion='' gccversion='4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)' gccosandvers='' intsize=4 longsize=8 ptrsize=8 doublesize=8 byteorder=12345678 doublekind=3 d_longlong=define longlongsize=8 d_longdbl=define longdblsize=16 longdblkind=3 ivtype='long' ivsize=8 nvtype='double' nvsize=8 Off_t='off_t' lseeksize=8 alignbytes=8 prototype=define Linker and Libraries: ld='gcc' ldflags =' -mmacosx-version-min=10.10 -fstack-protector-strong' libpth=/Library/Developer/CommandLineTools/usr/bin/../lib/clang/7. +0.2/lib /Library/Developer/CommandLineTools/usr/lib /usr/lib libs=-lpthread -ldbm -ldl -lm -lutil -lc perllibs=-lpthread -ldl -lm -lutil -lc libc= so=dylib useshrplib=false libperl=libperl.a gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs dlext=bundle d_dlsymun=undef ccdlflags=' ' cccdlflags=' ' lddlflags=' -mmacosx-version-min=10.10 -bundle -undefined dynamic_ +lookup -fstack-protector-strong' Characteristics of this binary (from libperl): Compile-time options: HAS_TIMES MULTIPLICITY PERLIO_LAYERS PERL_COPY_ON_WRITE PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP PERL_OP_PARENT PERL_PRESERVE_IVUV PERL_USE_SAFE_PUTENV USE_64_BIT_ALL USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LOCALE_TIME USE_PERLIO USE_PERL_ATOF USE_REENTRANT_API USE_THREAD_SAFE_LOCALE Built under darwin Compiled at Apr 6 2023 06:01:16 @INC: /Applications/XAMPP/xamppfiles/lib/perl5/site_perl/5.34.1/darwin-t +hread-multi-2level /Applications/XAMPP/xamppfiles/lib/perl5/site_perl/5.34.1 /Applications/XAMPP/xamppfiles/lib/perl5/5.34.1/darwin-thread-mult +i-2level /Applications/XAMPP/xamppfiles/lib/perl5/5.34.1

However, I can't seem to install DBD::mysql because of some architecture mismatch.

I got the Makefile process sorted out:

/Applications/XAMPP/bin/perl Makefile.PL --mysql_config /Applications/ +XAMPP/xamppfiles/bin/mysql_config --testuser=root --libs=-L/Applicati +ons/XAMPP/xamppfiles/lib/ --cflags=-I/Applications/XAMPP/xamppfiles/i +nclude/

And it works just fine:

I will use the following settings for compiling and testing: cflags (User's choice) = -I/Applications/XAMPP/xamppfiles/inc +lude/ embedded (mysql_config ) = libs (User's choice) = -L/Applications/XAMPP/xamppfiles/lib +/ mysql_config (Users choice ) = /Applications/XAMPP/xamppfiles/bin/m +ysql_config nocatchstderr (default ) = 0 nofoundrows (default ) = 0 nossl (default ) = 0 testdb (User's choice) = test testhost (default ) = testpassword (default ) = testport (default ) = testsocket (default ) = testuser (User's choice) = root To change these settings, see 'perl Makefile.PL --help' and 'perldoc DBD::mysql::INSTALL'. Checking if libs are available for compiling... Looks good. Using DBI 1.643 (for perl 5.034001 on darwin-thread-multi-2level) inst +alled in /Applications/XAMPP/xamppfiles/lib/perl5/site_perl/5.34.1/da +rwin-thread-multi-2level/auto/DBI/ Writing Makefile for DBD::mysql

And make seems happy:

gcc -c -I/Applications/XAMPP/xamppfiles/lib/perl5/site_perl/5.34.1/da +rwin-thread-multi-2level/auto/DBI -I/Applications/XAMPP/xamppfiles/in +clude/ -DDBD_MYSQL_WITH_SSL -g -fno-common -DPERL_DARWIN -no-cpp-pre +comp -mmacosx-version-min=10.10 -fno-strict-aliasing -pipe -fstack-pr +otector-strong -DPERL_USE_SAFE_PUTENV -O3 -DVERSION=\"4.050\" -DXS_ +VERSION=\"4.050\" "-I/Applications/XAMPP/xamppfiles/lib/perl5/5.34.1 +/darwin-thread-multi-2level/CORE" socket.c Running Mkbootstrap for DBD::mysql () chmod 644 mysql.bs rm -f blib/arch/auto/DBD/mysql/mysql.bundle gcc -mmacosx-version-min=10.10 -bundle -undefined dynamic_lookup -fst +ack-protector-strong dbdimp.o mysql.o socket.o -o blib/arch/auto/DBD +/mysql/mysql.bundle \ \ chmod 755 blib/arch/auto/DBD/mysql/mysql.bundle cp mysql.bs blib/arch/auto/DBD/mysql/mysql.bs chmod 644 blib/arch/auto/DBD/mysql/mysql.bs Manifying blib/man3/Bundle::DBD::mysql.3 Manifying blib/man3/DBD::mysql::INSTALL.3 Manifying blib/man3/DBD::mysql.3

But make test fails bigtime because .cpan/build/DBD-mysql-4.050-0/blib/arch/auto/DBD/mysql/mysql.bundle is the wrong architecture:

PERL_DL_NONLAZY=1 /Applications/XAMPP/xamppfiles/bin/perl "-MExtUtils: +:Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/00base.t .............................. 1/6 # Failed test 'use DBD::mysql;' # at t/00base.t line 15. # Tried to use 'DBD::mysql'. # Error: Can't load '/Users/cody/.cpan/build/DBD-mysql-4.050-0/bl +ib/arch/auto/DBD/mysql/mysql.bundle' for module DBD::mysql: dlopen(/U +sers/cody/.cpan/build/DBD-mysql-4.050-0/blib/arch/auto/DBD/mysql/mysq +l.bundle, 0x0002): tried: '/Users/cody/.cpan/build/DBD-mysql-4.050-0/ +blib/arch/auto/DBD/mysql/mysql.bundle' (mach-o file, but is an incomp +atible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/ +Preboot/Cryptexes/OS/Users/cody/.cpan/build/DBD-mysql-4.050-0/blib/ar +ch/auto/DBD/mysql/mysql.bundle' (no such file), '/Users/cody/.cpan/bu +ild/DBD-mysql-4.050-0/blib/arch/auto/DBD/mysql/mysql.bundle' (mach-o +file, but is an incompatible architecture (have 'arm64', need 'x86_64 +')) at /Applications/XAMPP/xamppfiles/lib/perl5/5.34.1/darwin-thread- +multi-2level/DynaLoader.pm line 197. # at t/00base.t line 15.

So at some point I need to tell one of these processes, generating the Makefile.PL or doing the make, or both, that we're on x86_64? How do I do that exactly?

TIA

Replies are listed 'Best First'.
Re: New M2 based Mac and architecture questions
by karlgoethebier (Abbot) on Jun 25, 2023 at 12:42 UTC

    Maybe it will help if you read this.

    «The Crux of the Biscuit is the Apostrophe»

      That looks very promising, thank you. I will report my results in a few hours when I get home.

Re: New M2 based Mac and architecture questions
by kcott (Archbishop) on Jun 25, 2023 at 09:11 UTC

    G'day Cody Fendant,

    "... generating the Makefile.PL or doing the make ..."

    The generation of Makefile.PL is done by the author and supplied as part of the distribution. If you follow DBD::mysql to DBD-mysql-4.050, you'll see it listed there.

    Amongst other files you'll see listed, there's DBD::mysql::INSTALL. This has a lot of information. I'd probably look at "SPECIAL SYSTEMS: macOS" first; although, as I'm not familiar with your system, I don't know how helpful that might be.

    — Ken

      Sorry for the confusion. I meant "generating the makefile", not "generating the Makefile.PL".