我正在尝试安装FANN库以用于一个项目中。我正在使用这个作为我的指南,但当我运行cmake .
时,我收到了如下提示:
`$ cmake .
-- FANN is used as APPLICATION_NAME
-- Try OpenMP CXX flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Could NOT find OpenMP (missing: OpenMP_CXX_FLAGS)
-- The compiler /usr/bin/c++ has no C++0x, C++11 or C++14 support. FANN will still work with no problem, but the tests will not be able to compile.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/marvin/fann`
即使我已经安装了gcc/g++ 4.9,但根据Git hub上的说明,运行
cmake .
时输出应该类似于这样:`-- The C compiler identification is GNU 4.8.1
-- The CXX compiler identification is GNU 4.8.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- FANN is used as APPLICATION_NAME
-- Try OpenMP C flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Try OpenMP CXX flag = [-fopenmp]
-- Performing Test OpenMP_FLAG_DETECTED
-- Performing Test OpenMP_FLAG_DETECTED - Success
-- Found OpenMP: -fopenmp
-- Found PythonInterp: /home/cobalt/anaconda3/bin/python (found version "3.4.3")
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Performing Test COMPILER_SUPPORTS_CXX14
-- Performing Test COMPILER_SUPPORTS_CXX14 - Success
-- Performing Test COMPILER_SUPPORTS_CXX11
-- Performing Test COMPILER_SUPPORTS_CXX11 - Success
-- Performing Test COMPILER_SUPPORTS_CXX0X
-- Performing Test COMPILER_SUPPORTS_CXX0X - Success
-- The compiler /usr/bin/c++ has C++14 support.
-- Configuring done
-- Generating done
-- Build files have been written to: /home/cobalt/repos/fann`
有需要帮忙的吗?
g++
),它甚至不支持 C++0x 标准。如果你确实已经安装了最新的 g++,那么你需要显式地将其设置为你的 C++ 编译器。 - tchakravartysudo update-alternatives --config gcc
后,我得到了以下信息:`有 2 个选择可替代 /usr/bin/gcc (提供 /usr/bin/gcc)。选择 路径 优先级 状态
cmake -DCMAKE_CXX_FLAGS="-std=c++11" ..
来编译程序。也许可以删除CMakeLists.txt文件,这将触发对编译器的新搜索,并得到编译器的输出结果。 - usr1234567