2016-01-25 3 views
0

Я пытаюсь создать и установить MGSim simulator из исходного кода. Для этого я ввел следующую команду конфигурации:
[[email protected] build-mtalpha]# ../configure --target=mtalpha --disable-trace-checks --prefix=/home/mehdi/mgsim CXX=g++ CPPFLAGS=-std=c++0xКак настроить сборку C++ для C++ 11

Я думаю, что включили поддержку C++ 11, обеспечивая флаг `C++ 0x», но я все еще получаю следующее сообщение об ошибке:

configure: error: *** A compiler with support for C++11 language features is required.

Я ввел другие альтернативы для C++ 0x, такие как C++ 11, g ++, gnu-0x и т. Д., Но никто не работал.
Полный выход конфигурирования является here:

checking build system type... x86_64-unknown-linux-gnu 
checking host system type... x86_64-unknown-linux-gnu 
checking target system type... mtalpha-unknown-none 
checking for a BSD-compatible install... /usr/bin/install -c 
checking whether build environment is sane... yes 
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p 
checking for gawk... gawk 
checking whether make sets $(MAKE)... yes 
checking whether make supports nested variables... yes 
checking whether UID '1000' is supported by ustar format... yes 
checking whether GID '1000' is supported by ustar format... yes 
checking how to create a ustar tar archive... gnutar 
checking whether make supports nested variables... (cached) yes 
checking for ranlib... ranlib 
checking for a sed that does not truncate output... /usr/bin/sed 
checking for a Python interpreter with version >= 2.6... python 
checking for python... /usr/bin/python 
checking for python version... 2.7 
checking for python platform... linux2 
checking for python script directory... ${prefix}/lib/python2.7/site-packages 
checking for python extension module directory... ${exec_prefix}/lib64/python2.7/site-packages 
checking for help2man... no 
checking for rst2man... no 
checking for rst2man.py... no 
checking for tbl... tbl 
checking for groff... groff 
checking for ps2pdf... ps2pdf 
checking whether the C++ compiler works... yes 
checking for C++ compiler default output file name... a.out 
checking for suffix of executables... 
checking whether we are cross compiling... no 
checking for suffix of object files... o 
checking whether we are using the GNU C++ compiler... yes 
checking whether g++ accepts -g... yes 
checking for style of include used by make... GNU 
checking dependency style of g++... gcc3 
checking how to run the C++ preprocessor... g++ -E 
checking for grep that handles long lines and -e... /usr/bin/grep 
checking for egrep... /usr/bin/grep -E 
checking for ANSI C header files... yes 
checking for sys/types.h... yes 
checking for sys/stat.h... yes 
checking for stdlib.h... yes 
checking for string.h... yes 
checking for memory.h... yes 
checking for strings.h... yes 
checking for inttypes.h... yes 
checking for stdint.h... yes 
checking for unistd.h... yes 
checking minix/config.h usability... no 
checking minix/config.h presence... no 
checking for minix/config.h... no 
checking whether it is safe to define __EXTENSIONS__... yes 
checking whether the compiler supports GCC C++ ABI name demangling... yes 
checking whether g++ -std=gnu++11 supports range-based for loops... yes 
checking whether g++ -std=gnu++11 supports auto and decltype declarations... yes 
checking whether g++ -std=gnu++11 supports double right angle brackets in template uses (a<b<int>>)... yes 
checking whether g++ -std=gnu++11 supports initializer lists... yes 
checking whether g++ -std=gnu++11 supports static_assert... yes 
checking whether g++ -std=gnu++11 supports constructor reuse... yes 
checking whether g++ -std=gnu++11 supports move references... yes 
checking whether g++ -std=gnu++11 supports std::array... yes 
checking whether g++ -std=gnu++11 supports threads... no 
checking whether g++ -std=gnu++0x supports range-based for loops... yes 
checking whether g++ -std=gnu++0x supports auto and decltype declarations... yes 
checking whether g++ -std=gnu++0x supports double right angle brackets in template uses (a<b<int>>)... yes 
checking whether g++ -std=gnu++0x supports initializer lists... yes 
checking whether g++ -std=gnu++0x supports static_assert... yes 
checking whether g++ -std=gnu++0x supports constructor reuse... yes 
checking whether g++ -std=gnu++0x supports move references... yes 
checking whether g++ -std=gnu++0x supports std::array... yes 
checking whether g++ -std=gnu++0x supports threads... no 
checking whether g++ -std=c++11 supports range-based for loops... yes 
checking whether g++ -std=c++11 supports auto and decltype declarations... yes 
checking whether g++ -std=c++11 supports double right angle brackets in template uses (a<b<int>>)... yes 
checking whether g++ -std=c++11 supports initializer lists... yes 
checking whether g++ -std=c++11 supports static_assert... yes 
checking whether g++ -std=c++11 supports constructor reuse... yes 
checking whether g++ -std=c++11 supports move references... yes 
checking whether g++ -std=c++11 supports std::array... yes 
checking whether g++ -std=c++11 supports threads... no 
checking whether g++ -std=c++0x supports range-based for loops... yes 
checking whether g++ -std=c++0x supports auto and decltype declarations... yes 
checking whether g++ -std=c++0x supports double right angle brackets in template uses (a<b<int>>)... yes 
checking whether g++ -std=c++0x supports initializer lists... yes 
checking whether g++ -std=c++0x supports static_assert... yes 
checking whether g++ -std=c++0x supports constructor reuse... yes 
checking whether g++ -std=c++0x supports move references... yes 
checking whether g++ -std=c++0x supports std::array... yes 
checking whether g++ -std=c++0x supports threads... no 
configure: error: *** A compiler with support for C++11 language features is required. 

Полный журнал конфигурирования можно найти here.

+2

Возможно, ваш компилятор не поддерживает функцию, требуемую исходным кодом. Трудно сказать, что вы не указали свою версию компилятора. Или, вы знаете, вы можете посмотреть сообщение * перед ошибкой *, в которой говорится: «Проверяете, поддерживает ли g ++ -std = C++ 0x потоки ... нет». Попробуйте включить поддержку потоковой передачи? – Yakk

+0

Какая у вас версия g ++? Проблема может быть в том, что она слишком стар. –

+1

И определенно включите ** полный ** вывод скрипта 'configure'. Как обычно, фактическая проблема, вероятно, показана в нескольких строках до окончательной строки «ошибка». –

ответ

4

В сценарии configure упоминается отсутствие поддержки потоков на линии непосредственно перед ошибкой. Я сомневаюсь, что это совпадение.

Быстрый google находит сообщение SO that says this is how you enable threading support: -pthread.

+0

Спасибо. '../configure --target = mtalpha --disable-trace-checks --prefix =/home/mehdi/mgsim CXX = g ++ CXXFLAGS = -pthread' наконец решил проблему. – JasonStack

+0

Это, однако, странный autoconf не знает, что для потоковой обработки требуется '-pthread' ... –

+0

Кроме того,' CPPFLAGS = -std = C++ 0x' является no-op. –

Смежные вопросы