# boost undefined symbols (with g++5)



## outpaddling (Sep 14, 2017)

Stuck on the undefined reference errors below regarding boost::program_options.

I suspect a tool chain mixing issue (boost compiled with clang, this code with g++5), but haven't been able to find any good references to this error.

Anyone seen a similar problem?

Thanks,

    Jason


```
g++5 -O2 -pipe -fstack-protector -Wl,-rpath=/usr/local/lib/gcc5 -fno-strict-aliasing  -Wl,-rpath=/usr/local/lib/gcc5 -O2 -msse -msse2 -DUSE_SSE -DMEASURE_DGEMM -DVERBOSE -Wall -fPIC -fopenmp -I/usr/local/include -o StringUtils.o -c StringUtils.cpp
g++5 -O2 -pipe -fstack-protector -Wl,-rpath=/usr/local/lib/gcc5 -fno-strict-aliasing  -Wl,-rpath=/usr/local/lib/gcc5 -O2 -msse -msse2 -DUSE_SSE -DMEASURE_DGEMM -DVERBOSE -Wall -fPIC -fopenmp -I/usr/local/include -o Timer.o -c Timer.cpp
g++5  -fstack-protector -Wl,-rpath=/usr/local/lib/gcc5 -L/usr/local/lib/gcc5 -fopenmp -o bolt BoltMain.o Bolt.o BoltParams.o BoltParEstCV.o BoltReml.o CovariateBasis.o DataMatrix.o FileUtils.o Jackknife.o LDscoreCalibration.o MapInterpolater.o MatrixUtils.o MemoryUtils.o NonlinearOptMulti.o NumericUtils.o PhenoBuilder.o RestrictSnpSet.o SnpData.o SnpInfo.o SpectrumTools.o StatsUtils.o StringUtils.o Timer.o -L/usr/local/lib -Wl,-rpath,/usr/local/lib -lnlopt -lboost_program_options -lboost_iostreams -lz -llapack -lopenblas -lgfortran -lpthread -lm
Bolt.o: In function `long double boost::math::detail::full_igamma_prefix<long double, boost::math::policies::policy<boost::math::policies::promote_float<false>, boost::math::policies::promote_double<false>, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy> >(long double, long double, boost::math::policies::policy<boost::math::policies::promote_float<false>, boost::math::policies::promote_double<false>, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy> const&)':
Bolt.cpp:(.text._ZN5boost4math6detail18full_igamma_prefixIeNS0_8policies6policyINS3_13promote_floatILb0EEENS3_14promote_doubleILb0EEENS3_14default_policyES9_S9_S9_S9_S9_S9_S9_S9_S9_S9_EEEET_SB_SB_RKT0_[_ZN5boost4math6detail18full_igamma_prefixIeNS0_8policies6policyINS3_13promote_floatILb0EEENS3_14promote_doubleILb0EEENS3_14default_policyES9_S9_S9_S9_S9_S9_S9_S9_S9_S9_EEEET_SB_SB_RKT0_]+0x68): warning: powl has lower than advertised precision
BoltParams.o: In function `LMM::BoltParams::processCommandLineArgs(int, char**)':
BoltParams.cpp:(.text+0x1fa5): undefined reference to `boost::program_options::options_description::options_description(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, unsigned int)'
BoltParams.cpp:(.text+0x3244): undefined reference to `boost::program_options::options_description::options_description(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, unsigned int)'
BoltParams.cpp:(.text+0x3b2e): undefined reference to `boost::program_options::options_description::options_description(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, unsigned int)'
BoltParams.cpp:(.text+0x42cc): undefined reference to `boost::program_options::options_description::options_description(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, unsigned int)'
BoltParams.cpp:(.text+0x4338): undefined reference to `boost::program_options::options_description::options_description(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned int, unsigned int)'
```


----------



## camp0 (Nov 6, 2017)

Hi,

Im able to use the boost:rogram_options with no issues, any reason for not use c++? instead gcc? Looks that may be is missing math.h?

Is that project public for compile?

Regards,
Luis


----------



## outpaddling (Nov 6, 2017)

GCC requirement is from


```
USES=           compiler:openmp
```

All my work-in-progress ports are available here:

https://github.com/outpaddling/freebsd-ports-wip

Thanks,

   JB


----------



## camp0 (Nov 7, 2017)

Hi Jason,

I just need to know the Makefile that you use for compile that project or any instructions for build and reproduce the issue.

Regards,
Luis


----------



## outpaddling (Nov 7, 2017)

Sorry, I assumed I had stated the port name in the original post...

The easiest way to reproduce it is by checking out the collection using the instructions at the bottom of the link.  Then

`cd /usr/ports/wip/bolt-llm
make`

Thanks for contributing your time!


----------



## outpaddling (Nov 11, 2017)

Solved.  Replaced compiler:openmp with compiler:gcc-c++11-lib.  The latter is sufficient to enable openmp as well, as compiler:openmp merely adds a GCC requirement.


----------



## camp0 (Nov 13, 2017)

Did you use the flag USE_CXXSTD=gnu++11 at the end?


----------



## outpaddling (Nov 13, 2017)

Yes, latest is here: https://github.com/outpaddling/freebsd-ports-wip/tree/master/bolt-lmm
https://github.com/outpaddling/freebsd-ports-wip/tree/master/bolt-lmm
Or running wip-update will pull the latest commits from the repo.

Cheers,

    JB


----------

