intelxed / xed

The X86 Encoder Decoder (XED), is a software library for encoding and decoding X86 (IA32 and Intel64) instructions
https://intelxed.github.io/
Apache License 2.0
1.39k stars 145 forks source link

GitHub XED Building Instructions #295

Closed Victor6799 closed 1 year ago

Victor6799 commented 1 year ago

I'm trying to follow the abbreviated GITHUB building instructions as shown here https://github.com/intelxed/xed

git clone https://github.com/intelxed/xed.git xed git clone https://github.com/intelxed/mbuild.git mbuild cd xed ./mfile.py

The first three commands works fine. But when running the last one I get the following error:

$ ./mfile.py /usr/bin/env: ‘python3’: No such file or directory

I've installed python version 3.11 to the following directory c:\python and have tried the following SO solution posted here (https://stackoverflow.com/questions/13091522/bin-env-python-no-such-file-or-directory-windows-through-git-bash-trying-to) Unfortunately it does not work. The error message can be traced to the very first line from the mfile.py file.

marjevan commented 1 year ago

Did you try python .\mfile.py or c:\python\python.exe .\mfile.py ?

Victor6799 commented 1 year ago

@marjevan thank you. I tried both suggestions and got the following results:

VME@XFL-DEVS MINGW64 ~/xed (main) $ python .\mfile.py C:\python\python.exe: can't open file 'C:\Users\VME\xed\.mfile.py': [Errno 2] No such file or directory

VME***@XFL-DEVS MINGW64 ~/xed (main) $ python mfile.py [MBUILD ERROR] Could not find MSVS 2022 directory

File "C:\Users\VME\xed\mfile.py", line 106, in retval = work() File "C:\Users\VME\xed\mfile.py", line 100, in work retval = xed_mbuild.execute() File "C:\Users\VME\xed\xed_mbuild.py", line 2819, in execute xed_args(env) # parse command line knobs File "C:\Users\VME\xed\xed_mbuild.py", line 992, in xed_args env.parse_args(env['xed_defaults']) File "C:\Users\VME\xed..\mbuild\mbuild\env.py", line 1081, in parse_args self.process_user_settings() File "C:\Users\VME\xed..\mbuild\mbuild\env.py", line 987, in process_user_settings self.set_compiler_env() File "C:\Users\VME\xed..\mbuild\mbuild\env.py", line 1308, in set_compiler_env build_env.set_env_ms(self) File "C:\Users\VME\xed..\mbuild\mbuild\build_env.py", line 417, in set_env_ms find_ms_toolchain(env) File "C:\Users\VME\xed..\mbuild\mbuild\build_env.py", line 255, in find_ms_toolchain env['vc_dir'] = msvs.set_msvs_env(env) File "C:\Users\VME\xed..\mbuild\mbuild\msvs.py", line 1637, in set_msvs_env vc = _set_msvs_dev17(env, x64_host, x64_target, vs_dir) File "C:\Users\VME***\xed..\mbuild\mbuild\msvs.py", line 714, in _set_msvs_dev17 die('Could not find MSVS 2022 directory')

VME***@XFL-DEVS MINGW64 ~/xed (main) $ c:\python\python.exe .\mfile.py bash: c:pythonpython.exe: command not found

VME***@XFL-DEVS MINGW64 ~/xed (main) $ \c\python\python.exe .\mfile.py bash: cpythonpython.exe: command not found

Victor6799 commented 1 year ago

@marjevan thanks for post i then tried the command below and it worked! I'm working on Windows 10 version 20H2 and installed Python 3.11.2 and Git-Hub 2.39.2.

$ python mfile.py

The only thing now is that I cannot find libxed.a file in the newly created obj directory. There are many obj files created but there is no libxed.a object file.

marjevan commented 1 year ago

You should search for xed.lib on Windows machines

Victor6799 commented 1 year ago

@marjevan thanks that worked also. I found the file xed.lib but why does the website say to search for a file named libxed.a ?

marjevan commented 1 year ago

I'll update the README file to support both Linux and Windows. It will be available on the next external release. Thanks.