Good evening,
Before compiling make sure you have boost installed on the server that you are using. You can install boost by using the following command:
sudo apt-get install libboost-all-dev.
If you look at the top of some of the programs (Paper_MCMC_V2.cpp, MCMC_PrescreeningSwap.cpp, MCMC_Cache_ALL_V2.cpp, MCMC_NormRatio.cpp, and MCMCFASTCASH_percentscore.cpp) available on the GitLab you will notice that there is a comment box (comments in C++ are labeled with "//"). In the comment box there is a section titled "Compile" which shows an example of how one can compile the file. Below I will give a more general example:
- Code: Select all
g++ -x c++ -std=c++11 -o NameOfProgram Path/To/The/CppFile
The "NameOfProgram" is whatever the user chooses it to be. The "Path/To/The/CppFile" is the path to the cpp file that contains the code you are interested in compiling.
After you have executed the above command on the terminal you can use ./NameOfProgram to run the program.
If you are using eclipse to run my program you will need to make the following changes to eclipse:
- Go to the Window tab on the top left hand corner and press the Preferences tab from within this menu. A pop up should appear. On the left hand side of the pop up click on C/C++ this will open up a menu from within this menu click on Build and then on Settings. Now click on the tab labeled Discovery and then click on the CDT GCC Built-in Compiler Settings part of the menu. Below you will see a text box which contains ${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}". Add a space to the text box and type in the following -std=c++11. The text box should now look like this: ${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}" -std=c++11. Now press the Apply and Close button on the lower right hand corner.
- Go to the Project Explorer and right click on the project. In the pop up menu click Properties and then click on C/C++ Build. Now click on Miscellaneous from within the GCC C++ Compiler menu (this will be the first Miscellaneous that appears on the screen). You will see a text box on the right hand side that reads as follows: -c -fmessage-length=0. Add a space to the text box and type -std=c++11. Now the text box should look like this: -c -fmessage-length=0 -std=c++11. Now press the Apply and Close button on the lower right hand corner.