Gerd
Gerd

Reputation: 2603

DBD::mysql installation on Catalina/Big Sur fail with 'EXTERN.h' file not found?

I install DBD::mysql on Catalina preparing:

perl Makefile.PL --testpassword=s3kr1t --testhost=localhost --testport 3306 --testuser=test --libs="-L/usr/local/opt/openssl/lib -lssl -lcrypto -L/usr/local/lib -L/usr/local/Cellar/mysql/8.0.12/lib -lmysqlclient"

after run 'make' I get an error:

/Library/Perl/5.18/darwin-thread-multi-2level/auto/DBI/DBIXS.h:22:10: fatal error: 'EXTERN.h' file not found 

s. DBD::mysql::INSTALL

Upvotes: 1

Views: 2024

Answers (2)

maarten
maarten

Reputation: 465

I got it to compile on Big Sur using:

cpanm DBD::mysql --configure-args="--cflags=-I/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/System/Library/Perl/Extras/5.30/darwin-thread-multi-2level/auto/DBI/\ -I/usr/local/mysql/include/\ -Wno-incompatible-pointer-types\ -Wno-compound-token-split-by-macro" --force

I had to disable the two warnings to get a full compile, the next one was indeed the the no rule error:

make: *** No rule to make target `/System/Library/Perl/Extras/5.30/darwin-thread-multi-2level/auto/DBI/Driver_xst.h', needed by `mysql.xsi'.  Stop.

This was solved by first doing:

cpanm DBI --force

And the doing the original:

cpanm DBD::mysql --configure-args="--cflags=-I/Library/Developer/CommandLineTools/SDKs/MacOSX11.3.sdk/System/Library/Perl/Extras/5.30/darwin-thread-multi-2level/auto/DBI/\ -I/usr/local/mysql/include/\ -Wno-incompatible-pointer-types\ -Wno-compound-token-split-by-macro" --force

Then there was one remaining issue for getting Bugzilla to work, which is solved here: https://bugzilla.mozilla.org/show_bug.cgi?id=1588175

Upvotes: 2

Gerd
Gerd

Reputation: 2603

Look at EXTERN.h:

$ find /Library/Developer/CommandLineTools -name EXTERN.h
/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/System/Library/Perl/5.30/darwin-thread-multi-2level/CORE/EXTERN.h
/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/System/Library/Perl/5.28/darwin-thread-multi-2level/CORE/EXTERN.h
/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE/EXTERN.h
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Perl/5.28/darwin-thread-multi-2level/CORE/EXTERN.h
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE/EXTERN.h

check your perl version:

$ perl -v

This is perl 5, version 18, subversion 4 (v5.18.4) built for darwin-thread-multi-2level

the right header is:

/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE/EXTERN.h

Use the correct OSX header so it work:

perl Makefile.PL --testpassword=s3kr1t --testhost=localhost --testport 3306 --testuser=test --libs="-L/usr/local/opt/openssl/lib -lssl -lcrypto -L/usr/local/lib -L/usr/local/Cellar/mysql/8.0.25_1/lib -lmysqlclient" --cflags='-I/usr/local/opt/openssl/include -I/usr/local/opt/zlib/include -I/usr/local/opt/zstd/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE -I/usr/local/Cellar/mysql/8.0.25_1/include/mysql'

PS, don't forget create mysql user 'test' with all privileges :-)

See details at:

UPGRADE for OSX 11.1 - Big Sur:

If I take the way above, I get at first the Error:

./dbdimp.h:20:10: fatal error: 'DBIXS.h' file not found
#include <DBIXS.h>  /* installed by the DBI module                        */

The fix is, extend the perl Makefile.PL to:

perl Makefile.PL --testpassword=s3kr1t --testhost=localhost --testport 3306 --testuser=test --libs="-L/usr/local/opt/openssl/lib -lssl -lcrypto -L/usr/local/lib -L/usr/local/Cellar/mysql/8.0.25_1/lib -lmysqlclient" --cflags='-I/usr/local/opt/openssl/include -I/usr/local/opt/zlib/include -I/usr/local/opt/zstd/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/System/Library/Perl/5.30/darwin-thread-multi-2level/CORE -I/usr/local/Cellar/mysql/8.0.25_1/include/mysql -I/Library//Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/System/Library/Perl/Extras/5.30/darwin-thread-multi-2level/auto/DBI'

The next problem is:

make: *** No rule to make target `/System/Library/Perl/Extras/5.30/darwin-thread-multi-2level/auto/DBI/Driver_xst.h', needed by `mysql.xsi'.  Stop.

Why this? The default installation of DBI on Big Sur is broken!

After downloading the current DBI archive DBI-1.643.tar.gz and reinstall DBI the DBD::mysql make run complete!

Now I must make a break :-) after 2 hours try and error!!!

Upvotes: 4

Related Questions