V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
MySQL 5.5 Community Server
MySQL 5.6 Community Server
Percona Configuration Wizard
XtraBackup 搭建主从复制
Great Sites on MySQL
Percona
MySQL Performance Blog
Severalnines
推荐管理工具
Sequel Pro
phpMyAdmin
推荐书目
MySQL Cookbook
MySQL 相关项目
MariaDB
Drizzle
参考文档
http://mysql-python.sourceforge.net/MySQLdb.html
waterlaw
V2EX  ›  MySQL

MySQL8.4 的代码在 Mac 上编译报错了?

  •  1
     
  •   waterlaw ·
    water-law · 193 天前 · 1292 次点击
    这是一个创建于 193 天前的主题,其中的信息可能已经有所发展或是发生改变。

    git clone -b 8.4 https://github.com/mysql/mysql-server.git

    mkdir build

    cd build

    cmake .. -DWITH_DEBUG=1
    -DDOWNLOAD_BOOST=1
    -DWITH_BOOST=/Users/zjp/Projects/mysql-server/build/boost
    -DCMAKE_INSTALL_PREFIX=/Users/zjp/Projects/mysql-server/build/install
    -DMYSQL_DATADIR=/Users/zjp/Projects/mysql-server/build/install/data

    make -j8

    输出日志

    [ 17%] Building CXX object extra/icu/CMakeFiles/icui18n.dir/icu-release-73-1/source/i18n/ufieldpositer.cpp.o [ 17%] Building CXX object extra/icu/CMakeFiles/icui18n.dir/icu-release-73-1/source/i18n/uitercollationiterator.cpp.o [ 17%] Building CXX object extra/icu/CMakeFiles/icui18n.dir/icu-release-73-1/source/i18n/ulistformatter.cpp.o [ 17%] Building CXX object extra/icu/CMakeFiles/icui18n.dir/icu-release-73-1/source/i18n/ulocdata.cpp.o [ 17%] Building CXX object extra/icu/CMakeFiles/icui18n.dir/icu-release-73-1/source/i18n/umsg.cpp.o [ 17%] Building CXX object extra/icu/CMakeFiles/icui18n.dir/icu-release-73-1/source/i18n/unesctrn.cpp.o [ 17%] Building CXX object extra/icu/CMakeFiles/icui18n.dir/icu-release-73-1/source/i18n/uni2name.cpp.o [ 18%] Building CXX object extra/icu/CMakeFiles/icui18n.dir/icu-release-73-1/source/i18n/units_complexconverter.cpp.o [ 18%] Building CXX object extra/icu/CMakeFiles/icui18n.dir/icu-release-73-1/source/i18n/units_converter.cpp.o [ 18%] Building CXX object extra/icu/CMakeFiles/icui18n.dir/icu-release-73-1/source/i18n/units_data.cpp.o [ 18%] Building CXX object extra/icu/CMakeFiles/icui18n.dir/icu-release-73-1/source/i18n/units_router.cpp.o [ 18%] Building CXX object extra/icu/CMakeFiles/icui18n.dir/icu-release-73-1/source/i18n/unum.cpp.o [ 18%] Building CXX object extra/icu/CMakeFiles/icui18n.dir/icu-release-73-1/source/i18n/unumsys.cpp.o [ 18%] Building CXX object extra/icu/CMakeFiles/icui18n.dir/icu-release-73-1/source/i18n/upluralrules.cpp.o [ 18%] Building CXX object extra/icu/CMakeFiles/icui18n.dir/icu-release-73-1/source/i18n/uregexc.cpp.o [ 18%] Building CXX object extra/icu/CMakeFiles/icui18n.dir/icu-release-73-1/source/i18n/uregex.cpp.o [ 18%] Building CXX object extra/icu/CMakeFiles/icui18n.dir/icu-release-73-1/source/i18n/uregion.cpp.o [ 18%] Building CXX object extra/icu/CMakeFiles/icui18n.dir/icu-release-73-1/source/i18n/uspoof_build.cpp.o [ 18%] Building CXX object extra/icu/CMakeFiles/icui18n.dir/icu-release-73-1/source/i18n/usearch.cpp.o [ 18%] Building CXX object extra/icu/CMakeFiles/icui18n.dir/icu-release-73-1/source/i18n/uspoof_conf.cpp.o [ 18%] Building CXX object extra/icu/CMakeFiles/icui18n.dir/icu-release-73-1/source/i18n/uspoof.cpp.o [ 18%] Building CXX object extra/icu/CMakeFiles/icui18n.dir/icu-release-73-1/source/i18n/uspoof_impl.cpp.o [ 18%] Building CXX object extra/icu/CMakeFiles/icui18n.dir/icu-release-73-1/source/i18n/utf16collationiterator.cpp.o [ 18%] Building CXX object extra/icu/CMakeFiles/icui18n.dir/icu-release-73-1/source/i18n/utf8collationiterator.cpp.o [ 18%] Building CXX object extra/icu/CMakeFiles/icui18n.dir/icu-release-73-1/source/i18n/utmscale.cpp.o [ 18%] Building CXX object extra/icu/CMakeFiles/icui18n.dir/icu-release-73-1/source/i18n/utrans.cpp.o [ 18%] Building CXX object extra/icu/CMakeFiles/icui18n.dir/icu-release-73-1/source/i18n/vtzone.cpp.o [ 18%] Building CXX object extra/icu/CMakeFiles/icui18n.dir/icu-release-73-1/source/i18n/vzone.cpp.o [ 18%] Building CXX object extra/icu/CMakeFiles/icui18n.dir/icu-release-73-1/source/i18n/zonemeta.cpp.o [ 18%] Building CXX object extra/icu/CMakeFiles/icui18n.dir/icu-release-73-1/source/i18n/zrule.cpp.o [ 18%] Building CXX object extra/icu/CMakeFiles/icui18n.dir/icu-release-73-1/source/i18n/ztrans.cpp.o [ 18%] Linking CXX static library libicui18n.a [ 18%] Built target icui18n [ 18%] Linking CXX executable ../../../../runtime_output_directory/routertest_mysql_protocol_classic_protocol_message [ 18%] Built target routertest_mysql_protocol_classic_protocol_message make: *** [all] Error 2

    主要是弹窗让我安装 m4, 安装了下次编译还给我弹出来,这有办法破解吗?

    1 条回复    2024-06-03 10:15:05 +08:00
    ShuA1
        1
    ShuA1  
       192 天前
    出现这个问题通常是因为缺少 m4 工具或路径配置问题,特别是如果在 macOS 或 Linux 系统中。如果你已经安装了 m4 ,但编译过程仍提示需要安装,可以尝试以下解决方案:

    1. 确认 m4 是否正确安装
    首先,确保 m4 已正确安装并且在系统路径中可用。你可以运行以下命令检查:
    > which m4
    如果 m4 已安装,此命令应返回 m4 的路径。如果未安装,可以使用以下命令进行安装:

    macOS (使用 Homebrew):
    > brew install m4

    2. 确认路径
    有时候,即使安装了 m4 ,系统路径中可能没有包含它。可以手动添加路径:
    > export PATH=/usr/local/bin:$PATH
    将 /usr/local/bin 替换为 m4 安装路径所在的位置。

    3. 清理缓存和重新编译
    有时候,CMake 的缓存会导致问题。尝试清理缓存并重新生成 Makefile:
    > cd /path/to/your/build
    > rm -rf *
    > cmake .. -DWITH_DEBUG=1 -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/Users/zjp/Projects/mysql-server/build/boost -DCMAKE_INSTALL_PREFIX=/Users/zjp/Projects/mysql-server/build/install -DMYSQL_DATADIR=/Users/zjp/Projects/mysql-server/build/install/data
    > make -j8
    4. 使用 autoreconf
    在某些情况下,m4 需要 autoconf 配合工作。可以尝试安装 autoconf 并使用 autoreconf:
    macOS:
    > brew install autoconf

    然后在源码目录运行:
    > autoreconf -i

    5. 检查权限
    确保你有足够的权限执行 m4 以及所有相关工具。如果使用的是 macOS ,可能需要通过 sudo 安装工具:
    > sudo brew install m4

    6. 验证 m4 版本
    有时候,编译可能需要特定版本的 m4 。你可以检查版本并更新:
    > m4 --version

    如果这些步骤无法解决问题,请提供更多的编译错误日志以便进一步诊断。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5447 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 02:46 · PVG 10:46 · LAX 18:46 · JFK 21:46
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.