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!
----------------------------
First, there is one dependency:
First, there is one dependency, regrdless of the OS you use:
cmake - it's the build system
building the library is simple. Enter the build folder, run th tools. Like this:
cd build
cmake .. -DCMAKE_BUILD_TYPE:string=Release
make
Building on Linux:
--------------------
* To run in the output folder (without installing):
building the library is simple. Enter the build folder, run the tools. Like this:
Changing folder to build and using 'cmake ..' is important!
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.
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:
--------------------

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

@ -3,6 +3,7 @@
#include <iostream>
#include <integers.h>
#include <vector>
#include <ctime>
using namespace std;
#include <DFTypes.h>
@ -10,6 +11,9 @@ using namespace std;
int main (void)
{
time_t start, end;
double time_diff;
uint32_t x_max,y_max,z_max;
uint32_t num_blocks = 0;
uint32_t bytes_read = 0;
@ -27,6 +31,7 @@ int main (void)
DF.InitMap();
DF.getSize(x_max,y_max,z_max);
time(&start);
for(uint32_t i = 0; i< 1000;i++)
{
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 << 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;
return 0;
}

@ -170,10 +170,7 @@ int main (int argc, const char* argv[])
{
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();
#endif
delete pDF;
return 0;
}

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