[Cs-dev] pnacl build
Date | 2013-11-13 18:06 |
From | Victor Lazzarini |
Subject | [Cs-dev] pnacl build |
I’ve spent some of the day today looking at the pNaCl SDK and I have started a build for Csound. I was able to build almost the system as per the android build, bar a couple of opcodes (mp3 and socks), which had missing system dependencies. Also there is no support for dlopen(), and so no plugins for the moment. The status of the build is this: all Csound object files can be built. Linking is still not happening because of the missing libsndfile dependency. Unfortunately, the build scripts that come with the SDK are a little restrictive, there is no way out of the box to build a library (even a static one). It looks like the libsndfile srcs will need to be dropped directly into the build. Also, there seemed to be no way to communicate include paths, so I had to edit the makefile in the SDK tools to add the include paths for Csound (in this case nacl_llvm.mk). I don’t like this, but it was just to see if things could be built. I had to protect some parts of the code with #ifdefs, but very little actually. I was surprised how straight it was. Once linking is sorted, we will need some sort of pepper glue code so that the API is seen from outside, and to add the audio IO (which should be straightforward, because of the good support in the pepper audio API). A build.sh and Makefile have been placed in ./nacl in GIT, with the SDK installed and NACL_SDK_ROOT set correctly, you should be able to compile the files. It will fail at the link stage, but that just needs a little more work Regards ------------------------------------------------------------------------------ DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access Free app hosting. Or install the open source package on any LAMP server. Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native! http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net |
Date | 2013-11-13 18:08 |
From | Michael Gogins |
Subject | Re: [Cs-dev] pnacl build |
Attachments | None None |
Great! I just wish this PNaCl stuff would run on Android, then we would have one platform to rule them all... Regards, Mike ----------------------------------------------------- Michael GoginsIrreducible Productions http://michaelgogins.tumblr.com Michael dot Gogins at gmail dot com On Wed, Nov 13, 2013 at 1:06 PM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote: I’ve spent some of the day today looking at the pNaCl SDK and I have started a build for |
Date | 2013-11-13 19:28 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] pnacl build |
An update: I’ve managed to make a Csound static library (libcsound.a). I think with this and libsndfile (I will try to make a build tomorrow), it is possible to make pNaCl app. I also found a way of sticking the include paths, and now it builds with the SDK straight out of the box. In GIT now. Victor On 13 Nov 2013, at 18:08, Michael Gogins |
Date | 2013-11-13 19:31 |
From | Steven Yi |
Subject | Re: [Cs-dev] pnacl build |
Attachments | None None |
This sounds very exciting! I was working further on emscripten today and finding myself getting quite stuck. I'm going to hold off on Emscripten for a couple days and see about downloading the naclsdk and trying to compile.
On Wed, Nov 13, 2013 at 2:28 PM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote: An update: I’ve managed to make a Csound static library (libcsound.a). I think with this and libsndfile (I will try to make a build tomorrow), it |
Date | 2013-11-13 19:57 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] pnacl build |
On OSX, it’s just a case of downloading and installing the SDK as per http://www.chromium.org/nativeclient/pnacl/introduction-to-portable-native-client and setting NACL_SDK_ROOT, then running build.sh in your Csound sources ./nacl directory. I am finding the building process setup very similar to Android NDK. Victor On 13 Nov 2013, at 19:31, Steven Yi |
Date | 2013-11-13 20:19 |
From | Steven Yi |
Subject | Re: [Cs-dev] pnacl build |
Attachments | None None |
I got the build file going but got some errors: ..//Top/csound.c:585:6: error: too many braces around scalar initializer [-Werror] {{{0}}}, /* exitjmp of type jmp_buf */
^~~ ..//Top/csound.c:585:5: error: braces around scalar initializer [-Werror] {{{0}}}, /* exitjmp of type jmp_buf */ ^~~~~ ..//Top/csound.c:857:5: error: incompatible pointer to integer conversion
initializing 'int' with an expression of type 'void *' [-Werror,-Wint-conversion] NULL /* self-reference */ ^~~~ /Users/stevenyi/work/nacl_sdk/pepper_31/toolchain/mac_pnacl/host_x86_64/lib/clang/3.3/include/stddef.h:77:16: note:
expanded from macro 'NULL' # define NULL ((void*)0) ^~~~~~~~~~ 3 errors generated. I'm going to finally upgrade to Mavericks today when I get home. No idea if that is a factor or not but thought I'd mention that.
Thanks! steven On Wed, Nov 13, 2013 at 2:57 PM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote: On OSX, it’s just a case of downloading and installing the SDK as per |
Date | 2013-11-13 20:27 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] pnacl build |
Oh yes I got rid of -Werror in the SDK makefile (in tools/common.mk), I forgot about it. Not sure if there is any other way round this. Victor On 13 Nov 2013, at 20:19, Steven Yi |
Date | 2013-11-13 20:39 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] pnacl build |
Attachments | Makefile None None |
libsndfile also builds OK with the attached Makefile dropped in the libsndfile-android sources src directory (in place of the original Makefile). The only thing it also requires is this header, which is not in the SDK https://github.com/chromium-illumos/native_client/blob/master/pnacl/libelf/include/byteswap.h Victor On 13 Nov 2013, at 20:19, Steven Yi |
Date | 2013-11-13 21:49 |
From | Steven Yi |
Subject | Re: [Cs-dev] pnacl build |
Attachments | None None |
I've made a change to the Makefile to get rid of -Werror so we won't have to modify the one in nacl's tool directory (pushed to GIT). I'm now getting: ..//Top/server.c:84:42: error: use of undeclared identifier 'u_int32_t'
p->server_addr.sin_addr.s_addr = htonl(INADDR_ANY); ^ /Users/stevenyi/work/nacl_sdk//pepper_31/include/pnacl/netinet/in.h:47:22: note: expanded from macro 'INADDR_ANY'
#define INADDR_ANY (u_int32_t)0x00000000 ^ On Wed, Nov 13, 2013 at 3:27 PM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote: Oh yes I got rid of -Werror in the SDK makefile (in tools/common.mk), I forgot about it. |
Date | 2013-11-13 22:01 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] pnacl build |
interesting. It doesn’t trip me here. I have pepper_canary instead of pepper_31 Victor On 13 Nov 2013, at 21:49, Steven Yi |
Date | 2013-11-13 23:03 |
From | Steven Yi |
Subject | Re: [Cs-dev] pnacl build |
Curious, pepper_31 is the latest stable. As far as I understand, canary is the very experimental track: The SDK also includes a special bundle called pepper_canary. This bundle contains the toolchains, libraries, and examples that are designed to work with the most recent development builds of the canary channel of the Chrome browser. Use thepepper_canary bundle to test the newest Pepper APIs or SDK tools that are not yet available in regular Pepper bundles and released versions of Chrome. You can run a canary build of Chrome side-by-side with a stable version. When you ship a Native Client application you should build it with a numbered Pepper bundle that corresponds to the version of Chrome that you plan to support. Could you try with pepper_31? On Wed, Nov 13, 2013 at 5:01 PM, Victor Lazzarini |
Date | 2013-11-14 00:01 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] pnacl build |
Ok, I’ve got pepper_31 and rebuilt. After stumbling on that error (clearly a SDK bug), I’ve fixed it by adding the missing definitions to server.c, protected for NACL. It’s building now and the changes are in GIT. Victor On 13 Nov 2013, at 23:03, Steven Yi |
Date | 2013-11-14 03:41 |
From | Steven Yi |
Subject | Re: [Cs-dev] pnacl build |
Fantastic, libcsound.a building here. I was looking but I didn't see how one builds a library that could be loaded and accessed from Javascript. I saw things about going the other way from the exe to Javascript though. I'm at least caught up here. On Wed, Nov 13, 2013 at 7:01 PM, Victor Lazzarini |
Date | 2013-11-14 07:25 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] pnacl build |
I think you need to create a pexe that links to the library, which will access the library and offer controls to the javascript/html side. I will try and modify the audio API example to do this. Victor On 14 Nov 2013, at 03:41, Steven Yi |
Date | 2013-11-14 07:27 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] pnacl build |
I see this a bit like Android, where we need a jni wrapper in between Java and Csound, and here it will be a C/C++ glue code using pepper to do that. Victor On 14 Nov 2013, at 03:41, Steven Yi |