CMAKE AIX XLC编译器未使用
CMAKE AIX xlc compiler not getting used
我正在尝试将XLC编译器用于AIX上的CPP代码。我想要我的C代码的CC编译器
输出:
user@AIX> cmake -DCMAKE_CXX_COMPILER=/usr/vac/bin/xlc ..
-- The C compiler identification is XL 11.1.0
-- The CXX compiler identification is XL 11.1.0
-- Check for working C compiler: /usr/vac/bin/cc
-- Check for working C compiler: /usr/vac/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/vac/bin/xlc
-- Check for working CXX compiler: /usr/vac/bin/xlc -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
但是当我运行时(在上述输出之后),它似乎是在使用GCC编译器。
user@AIX> make
[ 0%] Building CXX object ../libs/shrxml/CMakeFiles/shrxml.dir/XML.cpp.o
gcc: unrecognized option '-+'
gcc: unrecognized option '-qthreaded'
gcc: unrecognized option '-qhalt=e'
gcc: unrecognized option '-qnamemangling=v6'
gcc: unrecognized option '-qmaxmem=9216'
gcc: unrecognized option '-qnamemangling=v6'
gcc: unrecognized option '-qmaxmem=9216'
gcc: unrecognized option '-qpic'
In file included from /opt/freeware/lib/gcc/powerpc-ibm-
aix6.1.0.0/4.4.5/include/c++/backward/strstream:47,
from
/home/user/workspace/bitbucket/ark/src/libs/shrxml/XML.cpp:105:
/opt/freeware/lib/gcc/powerpc-ibm-
aix6.1.0.0/4.4.5/include/c++/backward/backward_warning.h:28:2: warning:
#warning This file includes at least one deprecated or antiquated header
which may be removed without further notice at a future date. Please use a
non-deprecated interface with equivalent functionality instead. For a
listing of replacement headers and interfaces, consult the file
backward_warning.h. To disable this warning use -Wno-deprecated.
我尝试在我的cmakelists中添加集合.txt文件
set(CMAKE_CXX_COMPILER /usr/vac/bin/xlc CACHE PATH "" FORCE)
set(CMAKE_CC_COMPILER /usr/vac/bin/cc CACHE PATH "" FORCE)
我还导出了环境变量:
user@AIX> echo $CMAKE_CXX_COMPILER
/usr/vac/bin/xlc
user@AIX>
有什么想法吗?
/usr/vac/bin目录中没有CC或XLC的链接。
当我在shrxlm目录中使用GCC和XLC时,我能找到的就是GCC。为什么Cmake不兑现我对XLC编译器的要求?
检查系统上的cc
符号链接,以确保其指向XL而不是GCC。执行which cc
,然后进行ls -l
。
根据cmake常见问题解答"我如何使用其他编译器?"部分,有3种方法。看起来您尝试使用所有3个,包括标记为"避免"的Method 3 (set())
。
您可以再次尝试Method 1: use environment variables
,但是这次使用在此处列出的环境变量,CC
(for C)和CXX
(对于C )环境变量?
相关文章:
- 普通环路未使用gcc 4.8.5自动矢量化
- G++ 编译器是否在未使用返回值的情况下将 constexpr 函数视为常规函数?
- 我的编译器是否忽略了我未使用的静态thread_local类成员
- 添加字符时,编译器会停止优化未使用的字符串
- 避免在 openmp 并行块中使用预编译器语句出现未使用的变量警告
- 为什么msvc编译器在显式调用析构函数时会发出未使用的变量
- CMAKE AIX XLC编译器未使用
- 编译器是否C++优化未使用的 #includes
- 编译器是否会排除未使用的模板代码
- 编译器是否会优化未使用的链接文件
- g++ 编译器中未使用的变量
- 编译器总是在cpp中编译未使用的函数
- 为什么Visual C++编译器将未使用的类编译为可执行文件
- 为什么C++编译器没有优化未使用的引用变量?
- 编译器会删除未使用的函数、定义、变量、宏、include等吗?
- GetCurrentHwProfile 未使用 MinGW 的 g++ 编译器在此范围内声明
- 防止英特尔编译器过度优化未使用的变量
- 编译器是否为未使用的类生成虚函数表
- c++编译器会通过“引用”优化掉未使用的返回值吗
- 编译器会优化出静态函数未使用的参数吗?