{"id":7911,"date":"2015-06-12T10:56:00","date_gmt":"2015-06-12T15:56:00","guid":{"rendered":"http:\/\/www.multitech.net\/developer\/?page_id=7911"},"modified":"2022-08-16T15:44:19","modified_gmt":"2022-08-16T20:44:19","slug":"mlinux-c-toolchain","status":"publish","type":"page","link":"https:\/\/www.multitech.net\/developer\/software\/mlinux\/mlinux-software-development\/mlinux-c-toolchain\/","title":{"rendered":"C\/C++ Toolchain"},"content":{"rendered":"<p><strong>System requirements: <\/strong>This process requires a PC running a 64-bit Linux OS or a virtual machine that runs a 64-bit Linux OS. (Do not install the toolchain on the device itself.)<\/p>\n<ul>\n<li>For\u00a0mLinux<sup>\u2122<\/sup> 3, Ubuntu 14.04 is preferred.<\/li>\n<li>For mLinux 4, Ubuntu 14.04 or Ubuntu 16.04 may be used.<\/li>\n<li>For mLinux 5.3 and above, Ubuntu 16.04 or\u00a0Ubuntu 18.04 may be used.<\/li>\n<\/ul>\n<p><strong>NOTE:<\/strong> Before downloading and running the install script, refer to the appropriate toolchain information based\u00a0on\u00a0your version number at: <a href=\"http:\/\/www.multitech.net\/mlinux\/sdk\/\" target=\"_blank\">http:\/\/www.multitech.net\/mlinux\/sdk\/<\/a><\/p>\n<p>Since the filenames vary for each .sh file, do not\u00a0 just change the version number for the url in the curl command.\u00a0 Replace the entire filename as well.\u00a0\u00a0As in the below example, the address\u00a0 for\u00a0 version 3.3.6 is:<br \/>\n<a href=\"http:\/\/www.multitech.net\/mlinux\/sdk\/3.3.6\/mlinux-eglibc-x86_64-mlinux-factory-image-arm926ejste-toolchain-3.3.6.sh\">http:\/\/www.multitech.net\/mlinux\/sdk\/3.3.6\/mlinux-eglibc-x86_64-mlinux-factory-image-arm926ejste-toolchain-3.3.6.sh<\/a><\/p>\n<p>But for version 4.0.1, the url would be:\u00a0\u00a0 <a href=\"http:\/\/www.multitech.net\/mlinux\/sdk\/4.0.1\/mlinux-glibc-x86_64-mlinux-factory-image-arm926ejste-toolchain-4.0.1.sh\">http:\/\/www.multitech.net\/mlinux\/sdk\/4.0.1\/mlinux-glibc-x86_64-mlinux-factory-image-arm926ejste-toolchain-4.0.1.sh<\/a><\/p>\n<p>To install the C\/C++ toolchain, download and execute the install script:<\/p>\n<pre class=\"brush:shell\">curl http:\/\/www.multitech.net\/mlinux\/sdk\/3.3.6\/mlinux-eglibc-x86_64-mlinux-factory-image-arm926ejste-toolchain-3.3.6.sh &gt; mlinux-toolchain-install.sh\r\nchmod +x mlinux-toolchain-install.sh\r\n.\/mlinux-toolchain-install.sh<\/pre>\n<p>Once the toolchain is installed, load the environment for it:<\/p>\n<pre class=\"brush:shell\">source \/path\/to\/sdk\/environment-setup-arm926ejste-mlinux-linux-gnueabi<\/pre>\n<p>This sets common environment variables for compiling such as <code>$CC<\/code>, <code>$LD<\/code>, etc. To compile a single source file C program, run the following from your app&#8217;s source code directory:<\/p>\n<pre class=\"brush:shell\"> $CC -o myapp myapp.c<\/pre>\n<p>Which builds a myapp executable from myapp.c. To execute the app, <code>scp<\/code> myapp over to the Conduit<sup>\u00ae<\/sup>.<\/p>\n<h4>Open Source C<\/h4>\n<p>You can also build a standard open source C project. For this, the typical process would be:<\/p>\n<pre class=\"brush:shell\"># load the environment as before.\r\n# run in the source dir for the project.\r\n$ .\/configure\r\n$ make<\/pre>\n<p>For more details on\u00a0the\u00a0toolchain\u00a0from Yocto, see the following:<\/p>\n<p>Documentation for mLinux 6 and above (Yocto 3.1):<br \/>\n<a href=\"https:\/\/www.yoctoproject.org\/docs\/2.6\/sdk-manual\/sdk-manual.html\">https:\/\/www.yoctoproject.org\/docs\/3.1\/sdk-manual\/sdk-manual.html<\/a><\/p>\n<p>Documentation for mLinux 5.3 and above (Yocto 2.6):<br \/>\n<a href=\"https:\/\/www.yoctoproject.org\/docs\/2.6\/sdk-manual\/sdk-manual.html\">https:\/\/www.yoctoproject.org\/docs\/2.6\/sdk-manual\/sdk-manual.html<\/a><\/p>\n<p>Documentation for mLinux 4 (Yocto 2.1):<br \/>\n<a href=\"https:\/\/www.yoctoproject.org\/docs\/2.1\/sdk-manual\/sdk-manual.html\" target=\"_blank\">https:\/\/www.yoctoproject.org\/docs\/2.1\/sdk-manual\/sdk-manual.html<\/a><\/p>\n<p>Documentation for mLinux 3 (Yocto 1.6):<br \/>\n<a href=\"https:\/\/www.yoctoproject.org\/docs\/1.6\/dev-manual\/dev-manual.html\">https:\/\/www.yoctoproject.org\/docs\/1.6\/dev-manual\/dev-manual.html<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>System requirements: This process requires a PC running a 64-bit Linux OS or a virtual machine that runs a 64-bit Linux OS. (Do not install the toolchain on the device itself.) For\u00a0mLinux\u2122 3, Ubuntu 14.04 is preferred. For mLinux 4, Ubuntu 14.04 or Ubuntu 16.04 may be used. For mLinux 5.3 and above, Ubuntu 16.04 [&hellip;]<\/p>\n","protected":false},"author":537,"featured_media":0,"parent":9192,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"class_list":["post-7911","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/7911","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/users\/537"}],"replies":[{"embeddable":true,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/comments?post=7911"}],"version-history":[{"count":49,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/7911\/revisions"}],"predecessor-version":[{"id":32990,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/7911\/revisions\/32990"}],"up":[{"embeddable":true,"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/pages\/9192"}],"wp:attachment":[{"href":"https:\/\/www.multitech.net\/developer\/wp-json\/wp\/v2\/media?parent=7911"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}