Skip to content

Instantly share code, notes, and snippets.

@sztanko
Last active December 22, 2015 03:59
Show Gist options
  • Save sztanko/6414090 to your computer and use it in GitHub Desktop.
Save sztanko/6414090 to your computer and use it in GitHub Desktop.
Compiling CIFReader from Tom Cairns
Chances you will ever need to use https://github.com/swlines/CIFReader are one in million.
If you are working on a transport app and open data, chances are larger.
If you are good with c++ and compiling c++, you probably don't need to read it. Instead, just click here:
http://performance-dynamics.net/wp-content/uploads/2010/10/100-Percent-Genius-Shirt-300x300.jpg
Oh no, don't click, it is not clickable in this gist, so just copy and paste it in your browser address bar. But you probably have figured it out already, since we know you are a genius.
This tutorial potentially can save you one week of work.
0. Get the CIF files from http://data.atoc.org/data-download (you need to register)
1. Compile mysql++
1a. If your system is 64bit, you probably need this command to configure. Alternatively, use your own mysql-lib path. ./configure --with-field-limit=55 --with-mysql-lib=/usr/lib/x86_64-linux-gnu/
1b. follow stack overflow advices on changing the config in case you have problems. You probably will have problems. Yes, I am talking about adding lines to lib/sql_buffer.cpp See: http://stackoverflow.com/questions/10849548/setting-up-mysql-in-linux
1c. PRO TIP: did you know you can build things in parallel using "make -j 4" instead of "make". This will probably make your build run 4 times faster.
2. apt-get install libboost-regex-dev libboost-filesystem-dev libboost-thread-dev libboost-system-dev -y
3. When compiling the CIFReader, you probably will have some problems with linker. The reason for that is that g++ compile command specified in the README is not entirely correct. At least it didn't work on all installations I have ever tried to install the project.
The g++ command that will looks something like this:
g++ -Wall -I/usr/include/mysql -I/usr/local/include/mysql++ -I/usr/include/boost -lmysqlclient -o parser main.cpp classes/*.cpp classes/NR-CIF/*.cpp -lmysqlpp -lboost_regex -lboost_filesystem -lboost_thread -lboost_system
Just change the order of library inclusion.
4. Follow all the other instructions specified in README.
In case it still doesn't work, contact me. My twitter is @sztanko
p.s. We all are grateful to Tom Cairns for providing this genius peace of software. Once you are done with installing, it does magic and seriously improves the quality of your life. Just watching its progress bar fills you with joy and happiness.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment