openEuler ARM 使用 vdbench50407
系统信息:openEuler 22.03 (LTS-SP4) Linux 5.10.0-216.0.0.115.oe2203sp4.aarch64
1. 软件包获取
- vdbench src https://www.oracle.com/downloads/server-storage/vdbench-source-downloads.html
- vdbench bin https://www.oracle.com/downloads/server-storage/vdbench-downloads.html
2. 编译动态库
# 默认安装java-11-openjdk
dnf install java java-devel
# 获取java.home路径
java -XshowSettings:properties -version# 解压vdbench50407源码包并创建linux目录
unzip vdbench50407.src.zip -d /root/vdbench50407-src/
cd /root/vdbench50407-src/src/
mkdir linux# 更新 make.linux 文件,vdb=vdbench源码路径|java=java.home路径|删除-m32和-m64字符
cd Jni/
sed -i 's#vdb=$mine/vdbench504#vdb=/root/vdbench50407-src/src#g' make.linux
sed -i 's#java=/net/sbm-240a.us.oracle.com/export/swat/swat_java/linux/jdk1.5.0_22/#java=/usr/lib/jvm/java-11-openjdk-11.0.25.9-3.oe2203sp4.aarch64/#g' make.linux
sed -i 's/-m32//g' make.linux
sed -i 's/-m64//g' make.linux# 更新vdbjni.h文件,118行首增加 extern
vim vdbjni.h
char ptod_txt[256]; /* workarea for PTOD displays */
# 更新为
extern char ptod_txt[256]; /* workarea for PTOD displays */# 执行编译
./make.linux
3. 运行vdbench
# 解压vdbench50407 bin包
unzip vdbench50407.zip -d /root/vdbench50407/# 复制源码目录下 linux64.so 动态库文件,并重新命名 aarch64.so
cp /root/vdbench50407-src/src/linux/linux64.so /root/vdbench50407/linux/aarch64.so# 测试
cd /root/vdbench50407
./vdbench -t
4. 错误处理
4.1. 错误1
target directory: /root/vdbench50407-src/src
Compiling 32 bit
In file included from /root/vdbench50407-src/src/Jni/vdbjni.c:13:
/root/vdbench50407-src/src/Jni/vdbjni.h:23:10: fatal error: jni.h: No such file or directory23 | #include <jni.h>| ^~~~~~~
compilation terminated.
In file included from /root/vdbench50407-src/src/Jni/vdblinux.c:18:
/root/vdbench50407-src/src/Jni/vdbjni.h:23:10: fatal error: jni.h: No such file or directory23 | #include <jni.h>| ^~~~~~~
compilation terminated.
In file included from /root/vdbench50407-src/src/Jni/vdb_dv.c:13:
/root/vdbench50407-src/src/Jni/vdbjni.h:23:10: fatal error: jni.h: No such file or directory23 | #include <jni.h>| ^~~~~~~
解决方法
# make.linux文件,java路径配置错误
vim /root/vdbench50407-src/src/Jni/make.linuxvdb=/root/vdbench50407-src/src
java=/usr/lib/jvm/java-11-openjdk-11.0.25.9-3.oe2203sp4.aarc64/
jni=$vdb/Jni# 不确定JDK路径,通过以下方法查找
find / -type f -name 'jni.h'
5. 错误1
/usr/bin/ld: vdblinux.o:(.bss+0x0): multiple definition of `ptod_txt'; vdbjni.o:(.bss+0x0): first defined here
/usr/bin/ld: vdb_dv.o:(.bss+0x0): multiple definition of `ptod_txt'; vdbjni.o:(.bss+0x0): first defined here
/usr/bin/ld: vdb.o:(.bss+0x0): multiple definition of `ptod_txt'; vdbjni.o:(.bss+0x0): first defined here
collect2: error: ld returned 1 exit status
chmod: cannot access '/root/vdbench50407-src/src/linux/linux32.so': No such file or directory
Compiling 64 bit
Linking 64 bit/usr/bin/ld: vdblinux.o:(.bss+0x0): multiple definition of `ptod_txt'; vdbjni.o:(.bss+0x0): first defined here
/usr/bin/ld: vdb_dv.o:(.bss+0x0): multiple definition of `ptod_txt'; vdbjni.o:(.bss+0x0): first defined here
/usr/bin/ld: vdb.o:(.bss+0x0): multiple definition of `ptod_txt'; vdbjni.o:(.bss+0x0): first defined here
collect2: error: ld returned 1 exit status
解决方法
# 更新vdbjni.h文件,118行首增加 extern
vim /root/vdbench50407-src/src/Jni/vdbjni.hchar ptod_txt[256]; /* workarea for PTOD displays */
# 更新为
extern char ptod_txt[256]; /* workarea for PTOD displays */