facebookresearch / CompilerGym

Reinforcement learning environments for compiler and program optimization tasks
https://compilergym.ai/
MIT License
906 stars 127 forks source link

How do I use the binary that I built from the CompilerGym source code? #807

Open chendian2023 opened 1 year ago

chendian2023 commented 1 year ago

❓ Questions and Help

I have built CompilerGym from source on my x86 Linux platform, and now I have directories named bin, include, lib, and share. However, I am unsure how to use these directories. Are there any instructions available? Currently, I am only able to use CompilerGym by importing it after installing it with "pip3 install compiler_gym==0.2.5" .

In other words , how can I generate *.whl such as "compiler_gym-0.2.5-py3-none-manylinux2014_x86_64.whl " after building form source using CMake ,Ninja , ninja install ?

Thanks for your reply .

Additional Context

I was able to successfully build CompilerGym from source after making some modifications to the package versions in the original CMakeLists file. After numerous attempts, I have finally succeeded in compiling CompilerGym from source code. However, I am now unsure how to use it.

chendian2023 commented 1 year ago

ls bin/ acountry ahost compute_autophase compute_observation llvm-extract-one adig compiler_gym-llvm-service compute_ir_instruction_count compute_programl PrintInstCountFeatureNames

ls lib/ cmake libglog.a libgmock_main.a libgtest_main.a libz.a libz.so.1 pkgconfig libcares.a libgmock.a libgtest.a libre2.a libz.so libz.so.1.2.13

ls include/ ares_build.h ares.h ares_version.h gmock grpc++ gtest re2 zlib.h ares_dns.h ares_rules.h glog grpc grpcpp nlohmann zconf.h

ls share/ grpc man pkgconfig

ChrisCummins commented 1 year ago

Hi @chendian2023, once you have built with cmake you should have a *.whl file that can be installed using:

pip install <path to build directory>/py_pkg/dist/compiler_gym*.whl --force-reinstall

See INSTALL.md for details.

I was able to successfully build CompilerGym from source after making some modifications to the package versions in the original CMakeLists file.

Patches welcome! :) What versions needed changing?

Cheers, Chris