Cross compile Mono from source for the Omega2 and Omega2+



  • So far I didn't have any problems running a few .NET applications on the Omega. Will look further on this subject. I also looked at .NET core but could not manage to compile it for the Omega. As far as I know and described in the git repository, Core supports only a few CPU architectures but not MIPS unfortunately.



  • Updated thread with timezone fix.



  • Hi.

    Thank you for the great work regarding mono on omega2.
    I have tried skipping the whole "build from source" step, and go directly to "install from your ipkg file" - simply to see if I can get that part working before I start customizing my own, but it seems, that if i run "opkg install mono-runtime_4.3.0-1_mips_24kc.ipk" from a path where I have downloaded your "mono-runtime 4.3.0 30-04-2017", then it fails, saying the package is not for Mips... am I missing something?

    Kind regards, and again, thank you for your work.



  • @Martin-Frederiksen Yeah I also had this problem with the .ipk file. You can extract the ipk and then the data.tar.gz file and copy all the contents of data.tar.gz to "/". That precompiled mono package you mentioned is old. Will compile a newer version for you. ;). Maybe that one will work with opkg.

    UPDATE: here you go:
    http://51.255.195.37/mono-runtime_5.0-1_mipsel_24kc.ipk

    Small note: I could not check which version this one is. I compiled the latest mono source and named it 5.0. You can check mono --version which version it really is.

    So if opkg doesn't work then extract the files and copy those to root:

    tar xf mono-runtime_5.0-1_mipsel_24kc.ipk
    tar xf data.tar.gz
    cp -R ./bin ./lib /
    


  • @Jackdaw Thanks man.. That is so awesome, and yes, I actually had to extract, as opkg did not work. For anyone following along though, I had to use tar with xzf parameters, to uncompress from zip.... Great work, and it is version 5.7.0 in this package.

    Cheers

    /M



  • @Martin-Frederiksen Glad that it worked! Will have to take a look at the ipk file. Shame that opkg doesn't work.



  • Hi @Jackdaw!

    I tried to compile mono myself, it seems there is an environment variable STAGING_DIR missing. But this did not completely solve my problems. Can you perhaps provide a working link with your mono version?



  • @Rainer-Müller

    You can ignore the STAGING_DIR. If you do all the things written in my instructions, then you have a fully working mono package :).

    I see that the precompiled package is not there anymore. Will create one somewhere this weekend.



  • Hi Jack can you reupload the ipk compiled for mono you build. Thanks a lot



  • Wow, sorry I forgot to add a package. That took me a time to notice.

    Do people still have problems compiling mono for the Omega? I will try again this weekend and update the tutorial. Please remind me again. :).



  • I could not cross compile the recent version of mono. Will see if I will be more successfull at the end of this week.



  • This post is deleted!


  • @Jackdaw I stuck on setting crosscompiled environment. I mean - after all setup for crosscopile (I used also recent openwrt-sdk-18.06.1-ramips-mt76x8_gcc-7.3.0_musl.Linux-x86_64.tar.xz) BuildMono/bin/mono is build for Ubuntu (not for Omega2). Both BuildHost/bin/mono and BuildMono/bin/mono works on Ubuntu but the latter not works on Omega2 (wrong ELF format). So I suspected that cross-tools are wrongly setup and in the second stage still Ubuntu host tools are used (in /Makefile commands CC = gcc)

    I tried your solution with export CC=$CROSS-gcc
    and also alising it manually before automake and make but it still build host-platform version 😞

    Any idea how to properly setup cross-toolsets before compiling for ramips-mt76x8 ?



  • I think I have ignored that autogen.sh ends with an error around checking shm_open:

    checking for inotify_rm_watch with unsigned wd... no
    checking for shm_open that works well enough with mmap... configure: error: in `/home/project/mono':
    configure: error: cannot run test program while cross compiling
    See `config.log' for more details
    

    How to workaround it? Obviously it can not run crosscompiled test on build machine 😕



  • ...ok, I figure it out (more or less):
    There's on open regressed issue on Mono project for this:
    https://github.com/mono/mono/issues/9951

    I had to switch back to 2018-04 branch on Mono to make it work.
    Compiled with openwrt-sdk-18.06.1-ramips-mt76x8_gcc-7.3.0_musl.Linux-x86_64.tar.xz

    Cheers!



  • Is it possible to get new link for package download?



  • Sorry for the long wait.

    You can download the precompiled package here. Use at your own risk.
    It contains the mono binary and the full .net library, so you need to extend your root partition with a microsd card.

    http://207.180.192.51/mono-5.8.1.0-1_mipsel_24kc.ipk

    Could someone check if the package will install with opkg this time? Thanks.

    I will update this thread in a while. Some things has been changed.



  • @Jackdaw

    Is there an updated valid link for mono-5.8.1.0-1_mipsel_24kc.ipk? I'm not able to get it to download.



  • @paaablo80 I'm trying to build mono with no luck. Would you please help me with this? If you already have it donde it would be great help. Please let me know. Thank you.



  • @Jackdaw I'm trying to build mono with no luck. Would you please help me with this? If you already have it donde it would be great help. Please let me know. Thank you.



Looks like your connection to Community was lost, please wait while we try to reconnect.