Jump to content

Compile on Linux please!


QBAS
 Share

Recommended Posts

Hi QBAS,

Check out this link

    http://sdcc.sourceforge.net/

You can download the SDCC 'C' compiler and the gputils from this site. This compiler and utils provide support for the PIC chips. There are a couple of alternate methods for installing it on Linux depending on the flavor of Linux you have. The documentation with SDCC and gputils is fairly good. Although I don't use Linux that often, this is the same compiler that is used on Windows so building applications on Linux should be fairly easy.

Hope this is what you are looking for  :)

Regards,

Synapsys

Link to comment
Share on other sites

Hi.

I'm no expert, but I'll try to answer your questions:

For asm - for your own projects: gputils from http://gputils.sourceforge.net should work. But I think this isn't useful for existing projects because Microchip assembler has different syntax. MPASM under Wine will work.

For C - I'd guess SDCC  2.5.0 (from http://sdcc.sourceforge.net/) will work. The instructions on http://www.ucapps.de/mios_c.html page are referring to install in WIN32 environment, but if you understand the general requirements to make it work You can make it also in Linux.

Moebius

Link to comment
Share on other sites

Thank you very much.

Ok - this is what I need.

I will check gputils & SDCC 'C' compiler.

Previously I was trying install MPASM under Wine on FC4, but it never runs.

Maybe on another distro will be ok.

For asm - for your own projects: gputils from http://gputils.sourceforge.net should work. But I think this isn't useful for existing projects because Microchip assembler has different syntax. MPASM under Wine will work.

So - if I use program Skeleton or modificate midibox64e under gputils program will not working?

(sorry for too much questions)

QBAS

Link to comment
Share on other sites

Hi.

Previously I was trying install MPASM under Wine on FC4, but it never runs.

Hmm.. IF you have MPLAB IDE installed somewhere (on Win32), you could try only copying MPASMWIN.EXE and try using it under the wine.

So - if I use program Skeleton or modificate midibox64e under gputils program will not working?

That is what I've understood. GPASM will not compile sources made for MPASM but will give you bunch of errors because of the differences in the syntax.

Does anybody have better knowledge about this or am I wrong?

Moebius

Link to comment
Share on other sites

hello Moebius

IF you have MPLAB IDE installed somewhere (on Win32), you could try only copying MPASMWIN.EXE and try using it under the wine.

Unfortunately not :(  I was not backuped an installed programs.

Maybe I will find somebody with Win32 for install and copy to my computer.

Ok I will try again, but thank you for many informations.

QBAS

Link to comment
Share on other sites

Hi,

That is what I've understood. GPASM will not compile sources made for MPASM but will give you bunch of errors because of the differences in the syntax.

There are a few differences between MPASM and GPASM but they are somewhat insignificant. The original difficulty with MIDIbox code (MIOS and applications) with respect to GPASM was the macros that TK wrote. He used a feature in some macros that is not available in GPASM (e.g. passing an instruction to a macro as a parameter). I certainly don't blame TK for this, as the feature is quite powerful. In and of itself, this is not a big problem since the macros can be expanded manually in the source code. This is a lot of work however and prone to errors. In the meantime, I believe that TK has modified the code to make it compatible with GPASM. (I am not certain about this so TK’s input is needed to be sure).

As an exercise in absurdity  ???, I wrote a Windows application last year that scanned every source module in MIOS and expanded all the macros into another set of source modules. Once I had done this I was able to build MIOS using GPASM. I don’t recommend this since you end up with a non-standard unsupported set of code. Like I said, an exercise in absurdity  :P.

Regards,

Synapsys

Link to comment
Share on other sites

Hi all!

IF you have MPLAB IDE installed somewhere (on Win32), you could try only copying MPASMWIN.EXE and try using it under the wine.

Today my friend send me installed MPLAB, so now I can run it without installing!

Thank you guys from all my heart.

QBAS

Link to comment
Share on other sites

Since i faced the same problem this week, i wrote some small sed script that replaces the problematic MACROs  in the source code:

replace-macros.sed

-------------------------------------------------------8<------------------------------------------------------------

1i;hey emacs, this is -*- asm -*-

/^[ \t]*;/b #skip commented line

/^\s*\w*\s*MACRO/b #skip macro definitions

s/\<BIFSET\s*\([^,]*\)\s*,\s*\([^,]*\),\s*\([^,]*\)\s*,\s*\(.*\)/btfsc \1, \2, \3\n\t\4/g

s/\<BIFCLR\s*\([^,]*\)\s*,\s*\([^,]*\),\s*\([^,]*\)\s*,\s*\(.*\)/btfss \1, \2, \3\n\t\4/g

s/\<IFSET\s*\([^,]*\)\s*,\s*\([^,]*\),\s*\(.*\)/btfsc \1, \2\n\t\3/g

s/\<IFCLR\s*\([^,]*\)\s*,\s*\([^,]*\),\s*\(.*\)/btfss \1, \2\n\t\3/g

s/\<IFNEQ\s*\([^,]*\)\s*,\s*\([^,]*\),\s*\(.*\)/cpfseq \1, \2\n\t\3/g

s/\<IFLEQ\s*\([^,]*\)\s*,\s*\([^,]*\),\s*\(.*\)/cpfsgt \1, \2\n\t\3/g

s/\<IFGEQ\s*\([^,]*\)\s*,\s*\([^,]*\),\s*\(.*\)/cpfslt \1, \2\n\t\3/g

-------------------------------------------------------8<------------------------------------------------------------

fix-gpasm.sh:

-------------------------------------------------------8<------------------------------------------------------------

#!/bin/sh

for i in src/*.inc src/*.asm src/*.h;do

tr -d '\r' < $i|sed -f replace-macros.sed >${i}_ && mv ${i}_ $i

done

-------------------------------------------------------8<------------------------------------------------------------

Now i just have to copy the new src/ directory if there is a new version, run fix-gpasm.sh and can compile the source native on linux with gpasm :)

Greetings,

Sven.

Link to comment
Share on other sites

Sven - Excellent Work!

As stryd_one already suggested this should be in the wiki.

Do You mind asking a favour: Could you write a little article to the wiki about compiling on linux with gpasm ect. with your code included. We could use Your expertise here.

You can log to http://wiki.midibox.org by using forum login/password combination.

Moebius

Link to comment
Share on other sites

No worries. You should always read ucapps.de, the forum, the wiki, the portal, and google for these things, many times you will find the answer there first, or at least something that will give you specific questions to ask here :)

Link to comment
Share on other sites

  • 8 months later...

hi all

this weekend i wanted to compile the Midibox SEQ application the first time under osx. usually i do this on an old PC , but always had trouble finding the right files and because its much more affort than having one maschine for all that. So first i tried to read the forum and stumbeld over Xcode2. Then i realized i don´t need that, but need gputils-0.13.4, managed to install everthing to recognize that i get a lot of error messages. looked in the forum again and found this thread... and of course the wiki. http://www.midibox.org/dokuwiki/doku.php?id=compiling_the_midibox_source_on_linux

now since i am not a linux expert and much more not a command line expert i have problems to get this sed file running.

from the wiki

To use this script, copy the following files in your mios_v_1_x_src dir:

does this mean i need to copy both into txt files and save one as "replace-macros.sed" and the other as "fix-gpasm.sh" in the dir of the MB SEQ. because if i do so it does not work. terminal gives me following messages after sh fix-gpasm.sh back:

fix-gpasm.sh: line 4: src/*.inc: No such file or directoryfix-gpasm.sh: line 4: src/*.inc_: No such file or directory

fix-gpasm.sh: line 4: src/*.asm: No such file or directory

fix-gpasm.sh: line 4: src/*.asm_: No such file or directory

fix-gpasm.sh: line 4: src/*.h: No such file or directory

fix-gpasm.sh: line 4: src/*.h_: No such file or directory

am i only in the wrong direction or do i need to do something else.

thanks for the help

chriss

Link to comment
Share on other sites

Hi chriss,

you're in the wrong direction, because the link you found refers to MIOS, the OS itself and not to MIOS-applications like the SEQ!

But you are also in the right direction, because you just need GPASM indeed, but currently there seems to be an unsolved issue: http://www.midibox.org/forum/index.php?topic=2870.msg54888#msg54888

Anyway, maybe you're interesed in these links for OSX (that's a linux topic btw ;) ) though they are targeted on C:

http://www.midibox.org/dokuwiki/doku.php?id=application_development

http://www.midibox.org/dokuwiki/doku.php?id=installing_gputils_and_sdcc_on_osx

http://www.midibox.org/dokuwiki/doku.php?id=how_to_use_xcode2_as_ide_on_a_mac

Best regards,

Michael

Link to comment
Share on other sites

ok

thank you for the info. didn´t thought about that.

But that means i can not compile MB applications whith gpasm right at the moment. (either v.0.13.3 nor v.0.13.4) or is it possible to write a sed file which does the same as it does with MIOS files?

And thanks for the links, although i knew them it´s always nice to get replies like that.

thanks again

chriss

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...