getting library to run on ubuntu 14.04

Hi, I'm trying to make this
https://github.com/andrewprock/pokerstove#building

poker library to run so it could be included and used in a simple
.cpp
file opened by simple text editor and compiled in terminal using
g++ -o my_prog my_cpp.cpp


Instruction tells that I need the following installed on my platform of choice:
boost, version 1.46 or higher
cmake, version 2.4 or higher
subversion, version 1.7 or higher

I did it using
sudo apt-get install libboost-all-dev cmake subversion

Also installed GNU C++ compiler like this
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential
gcc -v
make -v

and git using
sudo apt-get install git

I runed all these commands from my home directory (i think, not very experienced with ubuntu)
It looked like this for example
girts@girts-ThinkPad-E520:~$ sudo apt-get install build-essential


Everything runed super smoothly and I was very pleased with not getting tons of errors.

Next I followed these instructions
To build under linux using cmake, create a build directory, invoke cmake on the programs directory, then build.
git clone https://github.com/andrewprock/pokerstove.git
mkdir pokerstove/src/build
cd pokerstove/src/build
cmake ..
make

Again i did it from my home folder if it means anything and didnt get any errors

Next the creator of the library says
You should then be able to execute the simple command line example:
~/cmake/programs$ ./programs/ps-eval/ps-eval

When i runed this command from my current directory
girts@girts-ThinkPad-E520:~/pokerstove/src/build$
all i was getting was this :
bash: /home/girts/cmake/programs$: No such file or directory



Is there anything I did wrong here? Any tips would be really appreciated.

Last edited on
The binaries are in the pokerstove/src/build/bin directory.
as you are in build, you may simply do bin/ps-eval


By the way, ~/cmake/programs$ was their prompt.
This actually worked man! Thanks a lot!!
Next thing i should do is to try including these libraries into my .cpp file
#include <iostream>
#include <vector>
#include <boost/algorithm/string.hpp>
#include <boost/math/special_functions/binomial.hpp>
#include <boost/foreach.hpp>
#include <boost/format.hpp>
#include <boost/lexical_cast.hpp>
#include <pokerstove/util/combinations.h>
#include <pokerstove/peval/Card.h>

You can see the specific
<pokerstove/peval/Card.h>

I tryed to include them when i was at my
girts@girts-ThinkPad-E520:~/pokerstove/src/build$
directory (created .cpp file exactly there) but i couldnt include it because compiler gave me error that there is no such fle or directory. Maybe I somehow installed this in the wrong place? (instead of my home folder should have been installed elsewhere?)
Last edited on
The file is in ~/pokerstove/src/build/lib/pokerstove/peval/Card.h

The compiler search specific directories for the headers, by instance /usr/include/. The makefile seems to be missing an «install» option that would move the files to the corresponding directories.

If you want it to search in other paths you may use the -I or the -isystem flag. Or you could add the path to the C_INCLUDE_PATH and CPLUS_INCLUDE_PATH variables.

$ g++ -I lib/ foo.cpp
$ export CPLUS_INCLUDE_PATH=~/pokerstove/src/build/lib/:${CPLUS_INCLUDE_PATH} g++ foo.cpp



After that, you'll probably have the same issue when linking, in that case use the -L flag or the LIBRARY_PATH variable.
$ g++ -L lib/pokerstove/peval -lpeval foo.o
$ export LIBRARY_PATH=~/pokerstove/src/build/lib/pokerstove/peval:${LIBRARY_PATH} g++ -lpeval foo.o
Last edited on
Tnx a lot for your effor man. This is not making 100% sence to me right now coz i have been trying to make this work for 12 hours straight. Maybe will figure out something tomorow from this
Topic archived. No new replies allowed.