2015-05-19 2 views
0

До сих пор я не могу построить QuantLib 1.5 на OS X 10.9.5, следуя официальным инструкциям http://quantlib.org/install/macosx.shtmlКак построить QuantLib на Mac OS X 10.9.5

./configure --enable-static --with-boost-include=/opt/local/include/ \ 
     --with-boost-lib=/opt/local/lib/ --prefix=/opt/local/ \ 
     CXXFLAGS="-stlib=libstdc++ -mmacosx-version-min=10.6" \ 
     LDFLAGS="-stlib=libstdc++ -mmacosx-version-min=10.6" 

configure: WARNING: you should use --build, --host, --target 
configure: WARNING: invalid host type: 
configure: WARNING: you should use --build, --host, --target 
configure: WARNING: invalid host type: 
checking for a BSD-compatible install... /usr/bin/install -c 
checking whether build environment is sane... yes 
checking for a thread-safe mkdir -p... config/install-sh -c -d 
checking for gawk... no 
checking for mawk... no 
checking for nawk... no 
checking for awk... awk 
checking whether make sets $(MAKE)... yes 
checking whether make supports nested variables... yes 
checking for gawk... (cached) awk 
checking for -gcc... no 
checking for gcc... gcc 
checking whether the C compiler works... no 
configure: error: in `~/Downloads/qlib/QuantLib-1.5': 
configure: error: C compiler cannot create executables 
See `config.log' for more details 

$ make && sudo make install 
make: *** No targets specified and no makefile found. Stop. 

Так что может быть не так? И как я могу это исправить?

Вот выдержка из журнала Config:

## ----------- ## 
## Core tests. ## 
## ----------- ## 

configure:2416: checking for a BSD-compatible install 
configure:2484: result: /usr/bin/install -c 
configure:2495: checking whether build environment is sane 
configure:2550: result: yes 
configure:2701: checking for a thread-safe mkdir -p 
configure:2740: result: config/install-sh -c -d 
configure:2747: checking for gawk 
configure:2777: result: no 
configure:2747: checking for mawk 
configure:2777: result: no 
configure:2747: checking for nawk 
configure:2777: result: no 
configure:2747: checking for awk 
configure:2763: found /usr/bin/awk 
configure:2774: result: awk 
configure:2785: checking whether make sets $(MAKE) 
configure:2807: result: yes 
configure:2836: checking whether make supports nested variables 
configure:2853: result: yes 
configure:2987: checking for gawk 
configure:3014: result: awk 
configure:3069: checking for -gcc 
configure:3099: result: no 
configure:3109: checking for gcc 
configure:3125: found /usr/bin/gcc 
configure:3136: result: gcc 
configure:3365: checking for C compiler version 
configure:3374: gcc --version >&5 
Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn) 
Target: x86_64-apple-darwin13.4.0 
Thread model: posix 
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 
configure:3385: $? = 0 
configure:3374: gcc -v >&5 
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 
Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn) 
Target: x86_64-apple-darwin13.4.0 
Thread model: posix 
configure:3385: $? = 0 
configure:3374: gcc -V >&5 
clang: error: argument to '-V' is missing (expected 1 value) 
clang: error: no input files 
configure:3385: $? = 1 
configure:3374: gcc -qversion >&5 
clang: error: unknown argument: '-qversion' 
clang: error: no input files 
configure:3385: $? = 1 
configure:3405: checking whether the C compiler works 
configure:3427: gcc -I/opt/local/include -stlib=libstdc++ -mmacosx-version-min=10.6 -L/opt/local/lib conftest.c >&5 
clang: error: unknown argument: '-stlib=libstdc++' 
configure:3431: $? = 1 
configure:3469: result: no 
configure: failed program was: 
| /* confdefs.h */ 
| #define PACKAGE_NAME "QuantLib" 
| #define PACKAGE_TARNAME "QuantLib" 
| #define PACKAGE_VERSION "1.5" 
| #define PACKAGE_STRING "QuantLib 1.5" 
| #define PACKAGE_BUGREPORT "[email protected]" 
| #define PACKAGE_URL "" 
| #define PACKAGE "QuantLib" 
| #define VERSION "1.5" 
| /* end confdefs.h. */ 
| 
| int 
| main() 
| { 
| 
| ; 
| return 0; 
| } 
configure:3474: error: in `~/Downloads/qlib/QuantLib-1.5': 
configure:3476: error: C compiler cannot create executables 
See `config.log' for more details 
+0

Это похоже на проблему с компилятором во время вызова 'configure'. Как говорится в сообщении: «Подробнее см.« Config.log »». Что там зарегистрирована ошибка? –

+0

Я верю, что попробовал ту же команду некоторое время назад, и это сработало .... – SmallChess

+0

Я добавил конфигурационный отрыв журнала, возможно, это может помочь выявить, что не так. –

ответ

0

Если у вас есть эта проблема

checking whether the C compiler works... no 

Это означает, что вы не установили инструменты командной строки правильно для Xcode. Загрузите и установите его.

0

Ваш ключ находится в config.log: "лязг: ошибка: неизвестный аргумент:" -stlib = libstdC++"

изменение -stlib к -stdlib, он должен собрать и построить.

0

См. Ответ this о том, как настроить gcc. Причина в том, что, как и я, вы, вероятно, установили GCC с homebrew или что-то еще, поэтому не используете Apple по умолчанию.

Я установил GCC 5.3 с доморощенным.

Работал для меня, просто вынимая вариант -stdlib все вместе.

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