HyperNEAT icon indicating copy to clipboard operation
HyperNEAT copied to clipboard

Arch Linux build issues (patched)

Open hugoaboud opened this issue 4 years ago • 2 comments

I've had some issues building the library with GCC on Arch Linux 2020, so I've updated the build script to patch some source files and use the zlib and boost installed by pacman. I've also patched it to use wxWidgets version 3.0 and Python 3.8

  1. -stdlib=libstdc++ As mentioned here, this flag causes compiling issues with GCC. The patch removes all entries on CMakeLists.txt files.

  2. Board -fPIC When compiling with BUILD_PYTHON, there was an issue "relocation R_X86_64_PC32 against symbol can not be used when making a shared object" with Board. The patch adds the -fPIC to the cmake command for this library. Thought I'm not sure it affects the code.

  3. zlib, zlib_d The zlib installed by pacman is linked with -lz. The patch fixes the names on CMakeLists.txt files.

  4. typedef void *gzFile On the current zlib version, this is typedef struct gzFile_s *gzFile. The patch changes it on tinyxmlplus.h.

  5. SaveFileGZ() not saving, SaveFile() normal For some reason, the "9wb+" option with the current zlib::gzopen won't create a file. I found that taking the + out it works. The patch changes it to "9wb" on tinyxmlplus.cpp.

  6. shared_ptr ambiguous Some shared_ptr across the source are missing the boost:: namespace. The patch fixes all files it finds.

  7. mutex ambiguous Some mutex across the source are missing the boost:: namespace. The patch fixes all files it finds.

  8. GtpInputStream::GetLine The compiler needs an explicit cast from istream to bool, so the patch changes the return to return (bool) getline(m_in, line) on fuego-0.4/gtpengine/GtpInputStream.cpp.

  9. SgGameReader::GetIntProp The compiler needs an explicit cast from istringstream to bool, so the patch changes the return to return (bool) in; on fuego-0.4/smartgame/SgGtpClient.cpp.

  10. boost -mt-d, -mt I don't really know why these flags are added to the boost library names, I guess it's related to the boost that's part of the repo. The patch removes them, and also removes the '-' character after each boost lib name.

  11. wxOPEN, wxFILE_MUST_EXIST, wxSAVE As mentioned here these have changed respectively to wxFD_OPEN, wxFD_FILE_MUST_EXIST and wxFD_SAVE.

  12. OnlyGaussianHiddenNodes 0.0 This one took me a while to figure out, but the .dat file I was using as template didn't have this parameter, so the experiment would randomly crash.

Here is the patch shell script, it might be helpful for someone. (rename to .sh)

I'm using it as a lib for my software, so I can't tell if all the methods and experiments are working, especially the ones about Checkers/Go. But it's worth the try.

hugoaboud avatar Apr 12 '20 08:04 hugoaboud

Cool, can you submit a pull request?

MisterTea avatar Apr 12 '20 19:04 MisterTea

Absolutely! I'm not testing the main module (HCUBE_ExperimentRun, etc..), since I'm using it as a lib. But yesterdey I've tried a quick run with GUI and noticed that some crashes occur.

As I was creating my ExperimentRun class, I've noticed that using HCUBE_NTHREADS=1 would avoid a few crashes, until I realized that the vector<> experiments was not being fully handled. The methods createPopulation, preprocessPopulation and finishEvaluations would update only the first experiment. So using NTHREADS=1 was fine, but =4 not.

Would you like me to update this on your ExperimentRun class or do you rather take a look at it yourself? I've taken out all the ExperimentType stuff on my class, so I'm not sure the changes I've made would conflict with your code.

Also, do you want me to commit the version changes for wx and Python?

hugoaboud avatar Apr 12 '20 23:04 hugoaboud