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

Package requests munselinterpol, rootSolve, spacesXYZ adn spacesRGB #425

Open
codingthemystery opened this issue May 10, 2024 · 1 comment
Labels
package request This is a request for a Wasm package

Comments

@codingthemystery
Copy link

munsellinterpol has three dependencies. I was able to create a WASM file but there's a problem with a .so file in rootSolve. It seems to be an issue with dynamic linking. If you can add the packages, it'll make life a lot easier :)

Error: Error in unknown source: package or namespace load failed for ‘munsellinterpol’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/usr/lib/R/library/rootSolve/libs/rootSolve.so':
Could not load dynamic lib: /usr/lib/R/library/rootSolve/libs/rootSolve.so
Error: bad export type for 'dls001_': undefined

@georgestagg georgestagg added the package request This is a request for a Wasm package label May 10, 2024
@georgestagg
Copy link
Member

This is difficult currently because the dls001 symbol used in rootSolve is defined as a Fortran COMMON block, and at the time of writing the LLVM WebAssembly backend does not support common symbols.

I know of no automated or general way to solve this problem right now. One trick I have used in the past is rewriting the Fortran source to use Fortran 90 modules to handle global state, but for lsodes.f that looks difficult. The code is long, and at first glance the use of the common symbols seems involved, being used over several functions.

So, in this case I think the only real approach is to wait. Eventually, one of the flang-new or LFortran compilers will support COMMON blocks for the WebAssembly backend, and then these packages should just compile and work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package request This is a request for a Wasm package
Projects
None yet
Development

No branches or pull requests

2 participants