{"id":1534,"date":"2014-11-28T04:57:59","date_gmt":"2014-11-28T04:57:59","guid":{"rendered":"http:\/\/41j.com\/blog\/?p=1534"},"modified":"2014-11-28T17:16:56","modified_gmt":"2014-11-28T17:16:56","slug":"debian-jessie-emscripten-installation-notes","status":"publish","type":"post","link":"https:\/\/41j.com\/blog\/2014\/11\/debian-jessie-emscripten-installation-notes\/","title":{"rendered":"Debian Jessie Emscripten installation notes"},"content":{"rendered":"<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nwget https:\/\/s3.amazonaws.com\/mozilla-games\/emscripten\/releases\/emsdk-portable.tar.gz\r\ntar xvzf emsdk-portable.tar.gz\r\nsudo apt-get update\r\nsudo apt-get install build-essential cmake python2.7 nodejs default-jre git-core\r\n.\/emsdk_portable\/emsdk update\r\n.\/emsdk_portable\/emsdk install latest # wait a long time.\r\n.\/emsdk_portable\/emsdk activate latest\r\nsource emsdk_portable\/emsdk_env.sh\r\n<\/pre>\n<p>Edit ~\/.emscripten change the line reading:<\/p>\n<pre>\r\nNODE_JS = 'node'\r\n<\/pre>\n<p>to<\/p>\n<pre>\r\nNODE_JS = 'nodejs'\r\n<\/pre>\n<p>Then create a simple hello word program in hi.c e.g.<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\n#include&lt;stdio.h&gt;\r\n\r\nint main() {\r\n  printf(&quot;hello, world!\\n&quot;);\r\n  return 0;\r\n}\r\n<\/pre>\n<p>compile with with emscripten as follows:<\/p>\n<pre>\r\nemcc hi.c -o hello.html\r\n<\/pre>\n<p>Which will produce hello.html You can then open this with firefox! Emscripten will add a bunch of support code, around this automatically. If you ommit the -o it will produce a a.out.js with the Javascript only.<\/p>\n<p>In addition to the above you might want to add something like the following to your .bashrc, so that the past persist across bash sessions:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nPATH=$PATH:\/home\/new\/ems\/emsdk_portable\r\nPATH=$PATH:\/home\/new\/ems\/emsdk_portable\/clang\/fastcomp\/build_master_64\/bin\r\nPATH=$PATH:\/home\/new\/ems\/emsdk_portable\/emscripten\/master\r\nEMSCRIPTEN=\/home\/new\/ems\/emsdk_portable\/emscripten\/master\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>wget https:\/\/s3.amazonaws.com\/mozilla-games\/emscripten\/releases\/emsdk-portable.tar.gz tar xvzf emsdk-portable.tar.gz sudo apt-get update sudo apt-get install build-essential cmake python2.7 nodejs default-jre git-core .\/emsdk_portable\/emsdk update .\/emsdk_portable\/emsdk install latest # wait a long time. .\/emsdk_portable\/emsdk activate latest source emsdk_portable\/emsdk_env.sh Edit ~\/.emscripten change the line reading: NODE_JS = &#8216;node&#8217; to NODE_JS = &#8216;nodejs&#8217; Then create a simple hello word program in hi.c e.g. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[],"class_list":["post-1534","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1RRoU-oK","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts\/1534","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/comments?post=1534"}],"version-history":[{"count":3,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts\/1534\/revisions"}],"predecessor-version":[{"id":1541,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts\/1534\/revisions\/1541"}],"wp:attachment":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/media?parent=1534"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/categories?post=1534"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/tags?post=1534"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}