I have a small test case program just to see if boost works on some system.
#include <iostream>
#include <boost/math/distributions/normal.hpp>
#include <boost/math/distributions/chi_squared.hpp>
using namespace std;
int main(int argc, char* argv[]) {
// Boost test
boost::math::normal std_normal;
double x = 1.5;
cout << boost::math::cdf(std_normal, x) << endl;
boost::math::normal non_std_normal(1.5, 2);
cout << boost::math::cdf(non_std_normal, x) << endl; // should output 1/2
// Test the chi-squared inverse
int degree_of_freedom = 19;
boost::math::chi_squared chi_dist(degree_of_freedom);
cout << boost::math::quantile(complement(chi_dist, 0.05)) << endl;
return 0;
}
I ssh to some server and they only allow me to use boost libraries through some directory full of shared objects and archive files (i.e. libboost_log.so, libboost_math_c99.a, etc.).
To be honest, I have no clue how to use these files. I tried (for both g++ and gcc)
g++ test.cpp -o test -l /share/apps/boost/1.55.0/lib
g++ test.cpp -o test -l /share/apps/boost/1.55.0/lib -lboost_system -lboost_filesystem
g++ -std=c++11 -pedantic test.cpp -I/share/apps/boost/1.55.0/include/ -o test
g++ test.cpp -o test -I /share/apps/boost/1.55.0/include -lboost_system -lboost_filesystem
where /share/apps/boost/1.55.0/lib is the directory for the .so and .a files and /share/apps/boost/1.55.0/include is the directory for the .hpp files.
I was denied permission for the 3rd command with the following output:
In file included from /share/apps/boost/1.55.0/include/boost/math/special_functions/detail/round_fwd.hpp:11:0, from /share/apps/boost/1.55.0/include/boost/math/special_functions/math_fwd.hpp:26, from /share/apps/boost/1.55.0/include/boost/math/special_functions/erf.hpp:13, from /share/apps/boost/1.55.0/include/boost/math/distributions/normal.hpp:19, from test.cpp:12: /share/apps/boost/1.55.0/include/boost/config.hpp:30:29: fatal error: /share/apps/boost/1.56.0/build/boost_1_56_0/boost/config/user.hpp: Permission denied
I received the error for the fourth command:
fatal error: boost/math/distributions/normal.hpp: No such file or directory.