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

Unable to Build #23

Open
Neuroforge opened this issue Oct 23, 2023 · 0 comments
Open

Unable to Build #23

Neuroforge opened this issue Oct 23, 2023 · 0 comments

Comments

@Neuroforge
Copy link

Neuroforge commented Oct 23, 2023

Hello,

I am trying to build this library as i'd like to see how it works with the latest version of LibSVM.

Is this possible? First, i'm trying to just build it as is, using the current version released on npm.

If i checkout the repo and build the code and install it my project i get the following error....

TypeError: libsvm.load is not a function.

In the wasm.js file in the root folder i've added a console log to see if i can figure out why it is not loading.

'use strict';

const loadSVM = require('./src/loadSVM');
const libsvm = require('./out/wasm/libsvm');


console.log(libsvm)
module.exports = libsvm.load().then(() => loadSVM(libsvm));

Output from my build

Promise { <pending> }

Output from npm package

It looks like the promise is in fact resolved.

Screenshot 2023-10-23 at 3 14 43 pm

Any idea what could be happening here?

Follow up...

I've tried to alter wasm.js to resolve the promise....

'use strict';

const loadSVM = require('./src/loadSVM');
const libsvm = require('./out/wasm/libsvm');


console.log(libsvm);
module.exports = libsvm.then((p) => {
  console.log(p);
  return p.load().then(() => loadSVM(libsvm));
});

This turns up the following error


TypeError: libsvm.cwrap is not a function
    at module.exports (/Users/daniel/Desktop/libsvm/src/loadSVM.js:7:30)
    at /Users/daniel/Desktop/libsvm/wasm.js:10:30

All of the other jazz is logged out now correctly....

Screenshot 2023-10-23 at 3 32 49 pm

I've look on Stackoverflow and there is a thread on...

https://stackoverflow.com/questions/56040210/uncaught-typeerror-module-cwrap-is-not-a-function

But it seems this is already factored into the build configuration in the make file -s EXTRA_EXPORTED_RUNTIME_METHODS='["cwrap", "Pointer_stringify"]'

This param has been depricated in favour of ...

-sEXPORTED_RUNTIME_METHODS=cwrap,Pointer_stringify

but i still get a warning about Pointer_stringify.

(It seems that Pointer_stringify is used in the serialize method of libsvm, but that isn't important and i could just remove it)

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

1 participant