[Csnd-dev] Adding plugin opcodes to WASM/Emscripten build

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[Csnd-dev] Adding plugin opcodes to WASM/Emscripten build

eddyc
Hi,
I am trying to add csound plugins which have no external dependencies to the WASM/Emscripten build.
I was able to compile csound and the plugin opcodes to llvm byte code using emmake, then I tried adding libarrayops.so (for arrayops.cpp) to the final binary using emcc and was actually successful. I then tried to add libpvsops.so (for pvsops.cpp) as well but unfortunately this gave me a duplicate symbol error: error: Linking globals named 'csoundModuleCreate': symbol multiply defined! Does anyone have any pointers on how I could fix this?
Ed
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd-dev] Adding plugin opcodes to WASM/Emscripten build

Michael Gogins-2
Some plugins already are statically linked for WASM. The code is in
csound/Top/init_static_modules.c, just follow the pattern there. Each
module has to have a renamed csoundModuleCreate function to prevent
your problem, so the opcode itself then also has to be modified to
match, see for example ftsamplebank.cpp.

Regards,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Mon, Sep 4, 2017 at 6:15 PM, Ed Costello <[hidden email]> wrote:
> Hi,
> I am trying to add csound plugins which have no external dependencies to the WASM/Emscripten build.
> I was able to compile csound and the plugin opcodes to llvm byte code using emmake, then I tried adding libarrayops.so (for arrayops.cpp) to the final binary using emcc and was actually successful. I then tried to add libpvsops.so (for pvsops.cpp) as well but unfortunately this gave me a duplicate symbol error: error: Linking globals named 'csoundModuleCreate': symbol multiply defined! Does anyone have any pointers on how I could fix this?
> Ed
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd-dev] Adding plugin opcodes to WASM/Emscripten build

eddyc
I see that there, I am however using Victor’s CPOF to develop plugins and I’m not sure if I can do something similar.
Ed

> On 4 Sep 2017, at 23:51, Michael Gogins <[hidden email]> wrote:
>
> Some plugins already are statically linked for WASM. The code is in
> csound/Top/init_static_modules.c, just follow the pattern there. Each
> module has to have a renamed csoundModuleCreate function to prevent
> your problem, so the opcode itself then also has to be modified to
> match, see for example ftsamplebank.cpp.
>
> Regards,
> Mike
>
> -----------------------------------------------------
> Michael Gogins
> Irreducible Productions
> http://michaelgogins.tumblr.com
> Michael dot Gogins at gmail dot com
>
>
> On Mon, Sep 4, 2017 at 6:15 PM, Ed Costello <[hidden email]> wrote:
>> Hi,
>> I am trying to add csound plugins which have no external dependencies to the WASM/Emscripten build.
>> I was able to compile csound and the plugin opcodes to llvm byte code using emmake, then I tried adding libarrayops.so (for arrayops.cpp) to the final binary using emcc and was actually successful. I then tried to add libpvsops.so (for pvsops.cpp) as well but unfortunately this gave me a duplicate symbol error: error: Linking globals named 'csoundModuleCreate': symbol multiply defined! Does anyone have any pointers on how I could fix this?
>> Ed
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd-dev] Adding plugin opcodes to WASM/Emscripten build

Michael Gogins-2
Sure you can. You just have to do what my example does about the
module registration functions.

Regards,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Tue, Sep 5, 2017 at 9:36 AM, Ed Costello <[hidden email]> wrote:

> I see that there, I am however using Victor’s CPOF to develop plugins and I’m not sure if I can do something similar.
> Ed
>
>> On 4 Sep 2017, at 23:51, Michael Gogins <[hidden email]> wrote:
>>
>> Some plugins already are statically linked for WASM. The code is in
>> csound/Top/init_static_modules.c, just follow the pattern there. Each
>> module has to have a renamed csoundModuleCreate function to prevent
>> your problem, so the opcode itself then also has to be modified to
>> match, see for example ftsamplebank.cpp.
>>
>> Regards,
>> Mike
>>
>> -----------------------------------------------------
>> Michael Gogins
>> Irreducible Productions
>> http://michaelgogins.tumblr.com
>> Michael dot Gogins at gmail dot com
>>
>>
>> On Mon, Sep 4, 2017 at 6:15 PM, Ed Costello <[hidden email]> wrote:
>>> Hi,
>>> I am trying to add csound plugins which have no external dependencies to the WASM/Emscripten build.
>>> I was able to compile csound and the plugin opcodes to llvm byte code using emmake, then I tried adding libarrayops.so (for arrayops.cpp) to the final binary using emcc and was actually successful. I then tried to add libpvsops.so (for pvsops.cpp) as well but unfortunately this gave me a duplicate symbol error: error: Linking globals named 'csoundModuleCreate': symbol multiply defined! Does anyone have any pointers on how I could fix this?
>>> Ed
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd-dev] Adding plugin opcodes to WASM/Emscripten build

Victor Lazzarini-2
In reply to this post by eddyc
You can use that approach: in your module define a csoundModuleCreate()  that calls
the template function plugin<>() that registers the plugin (instead of putting it in
onload()). Don’t include modload.h in that case.
Then follow what Mike suggests.

========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 5 Sep 2017, at 14:36, Ed Costello <[hidden email]> wrote:
>
> I see that there, I am however using Victor’s CPOF to develop plugins and I’m not sure if I can do something similar.
> Ed
>
>> On 4 Sep 2017, at 23:51, Michael Gogins <[hidden email]> wrote:
>>
>> Some plugins already are statically linked for WASM. The code is in
>> csound/Top/init_static_modules.c, just follow the pattern there. Each
>> module has to have a renamed csoundModuleCreate function to prevent
>> your problem, so the opcode itself then also has to be modified to
>> match, see for example ftsamplebank.cpp.
>>
>> Regards,
>> Mike
>>
>> -----------------------------------------------------
>> Michael Gogins
>> Irreducible Productions
>> http://michaelgogins.tumblr.com
>> Michael dot Gogins at gmail dot com
>>
>>
>> On Mon, Sep 4, 2017 at 6:15 PM, Ed Costello <[hidden email]> wrote:
>>> Hi,
>>> I am trying to add csound plugins which have no external dependencies to the WASM/Emscripten build.
>>> I was able to compile csound and the plugin opcodes to llvm byte code using emmake, then I tried adding libarrayops.so (for arrayops.cpp) to the final binary using emcc and was actually successful. I then tried to add libpvsops.so (for pvsops.cpp) as well but unfortunately this gave me a duplicate symbol error: error: Linking globals named 'csoundModuleCreate': symbol multiply defined! Does anyone have any pointers on how I could fix this?
>>> Ed