Short Guide on Compiling NewRPL
|
11-17-2016, 07:01 PM
(This post was last modified: 11-19-2016 01:19 AM by Han.)
Post: #1
|
|||
|
|||
Short Guide on Compiling NewRPL
This is meant to serve as both my own personal documentation and a short guide on getting the tools to start dabbling in the newrpl source code. I will eventually put up instructions on how to get set up on all the main platforms (Windows, Mac OS X, and Linux). For Windows, I am still using Windows 7. And for Linux, I will likely be using either Slackware or Ubuntu.
Windows 7
Compiling the NewRPL compiler for Windows
Compiling the PC virtual calculator
Compile the firmware on Windows 7 ... todo ... ------------------------------------------------------------------------------------------------- Mac OS X (10.9.5)
Compiling the NewRPL compiler for Mac OS X
Compiling the Mac virtual calculator
Compile the firmware on Mac OS X
Graph 3D | QPI | SolveSys |
|||
11-17-2016, 07:26 PM
Post: #2
|
|||
|
|||
RE: Compiling NewRPL Guide
(11-17-2016 07:01 PM)Han Wrote: Install git for Windows: Git for Windows Download PageFor windows users, may I suggest TortoiseGIT https://tortoisegit.org? It integrates well with the system, for users that may actually modify the code and commit their changes. (11-17-2016 07:01 PM)Han Wrote: Copy the newrpl-comp.exe file to tools-bin folder within the newrpl-sources folder. In my case this alone wasn't enough, as newrpl-comp refused to run. I had to also copy the following files to the same directory: libgcc_s_dw2-1.dll libstdc++-6.dll libwinpthread-1.dll Perhaps they improved the installers, my Qt install is from a couple of years back. |
|||
11-17-2016, 07:48 PM
(This post was last modified: 11-18-2016 01:48 PM by Han.)
Post: #3
|
|||
|
|||
RE: Compiling NewRPL Guide
(11-17-2016 07:26 PM)Claudio L. Wrote:(11-17-2016 07:01 PM)Han Wrote: Install git for Windows: Git for Windows Download PageFor windows users, may I suggest TortoiseGIT https://tortoisegit.org? It integrates well with the system, for users that may actually modify the code and commit their changes. I'll add that as well. (11-17-2016 07:26 PM)Claudio L. Wrote:(11-17-2016 07:01 PM)Han Wrote: Copy the newrpl-comp.exe file to tools-bin folder within the newrpl-sources folder. I have not tested newrpl-comp.exe by itself beyond seeing if the executable was visible by Qt (from within the newrpl-comp project). Doing so gave me a window that showed the help info for running newrpl-comp and left me with essentially an "ended session" (as if I ran newrpl-comp without any arguments). But for running the UI, the most recent Qt Creator (4.1.0) did not require me to copy those DLL files (this was to get the UI project to run). Incidentally, I am trying to compile the actual firmware. It complains of missing memory.h (referenced in runstream.c). Is this include file from the mpdecimal library? I ask because compiling with Qt Creator on Windows 7 seems to not recognize subdirectories when searching for includes (unless explicitly specifying it in the project file). EDIT: Forgot to mention I'm using https://developer.arm.com/open-source/gn.../downloads -- after a much more closer inspection, the download page says it's for Cortex-M and Cortex-R ... is that the same chip on the 50g? (My guess is not since the compiler seems to be missing stuff.) Or maybe it was from here: https://launchpad.net/gcc-arm-embedded/+download (I don't remember; got rid of the install files.) Do you have a recommended ARM cross compiler? EDIT2: It appears likely that nothing is wrong with the cross compiler and my issues may be due to Windows and how it parses paths. On Mac OS X, I am able to compile all three main projects (with some minor edits). Graph 3D | QPI | SolveSys |
|||
11-18-2016, 03:12 AM
Post: #4
|
|||
|
|||
RE: Compiling NewRPL Guide
Updated to include Mac OS X instructions. I compiled the firmware, but have not tested the firmware file (left my 49G+ and 50G at the office). Claudio, can you comment on the errors mentioned at the end of the Mac OS X section in the first post?
Graph 3D | QPI | SolveSys |
|||
11-18-2016, 04:57 AM
Post: #5
|
|||
|
|||
RE: Short Guide on Compiling NewRPL
(11-18-2016 03:12 AM)Han Wrote: Updated to include Mac OS X instructions. I compiled the firmware, but have not tested the firmware file (left my 49G+ and 50G at the office). Claudio, can you comment on the errors mentioned at the end of the Mac OS X section in the first post? I can tell you that I compiled both UI and FW on Ubuntu (64-bits) and on FreeBSD (32 and 64 bits) (most similar OS to a Mac that I can get) and it compiled with zero errors. I also compile UI on Windows (32-bits) and get zero errors. Sometimes I get a spurious warning about a comparison on ui_cmdline.c that makes no sense to me. Regarding memory.h: It was an old #include needed back in the early days, but I eventually replaced all calls to memcpy and friends with my own memcpyw and memcpyb to become completely independent from any system library, so memory.h became obsolete and can be removed with no consequences (I'll commit that change tomorrow). It's a standard header, though, it should be there even on Mac. Perhaps there's some missing basic headers? Also the problem with types should never happen: The first thing newrpl.h does is define all those custom types: WORD is defined as uint32_t to be 100% consistent across multiple platforms. Replacing WORD with unsigned int is superfluous, as they are the same type, same as replacing int with BINT in your example. I'm not sure where those errors come from. The arm-none-eabi-gcc you are using should be fine. A while back they had declared ARM9 obsolete and removed libgcc.a from the packages, but they eventually included everything back. Even though they say Cortex, the old arm920t is supported and they provide a libgcc.a that is armv4t compatible. As far as recommended ARM compiler: I tested the arm-none-eabi-gcc in the Ubuntu packages and works well. I also used the freebsd package and worked just as well. For the UI project, I used Clang on FreeBSD and it compiles fine too. A few details on your tutorial: * All tools like elf2rom and newrpl-comp have a proper "install" target that copies the executable file into tools-bin for you. It is supposed to work on all targets except Windows. When you configure the project, select the "Release" target, then add a custom step after build, in which you put "install" as the sole argument. When you hit build, it will copy the file at the end for you. Doesn't work on Windows, as the executable has a different extension and the cp command is not supported. * I gave up on trying to cross compile the firmware on Windows. arm-none-eabi-gcc always has issues with the paths. To build the firmware on Windows, I recommend an Ubuntu VM. |
|||
11-18-2016, 01:35 PM
(This post was last modified: 11-18-2016 01:42 PM by Han.)
Post: #6
|
|||
|
|||
RE: Short Guide on Compiling NewRPL
Thank you for the info on the errors and memory.h
(11-18-2016 04:57 AM)Claudio L. Wrote:(11-18-2016 03:12 AM)Han Wrote: Updated to include Mac OS X instructions. I compiled the firmware, but have not tested the firmware file (left my 49G+ and 50G at the office). Claudio, can you comment on the errors mentioned at the end of the Mac OS X section in the first post? On Mac, there are numerous warnings about instances were const is used twice in a declaration (e.g. const unsigned int const <blah>) but this is likely just due to Xcode being extremely picky. Once I got the projects to compile, though, I no longer saw them in the logs so I cannot give any further details. (Even using make clean and rebuilding did not show any warnings after the minor modifications I had mentioned.) (11-18-2016 04:57 AM)Claudio L. Wrote: Regarding memory.h: It was an old #include needed back in the early days, but I eventually replaced all calls to memcpy and friends with my own memcpyw and memcpyb to become completely independent from any system library, so memory.h became obsolete and can be removed with no consequences (I'll commit that change tomorrow). It's a standard header, though, it should be there even on Mac. Perhaps there's some missing basic headers? It's there, but I think runstream.c was looking for it within the mpdecimal library. At least the newRPL-BASE.pro file seems to suggest so, anyway. But I am glad to read that removing it is OK. (11-18-2016 04:57 AM)Claudio L. Wrote: Also the problem with types should never happen: The first thing newrpl.h does is define all those custom types: WORD is defined as uint32_t to be 100% consistent across multiple platforms. Replacing WORD with unsigned int is superfluous, as they are the same type, same as replacing int with BINT in your example. I'm not sure where those errors come from. I was surprised by this as well. I think the Mac compiler is just super picky. At any rate, the differences were:
If you already tried compiling the firmware on Windows with no success, then I probably won't bother trying too hard (I too ran into path issues despite using the "DOS" paths that I had to manually determine using dir /X). The only thing I have not tried is to install the compiler in a simple directory at the root of the drive. Graph 3D | QPI | SolveSys |
|||
11-18-2016, 02:54 PM
Post: #7
|
|||
|
|||
RE: Short Guide on Compiling NewRPL
(11-18-2016 01:35 PM)Han Wrote: I'll fix this. Could you email me a complete capture with all your warnings and errors? Picky or not, the ones above need to be fixed in the code, and the others about const probably too, I just never came across these issues because my compiler never told me :-). |
|||
11-18-2016, 03:34 PM
(This post was last modified: 11-18-2016 03:34 PM by Han.)
Post: #8
|
|||
|
|||
RE: Short Guide on Compiling NewRPL
(11-18-2016 02:54 PM)Claudio L. Wrote:(11-18-2016 01:35 PM)Han Wrote: I emailed you text files of only the warnings (since my tree has the modified sources). I can start fresh (new git clone) if you want the errors, too (although the above modifications fix the errors). Graph 3D | QPI | SolveSys |
|||
11-18-2016, 05:49 PM
Post: #9
|
|||
|
|||
RE: Short Guide on Compiling NewRPL
Manged to compile newrplfw.elf on Windows up until calling elf2rom. Looks like I will need to figure out how to compile libelf using the mingw installation within Qt.
Graph 3D | QPI | SolveSys |
|||
11-19-2016, 01:12 AM
Post: #10
|
|||
|
|||
RE: Short Guide on Compiling NewRPL
Here's the sig_digits error:
Code: /usr/local/gcc-arm/bin/arm-none-eabi-gcc -c -mtune=arm920t -mcpu=arm920t -mlittle-endian -fomit-frame-pointer -fno-toplevel-reorder -msoft-float -Os -pipe -mthumb-interwork -nostdinc -DTARGET_50G -DNDEBUG -DNEWRPL_BUILDNUM=711 -I../newrpl-sources -I. -I/usr/local/gcc-arm/arm-none-eabi/include -I../newrpl-sources/firmware/include -I../newrpl-sources/newrpl -I/usr/local/include -I/usr/include -I../../Qt/5.7/clang_64/mkspecs/macx-clang -o decimal.o ../newrpl-sources/newrpl/decimal.c Graph 3D | QPI | SolveSys |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 4 Guest(s)