使用 LLVM Clang 编译 NAS 并行基准会出现错误

XHotSniperX

我在 Linux 上并尝试使用 LLVM Clang 编译器和 LLVM OpenMP 运行时库编译 NPB 套件(C 版本)链接

我编辑了包含的配置文件“make.def”,以便与 clang 一起使用:

#---------------------------------------------------------------------------
#
#                SITE- AND/OR PLATFORM-SPECIFIC DEFINITIONS. 
#
#---------------------------------------------------------------------------

#---------------------------------------------------------------------------
# Items in this file will need to be changed for each platform.
# (Note these definitions are inconsistent with NPB2.1.)
#---------------------------------------------------------------------------

#---------------------------------------------------------------------------
# Parallel C:
#
# For IS, which is in C, the following must be defined:
#
# CC         - C compiler 
# CFLAGS     - C compilation arguments
# C_INC      - any -I arguments required for compiling C 
# CLINK      - C linker
# CLINKFLAGS - C linker flags
# C_LIB      - any -L and -l arguments required for linking C 
#
# compilations are done with $(CC) $(C_INC) $(CFLAGS) or
#                            $(CC) $(CFLAGS)
# linking is done with       $(CLINK) $(C_LIB) $(CLINKFLAGS)
#---------------------------------------------------------------------------

#---------------------------------------------------------------------------
# This is the C compiler used for OpenMP programs
#---------------------------------------------------------------------------
CC = clang-7
# This links C programs; usually the same as ${CC}
CLINK   = clang-7

#---------------------------------------------------------------------------
# These macros are passed to the linker 
#---------------------------------------------------------------------------
C_LIB  = -L/usr/local/lib

#---------------------------------------------------------------------------
# These macros are passed to the compiler 
#---------------------------------------------------------------------------
C_INC = -I../common -I/usr/local/include

#---------------------------------------------------------------------------
# Global *compile time* flags for C programs
#---------------------------------------------------------------------------
CFLAGS  = -fopenmp -O3
# CFLAGS = -g

#---------------------------------------------------------------------------
# Global *link time* flags. Flags for increasing maximum executable 
# size usually go here. 
#---------------------------------------------------------------------------
CLINKFLAGS = -fopenmp -O0 -Wl,-rpath,/usr/local/lib


#---------------------------------------------------------------------------
# Utilities C:
#
# This is the C compiler used to compile C utilities.  Flags required by 
# this compiler go here also; typically there are few flags required; hence 
# there are no separate macros provided for such flags.
#---------------------------------------------------------------------------
UCC = clang-7 -O


#---------------------------------------------------------------------------
# Destination of executables, relative to subdirs of the main directory. . 
#---------------------------------------------------------------------------
BINDIR  = ../bin


#---------------------------------------------------------------------------
# The variable RAND controls which random number generator 
# is used. It is described in detail in Doc/README.install. 
# Use "randi8" unless there is a reason to use another one. 
# Other allowed values are "randi8_safe", "randdp" and "randdpvec"
#---------------------------------------------------------------------------
# RAND   = randi8
# The following is highly reliable but may be slow:
RAND   = randdp


#---------------------------------------------------------------------------
# The variable WTIME is the name of the wtime source code module in the
# NPB2.x/common directory.  
# For most machines,       use wtime.c
# For SGI power challenge: use wtime_sgi64.c
#---------------------------------------------------------------------------
WTIME  = wtime.c


#---------------------------------------------------------------------------
# Enable if either Cray or IBM: 
# (no such flag for most machines: see common/wtime.h)
# This is used by the C compiler to pass the machine name to common/wtime.h,
# where the C/Fortran binding interface format is determined
#---------------------------------------------------------------------------
# MACHINE   =   -DCRAY
# MACHINE   =   -DIBM

这总是会给出相同的链接错误clang: error: linker command failed with exit code 1 (use -v to see invocation)尝试使用 make suite 构建它时:

cd SP; make CLASS=S
make[2]: Entering directory '/home/akan/Downloads/Benchmarks/NPB3.0-omp-C-master/SP'
make[3]: Entering directory '/home/akan/Downloads/Benchmarks/NPB3.0-omp-C-master/sys'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/akan/Downloads/Benchmarks/NPB3.0-omp-C-master/sys'
../sys/setparams sp S
make.def modified. Rebuilding npbparams.h just in case
rm -f npbparams.h
../sys/setparams sp S
clang-7  -c -I../common -I/usr/local/include -fopenmp -O3 sp.c
clang-7 -fopenmp -O0 -Wl,-rpath,/usr/local/lib -o ../bin/sp.S sp.o ../common/c_print_results.o ../common/c_timers.o ../common/c_wtime.o -L/usr/local/lib
/usr/bin/ld: cannot open output file ../bin/sp.S: No such file or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Makefile:24: recipe for target '../bin/sp.S' failed
make[2]: *** [../bin/sp.S] Error 1
make[2]: Leaving directory '/home/akan/Downloads/Benchmarks/NPB3.0-omp-C-master/SP'
Makefile:14: recipe for target 'sp' failed
make[1]: *** [sp] Error 2
make[1]: Leaving directory '/home/akan/Downloads/Benchmarks/NPB3.0-omp-C-master'
make[1]: Entering directory '/home/akan/Downloads/Benchmarks/NPB3.0-omp-C-master'

不能用 Clang 编译 C 程序吗?或者我在 make.def 文件中遗漏了什么?

Zulan

这里重要的错误行是:

/usr/bin/ld: cannot open output file ../bin/sp.S: No such file or directory

由于它是输出文件,因此没有指向目录. 创建../bin,它应该可以工作。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

llvm / clang编译错误,内存耗尽

来自分类Dev

使用Clang编译器通过Make构建LLVM项目时出现怪异标志

来自分类Dev

来自clang / llvm编译器的重复符号错误

来自分类Dev

来自clang / llvm编译器的重复符号错误

来自分类Dev

clang插件编译错误:未定义符号llvm :: Registry <clang :: PluginASTAction,llvm :: RegistryTraits <clang :: PluginASTAction>>

来自分类Dev

如何为iOS交叉编译clang / llvm?

来自分类Dev

如何为 Android 编译 LLVM/Clang?

来自分类Dev

如何为使用Clang LLVM编译的C ++代码生成图形代码配置文件报告?

来自分类Dev

使用clang for if条件编译错误

来自分类Dev

使用clang生成LLVM IR

来自分类Dev

使用 GCC 编译简单的 C 程序时出现 clang 错误

来自分类Dev

LLVM 5.1“不推荐使用的isa”的编译器错误

来自分类Dev

LLVM 5.1“不推荐使用的isa”的编译器错误

来自分类Dev

使用clang-llvm编译器添加对类似于CUDA中__shared__的内存类型的支持

来自分类Dev

修改由Clang / LLVM编译器执行的优化

来自分类Dev

测量使用Clang / LLVM生成的函数的大小?

来自分类Dev

LLVM(Clang)是否曾经使用GCC?

来自分类Dev

编译时出现Apple LLVM 5.0错误

来自分类Dev

如何使用clang ++进行编译?

来自分类Dev

如何使用clang ++进行编译?

来自分类Dev

使用Clang编译时的最大错误数

来自分类Dev

使用GCC而不是clang进行模板友谊错误编译

来自分类Dev

从llvm-clang到llvm-gcc42的默认编译器(命令行)

来自分类Dev

CUDA:使用NVPTX编译LLVM IR

来自分类Dev

如何使用特定目标编译LLVM

来自分类Dev

如何使用特定目标编译LLVM

来自分类Dev

在CodeRunner中编译时出现Clang错误

来自分类Dev

使用boost :: hana Y-combinator时出现Clang编译器错误

来自分类Dev

代码使用clang编译,但不使用gcc编译

Related 相关文章

  1. 1

    llvm / clang编译错误,内存耗尽

  2. 2

    使用Clang编译器通过Make构建LLVM项目时出现怪异标志

  3. 3

    来自clang / llvm编译器的重复符号错误

  4. 4

    来自clang / llvm编译器的重复符号错误

  5. 5

    clang插件编译错误:未定义符号llvm :: Registry <clang :: PluginASTAction,llvm :: RegistryTraits <clang :: PluginASTAction>>

  6. 6

    如何为iOS交叉编译clang / llvm?

  7. 7

    如何为 Android 编译 LLVM/Clang?

  8. 8

    如何为使用Clang LLVM编译的C ++代码生成图形代码配置文件报告?

  9. 9

    使用clang for if条件编译错误

  10. 10

    使用clang生成LLVM IR

  11. 11

    使用 GCC 编译简单的 C 程序时出现 clang 错误

  12. 12

    LLVM 5.1“不推荐使用的isa”的编译器错误

  13. 13

    LLVM 5.1“不推荐使用的isa”的编译器错误

  14. 14

    使用clang-llvm编译器添加对类似于CUDA中__shared__的内存类型的支持

  15. 15

    修改由Clang / LLVM编译器执行的优化

  16. 16

    测量使用Clang / LLVM生成的函数的大小?

  17. 17

    LLVM(Clang)是否曾经使用GCC?

  18. 18

    编译时出现Apple LLVM 5.0错误

  19. 19

    如何使用clang ++进行编译?

  20. 20

    如何使用clang ++进行编译?

  21. 21

    使用Clang编译时的最大错误数

  22. 22

    使用GCC而不是clang进行模板友谊错误编译

  23. 23

    从llvm-clang到llvm-gcc42的默认编译器(命令行)

  24. 24

    CUDA:使用NVPTX编译LLVM IR

  25. 25

    如何使用特定目标编译LLVM

  26. 26

    如何使用特定目标编译LLVM

  27. 27

    在CodeRunner中编译时出现Clang错误

  28. 28

    使用boost :: hana Y-combinator时出现Clang编译器错误

  29. 29

    代码使用clang编译,但不使用gcc编译

热门标签

归档