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

trying to build native binaries for julia #148

Open
AbhimanyuAryan opened this issue Jun 3, 2023 · 4 comments
Open

trying to build native binaries for julia #148

AbhimanyuAryan opened this issue Jun 3, 2023 · 4 comments

Comments

@AbhimanyuAryan
Copy link

I'm aiming to compile native binaries for the 'facil' program across all platforms: Linux, Mac, and Windows. However, I'm uncertain about how to proceed due to my limited familiarity with C build systems.

Currently, I am using the platform provided by https://binarybuilder.org/.

As an example, this site(video) illustrates how to create native binaries for libsodium. The instructions provided were as follows:

./autogen.sh
./configure --prefix=${prefix} --build=${MACHTYPE} --host=${target}
make -j${nproc}
make install

Following these steps led to the creation of this build_tarballs.jl file: https://github.com/JuliaPackaging/Yggdrasil/blob/master/L/libsodium/build_tarballs.jl

Could you help me understand what the appropriate steps or 'recipe' would be to accomplish the same objective with facil? So I can generate build_tarballs.jl for facil

Thanks in advance

@boazsegev
Copy link
Owner

boazsegev commented Jun 5, 2023

To build the .so library (on POSIX systems) use: make lib (no other commands necessary).

I will try to keep the 0.8.x version makefile compatible with building a linked library, as well as maintain the option to override FIO_SFUNC to produce extern instead of static (so all function code is emitted to the library, making the job of automation tools easier).

However, this will only be valid for the facil.io C STL repo.

I hope that helps.

@AbhimanyuAryan
Copy link
Author

I greatly appreciate your prompt response, @boazsegev. Your input is highly valued. The prospect of using version 0.8 over the stable 0.7 has me rather enthusiastic.

Just to clarify, will executing make lib generate a dll for Windows-Mingw and a DyLib for MacOS?

I've successfully created .so files, and they operate seamlessly without any issues.

@boazsegev
Copy link
Owner

I believe it should generate a dll for Windows-Mingw and a .os for any POSIX system (including MacOS). AFAIK, MacOS should accept .so files for loadable libraries.

I don't have Windows to test it out, but I should definitely add a linked-library test to the CI at some point.

Let me know.

@AbhimanyuAryan
Copy link
Author

Sure I will test on windows and let you know

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

No branches or pull requests

2 participants