0

So far I'm unable to build QuantLib 1.5 on os x 10.9.5 following the official instructions http://quantlib.org/install/macosx.shtml

./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.

So what may be wrong? And how can I fix it?

Here is an excerpt from Config log:

## ----------- ##
## 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 "quantlib-dev@lists.sourceforge.net"
| #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
Bobby Digital
  • 79
  • 1
  • 1
  • 6

3 Answers3

1

If you have this problem

checking whether the C compiler works... no

It means that you have not installed the command line tools properly for your Xcode. Please download and install it.

Undo
  • 25,519
  • 37
  • 106
  • 129
CK TUNG
  • 51
  • 5
0

Your clue is in the config.log: "clang: error: unknown argument: '-stlib=libstdc++' "

change -stlib to -stdlib, it should compile and build.

HookahBoy
  • 1
  • 1
0

See this related answer on how to configure gcc. The reason is, like me, you probably installed GCC with homebrew or something, therefore not using Apple's default.

I installed GCC 5.3 with homebrew.

Worked for me by just taking out -stdlib option all together.

Community
  • 1
  • 1
WillZ
  • 3,775
  • 5
  • 30
  • 38