---
title: 常见应用使能方式
description: "1. MySQL"
url: https://www.hikunpeng.com/document/detail/zh/kunpengdevkithistory/hgcc/hist-hgcc/kunpenghgcc_06_0008.html
sourcePath: /source/zh/kunpengdevkithistory/hgcc/hist-hgcc/kunpenghgcc_06_0008.html
indexId: 5837c0b97e74a5714a54073099d69ecb583b2f592b7270b8d80223295b8cf42a71
---
# 常见应用使能方式

1. MySQL
  1 cmake .. -DCMAKE_INSTALL_PREFIX=/home/install/mysql-8.0.25 -DBUILD_CONFIG=mysql_release -DWITH_BOOST=../boost -DCMAKE_C_FLAGS="-Wl,-q" -DCMAKE_CXX_FLAGS="-Wl,-q" -DCMAKE_C_LINK_FLAGS="-Wl,-q" -DCMAKE_CXX_LINK_FLAGS="-Wl,-q -fbolt-use=/path/to/mysqld.profile -fbolt-target=mysqld" -DCMAKE_EXE_LINKER_FLAGS="-Wl,-q"

2. MongoDB
  1 2 3 4 5 6 7 # 带重定位信息的基线版本构建 python3 buildscripts/scons.py MONGO_VERSION=6.1.0 DESTDIR=/usr/local/mongo install-all-meta CFLAGS="-march=armv8-a+crc -mtune=generic -Wl,-q" CXXFLAGS="-march=armv8-a+crc -mtune=generic -Wl,-q" LINKFLAGS="-Wl,-q" -j 128 --disable-warnings-as-errors # perf采样 + perf2bolt生成bolt profile # 使用boltuse构建优化版本，注意如果使用的llvm-bolt版本不支持pie，需要手动在SConstruct中删掉pie选项 python3 buildscripts/scons.py MONGO_VERSION=6.1.0 DESTDIR=/usr/local/mongo install-devcore CFLAGS="-march=armv8-a+crc -mtune=generic -Wl,-q" CXXFLAGS="-march=armv8-a+crc -mtune=generic -Wl,-q" LINKFLAGS="-Wl,-q -fbolt-use=./mongod.profile -fbolt-target=mongod" -j 128 --disable-warnings-as-errors

3. Redis
  1 make CFLAGS="-Wl,-q" LDFLAGS="-fbolt-use=/path/to/redis.profile -fbolt-target=redis-server"

  默认使用当前路径下文件名为data.fdata的profile完成优化，可以使用-fbolt-use=FILE指定使用的profile，如-fbolt-use=/tmp/a.fdata 可以和-fbolt-target、-fbolt-option=<options>共用
