Linpack的编译和安装

使用的是openmpi + Gotoblas + HPL
此间过程结合参考了如下地址的相关信息:
1. http://www.ithao123.cn/content-782997.html
2. http://wenku.baidu.com/link?url=Geex2oLJQnJYh2S0alPeqO2TGbQoZ_6GPbsdX-41NTBFFMIT_oANCDgThFI8I3lhTaiFU2PBRhJcItNtCyEq3zM2glfqVKUgCClCbvj2H3K
3. http://james23dier.iteye.com/blog/780098

分别下载
这里写图片描述
中的前两个,因为网上大部分人用的是mpich,而本人以前一直用的openmpi,所以就直接用其代替,效果是一样的。
Gotoblas,BLAS库(Basic Linear Algebra Subprograms)是执行向量和矩阵运算的子程序集合。
HPL,linpack测试的软件,可在http://www.netlib.org/benchmark/hpl/下载最新版本。

这里写图片描述
1. 安装openmpi,这里要注意openmpi 的安装路径,因为后面使用其include路径以及其中的lib路径需要用到。安装过程不再赘述。
2. 建立linpack文件夹路径,其下为解压后的
这里写图片描述
3. 进入Gotoblas文件夹,在终端下执行./ quickbuild.64bit(如果你是32位系统,则执行./ quickbuild.31bit)进行快速安装,当然,你也可以依据README里的介绍自定义安装。如果安装正常,在本目录下就会生成libgoto2.a和libgoto2.so两个文件。
期间会遇到问题,是由于CPU太新,配置文件无法识别引起的
参考:http://blog.sina.com.cn/s/blog_733912170100snnh.html
修改的Makefile.rule文件如下:
1 #
2 # Beginning of user configuration
3 #
4
5 # This library’s version
6 VERSION = 1.13
7
8 # You can specify the target architecture, otherwise it’s
9 # automatically detected.
10 # TARGET = PENRYN
11
12 # If you want to support multiple architecture in one binary
13 # DYNAMIC_ARCH = 1
14
15 # C compiler including binary type(32bit / 64bit). Default is gcc.
16 # Don’t use Intel Compiler or PGI, it won’t generate right codes as I expect.
17 CC = gcc
18
19 # Fortran compiler. Default is g77.
20 FC = gfortran
21
22 # Even you can specify cross compiler
23 # CC = x86_64-w64-mingw32-gcc
24 # FC = x86_64-w64-mingw32-gfortran
25
26 # If you need 32bit binary, define BINARY=32, otherwise define BINARY=64
27 BINARY=64
28
29 # About threaded BLAS. It will be automatically detected if you don’t
30 # specify it.
31 # For force setting for single threaded, specify USE_THREAD = 0
32 # For force setting for multi threaded, specify USE_THREAD = 1
33 # USE_THREAD = 0
34
35 # If you’re going to use this library with OpenMP, please comment it in.
36 # USE_OPENMP = 1
37
38 # You can define maximum number of threads. Basically it should be
39 # less than actual number of cores. If you don’t specify one, it’s
40 # automatically detected by the the script.
41 # NUM_THREADS = 24
42
43 # If you don’t need CBLAS interface, please comment it in.
44 # NO_CBLAS = 1
45
46 # If you want to use legacy threaded Level 3 implementation.
47 # USE_SIMPLE_THREADED_LEVEL3 = 1
48
49 # If you want to drive whole 64bit region by BLAS. Not all Fortran
50 # compiler supports this. It’s safe to keep comment it out if you
51 # are not sure(equivalent to “-i8” option).
52 # INTERFACE64 = 1
53
54 # Unfortunately most of kernel won’t give us high quality buffer.
55 # BLAS tries to find the best region before entering main function,
56 # but it will consume time. If you don’t like it, you can disable one.
57 # NO_WARMUP = 1
58
59 # If you want to disable CPU/Memory affinity on Linux.
60 # NO_AFFINITY = 1
61
62 # If you would like to know minute performance report of GotoBLAS.
63 # FUNCTION_PROFILE = 1
64
65 # Support for IEEE quad precision(it’s real REAL*16)( under testing)
66 # QUAD_PRECISION = 1
67
68 # Theads are still working for a while after finishing BLAS operation
69 # to reduce thread activate/deactivate overhead. You can determine
70 # time out to improve performance. This number should be from 4 to 30
71 # which corresponds to (1 << n) cycles. For example, if you set to 26,
72 # thread will be running for (1 << 26) cycles(about 25ms on 3.0GHz
73 # system). Also you can control this mumber by GOTO_THREAD_TIMEOUT
74 # CCOMMON_OPT += -DTHREAD_TIMEOUT=26
75
76 # Using special device driver for mapping physically contigous memory
77 # to the user space. If bigphysarea is enabled, it will use it.
78 # DEVICEDRIVER_ALLOCATION = 1
79
80 # If you need to synchronize FP CSR between threads (for x86/x86_64 only).
81 # CONSISTENT_FPCSR = 1
82
83 # If you need santy check by comparing reference BLAS. It’ll be very
84 # slow (Not implemented yet).
85 # SANITY_CHECK = 1
86
87 # Common Optimization Flag; -O2 is enough.
88 COMMON_OPT += -O2
89
90 # Profiling flags
91 COMMON_PROF = -pg
92
93 #
94 # End of user configuration
95 #
这里写图片描述
如上操作后,问题解决。
(4)安装HPL。
进入hpl文件夹从setup文件夹下提取与自己平台相近的Make.文件,复制到hpl文件夹内,比如我们的平台为Intel xeon,所以就选择了Make.Linux_PII_FBLAS,它代表Linux操作系统、PII平台、采用FBLAS库。
编辑刚刚复制的文件,根据说明修改各个选项,使之符合自己的系统,比如我们系统的详细情况为,Intel xeon平台,mpich2安装目录为/usr/local/mipch2,hpl和gotoblas安装目录为/root/linpack,下面是我们的配置文件Make.Linux_xeon,对需要修改的部分我们做了注解,大家可以参考修改:
1. # - shell ————————————————————–
2. # ———————————————————————-
3. #
4. SHELL = /bin/sh
5. #
6. CD = cd
7. CP = cp
8. LN_S = ln -s
9. MKDIR = mkdir
10. RM = /bin/rm -f
11. TOUCH = touch
12. #
13. # ———————————————————————-
14. # - Platform identifier ————————————————
15. # ———————————————————————-
16. #
17. ARCH = Linux_xeon //设置平台类型
18. #
19. # ———————————————————————-
20. # - HPL Directory Structure / HPL library ——————————
21. # ———————————————————————-
22. #
23. TOPdir = (HOME)/linpack/hpl//24.INCdir= (TOPdir)/include
25. BINdir =

  • 5
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值