Skip to content

Add OpenFHE library #7869

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

Merged
merged 7 commits into from
Dec 30, 2023
Merged

Add OpenFHE library #7869

merged 7 commits into from
Dec 30, 2023

Conversation

sloede
Copy link
Contributor

@sloede sloede commented Dec 29, 2023

Build JLL package for OpenFHE.

@sloede sloede changed the title WIP: Add OpenFHE Add OpenFHE library Dec 29, 2023
@sloede sloede marked this pull request as ready for review December 29, 2023 22:47
@sloede
Copy link
Contributor Author

sloede commented Dec 29, 2023

Ready for review and & merge 🙏 @giordano

Copy link
Member

Choose a reason for hiding this comment

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

Can this patch be upstreamed? It doesn't look specific to Yggdrasil.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately, I failed to reproduce the error on my Macbook. I thus figured it is maybe a specific combination of Xcode and/or Clang. But I will try to get it upstreamed and amend the build recipe here accordingly once (if) a new, fixed upstream version is available.

It would be great if we could still get this PR merged already now, to allow us to continue working on further downstream packages.

Copy link
Member

@giordano giordano Dec 29, 2023

Choose a reason for hiding this comment

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

It's not a matter of being able to reproduce the error, but of correctness: if the standard declares that a function is defined in a certain header file, the header file should always be included, regardless of whether some toolchains happen to accidentally define said function through other includes. And my understanding is that abs is supposed to be defined by cmath: https://cplusplus.com/reference/cmath/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not a matter of being able to reproduce the error, but of correctness: if the standard declares that a function is defined in a certain header file, the header file should always be included, regardless of whether some toolchains happen to accidentally define said function through other includes. And my understanding is that abs is supposed to be defined by cmath: https://cplusplus.com/reference/cmath/

Sorry, just saw your reply now. Totally agree. I've created an upstream PR. It would still be great though if we can proceed here and I create a new release once the upstream fix has been published.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, that's fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note though that the problematic abs here is the one for int arguments (see error message in openfheorg/openfhe-development#633). Rereading the references, cmath only defines the float versions of abs, while cstdlib seems to be indeed the source for the int version (and is included in the header in question). However, including cstdlib does not prevent the error either, so I'm waiting to see if the upstream folks have a take on this 🤷‍♂️

Copy link
Member

Choose a reason for hiding this comment

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

Note though that the problematic abs here is the one for int arguments

Doesn't look like it. The error message emanating from line 118 in that header is trying to do std::abs on a double value since the code is

inline bool is64BitOverflow(double d) {
    return std::abs(d) > static_cast<double>(Max64BitValue());
}

so it needs cmath to have that abs. (and similarly for the error from line 137, which is also doing an abs of a double).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for your insights. I'll pass this on to the upstream devs should it come up.

@giordano giordano merged commit 5ad8377 into JuliaPackaging:master Dec 30, 2023
@sloede sloede deleted the msl/openfhe branch December 30, 2023 15:23
MichelJuillard pushed a commit to MichelJuillard/Yggdrasil that referenced this pull request Jan 8, 2024
* Add OpenFHE

* Add CSL to provide libgomp; disable unittests/benchmarks for hopefully wider platform support

* Disable MUSL builds since it is not supported

* Use suitable dependencies for OpenMP support

* Exclude unsupported architectures (PowerPC & 32-bit x86)

* Add patch for macOS

* Add missing "
grasph pushed a commit to Moelf/Yggdrasil that referenced this pull request Jul 1, 2024
* Add OpenFHE

* Add CSL to provide libgomp; disable unittests/benchmarks for hopefully wider platform support

* Disable MUSL builds since it is not supported

* Use suitable dependencies for OpenMP support

* Exclude unsupported architectures (PowerPC & 32-bit x86)

* Add patch for macOS

* Add missing "
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.

3 participants