我要评分
获取效率
正确性
完整性
易理解

Error Reported During Boost Installation

Symptom

After the ./b2 install command is run, the error message "gcc: error: unrecognized command line option '-m64'" is displayed.

Key Process and Cause Analysis

-m64 is an x86 64-bit application compilation option. To generate code for the AMD x86 64-bit architecture, set int to 32 bits and long and pointer to 64 bits. However, the ARM64 platform does not support this setting.

Conclusion and Solution

Run the following command to modify the Boost source code and set the compilation option of the ARM64 platform to -mabi=lp64:

sed -ri 's/\-m64/\-mabi=lp64/g' `grep -Rl '\-m64'`