compiling info, timer for expbench

develop
Petr Mrázek 2009-10-30 09:01:14 +00:00
parent a538417604
commit 879834178d
5 changed files with 36 additions and 9 deletions

@ -1,19 +1,35 @@
Here's how you build dfhack! Here's how you build dfhack!
---------------------------- ----------------------------
First, there is one dependency: First, there is one dependency, regrdless of the OS you use:
cmake - it's the build system cmake - it's the build system
building the library is simple. Enter the build folder, run th tools. Like this: Building on Linux:
cd build --------------------
cmake .. -DCMAKE_BUILD_TYPE:string=Release
make * To run in the output folder (without installing):
Changing folder to build and using 'cmake ..' is important! building the library is simple. Enter the build folder, run the tools. Like this:
cd build
cmake .. -DCMAKE_BUILD_TYPE:string=Release -DMEMXML_DATA_PATH:path=.
make
This will build the library and its tools and place them in /output. This will build the library and its tools and place them in /output.
You can also use a cmake-friendly IDE like KDevelop 4 or the cmake GUI program. You can also use a cmake-friendly IDE like KDevelop 4 or the cmake GUI program.
* To be installed into the system or packaged
cd build
cmake -DCMAKE_BUILD_TYPE:string=Release -DCMAKE_INSTALL_PREFIX=/usr -DMEMXML_DATA_PATH:path=/usr/share/dfhack ..
make
make install
With this dfhack installs:
library to $CMAKE_INSTALL_PREFIX/lib
executables to $CMAKE_INSTALL_PREFIX/bin
The Memory.xml file to /usr/share/dfhack
Building on Windows: Building on Windows:
-------------------- --------------------

@ -111,5 +111,7 @@ int main (void)
} }
DF.FinishReadCreatures(); DF.FinishReadCreatures();
delete pDF; delete pDF;
cout << "Done. Press any key to continue" << endl;
cin.ignore();
return 0; return 0;
} }

@ -3,6 +3,7 @@
#include <iostream> #include <iostream>
#include <integers.h> #include <integers.h>
#include <vector> #include <vector>
#include <ctime>
using namespace std; using namespace std;
#include <DFTypes.h> #include <DFTypes.h>
@ -10,6 +11,9 @@ using namespace std;
int main (void) int main (void)
{ {
time_t start, end;
double time_diff;
uint32_t x_max,y_max,z_max; uint32_t x_max,y_max,z_max;
uint32_t num_blocks = 0; uint32_t num_blocks = 0;
uint32_t bytes_read = 0; uint32_t bytes_read = 0;
@ -27,6 +31,7 @@ int main (void)
DF.InitMap(); DF.InitMap();
DF.getSize(x_max,y_max,z_max); DF.getSize(x_max,y_max,z_max);
time(&start);
for(uint32_t i = 0; i< 1000;i++) for(uint32_t i = 0; i< 1000;i++)
{ {
if((i % 10) == 0) if((i % 10) == 0)
@ -52,8 +57,13 @@ int main (void)
} }
} }
} }
time(&end);
time_diff = difftime(end, start);
cout << num_blocks << " blocks read" << endl; cout << num_blocks << " blocks read" << endl;
cout << bytes_read / (1024 * 1024) << " MB" << endl; cout << bytes_read / (1024 * 1024) << " MB" << endl;
cout << "map export tests done in " << time_diff << " seconds." << endl;
cout << "Press any key to continue" << endl;
cin.ignore();
delete pDF; delete pDF;
return 0; return 0;
} }

@ -170,10 +170,7 @@ int main (int argc, const char* argv[])
{ {
cout << stonetypes[p->first].id << " : " << p->second << endl; cout << stonetypes[p->first].id << " : " << p->second << endl;
} }
// wait for input on windows so the tool is still usable to some extent
#ifndef LINUX_BUILD
cin.ignore(); cin.ignore();
#endif
delete pDF; delete pDF;
return 0; return 0;
} }

@ -48,5 +48,7 @@ int main (void)
} }
} }
delete pDF; delete pDF;
cout << "Done. Press any key to continue" << endl;
cin.ignore();
return 0; return 0;
} }