Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arch Linux build issues (patched) #11

Open
hugoaboud opened this issue Apr 12, 2020 · 2 comments
Open

Arch Linux build issues (patched) #11

hugoaboud opened this issue Apr 12, 2020 · 2 comments

Comments

@hugoaboud
Copy link

hugoaboud commented Apr 12, 2020

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 hugoaboud changed the title Arch Linux Build Issues (Patched) Arch Linux build issues (patched) Apr 12, 2020
@MisterTea
Copy link
Owner

Cool, can you submit a pull request?

@hugoaboud
Copy link
Author

hugoaboud commented Apr 12, 2020

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants