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

fix: make Dragonfly compatible with older systems #1755

Merged
merged 1 commit into from
Aug 29, 2023
Merged

Conversation

romange
Copy link
Collaborator

@romange romange commented Aug 28, 2023

Change the Makefile to configure the compile to produce code
compatible with core2 architecture for x86_64 systems.
Plus specify precise CPU extensions that we use in the code.
Partly addresses #1519

Before the change we relied on default helio logic that configured
the build to run on sandybridge for x86_64.
This PR overrides x86_64 settings to much older core2 processor.

Also, we remove an unneeded cmake include.

@romange romange requested a review from kostasrim August 29, 2023 05:43
@@ -8,11 +8,16 @@ HELIO_OPENSSL_USE_STATIC_LIBS = ON
HELIO_ENABLE_GIT_VERSION = ON
HELIO_WITH_UNWIND = OFF

# equivalent to: if $(uname_m) == x86_64 || $(uname_m) == amd64
ifneq (, $(filter $(BUILD_ARCH),x86_64 amd64))
HELIO_MARCH_OPT := -march=core2 -msse4.1 -mpopcnt -mtune=skylake
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think skylake is a mistake here. They are running cpu family 6 model 13 which according to this is a pentium m. So you are tuning for an architecture that came later. Furthermore, as per the comments, shouldn't it be -march=native?

What am I missing here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our responsibility as project maintainers to do what's right and not what was asked in the comments :)

We lowered the bar but we are not going to support 32bit processor pentium-m discontinued in 2009.
march=native will produce a code based on Azure github runner CPU. That's totally random and will be incompatible with many machines that run Dragonfly today. I will update the commit description

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 I got confused because you wrote Possibly addresses and the changes introduced in this PR should be incompatible with what is discussed on that thread.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, fixed the description.

@@ -8,11 +8,16 @@ HELIO_OPENSSL_USE_STATIC_LIBS = ON
HELIO_ENABLE_GIT_VERSION = ON
HELIO_WITH_UNWIND = OFF

# equivalent to: if $(uname_m) == x86_64 || $(uname_m) == amd64
ifneq (, $(filter $(BUILD_ARCH),x86_64 amd64))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also isn't this only for the architecture and for the processor family ? I would expect something here that looks the microprocessor architecture and its familly

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, we support x86_64 and arm64 architectures and we release binaries that can run for both architectures.
See here: https://github.com/dragonflydb/dragonfly/releases

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know which architectures we support, it appeared to me that this PR was meant to address the microarchitecture mentioned on that PR. I got confused, that's all

@kostasrim
Copy link
Contributor

also one more question, I never noticed this Makefile, where is it used?

@romange
Copy link
Collaborator Author

romange commented Aug 29, 2023

also one more question, I never noticed this Makefile, where is it used?

it's been used by releash.sh script but anyone can use it actually. One of our contributors wanted to provide a standard way to buid a project and I did not mind.

Change the Makefile to configure the compile to produce code
compatible with core2 architecture for x86_64 systems.
Plus specify precise CPU extensions that we use in the code.
Partly addresses #1519

Before the change we relied on default helio logic that configured
the build to run on sandybridge for x86_64.
This PR overrides x86_64 settings to much older core2 processor.

Also, we remove an unneeded cmake include.

Signed-off-by: Roman Gershman <[email protected]>
kostasrim
kostasrim previously approved these changes Aug 29, 2023
@kostasrim
Copy link
Contributor

🚢 🇮🇹

@romange romange merged commit dbef4ca into main Aug 29, 2023
@romange romange deleted the ReduceArchBuild branch August 29, 2023 15:24
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

Successfully merging this pull request may close these issues.

2 participants