Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

Compiling BOOST in OSX, undefined symbols for architecture error

Baris_M_
Beginner
1,005 Views

Dear all,

I am trying to compile BOOST in OS X 10.10, using intel compilers 15.0.2

./bootstrap.sh --with-toolset=intel-darwin cxxflags="-std=c++11" linkflags="-std=c++11"

    ./b2 -q \

             toolset=intel-darwin \

             cxxflags="-std=c++11 -stdlib=libc++" \

             linkflags="-std=c++11 -stdlib=libc++" \

             address-model={{address_model}} \

             -j 4 \

             --user-config=user-config.jam \

             --build-dir=_build\

             link=shared \

             install \

             -sNO_BZIP2=0 \

             -sBZIP2_BINARY=bz2 \

             -sBZIP2_INCLUDE=${BZIP2_DIR}/include \

             -sBZIP2_LIBPATH=${BZIP2_DIR}/lib \

             -sNO_ZLIB=0 \

             -sZLIB_BINARY=z \

             -sZLIB_INCLUDE=${ZLIB_DIR}/include \

             -sZLIB_LIBPATH=${ZLIB_DIR}/lib

 

However I end up with "Undefined symbols for architecture X86_64" in the log. 

 

 

Undefined symbols for architecture x86_64:

__znst3__110moneypuncticlb0eed2ev undefined symbol

 

 

I googled to no avail. I tried without the stdlib flag, as suggested by a page I found in INTEL, that did not work as well.

 

when I set the toolset to clang, BOOST compiles correctly.

 

The environment variables correspond to intel64

0 Kudos
10 Replies
Steven_L_Intel1
Employee
1,005 Views

It looks as if this is defined in libc++abi.dylib 

Since BOOST is a C++ library, I doubt this has anything to do with Fortran, so I am moving this thread to the C++ forum.

0 Kudos
KitturGanesh
Employee
1,005 Views

Hi,
Can you try "address-model=64 toolset=intel stage" in the configuration options and see if it resolves the issue?
_Kittur

 

0 Kudos
velvia
Beginner
1,005 Views

Are you aware that Boost is available through homebrew ? I use Boost 1.57 on OSX 10.10 and it just took me "brew install boost" to get it.

0 Kudos
Baris_M_
Beginner
1,005 Views

 

Velvia: 

Yes, I am aware, but I am trying to install Fenics via hashdist with some additional components. The boost provided by brew does not work well for some reason. 

Kittur Ganesh: 

I forget to redact address-model=64, but I am trying the second suggestion, I will reply if I can get it running.

 

0 Kudos
velvia
Beginner
1,005 Views

I understand your problem.

If you want to install Fenics on your machine, I'll light a candle for you. It took me one week to install this thing on my computer a few years ago. It needs to compile the whole set of numerical libraries that exist out there just to say "Hello world!" ;-) They were libraries only compatible with Boost 1.47, other ones with Boost 1.45, etc. This can work, but be ready for long nights.

0 Kudos
KitturGanesh
Employee
1,005 Views

@Baris, sure please let me know if the option resolved the issue, thanks.

_Kittur

0 Kudos
Baris_M_
Beginner
1,005 Views

It might be unrelated, but I found out a curious behavior using intel compilers and Xcode ranlib/ar  trying to fix yet another problem.

The Xcode ar does not add the symbols! neither does xiar

I read in this post that the OS X ar behaves differently from linux ar. The -c option did not work, thus I started recompiling everything with -fno-common 

Now, I encountered yet another problem. There is a complaint that the libiomp is not found in the DYLD path (although I source the intel compiler environment variables) and the icc goes non-responsive (i.e. can not be ctrl-c'd), can only be killed with -9 

So, now I am trying this. Compile everything from scratch, remove both openmp and fno-common from default flags, if there are missing symbol complaints, first I will try no-common, then clang.

 

0 Kudos
Baris_M_
Beginner
1,005 Views

 

 

@_Kittur

I don't see an "intel stage" in the available options

###
### Unknown toolset: intel_stage
###
### You can specify the toolset as the argument, i.e.:
###     ./build.sh gcc
###
### Toolsets supported by this script are:
###     acc, como, darwin, gcc, intel-darwin, intel-linux, kcc, kylix,
###     mipspro, mingw(msys), pathscale, pgi, qcc, sun, sunpro, tru64cxx, vacpp
###
### A special toolset; cc, is available which is used as a fallback
### when a more specific toolset is not found and the cc command is
### detected. The 'cc' toolset will use the CC, CFLAGS, and LIBS
### environment variables, if present.
###

when I use toolset intel-darwin, I get the exact same error as

https://software.intel.com/en-us/forums/topic/515706?language=en

although I am using boost 1.55. The solution is not clear to me. 

0 Kudos
Baris_M_
Beginner
1,005 Views

The problem was solved by adding 

cxxflags="-std=c++0x"

to b2

      ./b2 -q \
             toolset=intel-darwin \
             cxxflags="-std=c++0x"\
             address-model=64 \
             -j 4 \
             --user-config=user-config.jam \
             --build-dir=_build\
             link=shared \
             install \
             -sNO_BZIP2=0 \
             -sBZIP2_BINARY=bz2 \
             -sBZIP2_INCLUDE=${BZIP2_DIR}/include \
             -sBZIP2_LIBPATH=${BZIP2_DIR}/lib \
             -sNO_ZLIB=0 \
             -sZLIB_BINARY=z \
             -sZLIB_INCLUDE=${ZLIB_DIR}/include \
             -sZLIB_LIBPATH=${ZLIB_DIR}/lib

0 Kudos
KitturGanesh
Employee
1,005 Views

Thanks Baris, you're correct (my typo). I think when I built boost (1.56) last I did the below:
% ./bootstrap.sh
%./b2 install --prefix=<path>
%cd <boost root>
% b2 --build-dir=<boost obj dir> address-model=64 toolset=intel stage

I haven't tried building boost 1.55 and may be I should try out again. Glad it worked for you and your info is noted, thanks.
_Kittur

 

0 Kudos
Reply