UMDGeoVis/Terrain_Analysis_on_IA

Compilation errors when using Windows+mingw32

Opened this issue · 2 comments

Several issues have been found when I tried to compile the program on Windows.

  1. The usage of package Eigen3: The current configuration in the CMakeLists.txt only works for the Linux system.
    The CMakeLists file will be modified in the next commit. But it is required to define EIGEN3_INCLUDE_DIR as an environment variable on your Windows system. Also, it seems to be necessary to copy the FindEigen3.cmake file from the eigen library folder to ..\CMake\share\cmake-3.20\Modules folder.

  2. uint is not defined when complied with mingw32:
    Can be fixed by replacing uint with unsigned int.

  3. Will have fatal error: sys/resource.h: No such file or directory
    Possible solution: use Cygwin environment
    Related topic: https://stackoverflow.com/questions/18671090/compiling-c-with-ms-visual-c-2010-sys-resource-h-no-such-file

I created a new branch (called feature/windows_build) with a working build process on MSVC compiler..

Issue 1. I simplified the linking of Eigen3 library. please check that this is still working on linux and on windows systems with mingw32

Issue 3. sys/resource.h is posix so it is not compatible on windows unless using cygwin. I added a check that disable the memory peak feature on non-posix systems. In such systems we have to implement a new function for computing this statistic.

I used windows subsystem for linux which helped issues 1 and 3.

Issue 1. using wsl, running sudo apt install libeigen3-dev and adding eigen3/ to the front of include headers that use the Eigen library seems to fix this issue for me

Issue 3. running the cython setup command in the linux environment through wsl also allowed me to bypass the sys/resource.h file not found error