鲲鹏社区首页
中文
注册
我要评分
文档获取效率
文档正确性
内容完整性
文档易理解
在线提单
论坛求助

软件安装及环境配置

操作步骤

  1. 上传Stream安装包“STREAM-master.zip”到指定的一台服务器目录“/home”目录。
  2. 使用PuTTY工具,以root用户登录服务器。
  3. 执行以下命令解压Stream安装包。
    cd /home
    unzip STREAM-master.zip
  4. 执行以下命令进入“STREAM-master”目录。
    cd STREAM-master
  5. 执行以下命令修改“Makefile”文件。
    1. 打开文件。
      vi Makefile
    2. 按“i”进入编辑模式,将“Makefile”文件内容替换为如下。
      CC = gcc
      #CFLAGS = -O2 -fopenmp
      CFLAGS = -O2 -ftree-vectorize -fopenmp -DSTREAM_ARRAY_SIZE=96000000 -DNTIMES=100 -mcmodel=large
      #FC = gfortran
      #FFLAGS = -O2 -fopenmp
      all: stream_c.exe
      stream_f.exe: stream.f mysecond.o
      	$(CC) $(CFLAGS) -c mysecond.c
      	$(FC) $(FFLAGS) -c stream.f
      	$(FC) $(FFLAGS) stream.o mysecond.o -o stream_f.exe
      stream_c.exe: stream.c
      	$(CC) $(CFLAGS) stream.c -o stream_c.exe
      clean:
      	rm -f stream_f.exe stream_c.exe *.o
      # an example of a more complex build line for the Intel icc compiler
      stream.icc: stream.c
      	icc -O3 -xCORE-AVX2 -ffreestanding -qopenmp -DSTREAM_ARRAY_SIZE=80000000 -DNTIMES=20 stream.c -o stream.omp.AVX2.80M.20x.icc
    3. 按“Esc”键,输入:wq!,按“Enter”保存并退出编辑。
  6. 执行以下命令进行编译。
    make
    编译成功后会在当前目录下生成“stream_c.exe”的可执行文件,可使用ll命令查看,结果如图1所示。
    图1 编译结果