Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions Converter/src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@


#include <iostream>
#include <execution>
#include <string>

#ifdef WINDOWS
#include <windows.h>
#else
#include <limits.h>
#include <unistd.h>
#endif

#include "unsuck/unsuck.hpp"
#include "chunker_countsort_laszip.h"
Expand Down Expand Up @@ -494,6 +500,17 @@ void generatePage(string exePath, string pagedir, string pagename) {

#include "HierarchyBuilder.h"

std::string getExePath() {
#ifdef WINDOWS
char result[ MAX_PATH ];
return std::string(result, GetModuleFileName(NULL, result, MAX_PATH));
#else
char result[ PATH_MAX ];
ssize_t count = readlink("/proc/self/exe", result, PATH_MAX);
return std::string(result, (count > 0) ? count : 0);
#endif
}

int main(int argc, char** argv) {


Expand All @@ -512,7 +529,8 @@ int main(int argc, char** argv) {

double tStart = now();

auto exePath = fs::canonical(fs::absolute(argv[0])).parent_path().string();
auto exePath = getExePath();
cout << "#exe path: " << exePath << endl;

launchMemoryChecker(2 * 1024, 0.1);
auto cpuData = getCpuData();
Expand Down Expand Up @@ -566,4 +584,4 @@ int main(int argc, char** argv) {


return 0;
}
}