RGF-team / rgf

Home repository for the Regularized Greedy Forest (RGF) library. It includes original implementation from the paper and multithreaded one written in C++, along with various language-specific wrappers.
378 stars 58 forks source link

FastRGF executables not found on Windows #290

Closed scolemann closed 5 years ago

scolemann commented 5 years ago

On Windows OS, the function is_fastrgf_executable in utils.py returns false when it should return true due to a path bug.

In the following two lines, the code needs to add '.exe' on Windows, otherwise the executables are not found.

is_fastrgf_executable in utils.py path_train = os.path.join(path, "forest_train") < line 172 > path_pred = os.path.join(path, "forest_predict") < line 181 >

I confirmed that adding .exe to the filename fixed the issue.

StrikerRUS commented 5 years ago

@scolemann Hhhm, it's very strange, because

  1. Windows can resolve the filename without .exe,
  2. we have tests on Windows which works well.

Anyway, thanks for your information! Can you please also provide the version of Windows you are using?

scolemann commented 5 years ago

@StrikerRUS OS: Windows 10 Pro Version: 10.0.17134 Build 17134

I walked through the code and the file not found Exception occurred on line 189: os.chmod(path_train, os.stat(path_train).st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)

If you call an exe, you can exclude the ".exe", but my assumption is that since we are performing an operation on a file we need the entire filename including extension.

While I have you, I also had another issue with FastRGF. Is it expected that we should have MinGW installed to run it? I had to install MSYS2 with the correct toolchain and then add the bin directory to my path.

scolemann commented 5 years ago

@StrikerRUS

I was in error. Since the Exception is passed, it's not an issue. I think in my troubleshooting of other issues (I had to create the .rgfrc file to get FastRGF to work) I thought this was an issue as I was debugging.

StrikerRUS commented 5 years ago

I walked through the code and the file not found Exception occurred on line 189: os.chmod(path_train, os.stat(path_train).st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)

If you call an exe, you can exclude the ".exe", but my assumption is that since we are performing an operation on a file we need the entire filename including extension.

Oh, it makes things clearer! Thank you very much for debugging! Great catch! I'll fix this soon.

Is it expected that we should have MinGW installed to run it?

I thought that MinGW is needed only in case of building from sources. Please, note that MinGW-w64 with POSIX threads is needed, not ordinary MinGW.