Skip to content Skip to sidebar Skip to footer

Linking Error When Compiling Ngspice With Emscripten On Ubuntu

I am trying to compile ngspice with emscripten under Ubuntu. I am running Ubuntu 13.10 64-bit on a hyper-v VM from a Windows 8 host. I downloaded the latest stable version of ngp

Solution 1:

You probably underestimate, what Emscripten is and does. Yes, it is a cross-compiler but to get source code translated via llvm there has to happen much more than just using a different compiler.

If you look at the ./configure output, it should already make you wonder:

checking host system type... x86_64-unknown-linux-gnu

This line cannot work since Javascript can only savely represent 32bit integers. So at least the x86_64 part of that arch config is wrong.

Also the line:

checking the name lister (/usr/bin/nm -B) interface... BSD nm

Like you already know, we are going to use LLVM, which means the native binary tools need to be replaced, too.

With configure scripts you have to run:

$ ~/Documents/srr/emscripten/emconfigure ./configure

This replaces most of tools and handling gets changed for Emscripten. Personally I would then recommend to invoke make like so:

$ ~/Documents/srr/emscripten/emmake make

While make alone should work, there are a lot of makefiles, that are written very badly, so enforcing the tools once again cannot hurt.

Full disclosure wise, from experience I would recommend against make and autotools builds. Use CMake if it is available.

Also prepare yourself to do quite a lot of work when porting. This is not a straight forward process and needs lot of manual work/testing as well as understanding all the tools/steps/source code.

Good luck.

Post a Comment for "Linking Error When Compiling Ngspice With Emscripten On Ubuntu"