-
Notifications
You must be signed in to change notification settings - Fork 2
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
Meson - a new shining star in scientific python community #30
Comments
might be interesting - cmake is full of magic, and the integration with distutils and setup.py is pretty odd, so might be worth taking a look. |
I tried meson earlier this year for an unrelated python project with a c++ backend, but I had troubles on Windows (the only platform to fail CI testing). Additionally, I don't know how to use vcpkg with it, unless adding the third party packages through GitHub Submodules and python scripts. However, I really do like it a lot, especially with GCC on Windows. It is very flexible and a possible cmake replacement. Perhaps, I'll give it another shot. |
What kind of troubles? |
@eli-schwartz I do not remember what exactly happened, but it was something about how the python source files were installed. This could be, and likely is, attributed to user error, but I do not know where as I copied how scipy used meson in my project. I'll try again this Sunday with some dummy projects. |
Cool, feel free to ping me if you have any issues. Also a few things have become easier to do based on discussions SciPy had with the Meson core team while implementing their build, so it may be worth checking out |
@eli-schwartz |
One way is to add #if defined _WIN32 || defined __CYGWIN__
#if defined BUILDING_DLL
#define DLL_PUBLIC __declspec(dllexport)
#else
#define DLL_PUBLIC __declspec(dllimport)
#endif
#else
// unix code can go here
#endif In your case, all functions are are considered public, right? Since unix compiler toolchains default to "EXPORT_ALL_SYMBOLS", this means you don't need any unix code. Another way is to add a file called
and list every single function extracted by running You'd check the
However due to CXX name mangling the precise symbol names might periodically change for reasons less straightforward than just adding/removing entire functions. The ideal thing to do here is to teach meson how to internally inject a build rule after building all the objects, to run dumpbin itself and generate this .def file on the fly before performing the final link, thus ensuring that everything is in sync. |
So, if I tailor the build script towards MinGW on Windows (which is recommended due to the use of vector extensions for simd), then I don't have to worry about exporting name-mangled symbols since GCC and CLANG does this by default? If so, then I will delve more into MinGW for Windows compilation since I dislike MSVC anyways. |
https://sourceware.org/binutils/docs/ld/WIN32.html#index-exporting-DLL-symbols
|
The mingw functionality does seem sort of sane 😜 because the alternative is to do like MSVC and create a shared DLL that has zero symbols and is, effectively, totally useless. |
Thanks for your insight on using the meson build system. After 15 minutes of free time and playing around with meson, I successfully compiled libopenpiv and produced an import lib. Meson is truly a miracle, especially for those who have limited experience with programming and build systems. P.S., The dependency system is awesome! After setting up wrap files for google-benchmark, Catch2, cxxopts, fmt, and pybind11, things ran quite smoothly. |
@eli-schwartz @timdewhirst CPU: Intel i5-1235U 1.30 GHz
I have no idea why my computer caps at SSE2 intrinsics. |
scipy, scikit-image and apparently numpy are moving to meson build system
Shall we try as well ? @timdewhirst @ErichZimmer
https://labs.quansight.org/blog/2021/07/moving-scipy-to-meson
The text was updated successfully, but these errors were encountered: