quickfix / quickfix

QuickFIX C++ Fix Engine Library
Other
1.55k stars 751 forks source link

[python] Release a new version to make it compatible for local and production integration #554

Open pablodcar opened 4 months ago

pablodcar commented 4 months ago

What happens?

Installing on a Mac M1 or a modern Linux results on compilation errors:

$ pip install quickfix

Collecting quickfix
  Downloading quickfix-1.15.1.tar.gz (1.5 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.5/1.5 MB 7.8 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: quickfix
  Building wheel for quickfix (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for quickfix (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [48 lines of output]
      /tmp/cc0IZ8JY.s: Assembler messages:
      /tmp/cc0IZ8JY.s:42520: Error: unknown mnemonic `lock' -- `lock'
      /tmp/cc0IZ8JY.s:42521: Error: unknown mnemonic `xadd' -- `xadd x0,[x2]'
      /tmp/cc0IZ8JY.s:42910: Error: unknown mnemonic `lock' -- `lock'
      /tmp/cc0IZ8JY.s:42911: Error: unknown mnemonic `xadd' -- `xadd x1,[x2]'
      /tmp/cc0IZ8JY.s:43196: Error: unknown mnemonic `lock' -- `lock'
      /tmp/cc0IZ8JY.s:43197: Error: unknown mnemonic `xadd' -- `xadd x0,[x1]'
      /tmp/cc0IZ8JY.s:43482: Error: unknown mnemonic `lock' -- `lock'
      /tmp/cc0IZ8JY.s:43483: Error: unknown mnemonic `xadd' -- `xadd x0,[x1]'
      /tmp/cc0IZ8JY.s:43773: Error: unknown mnemonic `lock' -- `lock'
      /tmp/cc0IZ8JY.s:43774: Error: unknown mnemonic `xadd' -- `xadd x0,[x1]'
      /tmp/cc0IZ8JY.s:44107: Error: unknown mnemonic `lock' -- `lock'
      /tmp/cc0IZ8JY.s:44108: Error: unknown mnemonic `xadd' -- `xadd x0,[x2]'
      /tmp/cc0IZ8JY.s:44441: Error: unknown mnemonic `lock' -- `lock'
      /tmp/cc0IZ8JY.s:44442: Error: unknown mnemonic `xadd' -- `xadd x0,[x2]'
      /tmp/cc0IZ8JY.s:45172: Error: unknown mnemonic `lock' -- `lock'
      /tmp/cc0IZ8JY.s:45173: Error: unknown mnemonic `xadd' -- `xadd x0,[x2]'
      /tmp/cc0IZ8JY.s:45550: Error: unknown mnemonic `lock' -- `lock'
      /tmp/cc0IZ8JY.s:45551: Error: unknown mnemonic `xadd' -- `xadd x0,[x2]'
      /tmp/cc0IZ8JY.s:53755: Error: unknown mnemonic `lock' -- `lock'
      /tmp/cc0IZ8JY.s:53756: Error: unknown mnemonic `xadd' -- `xadd x0,[x1]'
      /tmp/cc0IZ8JY.s:54053: Error: unknown mnemonic `lock' -- `lock'
      /tmp/cc0IZ8JY.s:54054: Error: unknown mnemonic `xadd' -- `xadd x0,[x1]'
      /tmp/cc0IZ8JY.s:54194: Error: unknown mnemonic `lock' -- `lock'
      /tmp/cc0IZ8JY.s:54195: Error: unknown mnemonic `xadd' -- `xadd x0,[x1]'
      /tmp/cc0IZ8JY.s:57191: Error: unknown mnemonic `lock' -- `lock'
      /tmp/cc0IZ8JY.s:57192: Error: unknown mnemonic `xadd' -- `xadd x0,[x1]'
      /tmp/cc0IZ8JY.s:78227: Error: unknown mnemonic `lock' -- `lock'
      /tmp/cc0IZ8JY.s:78228: Error: unknown mnemonic `xadd' -- `xadd x1,[x2]'
      /tmp/cc0IZ8JY.s:78511: Error: unknown mnemonic `lock' -- `lock'
      /tmp/cc0IZ8JY.s:78512: Error: unknown mnemonic `xadd' -- `xadd x0,[x1]'
      /tmp/cc0IZ8JY.s:79559: Error: unknown mnemonic `lock' -- `lock'
      /tmp/cc0IZ8JY.s:79560: Error: unknown mnemonic `xadd' -- `xadd x0,[x1]'
      /tmp/cc0IZ8JY.s:80369: Error: unknown mnemonic `lock' -- `lock'
      /tmp/cc0IZ8JY.s:80370: Error: unknown mnemonic `xadd' -- `xadd x0,[x1]'
      /tmp/cc0IZ8JY.s:81191: Error: unknown mnemonic `lock' -- `lock'
      /tmp/cc0IZ8JY.s:81192: Error: unknown mnemonic `xadd' -- `xadd x0,[x1]'
      /tmp/cc0IZ8JY.s:82026: Error: unknown mnemonic `lock' -- `lock'
      /tmp/cc0IZ8JY.s:82027: Error: unknown mnemonic `xadd' -- `xadd x0,[x1]'
      /tmp/cc0IZ8JY.s:82768: Error: unknown mnemonic `lock' -- `lock'
      /tmp/cc0IZ8JY.s:82769: Error: unknown mnemonic `xadd' -- `xadd x0,[x2]'
      Testing for std::tr1::shared_ptr...
      ...found
      Testing for std::shared_ptr...
      ...found
      Testing for std::unique_ptr...
      ...found
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for quickfix
Failed to build quickfix
ERROR: Could not build wheels for quickfix, which is required to install pyproject.toml-based projects

Solution

Changing the file AtomicCount.h to be compatible allows the installation of the library from sources successfully (following these instructions

Environment

uname -a
Linux af32789b9b28 5.15.82-0-virt #1-Alpine SMP Mon, 12 Dec 2022 09:15:17 +0000 aarch64 GNU/Linux
$ python --version
Python 3.11.6
$ pip --version
pip 23.2.1 from /home/revolut/app/.venv/lib/python3.11/site-packages/pip (python 3.11)
pablodcar commented 2 months ago

I was able to build the project for Python 3.11 with SSL support from the latest changes and with some fixes I did. Take a look at https://pypi.org/project/quickfix-py/. (Currently, Python 3.11 with osx arm64 and Linux aarch64 support prebuilt wheels).

Python Packaging does not come from https://github.com/quickfix/quickfix, but instead from my fork https://github.com/pablodcar/quickfix to fix the building and the packaging comes from https://github.com/pablodcar/quickfix-py-package.

Feel free to merge it into this one or send me a message to make the PR, right now I don't see too much interest in maintaining the health of this project since PRs have been open for a long time, and the project has compilation and testing issues, etc.

Python (and Ruby) are mentioned on the quickfixengine page, but the packaging was abandoned like 6 years ago, which is a shame, since this project is the only OSS for FIX protocol and a lot of work was invested in it. I would be happy to maintain the Python packaging.

shaiguptcmd commented 2 months ago

I was able to build the project for Python 3.11 with SSL support from the latest changes and with some fixes I did. Take a look at https://pypi.org/project/quickfix-py/. (Currently, Python 3.11 with osx arm64 and Linux aarch64 support prebuilt wheels).

Python Packaging does not come from https://github.com/quickfix/quickfix, but instead from my fork https://github.com/pablodcar/quickfix to fix the building and the packaging comes from https://github.com/pablodcar/quickfix-py-package.

Feel free to merge it into this one or send me a message to make the PR, right now I don't see too much interest in maintaining the health of this project since PRs have been open for a long time, and the project has compilation and testing issues, etc.

Python (and Ruby) are mentioned on the quickfixengine page, but the packaging was abandoned like 6 years ago, which is a shame, since this project is the only OSS for FIX protocol and a lot of work was invested in it. I would be happy to maintain the Python packaging.

Hi pablocar I need the windows wheel and linux wheel compatible with python 3.11. Can you please help

VRMink commented 2 months ago

for FIX protocol and a lot of work was invested in it. I would be happy to maintain the Python packaging.

You are heaven sent! I have spent two days now trying to find someone who successfully build on OSX (for testing) and also has it running on Linux (for production). Great stuff. Will follow your repo and see it I can get yours to work.

pablodcar commented 2 months ago

Hi @shaiguptcmd ,

Hi pablocar I need the windows wheel and linux wheel compatible with python 3.11. Can you please help

I do not have a Windows machine or Visual Studio to test. I can try adding windows' wheels if someone can make it compile in Windows with SSL support (and then a PR is open to my fork https://github.com/pablodcar/quickfix or to the original quickfix project and I would copy the change).

pablodcar commented 2 months ago

You are heaven sent! I have spent two days now trying to find someone who successfully build on OSX (for testing) and also has it running on Linux (for production). Great stuff. Will follow your repo and see it I can get yours to work.

@VRMink Great it worked! For now, I'm just adding the wheels I need for my daily work, meaning the combination of Python 3.11, Linux and OSX ARM64 architecture. If another platform is needed, I can try adding it to the build process.