在macOS Catalina 10.15.1下安装DBD::mysql有困难

问题描述 投票:0回答:1

在macOS Catalina 10.15.1下无法安装DBD::mysql。通过brew安装了Mysql 8.0.18和openssl 1.0.2t。

下面是模块安装日志。

cpan[1]> install DBD::mysql
..........

I will use the following settings for compiling and testing:

  cflags        (mysql_config) = -I/usr/local/Cellar/mysql/8.0.18_1/include/mysql
  embedded      (guessed     ) = 
  ldflags       (guessed     ) = 
  libs          (mysql_config) = -L/usr/local/Cellar/mysql/8.0.18_1/lib -L/usr/local/opt/openssl/lib -lmysqlclient -lssl -lcrypto
  mysql_config  (guessed     ) = mysql_config
  nocatchstderr (default     ) = 0
  nofoundrows   (default     ) = 0
  nossl         (default     ) = 0
  testdb        (default     ) = test
  testhost      (default     ) = 
  testpassword  (default     ) = 
  testport      (default     ) = 
  testsocket    (default     ) = 
  testuser      (guessed     ) = dmitry

To change these settings, see 'perl Makefile.PL --help' and
'perldoc DBD::mysql::INSTALL'.

Checking if libs are available for compiling...
Looks good.

Checking if your kit is complete...
Looks good
Using DBI 1.631 (for perl 5.018004 on darwin-thread-multi-2level) installed in /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level/auto/DBI/
Writing Makefile for DBD::mysql
Wide character in print at /System/Library/Perl/5.18/ExtUtils/MakeMaker.pm line 1034.
Wide character in print at /System/Library/Perl/5.18/ExtUtils/MakeMaker.pm line 1034.
Writing MYMETA.yml and MYMETA.json
cp lib/DBD/mysql/GetInfo.pm blib/lib/DBD/mysql/GetInfo.pm
cp lib/Bundle/DBD/mysql.pm blib/lib/Bundle/DBD/mysql.pm
cp lib/DBD/mysql/INSTALL.pod blib/lib/DBD/mysql/INSTALL.pod
cp lib/DBD/mysql.pm blib/lib/DBD/mysql.pm
cc -c  -I/System/Library/Perl/Extras/5.18/darwin-thread-multi-2level/auto/DBI -I/usr/local/Cellar/mysql/8.0.18_1/include/mysql -DDBD_MYSQL_WITH_SSL -g  -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector -Os   -DVERSION=\"4.050\" -DXS_VERSION=\"4.050\"  -iwithsysroot "/System/Library/Perl/5.18/darwin-thread-multi-2level/CORE"   dbdimp.c
In file included from dbdimp.c:15:
./dbdimp.h:20:10: fatal error: 'DBIXS.h' file not found
#include <DBIXS.h>  /* installed by the DBI module                        */
         ^~~~~~~~~
1 error generated.
make: *** [dbdimp.o] Error 1
  DVEEDEN/DBD-mysql-4.050.tar.gz
  /usr/bin/make -- NOT OK
Running make test
  Can't test without successful make
Running make install
  Make had returned bad status, install seems impossible
Failed during this command:
 DVEEDEN/DBD-mysql-4.050.tar.gz               : make NO

cpan[2]> 

似乎编译器找不到DBIXS.h文件 Find在系统中找到了这个文件。

/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Perl/Extras/5.18/darwin-thread-multi-2level/auto/DBI/DBIXS.h
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Perl/Extras/5.18/darwin-thread-multi-2level/auto/DBI/DBIXS.h
/System/Volumes/Data/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Perl/Extras/5.18/darwin-thread-multi-2level/auto/DBI/DBIXS.h
/System/Volumes/Data/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Perl/Extras/5.18/darwin-thread-multi-2level/auto/DBI/DBIXS.h
/System/Volumes/Data/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Perl/Extras/5.18/darwin-thread-multi-2level/auto/DBI/DBIXS.h
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Perl/Extras/5.18/darwin-thread-multi-2level/auto/DBI/DBIXS.h

如何在编译时包含这个头文件?

更新

我的搜索导致我使用标准路径构建软件包,其中没有头文件

/System/Library/Perl/5.18/darwin-thread-multi-2level

而且你必须使用路径

/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Perl/5.18/darwin-thread-multi-2level
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Perl/5.18/darwin-thread-multi-2level

但是这里要怎么指定呢?我在安装Mac::SystemDirectory时也遇到了同样的问题。

SystemLibraryPerl5.18darwin-thread-multi-2levelCOREEXTERN.h - 没有找到文件。

Perl信息。

 perl -V
Summary of my perl5 (revision 5 version 18 subversion 4) configuration:

  Platform:
    osname=darwin, osvers=19.0, archname=darwin-thread-multi-2level
    uname='darwin osx391.sd.apple.com 19.0 darwin kernel version 18.0.0: tue jul 9 11:12:08 pdt 2019; root:xnu-4903.201.2.100.7~1release_x86_64 x86_64 '
    config_args='-ds -e -Dprefix=/usr -Dccflags=-g  -pipe  -Dldflags= -Dman3ext=3pm -Duseithreads -Duseshrplib -Dinc_version_list=none -Dcc=cc'
    hint=recommended, useposix=true, d_sigaction=define
    useithreads=define, usemultiplicity=define
    useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
    use64bitint=define, use64bitall=define, uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
  Compiler:
    cc='cc', ccflags =' -g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector',
    optimize='-Os',
    cppflags='-g -pipe -fno-common -DPERL_DARWIN -fno-strict-aliasing -fstack-protector'
    ccversion='', gccversion='4.2.1 Compatible Apple LLVM 11.0.0 (clang-1100.0.32.4) (-macos10.15-objc-selector-opts)', gccosandvers=''
    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
    ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -fstack-protector'
    libpth=/usr/lib /usr/local/lib
    libs= 
    perllibs=
    libc=, so=dylib, useshrplib=true, libperl=libperl.dylib
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup -fstack-protector'


Characteristics of this binary (from libperl): 
  Compile-time options: HAS_TIMES MULTIPLICITY PERLIO_LAYERS
                        PERL_DONT_CREATE_GVSV
                        PERL_HASH_FUNC_ONE_AT_A_TIME_HARD
                        PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP
                        PERL_PRESERVE_IVUV PERL_SAWAMPERSAND 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_PERLIO USE_PERL_ATOF
                        USE_REENTRANT_API
  Locally applied patches:
    /Library/Perl/Updates/<version> comes before system perl directories
    installprivlib and installarchlib points to the Updates directory
  Built under darwin
  Compiled at Aug 23 2019 16:44:31
  @INC:
    /Library/Perl/5.18/darwin-thread-multi-2level
    /Library/Perl/5.18
    /Network/Library/Perl/5.18/darwin-thread-multi-2level
    /Network/Library/Perl/5.18
    /Library/Perl/Updates/5.18.4/darwin-thread-multi-2level
    /Library/Perl/Updates/5.18.4
    /System/Library/Perl/5.18/darwin-thread-multi-2level
    /System/Library/Perl/5.18
    /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level
    /System/Library/Perl/Extras/5.18
    .
mysql macos perl dbi dbd
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.