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

Test the shared libraries of CUTEst #50

Open
amontoison opened this issue Jun 13, 2024 · 2 comments
Open

Test the shared libraries of CUTEst #50

amontoison opened this issue Jun 13, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@amontoison
Copy link
Member

amontoison commented Jun 13, 2024

The new Meson build system, introduced with release 2.1.0, compiles static libraries (libcutest_single.a, libcutest_double.a) by default.
These libraries are incomplete by design and require linking with other object files that are problem-dependent in practice.

But the compilation of shared libraries is now functional.
I have added an additional file, cutest_delegate.f90, which is compiled only when shared libraries are requested to Meson (option -Ddefault_library=shared).
This approach proves beneficial when using CUTEst through high-level languages like Python or Julia.

With functions such as load_routines_s, load_routines, and load_routines_q, we can dynamically switch the shared library used for a particular problem.

cc @jfowkes

@amontoison amontoison added the enhancement New feature or request label Jun 13, 2024
@nimgould
Copy link
Contributor

Very good. Of course the makefile build provides more than just the cutest library, it also gives interfaces to many external packages, and provides scripts to run a particular problem with a particular external package.

@amontoison
Copy link
Member Author

I completely agree, Nick.
The makefile build system is more comprehensive than Meson and offers additional features (support more interfaces).
Meson just simplifies the compilation of libcutest_single and libcutest_double across all platforms.

I discovered that dlopen and dlsym are not available on Windows when I tested CUTEst in GALAHAD.
Windows uses LoadLibrary and GetProcAddress...
I need to update cutest_delegate.f90.

#ifdef _WIN32
// Windows-specific code using LoadLibrary, GetProcAddress
#else
// Unix-specific code using dlopen, dlsym
#endif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants