m-abr / FCPCodebase

FC Portugal Codebase
GNU General Public License v3.0
35 stars 7 forks source link

packaging the binary code #20

Closed Dionysus7777777 closed 1 month ago

Dionysus7777777 commented 7 months ago

Sorry to bother you again. After packaging the binary code, I successfully generated the 'dist' file. However, there seems to be a slight issue with this file. It works fine on my computer, but on others', there are some errors. Could you please help me understand why this is happening?

微信图片_20240429200941

m-abr commented 7 months ago

It seems that you might have inadvertently set parameter -P to False. Parameter -P accepts only int values (0 or 1). The parameter data types are specified in /scripts/commons/Script.py.

In the same folder as the binary you should have the start script you are using to invoke the team (e.g. start.sh) and the configuration file config.json, which is automatically created on the first run.

The problem could lie in either the start script or the configuration file. Please check if your start script contains something like this:

for i in {1..11}; do
  ./fcp -i $host -p $port -u $i -t FCPortugal -P False &         # '-P False' isn't valid, use '-P 0'
done

Or if your config.json file has something like this:

"P": [
        "Penalty Shootout",
        "False"                  # not a valid value, use "0" instead
    ],

Note: the configuration provided by the start script overrides the default values in config.json.

Dionysus7777777 commented 6 months ago

I encountered a rather strange issue. My earlier version could be packaged normally. However, my newer version cannot be packaged. I have checked, and I haven't added any new files, so this shouldn't be a potential issue. Specifically, when I execute the bundle.sh file, it can package properly and generate the dist files. But when I run ./start.sh in the dist file, I encounter this problem.

image
m-abr commented 6 months ago

Please follow these steps to resolve the issue:

  1. Delete the following folders:

    • /bundle/dist/
    • /bundle/build/
  2. Next, remove the compiled C++ modules:

    • /cpp/a_star/a_star.so
    • /cpp/ball_predictor/ball_predictor.so
    • /cpp/localization/localization.so
  3. Now, execute the following command to recompile the C++ modules:

    python Run_Utils.py
  4. Finally, rerun bundle.sh and check if the problem is resolved.


If the problem persists, there might be a conflict with multiple Python versions installed on your computer. Please verify the Python version used to compile the C++ modules by inspecting these files:

Dionysus7777777 commented 1 month ago

Thank you for your help. We had already resolved the issue earlier, but I forgot to reply and close the case. My apologies for that.