Installing ODEPACK on a Mac with C++ Code - macos

I used homebrew to install R on my mac. My question is we have an example code that uses dlsode as a call, programmed in c++. When I compile I get linker errors. How would I properly link the library, and is the R package what I need to use ODEPACK calls?
The error-----
Undefined symbols for architecture x86_64:
"dlsode_(void ()(int, double*, double*, double*), int*, double*, double*, double*, int*, double*, double*, int*, int*, int*, double*, int*, int*, int*, void ()(int, double, double, int*, int*, double*, int*), int*)", referenced from:
_main in test-38f452.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Related

I am getting issues, when compiling my code in codeblocks C++

I am trying to do my assignment for data structures class. The question is 1) Compile with UNIT_TEST defined and then run with -d yes to see the time it takes in seconds. Report that time in submission box along with the time you found when testing Selection Sort. Which is faster?
i am having trouble with understanding, what i am doing wrong. I am getting this error :
g++ -o bin/Debug/algAnalysis obj/Debug/main.o
Undefined symbols for architecture x86_64:
"Catch::NameAndTags::NameAndTags(Catch::StringRef const&, Catch::StringRef const&)", referenced from:
___cxx_global_var_init in main.o
"Catch::StringMaker<int, void>::convert(int)", referenced from:
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > Catch::Detail::stringify<int>(int const&) in main.o
"Catch::makeTestInvoker(void (*)())", referenced from:
___cxx_global_var_init in main.o
"Catch::AssertionHandler::handleExpr(Catch::ITransientExpression const&)", referenced from:
____C_A_T_C_H____T_E_S_T____0() in main.o
"Catch::AssertionHandler::handleUnexpectedInflightException()", referenced from:
____C_A_T_C_H____T_E_S_T____0() in main.o
"Catch::AssertionHandler::complete()", referenced from:
____C_A_T_C_H____T_E_S_T____0() in main.o
"Catch::AssertionHandler::AssertionHandler(Catch::StringRef, Catch::SourceLineInfo const&, Catch::StringRef, Catch::ResultDisposition::Flags)", referenced from:
____C_A_T_C_H____T_E_S_T____0() in main.o
"Catch::ITransientExpression::~ITransientExpression()", referenced from:
Catch::MatchExpr<std::__1::vector<int, std::__1::allocator<int> >, Catch::Matchers::Impl::MatchNotOf<std::__1::vector<int, std::__1::allocator<int> > > >::MatchExpr(std::__1::vector<int, std::__1::allocator<int> > const&, Catch::Matchers::Impl::MatchNotOf<std::__1::vector<int, std::__1::allocator<int> > > const&, Catch::StringRef) in main.o
Catch::MatchExpr<std::__1::vector<int, std::__1::allocator<int> >, Catch::Matchers::Impl::MatchNotOf<std::__1::vector<int, std::__1::allocator<int> > > >::~MatchExpr() in main.o
Catch::MatchExpr<std::__1::vector<int, std::__1::allocator<int> >, Catch::Matchers::Vector::EqualsMatcher<int> >::MatchExpr(std::__1::vector<int, std::__1::allocator<int> > const&, Catch::Matchers::Vector::EqualsMatcher<int> const&, Catch::StringRef) in main.o
Catch::MatchExpr<std::__1::vector<int, std::__1::allocator<int> >, Catch::Matchers::Vector::EqualsMatcher<int> >::~MatchExpr() in main.o
"Catch::ReusableStringStream::ReusableStringStream()", referenced from:
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > Catch::Detail::rangeToString<std::__1::__wrap_iter<int const*> >(std::__1::__wrap_iter<int const*>, std::__1::__wrap_iter<int const*>) in main.o
"Catch::ReusableStringStream::~ReusableStringStream()", referenced from:
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > Catch::Detail::rangeToString<std::__1::__wrap_iter<int const*> >(std::__1::__wrap_iter<int const*>, std::__1::__wrap_iter<int const*>) in main.o
"Catch::Detail::unprintableString", referenced from:
Catch::MatchExpr<std::__1::vector<int, std::__1::allocator<int> >, Catch::Matchers::Impl::MatchNotOf<std::__1::vector<int, std::__1::allocator<int> > > >::streamReconstructedExpression(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const in main.o
Catch::MatchExpr<std::__1::vector<int, std::__1::allocator<int> >, Catch::Matchers::Vector::EqualsMatcher<int> >::streamReconstructedExpression(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const in main.o
"Catch::AutoReg::AutoReg(Catch::ITestInvoker*, Catch::SourceLineInfo const&, Catch::StringRef const&, Catch::NameAndTags const&)", referenced from:
___cxx_global_var_init in main.o
"Catch::AutoReg::~AutoReg()", referenced from:
___cxx_global_var_init in main.o
"Catch::Matchers::Impl::MatcherUntypedBase::~MatcherUntypedBase()", referenced from:
Catch::Matchers::Impl::MatcherBase<std::__1::vector<int, std::__1::allocator<int> > >::~MatcherBase() in main.o
"Catch::StringRef::StringRef(char const*)", referenced from:
____C_A_T_C_H____T_E_S_T____0() in main.o
___cxx_global_var_init in main.o
(maybe you meant: __ZN5Catch9StringRefC1EPKcm)
"Catch::operator<<(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, Catch::StringRef const&)", referenced from:
Catch::MatchExpr<std::__1::vector<int, std::__1::allocator<int> >, Catch::Matchers::Impl::MatchNotOf<std::__1::vector<int, std::__1::allocator<int> > > >::streamReconstructedExpression(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const in main.o
Catch::MatchExpr<std::__1::vector<int, std::__1::allocator<int> >, Catch::Matchers::Vector::EqualsMatcher<int> >::streamReconstructedExpression(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const in main.o
"Stack::pop(int&)", referenced from:
SortClass<int>::sort(int*, int, int) in main.o
"Stack::push(int)", referenced from:
SortClass<int>::sort(int*, int, int) in main.o
"Stack::Stack(int)", referenced from:
SortClass<int>::sort(int*, int, int) in main.o
"Stack::~Stack()", referenced from:
SortClass<int>::sort(int*, int, int) in main.o
"Catch::ReusableStringStream::str() const", referenced from:
std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > Catch::Detail::rangeToString<std::__1::__wrap_iter<int const*> >(std::__1::__wrap_iter<int const*>, std::__1::__wrap_iter<int const*>) in main.o
"Catch::Matchers::Impl::MatcherUntypedBase::toString() const", referenced from:
Catch::MatchExpr<std::__1::vector<int, std::__1::allocator<int> >, Catch::Matchers::Impl::MatchNotOf<std::__1::vector<int, std::__1::allocator<int> > > >::streamReconstructedExpression(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const in main.o
Catch::Matchers::Impl::MatchNotOf<std::__1::vector<int, std::__1::allocator<int> > >::describe() const in main.o
Catch::MatchExpr<std::__1::vector<int, std::__1::allocator<int> >, Catch::Matchers::Vector::EqualsMatcher<int> >::streamReconstructedExpression(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const in main.o
"typeinfo for Catch::ITransientExpression", referenced from:
typeinfo for Catch::MatchExpr<std::__1::vector<int, std::__1::allocator<int> >, Catch::Matchers::Impl::MatchNotOf<std::__1::vector<int, std::__1::allocator<int> > > > in main.o
typeinfo for Catch::MatchExpr<std::__1::vector<int, std::__1::allocator<int> >, Catch::Matchers::Vector::EqualsMatcher<int> > in main.o
"typeinfo for Catch::Matchers::Impl::MatcherUntypedBase", referenced from:
typeinfo for Catch::Matchers::Impl::MatcherBase<std::__1::vector<int, std::__1::allocator<int> > > in main.o
"vtable for Catch::ITransientExpression", referenced from:
Catch::ITransientExpression::ITransientExpression(bool, bool) in main.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"vtable for Catch::Matchers::Impl::MatcherUntypedBase", referenced from:
Catch::Matchers::Impl::MatcherUntypedBase::MatcherUntypedBase(Catch::Matchers::Impl::MatcherUntypedBase const&) in main.o
Catch::Matchers::Impl::MatcherUntypedBase::MatcherUntypedBase() in main.o
NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
"_main", referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Process terminated with status 1 (0 minute(s), 0 second(s))
Here is my code so far:
#define CATCH_CONFIG_MAI
#define UNIT_TEST
#include <iostream>
#include <fstream>
#include <vector>
#ifdef UNIT_TEST
#include "catch.hpp"
#endif // UNIT_TEST
#include "stack.h"
using namespace std;
template <class T>
class SortClass
{
private:
void swap(T &a, T&b);
int split(T a[], int first, int last);
public:
void sort(T a[], int first, int last);
};
template <typename T>
int SortClass <T>::split (T arr[], int first, int last)
{
T x= arr[last];
int i= (first-1);
for (int j=first; j <= last-1; j++)
{
if (arr[j]<= x)
{
i++;
swap (arr[i], arr[j]);
}
}
swap (arr[i+1], arr[last]);
return (i+1);
}
template <class T>
void SortClass <T>::sort(T a[], int first, int last)
{
Stack stack;
stack.push (first);
stack.push (last);
while (not stack.isEmpty())
{
stack.pop(last);
stack.pop(first);
int s= split (a, first, last);
if (s-1>first )
{
stack.push(first);
stack.push(s-1);
}
if (s+1<last)
{
stack.push(s+1);
stack.push(last);
}
}
}
template <class T>
void SortClass <T>:: swap(T &a, T &b)
{
T temp=a;
a=b;
b=temp;
}
#ifndef UNIT_TEST
int main ()
{
const int N=10;
int x1[N]={1,3,5,6,4,2,8,9,7};
for (auto e: x1) std:: cout << e << " ";
std:: cout << std:: endl;
SortClass <int> s; s.sort(x1,0,N-1);
for (auto e: x1) std:: cout << e << " ";
std:: cout << std:: endl;
}
#endif
#ifdef UNIT_TEST
using Catch::Matchers::Equals;
TEST_CASE("A fast sort")
{
const int N = 6;
int x1[N] = { 1, 3, 5, 6, 4, 2 };
int x2[N] = { 1, 2, 3, 4, 5, 6 };
vector<int> v1(x1, x1 + N);
vector<int> v2(x2, x2 + N);
REQUIRE_THAT(v1, not Equals(v2));
SortClass<int> s;
s.sort(x1, 0, N - 1);
vector<int> v0(x1, x1 + N);
REQUIRE_THAT(v0, Equals(v2));
const int M = 100000;
int x3[M]; int x4[M];
ifstream ifs1("numbers");
for (auto &e : x3)
ifs1 >> e;
ifstream ifs2("sorted");
for (auto &e : x4)
ifs2 >> e;
s.sort(x3, 0, M - 1);
vector<int> v3(x3, x3 + M);
vector<int> v4(x4, x4 + M);
REQUIRE_THAT(v3, Equals(v4));
}
#endif
#define CATCH_CONFIG_MAIN Must be defined before #include "catch.hpp".
You have #define CATCH_CONFIG_MAI.

Issue with iostream_iterator with tuple C++

I want to use iostream_iterator for tuple.
I have overload input operator >> for the tuple.
But compiler give compilation error.
#include <vector>
#include <iostream>
#include <algorithm>
#include <iterator>
#include <tuple>
using namespace std;
using rec_t= tuple<int, string>;
istream& operator>>(istream& strm, rec_t& r) {
strm>>get<0>(r)>>get<1>(r);
return strm;
}
int main() {
int n;
cin>>n;
vector<rec_t> ar(n);
copy_n(istream_iterator<rec_t>(cin), n, begin(ar));
return 0;
}
The compiler error message is:
-------------- Build: Debug (compiler: GNU GCC Compiler)---------------
g++ -Wall -fexceptions -std=c++11 -g -c main.cpp -o obj/Debug/main.o
In file included from /usr/include/c++/4.9/iterator:66:0,
from main.cpp:4:
/usr/include/c++/4.9/bits/stream_iterator.h: In instantiation of ‘void std::istream_iterator<_Tp, _CharT, _Traits, _Dist>::_M_read() [with _Tp = std::tuple<int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >; _CharT = char; _Traits = std::char_traits<char>; _Dist = long int]’:
/usr/include/c++/4.9/bits/stream_iterator.h:70:17: required from ‘std::istream_iterator<_Tp, _CharT, _Traits, _Dist>::istream_iterator(std::istream_iterator<_Tp, _CharT, _Traits, _Dist>::istream_type&) [with _Tp = std::tuple<int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >; _CharT = char; _Traits = std::char_traits<char>; _Dist = long int; std::istream_iterator<_Tp, _CharT, _Traits, _Dist>::istream_type = std::basic_istream<char>]’
main.cpp:18:39: required from here
/usr/include/c++/4.9/bits/stream_iterator.h:121:17: error: cannot bind ‘std::istream_iterator<std::tuple<int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::istream_type {aka std::basic_istream<char>}’ lvalue to ‘std::basic_istream<char>&&’
*_M_stream >> _M_value;
^
In file included from /usr/include/c++/4.9/iostream:40:0,
from main.cpp:2:
/usr/include/c++/4.9/istream:872:5: note: initializing argument 1 of ‘std::basic_istream<_CharT, _Traits>& std::operator>>(std::basic_istream<_CharT, _Traits>&&, _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Tp = std::tuple<int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >]’
operator>>(basic_istream<_CharT, _Traits>&& __is, _Tp& __x)
^
Process terminated with status 1 (0 minute(s), 1 second(s))
1 error(s), 3 warning(s) (0 minute(s), 1 second(s))
You've fallen victim to ADL "argument dependent lookup".
You should go look it up, because there are good explanations out there.
Basically, your operator >> should be in the same namespace as your rec_t.
But it's not - rec_t is in namespace std (since it's really std::tuple<int, std::string>), and operator >> is in the global namespace.

Undefined symbols compiling in Mac OS X with Boost, GMP, and OpenMP

I'm having problems compiling a program called SDPB by following these instructions. To summarize, I'm installing a program that requires Boost, GMP, and OpenMP on Mac OS X Yosemite. All the individual pieces of code compile but when its time to link, I get Undefined symbols for architecture x86_64.
My question is basically identical to this question. However, I can't get the answers there to work for me. I still get the same error.
After more searching, I saw that people with similar questions were getting answers pointing to a conflict between clang and gcc. More specifically, there are issues with mixing the libraries libstdc++ and libc++.
Therefore, I made sure to recompile both Boost and GMP with gcc so that everything would be built using libstdc++. That didn't help. I then downloaded an implementation of clang that was compatible with OpenMP and tried to build everything using just libc++. That also didn't work. I then tried all sorts of permutations using clang with the -stdlib=libstdc++ flag and so on. Nothing seems to work. The details of the errors seemed to change a bit with the various permuations. I'll post a few snippets below. Of course, I always used the updated makefile to compile SDPB and I always configured GMP with the --enable-cxx flag as the answers linked above said to do.
Here, is a snippet of the error I received while compiling SDPB with gcc after I compiled GMP and Boost with gcc as well.
Undefined symbols for architecture x86_64:
"std::basic_string<char, std::char_traits<char>, std::allocator<char> >::find(char const*, unsigned long, unsigned long) const", referenced from:
boost::date_time::time_facet<boost::posix_time::ptime, char, std::ostreambuf_iterator<char, std::char_traits<char> > >::put(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, boost::posix_time::time_duration const&) const in SDPSolverIO.o
boost::date_time::time_facet<boost::posix_time::ptime, char, std::ostreambuf_iterator<char, std::char_traits<char> > >::put(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, boost::posix_time::ptime const&) const in main.o
"std::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const", referenced from:
std::_Rb_tree<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer>, std::_Select1st<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer> > >::_M_get_insert_unique_pos(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in SDPSolverIO.o
std::_Rb_tree<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer>, std::_Select1st<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer> > >::_M_get_insert_hint_unique_pos(std::_Rb_tree_const_iterator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in SDPSolverIO.o
std::_Rb_tree<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer>, std::_Select1st<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer> > >::_M_insert_unique_(std::_Rb_tree_const_iterator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer> >, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer> const&) in SDPSolverIO.o
std::map<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::timer::cpu_timer, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer> > >::operator[](std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in SDPSolverIO.o
std::_Rb_tree<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::program_options::variable_value>, std::_Select1st<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::program_options::variable_value> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::program_options::variable_value> > >::find(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const in main.o
std::_Rb_tree<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::_Select1st<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >::_M_get_insert_unique_pos(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in main.o
std::_Rb_tree<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::_Select1st<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >::_M_get_insert_hint_unique_pos(std::_Rb_tree_const_iterator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in main.o
...
Here, I compiled GMP and Boost using clang with the -stdlib=libstdc++ flag and I compiled SDPB with gcc.
Undefined symbols for architecture x86_64:
"std::basic_string<char, std::char_traits<char>, std::allocator<char> >::find(char const*, unsigned long, unsigned long) const", referenced from:
boost::date_time::time_facet<boost::posix_time::ptime, char, std::ostreambuf_iterator<char, std::char_traits<char> > >::put(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, boost::posix_time::time_duration const&) const in SDPSolverIO.o
boost::date_time::time_facet<boost::posix_time::ptime, char, std::ostreambuf_iterator<char, std::char_traits<char> > >::put(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, boost::posix_time::ptime const&) const in main.o
"std::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const", referenced from:
std::_Rb_tree<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer>, std::_Select1st<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer> > >::_M_get_insert_unique_pos(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in SDPSolverIO.o
std::_Rb_tree<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer>, std::_Select1st<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer> > >::_M_get_insert_hint_unique_pos(std::_Rb_tree_const_iterator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in SDPSolverIO.o
std::_Rb_tree<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer>, std::_Select1st<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer> > >::_M_insert_unique_(std::_Rb_tree_const_iterator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer> >, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer> const&) in SDPSolverIO.o
std::map<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, boost::timer::cpu_timer, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::timer::cpu_timer> > >::operator[](std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in SDPSolverIO.o
std::_Rb_tree<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::program_options::variable_value>, std::_Select1st<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::program_options::variable_value> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, boost::program_options::variable_value> > >::find(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const in main.o
std::_Rb_tree<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::_Select1st<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >::_M_get_insert_unique_pos(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in main.o
std::_Rb_tree<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::_Select1st<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >::_M_get_insert_hint_unique_pos(std::_Rb_tree_const_iterator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in main.o
...
Here I compiled Boost, GMP, and SDPB using clang with the -stdlib=libstdc++ flag.
Undefined symbols for architecture x86_64:
"std::string::find(char const*, unsigned long, unsigned long) const", referenced from:
boost::date_time::time_facet<boost::posix_time::ptime, char, std::ostreambuf_iterator<char, std::char_traits<char> > >::put(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, boost::posix_time::time_duration const&) const in SDPSolverIO.o
boost::date_time::time_facet<boost::posix_time::ptime, char, std::ostreambuf_iterator<char, std::char_traits<char> > >::put(std::ostreambuf_iterator<char, std::char_traits<char> >, std::ios_base&, char, boost::posix_time::ptime const&) const in main.o
"std::logic_error::what() const", referenced from:
vtable for boost::gregorian::bad_day_of_year in main.o
vtable for boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::gregorian::bad_day_of_year> > in main.o
vtable for boost::exception_detail::error_info_injector<boost::gregorian::bad_day_of_year> in main.o
vtable for std::out_of_range in main.o
vtable for boost::gregorian::bad_day_of_month in main.o
vtable for boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::gregorian::bad_day_of_month> > in main.o
vtable for boost::exception_detail::error_info_injector<boost::gregorian::bad_day_of_month> in main.o
...
Here, I compiled everything using clang but only SDPB with the -stdlib=libstdc++ flag.
Undefined symbols for architecture x86_64:
"bootstrapSDP(std::vector<__gmp_expr<__mpf_struct [1], __mpf_struct [1]>, std::allocator<__gmp_expr<__mpf_struct [1], __mpf_struct [1]> > > const&, std::vector<PolynomialVectorMatrix, std::allocator<PolynomialVectorMatrix> > const&)", referenced from:
parseBootstrapSDP(tinyxml2::XMLElement*) in parse.o
"RpotrfStabilized(char const*, int, __gmp_expr<__mpf_struct [1], __mpf_struct [1]>*, int, int*, std::__1::vector<int, std::__1::allocator<int> >&, std::__1::vector<__gmp_expr<__mpf_struct [1], __mpf_struct [1]>, std::__1::allocator<__gmp_expr<__mpf_struct [1], __mpf_struct [1]> > >&, double)", referenced from:
choleskyDecompositionStabilized(Matrix&, Matrix&, std::__1::vector<int, std::__1::allocator<int> >&, std::__1::vector<__gmp_expr<__mpf_struct [1], __mpf_struct [1]>, std::__1::allocator<__gmp_expr<__mpf_struct [1], __mpf_struct [1]> > >&, double) in Matrix.o
"boost::program_options::to_internal(std::string const&)", referenced from:
std::vector<std::string, std::allocator<std::string> > boost::program_options::to_internal<std::string>(std::vector<std::string, std::allocator<std::string> > const&) in main.o
"boost::program_options::basic_parsed_options<char> boost::program_options::parse_config_file<char>(std::basic_istream<char, std::char_traits<char> >&, boost::program_options::options_description const&, bool)", referenced from:
_main in main.o
"boost::program_options::options_description::options_description(std::string const&, unsigned int, unsigned int)", referenced from:
_main in main.o
Whenever I tried to compile SDPB without the -stdlib=libstdc++ using the modified version of clang with OpenMP support, I kept running into many
error: 'value_type' is a private member of '__gmp_expr<mpf_t, mpf_t>'
__val_expr<_BinaryOp<__bit_shift_left<typename _Expr::value_type>,
^
src/serialize.h:48:10: note: while substituting deduced template arguments into function template 'operator<<' [with _Expr = __gmp_expr<mpf_t, mpf_t>]
os << f;
If anyone can help it would be much appreciated.
The Mac OS X Installation instructions have been updated and everything works now if I just blindly follow them to the letter.

OpenCV Framework: symbol(s) not found for architecture armv7

I've got the precompiled opencv2.framework from OpenCV, and I've added it to my project. However trying to compile the project gives errors like:
Undefined symbols for architecture armv7:
"std::__1::__vector_base_common<true>::__throw_length_error() const", referenced from:
std::__1::vector<unsigned long, std::__1::allocator<unsigned long> >::__append(unsigned long) in opencv2(matrix.o)
std::__1::vector<cv::Vec<int, 128>, std::__1::allocator<cv::Vec<int, 128> > >::__append(unsigned long) in opencv2(matrix.o)
std::__1::vector<cv::Vec<int, 64>, std::__1::allocator<cv::Vec<int, 64> > >::__append(unsigned long) in opencv2(matrix.o)
std::__1::vector<cv::Vec<int, 32>, std::__1::allocator<cv::Vec<int, 32> > >::__append(unsigned long) in opencv2(matrix.o)
std::__1::vector<cv::Vec<int, 16>, std::__1::allocator<cv::Vec<int, 16> > >::__append(unsigned long) in opencv2(matrix.o)
std::__1::vector<cv::Vec<int, 12>, std::__1::allocator<cv::Vec<int, 12> > >::__append(unsigned long) in opencv2(matrix.o)
std::__1::vector<cv::Vec<int, 9>, std::__1::allocator<cv::Vec<int, 9> > >::__append(unsigned long) in opencv2(matrix.o)
...
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::basic_string(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
cv::Exception::Exception(int, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) in opencv2(system.o)
cv::error(cv::Exception const&) in opencv2(system.o)
_cvRegisterModule in opencv2(system.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::operator=(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
cv::Exception::formatMessage() in opencv2(system.o)
"_OBJC_CLASS_$_ALAssetsLibrary", referenced from:
objc-class-ref in opencv2(cap_ios_video_camera.o)
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__init(char const*, unsigned long)", referenced from:
cv::sum(cv::_InputArray const&) in opencv2(stat.o)
cv::countNonZero(cv::_InputArray const&) in opencv2(stat.o)
cv::mean(cv::_InputArray const&, cv::_InputArray const&) in opencv2(stat.o)
cv::meanStdDev(cv::_InputArray const&, cv::_OutputArray const&, cv::_OutputArray const&, cv::_InputArray const&) in opencv2(stat.o)
cv::minMaxIdx(cv::_InputArray const&, double*, double*, int*, int*, cv::_InputArray const&) in opencv2(stat.o)
cv::minMaxLoc(cv::_InputArray const&, double*, double*, cv::Point_<int>*, cv::Point_<int>*, cv::_InputArray const&) in opencv2(stat.o)
cv::norm(cv::_InputArray const&, int, cv::_InputArray const&) in opencv2(stat.o)
...
"std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::~basic_string()", referenced from:
cv::sum(cv::_InputArray const&) in opencv2(stat.o)
cv::countNonZero(cv::_InputArray const&) in opencv2(stat.o)
cv::mean(cv::_InputArray const&, cv::_InputArray const&) in opencv2(stat.o)
cv::meanStdDev(cv::_InputArray const&, cv::_OutputArray const&, cv::_OutputArray const&, cv::_InputArray const&) in opencv2(stat.o)
cv::minMaxIdx(cv::_InputArray const&, double*, double*, int*, int*, cv::_InputArray const&) in opencv2(stat.o)
cv::minMaxLoc(cv::_InputArray const&, double*, double*, cv::Point_<int>*, cv::Point_<int>*, cv::_InputArray const&) in opencv2(stat.o)
cv::norm(cv::_InputArray const&, int, cv::_InputArray const&) in opencv2(stat.o)
...
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've set Build Active Architectures Only to No in my build settings, but it still happens. What do I need to do to get OpenCV working? I'm using XCode 5, targeting iOS7.
I've already added -lstdc++ to linker flags and switch the C++ compiler to libstdc++, as-per this answer.
I have tried compiling OpenCV from source too but that yields the same error.
It's the same regardless of whether I have iOS6 or 7 as the deployment target.
Two things you should check:
You're attempting to use the C++ portions of OpenCV but Xcode/clang are very literal. If the file you're linking with is a .m it'll treat it as an Objective-C. Instead we want to treat it as an Objective-C++ file by either renaming the extension to .mm or by bringing up the file's properties in the right side bar and selecting Objective-C++ Source for the Type.
ALAssetsLibrary is defined in AssetsLibrary.framework, please add it to your Link Binary With Libraries step for your project.

Compiling player/stage on Mac os x

Not sure if any had this problem or similar but if you have some help would be appreciated.
I have setup postgresql in the following location and set the link path to /usr/local/pgsql-9.0. Also setup the libpqxx in the /usr/local/lib
But I am guessing the error says that it cant find the postgresql anywhere. Is that correct ?
Linking CXX shared library libplayerdrivers.dylib Undefined symbols: "_PQntuples", referenced from:
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o
PostgresConn::GetLayerData(char const*)in dbconn.o "_PQresultErrorMessage", referenced from:
Postlog::rollback() constin postlog.o
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o "_PQgetvalue", referenced from:
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o
PostgresConn::GetLayerData(char const*)in dbconn.o
PostgresConn::GetLayerData(char const*)in dbconn.o
PostgresConn::GetLayerData(char const*)in dbconn.o
PostgresConn::GetLayerInfo(char const*)in dbconn.o
PostgresConn::GetVectorMapInfo(std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >)in dbconn.o
PostgresConn::GetVectorMapInfo(std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >)in dbconn.o "_PQexecParams", referenced from:
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o "_PQresultStatus", referenced from:
Postlog::rollback() constin postlog.o
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::GetLayerData(char const*)in dbconn.o
PostgresConn::GetLayerInfo(char const*)in dbconn.o
PostgresConn::GetVectorMapInfo(std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >)in dbconn.o
PostgresConn::GetVectorMapInfo(std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >)in dbconn.o "_PQexec", referenced from:
Postlog::rollback() constin postlog.o
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::GetLayerData(char const*)in dbconn.o
PostgresConn::GetLayerInfo(char const*)in dbconn.o
PostgresConn::GetVectorMapInfo(std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >)in dbconn.o
PostgresConn::GetVectorMapInfo(std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >)in dbconn.o "_PQgetlength", referenced from:
PostgresConn::GetLayerData(char const*)in dbconn.o
PostgresConn::GetLayerInfo(char const*)in dbconn.o
PostgresConn::GetVectorMapInfo(std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >)in dbconn.o "_PQbinaryTuples", referenced from:
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o "_PQclear", referenced from:
Postlog::rollback() constin postlog.o
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o
Postlog::storeData(int, char const*, void const*, double, unsigned short, unsigned short, unsigned char, unsigned char)in postlog.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::WriteLayerData(LayerDataHolder&) in dbconn.o
PostgresConn::GetLayerData(char const*)in dbconn.o
PostgresConn::GetLayerInfo(char const*)in dbconn.o
PostgresConn::GetVectorMapInfo(std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >)in dbconn.o
PostgresConn::GetVectorMapInfo(std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >)in dbconn.o "_PQsetdbLogin", referenced from:
Postlog::Setup() in postlog.o
PostgresConn::Connect(char const*, char const*, char const*, char const*, char const*)in dbconn.o "_PQstatus", referenced from:
Postlog::Setup() in postlog.o
Postlog::isConnected() const in postlog.o
PostgresConn::Connected() in postgis.o
PostgresConn::Connect(char const*, char const*, char const*, char const*, char const*)in dbconn.o "_PQfinish", referenced from:
Postlog::Shutdown() in postlog.o
Postlog::~Postlog()in postlog.o
Postlog::~Postlog()in postlog.o
Postlog::~Postlog()in postlog.o
PostgresConn::Disconnect() in dbconn.o
ld: symbol(s) not found
Thanks to "mu is too short" its indeed the missing -lpq
Looks like there is a bug with the player/stage build for Mac Os X

Resources