Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Release: Virtual ARM Device] Linux ARM Emulator to Build/Run .Net Core #5394

Open
leemgs opened this issue Mar 18, 2016 · 67 comments
Open

[Release: Virtual ARM Device] Linux ARM Emulator to Build/Run .Net Core #5394

leemgs opened this issue Mar 18, 2016 · 67 comments
Assignees
Labels
arch-arm32 area-Meta backlog-cleanup-candidate An inactive issue that has been marked for automated closure. no-recent-activity
Milestone

Comments

@leemgs
Copy link
Contributor

leemgs commented Mar 18, 2016

Here is Linux/ARM Emulator as a virtual ARM device to help system developers that don't have any real embedded devices such as Raspberry Pi2 Board, Samsung ARM Chromebook, and Odroid (X)U3 Board. It means that you can easily build .net core source and run an executable ARM binary on the emulator.

Virtual ARM Device: Linux/ARM Emulator to build/run .Net Core

  • Note: We will continually update this webpage to share changed contents whenever you upload the latest version. (This webpage is last modified on Jul-15-2016 by Geunsik Lim.)

Requirements

  1. Host OS: Ubuntu 14.04 LTS X64 PC
    (Required RAM Size: 2GiB+)
  2. Target Architecture: ARMV7LE

Major Goal

  1. To enable Linux/ARM Continuous Integration (CI) based on QEMU/chroot
  2. To build & run dotnet core components (e.g, coreclr and corefx) like sandbox
  3. To provide the system developers (that don't have embedded boards) with Virtual ARM Device

Download

  • Download the latest version 20160610.4 of Linux/ARM Emulator:
  1. Default packages:
    https://dncorerepo.blob.core.windows.net/armemulator/linux-arm-emulator-20160610.4.tar.pbz2
    https://dncorerepo.blob.core.windows.net/armemulator/linux-arm-emulator-20160610.4.tar.pbz2.md5
  2. Optional packages:
    https://dncorerepo.blob.core.windows.net/armemulator/rootfs-u1404.20160607.ext4.tar.pbz2
    https://dncorerepo.blob.core.windows.net/armemulator/rootfs-u1404.20160607.ext4.tar.pbz2.md5

Getting Started: "Linux/ARM Emulator"

Step 1: Decompress the compress file with pbzip2 command for parallelism
(And, the existing bzip2 command is also compatible to decompress the file.)

   u1404$leemgs> sudo apt-get install pbzip2 
   u1404$leemgs> sudo ln -s /usr/bin/pbzip2 /usr/bin/pbunzip2
   u1404$leemgs> sudo time tar --use-compress-prog=pbunzip2 -xvf ./linux-arm-emulator-2016****.tar.pbz2

Step 2: Run ./start.sh (Please, refer to ./doc/README.txt for more details)

Step 3: .Net Core world!!!

   arm@emul#>  cd /dotnet/runtime-hardfp-debug-mode-***
   arm@emul#> time ./corerun -c ./  /dotnet/example/hello.exe
   arm@emul#> time ./corerun -c ./  /dotnet/example/MS****/Hello.exe linux
   arm@emul#> time ./corerun -c ./  /dotnet/example/MS****/Hello.exe freebsd
   arm@emul#> time ./corerun -c ./  /dotnet/example/MS****/Hello.exe mac
   arm@emul#> time ./corerun -c ./  /dotnet/example/FloatTest.exe

Step 4: Screenshot: Execution time experiment between debug build and release build
You can see more screenshots at https://github.com/dotnet/coreclr/issues/3784

linux-arm-emulator-20160426-1600 4

emulator-test-debug-and-release

emulator-ncurse-hello-debug-and-release

Build the latest CoreCLR/CoreFX firsthand on Ubuntu 14.04 X64

Compilation with Ubuntu/ARM rootFS for Ubuntu/ARM
Compilation with Linux/ARM Emulator rootFS for Linux/ARM
  • CoreCLR (w/ native-build on Linux/ARM Emulator):
    cd ./linux-arm-emulator-2016****
    ./start.sh - select Menu '3'
    source /dot/setenv/setenv_coreclr.sh
    cd /nfs/coreclr/ (Please, read ./doc/NFS.txt file for details)
    time ./build.sh arm-softfp cross clean verbose
  • CoreCLR (w/ cross-build on Ubuntu 14.04 X64):

sudo mount ./linux-arm-emulator/platform/rootfs-tm1.ext4 /work/dotnet/rootfs-coreclr/linux-arm-emulator
cd ./coreclr/

> vi ./cross/arm-softfp/toolchain.cmake

diff --git a/cross/arm-softfp/toolchain.cmake b/cross/arm-softfp/toolchain.cmake
index 407ab53..ee5a4a3 100644
--- a/cross/arm-softfp/toolchain.cmake
+++ b/cross/arm-softfp/toolchain.cmake
@@ -6,6 +6,7 @@ set(CMAKE_SYSTEM_PROCESSOR armv7l)

 ## Specify the toolchain
 set(TOOLCHAIN "arm-linux-gnueabi")
+set(TOOLCHAIN_CUSTOM "armv7l-tizen-linux-gnueabi/4.9.2")
 set(TOOLCHAIN_PREFIX ${TOOLCHAIN}-)
 #set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}gcc)
 #set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}g++)
@@ -20,8 +21,8 @@ add_compile_options(-mfpu=vfpv3)
 add_compile_options(--sysroot=${CROSS_ROOTFS})

 set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -target ${TOOLCHAIN}")
-set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -B${CROSS_ROOTFS}/usr/lib/gcc/${TOOLCHAIN}")
-set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -L${CROSS_ROOTFS}/lib/${TOOLCHAIN}")
+set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -B${CROSS_ROOTFS}/usr/lib/gcc/${TOOLCHAIN_CUSTOM}")
+set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} -L${CROSS_ROOTFS}/usr/lib/gcc/${TOOLCHAIN_CUSTOM}")
 set(CROSS_LINK_FLAGS "${CROSS_LINK_FLAGS} --sysroot=${CROSS_ROOTFS}")

> vi ./cross-build-corclr-emul.sh

------------- coreclr cross-build: start ----------------------------
#!/usr/bin/env bash
chroot="/work/dotnet/rootfs-coreclr/linux-arm-emulator"

ROOTFS_DIR=${chroot} CPLUS_INCLUDE_PATH="$chroot/usr/lib/gcc/armv7l-tizen-linux-gnueabi/4.9.2/include/c++/:$chroot/usr/lib/gcc/armv7l-tizen-linux-gnueabi/4.9.2/include/c++/armv7l-tizen-linux-gnueabi/:$chroot/usr/include/llvm/:$chroot/usr/include/llvm-c/:$chroot/usr/local/include" CXXFLAGS="-Wno-deprecated-declarations" ./build.sh arm-softfp cross debug clean verbose clang3.6

------------- coreclr cross-build: end ----------------------------
  • CoreFX (w/ native-build on Linux/ARM Emulator):

      **In Progress!!!**
    

Do unit test of coreCLR on Raspberry Pi2 board

work@pi2$ cd coreclr/tests/
work@pi2$ time ./runtest.sh \
--testRootDir=/home/pi/coreclr/bin/tests/Windows_NT.x64.Debug
--testNativeBinDir=/home/pi/coreclr/bin/obj/Linux.arm.Debug/tests
--coreClrBinDir=/home/pi/coreclr/bin/Product/Linux.arm.Debug
--mscorlibDir=/home/pi/coreclr/bin/Product/Linux.arm.Debug
--coreFxBinDir=/home/pi/corefx/bin/Linux.AnyCPU.Debug
--coreFxNativeBinDir=/home/pi/corefx/bin/Linux.arm.Debug

Todo

  1. Stabilize the file system consistency of guestOS
  2. Support SSHFS
  3. Completely separated a floating point (e.g., softfp and hard-fp) infrastructure

Changelog

  • Refer to the ./doc/CHANGELOG.txt file.

End.

@manu-st
Copy link

manu-st commented Mar 18, 2016

👍

@leemgs leemgs changed the title [Release: Virtual ARM Device] Linux/ARM Emulator for Evaluating .Net Core [Release: Virtual ARM Device] Linux/ARM Emulator to Evaluate .Net Core Mar 18, 2016
@leemgs
Copy link
Contributor Author

leemgs commented Mar 18, 2016

We have attached the latest version of Linux/ARM Emulator via Dropbox. If someone can support a free web storage with unlimited space compared to the Dropbox service in order to archive Linux/ARM Emulator version, we will continually upload new version of the Emulator there. Actually, We can not keep the old versions of Linux/ARM Emulator, because the free account of Dropbox is limited with ~2GiB.

@benpye
Copy link
Contributor

benpye commented Mar 19, 2016

@richlander Any chance you could get this hosted?

@mmitche
Copy link
Member

mmitche commented Mar 21, 2016

Awesome!

@leemgs
Copy link
Contributor Author

leemgs commented Mar 21, 2016

@richlander , Can you support a hosting service for more effective communication of .net core Linux/ARM?

@benpye, Yesterday, I figured out that OneDrive (~15GiB) had supported the web storage space bigger than Dropbox (~2GiB). I am thinking to move to OnDrive insted of Dropbox as workaround at next release if we cannot find any volunteers that can support mass web storage.

\CC: @myungjoo

@mkborg
Copy link
Contributor

mkborg commented Mar 22, 2016

"pbzip2" is compatible with regular "bzip2" thus the following ordinary command

tar jxvf ./linux-arm-emulator-20160318-1530.tar.pbz2

can be used instead of

sudo time tar --use-compress-prog=pbunzip2 -xvf ./linux-arm-emulator-20160318-1530.tar.pbz2

@leemgs
Copy link
Contributor Author

leemgs commented Mar 22, 2016

Instead, you will have slow decompression speed by using bzip2 w/o pbzip2.

@mkborg
Copy link
Contributor

mkborg commented Mar 22, 2016

Decompression speed doesn't matter for me. Short and standard command line is preferable.

I would also prefer 'xz' compression since it has much better compression rate and reduces download time.

@leemgs
Copy link
Contributor Author

leemgs commented Mar 23, 2016

\CC: @benpye , @jkotas , @myungjoo , @manu-silicon , @lemmaa , @prajwal-aithal

We have uploaded the updated version of the "Linux/ARM Emulator". From now on, we will upload the next version via OneDrive (~15GiB) instead of Dropbox (~2GiB).

linux-arm-emulator-ver-20160323-screen

@brucehoult
Copy link

I could host files on my personal server at hoult.org if it's useful. I'm using this emulator at work @b.hoult@samsung.com.

I'm moving literally right now from a core2duo with 150 GB to a Xeon E3-1231 v3 (pretty much an i7 4770 I think) with 1.4 TB. I wouldn't miss 50 or 100 GB or more.

@leemgs
Copy link
Contributor Author

leemgs commented Mar 23, 2016

@brucehoult , Thank you for supporting the mirroring service to archive the old versions of the Linux/ARM Emulator (for evaluating .net core)

@seanshpark
Copy link
Contributor

👍

@leemgs
Copy link
Contributor Author

leemgs commented Apr 4, 2016

We have released update version of "Linux/ARM Emulator" (ver. 20160404-1330) on Apr-04-2016.

\CC: @manu-silicon , @benpye , @jkotas , @myungjoo, @prajwal-aithal , @lemmaa , @brucehoult

@brucehoult
Copy link

Mirrored to http://hoult.org/coreclr/linux-arm-emulator-20160404-1330.tar.pbz2

@brucehoult
Copy link

@leemgs do the changes in the new emulator include updating the included build of coreclr to track github?

@leemgs
Copy link
Contributor Author

leemgs commented Apr 4, 2016

@brucehoult , the changes in the new emulator are included ./doc/CHANGELOG.txt file. And we will maintain the emulator with github.com (e.g., https://github.com/leemgs/linux-arm-emulator) in the near future after finishing some procedures.

@leemgs leemgs changed the title [Release: Virtual ARM Device] Linux/ARM Emulator to Evaluate .Net Core [Release: Virtual ARM Device] Linux/ARM Emulator to Build/Run .Net Core Apr 4, 2016
@leemgs
Copy link
Contributor Author

leemgs commented Apr 6, 2016

\CC: @hongsekim , @wateret

@galvesribeiro
Copy link
Member

Awesome work! I saw you already found hosting already. Keep going! If you need any infrastructure service that I can help like storage or CI please let me know. I can put it on our Azure account, no problem at all.

@leemgs
Copy link
Contributor Author

leemgs commented Apr 15, 2016

@galvesribeiro , 👍 Thank you so much. Could you provide the your storage as another mirror service to archive old versions?

@galvesribeiro
Copy link
Member

galvesribeiro commented Apr 15, 2016

@leemgs no problem at all. I want this ARM port going forward so I hope anybody later can get it into old armv6l devices as well.

Regarding the storage, ping me later today on Gitter so I can create an storage account and give you the keys. If a linux host is also needed to build the CI just let me know there as well and we can arrange that.

Good work! :)

@leemgs
Copy link
Contributor Author

leemgs commented Apr 16, 2016

@galvesribeiro, Yes, I will ping you today on Gitter (dotnet/coreclr).

@leemgs
Copy link
Contributor Author

leemgs commented Apr 26, 2016

We have uploaded the latest Linux/ARM Emulator (version 20160426-1600). You can check the changes from the ./doc/CHANGELOG.txt. From our experiment, the execution time of release build is faster about 3~4 times against that of debug build as following:

emulator-test-debug-and-release

emulator-ncurse-hello-debug-and-release

\CC: @manu-silicon , @benpye , @jkotas , @myungjoo, @prajwal-aithal , @lemmaa , @brucehoult , @galvesribeiro

@brucehoult
Copy link

Mirrored, shasum b29ceab62ee0817500194bd9f084b68a51291a96

http://hoult.org/coreclr/linux-arm-emulator-20160426-1600.tar.pbz2

@leemgs
Copy link
Contributor Author

leemgs commented Apr 28, 2016

@brucehoult , Could you upload https://dncorerepo.blob.core.windows.net/armemulator/linux-arm-emulator-20160426-1600.2.tar.pbz2 into http://hoult.org/coreclr/ ? The difference is just symbolic link of libunwind.so and typo of the prompt.

@brucehoult
Copy link

Done. http://hoult.org/coreclr/linux-arm-emulator-20160426-1600.2.tar.pbz2

That's quite a small change for 24 MB bigger.

@brucehoult
Copy link

@leemgs could I ask you to add the following to option 3 (make_arm_build_env) in start.sh ?

if ! uname -m | grep -q arm;then QEMU=qemu-arm-static; fi

And then use $QEMU instead of qemu-arm-static in the chroot command.

With this change, start.sh option 3 works to run the environment on real hardware such as Raspberry Pi.

@leemgs
Copy link
Contributor Author

leemgs commented Jun 10, 2016

Could you please add CoreFX dependencies (libcurl4-openssl-dev libkrb5-dev libssl-dev zlib1g-dev) to emulator?

Geunsik Lim (@leemgs) is handling this.

@PRAJWAL , Please, do cross-check about the additional packages to support cross compilation of CoreFX. If you are okay, I will include the additional packages into the existing linux arm emulator.

@prajwal-aithal
Copy link
Contributor

@leemgs I can verify that the above mentioned packages can be installed in the emulator to enable cross compilation of CoreFX.

@galvesribeiro
Copy link
Member

Guys, do you still need that storage? I saw the last activity in it on Apr 24. Thanks! Keep the good work!

@leemgs
Copy link
Contributor Author

leemgs commented Jun 10, 2016

@prajwal-aithal, @mkborg , The Linux/ARM Emulator ver 20160610.1 includes the packages that you wanted to append to support the compilation of the corefx.

Guys, do you still need that storage? I saw the last activity in it on Apr 24. Thanks! Keep the good work!

@galvesribeiro , Yes, However, I have to upload again the files at home because of the updated firewall policy whenever I release the up-to-date Linux/ARM Emulator.

@brucehoult , Please, append the latest version with wget command into your web-server.

  1. Default packages:
    https://dncorerepo.blob.core.windows.net/armemulator/linux-arm-emulator-20160610.1.tar.pbz2
    https://dncorerepo.blob.core.windows.net/armemulator/linux-arm-emulator-20160610.1.tar.pbz2.md5
  2. Optional packages:
    https://dncorerepo.blob.core.windows.net/armemulator/rootfs-u1404.20160607.ext4.tar.pbz2
    https://dncorerepo.blob.core.windows.net/armemulator/rootfs-u1404.20160607.ext4.tar.pbz2.md5

FYI, \CC: @lemmaa, @chunseoklee, @seanshpark, @mylibero, @parjong, @idkiller, @ILyoan, @watere , @sjsinju, @hongsekim, @jyoungyun, @papaslavik , @hqueue , @sam-baravy

@galvesribeiro
Copy link
Member

Ah, ok! No problem.

@brucehoult
Copy link

@leemgs mirrored to http://hoult.org/coreclr/

Thanks for the wget'able links. It makes it so much easier than downloading on a box with a GUI at home and re-uploading at 1 MB/s. With wget directly on my server ... 50 seconds to get a 1.4 GB file.

@leemgs
Copy link
Contributor Author

leemgs commented Jun 13, 2016

@brucehoult , Please, append the latest version with the wget command into your web-server.

  1. Default packages:

https://dncorerepo.blob.core.windows.net/armemulator/linux-arm-emulator-20160610.2.tar.pbz2
https://dncorerepo.blob.core.windows.net/armemulator/linux-arm-emulator-20160610.2.tar.pbz2.md5

Changelog will be available at ./doc/CHANGELOG.txt file.

@brucehoult
Copy link

@leemgs done

@mkborg
Copy link
Contributor

mkborg commented Jun 17, 2016

@leemgs @PRAJWAL

We are working on SOS-plug-in improvement and we need to rebuild lldb from sources (with our patches and with python scripting enabled). Unfortunately lldb build in emulator fails due to missing dependencies.

Could you please add lldb dependencies (swig libncurses5-dev libedit-dev libxml2-dev) to emulator?

@leemgs
Copy link
Contributor Author

leemgs commented Jul 7, 2016

Could you please add lldb dependencies (swig libncurses5-dev libedit-dev libxml2-dev) to emulator?

@prajwal-aithal , Could you check the lldb issue?

@leemgs leemgs changed the title [Release: Virtual ARM Device] Linux/ARM Emulator to Build/Run .Net Core [Release: Virtual ARM Device] Linux ARM Emulator to Build/Run .Net Core Jul 13, 2016
@prajwal-aithal
Copy link
Contributor

We now have enabled building and testing of coreclr and corefx on the Linux ARM Emulator. The documentation for the same can be found in coreclr (link will work after dotnet/coreclr#6249 is merged) and corefx.

The build and test process has been integrated into the CI system on a per-PR basis in both coreclr and corefx projects (Debug and Release jobs). Now, we can prevent build and major test regressions from occurring by detecting the same before merging the PR.

@leemgs
Copy link
Contributor Author

leemgs commented Jan 10, 2017

Default packages:
https://dncorerepo.blob.core.windows.net/armemulator/linux-arm-emulator-20160610.4.tar.pbz2
https://dncorerepo.blob.core.windows.net/armemulator/linux-arm-emulator-20160610.4.tar.pbz2.md5

@galvesribeiro , Could you check the azure storage of dncorerepo id? It seems that we cannot connect to the azure storage with the existing azure name & key that was provided by you.

Unable to retrieve child resources.
Details: getaddrinfo ENOTFOUND dncorerepo.blob.core.windows.net dncorerepo.blob.core.windows.net:443

@leemgs
Copy link
Contributor Author

leemgs commented Jan 10, 2017

@brucehoult , Could you upload the up-to-date linux-arm-emulator binary in your server (e.g. http://hoult.org/coreclr/)?

  • Default packages:
    linux-arm-emulator-20160610.4.tar.pbz2
    linux-arm-emulator-20160610.4.tar.pbz2.md5

  • Optional packages:
    rootfs-u1404.20160607.ext4.tar.pbz2
    rootfs-u1404.20160607.ext4.tar.pbz2.md5

\CC: @sjsinju

@msftgits msftgits transferred this issue from dotnet/coreclr Jan 30, 2020
@msftgits msftgits added this to the Future milestone Jan 30, 2020
@maryamariyan maryamariyan added the untriaged New issue has not been triaged by the area owner label Feb 26, 2020
@ericstj ericstj removed the untriaged New issue has not been triaged by the area owner label Jun 25, 2020
Copy link
Contributor

Due to lack of recent activity, this issue has been marked as a candidate for backlog cleanup. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will undo this process.

This process is part of our issue cleanup automation.

@dotnet-policy-service dotnet-policy-service bot added backlog-cleanup-candidate An inactive issue that has been marked for automated closure. no-recent-activity labels Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-arm32 area-Meta backlog-cleanup-candidate An inactive issue that has been marked for automated closure. no-recent-activity
Projects
No open projects
Development

No branches or pull requests