cust@cust:~$ cd ~/Desktop/multi2sim-5.0
cust@cust:~/Desktop/multi2sim-5.0$ g++ matx.cpp -o matx
cust@cust:~/Desktop/multi2sim-5.0$ ./matx
Enter the order of matrix (must be n*n)
1
* 1
Multiplication possible
Enter the elements of matrix 1
23
Elements of matrix 1 are
23
Enter the elements of matrix 2
12
Elements of matrix 2 are
12
Multiplication
276 cust@cust:~/Desktop/multi2sim-5.0$ m2s --x86-debug-syscall stdout matx
; Multi2Sim 5.0 - A Simulation Framework for CPU-GPU Heterogeneous Computing
; Please use command 'm2s --help' for a list of command-line options.
; Simulation alpha-numeric ID: SHxSw
[ELF Reader] [/home/cust/Desktop/multi2sim-5.0/matx] Error: 64-bit ELF files not
supported
The ELF file being loaded is a 64-bit file, currently not supported by
Multi2Sim. If you are compiling your own source code on a 64-bit machine, please
use the '-m32' flag in the gcc command-line. If you get compilation errors
related with missing '.h' files, check that the 32-bit gcc package associated
with your Linux distribution is installed.
答案1
你可能正在运行 64 位 Linux,但你使用的应用程序不支持 64 位二进制文件进行模拟。因此只需添加
-m32
到你的 g++ 行。
g++ -m32 matx.cpp -o matx
正如建议的那样:
正在加载的 ELF 文件是 64 位文件,目前 Multi2Sim 不支持。如果您在 64 位机器上编译自己的源代码,请在 gcc 命令行中使用“-m32”标志。如果您收到与缺少“.h”文件相关的编译错误,请检查是否安装了与您的 Linux 发行版相关的 32 位 gcc 包。