Ugh. I'm stumped! I keep hitting this error with the rpi build:
Configuring ncurses
/bin/sh: 1: /var/www/vhosts/david.zemon.name/propgcc-build/src/ncurses/configure: not found
make: *** [/var/www/vhosts/david.zemon.name/propgcc-build/src/../build-rpi/ncurses/ncurses-configured] Error 127
I don't get it. It's looking for a directory called ncurses in the source files.... but there's definitely no ncurses directory in the repository. I thought maybe I just didn't have an environment variable set correctly, or was missing a dependency, but the Makefile doesn't show any obvious issues (referring to line 254: https://github.com/DavidZemon/propgcc/blob/master/Makefile#L254). The one odd thing I noticed was that the target "$(BUILD)/ncurses/ncurses-configured" depends on "$(BUILD)/ncurses/ncurses-created" which doesn't exist in that file. So... maybe ncurses-created is supposed to create the ncurses directory? Makes sense based on the name. Where's that target defined?
--edit--
grep just finished searching the source directory and found nothing
I have no idea what is going on with the ncurses stuff. I didn't add it. However, the xxx-created files are just sentinels used to indicate that the xxx directory has been created. You can't use the directory itself as a dependency because it changes every time a file in it changes and causes lots of unnecessary rebuilds.
ncurses is only required for the raspberry pi, and then (I think) only for gdb. So it's probably safe to comment out the ncurses requirement in the Makefile (the CURSES=ncurses line for the rpi build). That said, I'm surprised that (a) ncurses didn't get checked in (and you're right, it didn't), and (b) nobody has complained about that before. I guess rpi versions of gdb were low on people's priority lists.
I'll see if I can figure out where I got the ncurses source code from and make sure it's OK to check in.
ncurses is only required for the raspberry pi, and then (I think) only for gdb. So it's probably safe to comment out the ncurses requirement in the Makefile (the CURSES=ncurses line for the rpi build). That said, I'm surprised that (a) ncurses didn't get checked in (and you're right, it didn't), and (b) nobody has complained about that before. I guess rpi versions of gdb were low on people's priority lists.
I'll see if I can figure out where I got the ncurses source code from and make sure it's OK to check in.
Eric
great!
David, can you merge my pull request? soon as it's merged, I can point TeamCity at your repo instead of mine, then as soon as eric commits the ncurses source code, TeamCity will build us a new raspberry pi binary!
That's very curious. I'll give this a try on my pi next chance i get. I'm working on a bug in PropWare (cogc issues again ) at the moment, but soon as that's fixed I'll get back to PropGCC raspberry pi builds
David, can you merge my pull request? soon as it's merged, I can point TeamCity at your repo instead of mine, then as soon as eric commits the ncurses source code, TeamCity will build us a new raspberry pi binary!
What did you change? I didn't get email saying you had submitted a pull request.
$ export PATH=$PATH:/opt/parallax/bin/
$ cd propgcc
$ make
If you're up for a challenge, try building my new propeller-gcc repository. It should automatically pull openspin and spin2cpp from their respective repositories and build them along with the rest of the gcc toolchain. If you decide to try this, make sure you read through the README.md file because there are a couple of additional steps required from what is needed by propgcc. Also, this repository uses Eric's port of the new version of gcc as well as binutils and lib.
What did you change? I didn't get email saying you had submitted a pull request.
Weird. It's just two small changes. 1) Add a path in front of the spin compiler variable so that the PATH variable doesn't have be messed with. 2) allow for longer path names (build and prefix)
If you're up for a challenge, try building my new propeller-gcc repository. It should automatically pull openspin and spin2cpp from their respective repositories and build them along with the rest of the gcc toolchain. If you decide to try this, make sure you read through the README.md file because there are a couple of additional steps required from what is needed by propgcc. Also, this repository uses Eric's port of the new version of gcc as well as binutils and lib.
ncurses is just fine on Raspberry Pi. I just install the libncurses5-dev package. gdb builds OK.
Why put ncurses source in the propgcc repository?
It was for cross-compilers. I built the RPi binaries on a PC, and the ARM cross-tools didn't come with ncurses, for some reason. But I guess it's arguable whether ncurses should be in the repo or not.
All this will become easier with David's new propeller-gcc repository, which makes the subdirectories into git submodules. Then I think whether or not to pull ncurses from its git (which we won't have to host) will be up to the builder.
I just modified the Makefile for propeller-gcc to write its generated code to ../build/target instead of directly to /opt/parallax. It also pushes ../build/target/bin onto the front of PATH before building any of the targets so the already generated binaries should be used to build the remaining binaries. I've also added a new "install" target that will copy the generated files to /opt/parallax.
So to build propeller-gcc:
make
sudo make install
If for some reason you want to install to some directory other than /opt/parallax:
INSTALL=/my/install/directory make install
Whether you need to use sudo with that command depends on whether you have write access to /my/install/directory.
I will make these same changes to the propgcc repository shortly.
I just modified the Makefile for propeller-gcc to write its generated code to ../build/target instead of directly to /opt/parallax. It also pushes ../build/target/bin onto the front of PATH before building any of the targets so the already generated binaries should be used to build the remaining binaries. I've also added a new "install" target that will copy the generated files to /opt/parallax.
So to build propeller-gcc:
make
sudo make install
If for some reason you want to install to some directory other than /opt/parallax:
INSTALL=/my/install/directory make install
Whether you need to use sudo with that command depends on whether you have write access to /my/install/directory.
I will make these same changes to the propgcc repository shortly.
Great! I like that a lot more. Would that mean that PREFIX doesn't need to be defined uniquely for cross-compiling? I notice the variable is still used for cross compiling at the moment
Great! I like that a lot more. Would that mean that PREFIX doesn't need to be defined uniquely for cross-compiling? I notice the variable is still used for cross compiling at the moment
Actually, PREFIX still needs to be redefined for cross compiling. In fact, I may have broken cross compiling with this edit. I'll have to check and fix that if I did. I'm still a little nervous about the idea of using ../build as a workspace. It bothers me to use a directory outside of the root of the tree where you type "make". In any case, you can still define PREFIX on the command line.
Actually, PREFIX still needs to be redefined for cross compiling. In fact, I may have broken cross compiling with this edit. I'll have to check and fix that if I did. I'm still a little nervous about the idea of using ../build as a workspace. It bothers me to use a directory outside of the root of the tree where you type "make". In any case, you can still define PREFIX on the command line.
Okay, I moved the code that determines the default value for PREFIX to before where the cross compilation gets setup. I hope that will fix cross compiles. Let me know if you have trouble.
All the changes i made to the propgcc repo are now gone, so I'm finding them and fixing again. Haven't gotten a successful build to finish yet.
I'm not a fan of the workspace being ../build either. I'd love to see it get moved underneath the checkout directory. It'd make building in TeamCity a lot easier too, if everything was contained inside the checkout directory.
All the changes i made to the propgcc repo are now gone, so I'm finding them and fixing again. Haven't gotten a successful build to finish yet.
I'm not a fan of the workspace being ../build either. I'd love to see it get moved underneath the checkout directory. It'd make building in TeamCity a lot easier too, if everything was contained inside the checkout directory.
How did your changes to propgcc get lost? Did I do something wrong?
I don't see any reason it couldn't be ./build instead of ../build. Maybe Eric will comment on why it is the way it is.
I'm not a fan of the workspace being ../build either. I'd love to see it get moved underneath the checkout directory. It'd make building in TeamCity a lot easier too, if everything was contained inside the checkout directory.
There's a pretty strong argument that building should not modify the checkout directory. This is particularly important if you're doing cross-compiles and need to frequently switch build environments. If all the changes are encapsulated in one directory, which can then be placed in .gitignore, then it's not too bad, but I think it's even better to make the object files "out of tree" in a separate directory, leaving the original checked out sources unchanged.
Yes, keeping the build directory out of the source tree is a common approach. Qtcreator for example builds into what it calls "shadow builds", basically directories outside the source tree. This is basically so that you can do cross compilations or use different compilers, clang for example.
It might be nice not to use such a simple generic name like "build" for this directory. But something more specific or user defined. qtcreator for example comes up with names like "/opt/qt5.3.1/Examples/Qt-5.3/widgets/mainwindows/build-application-Desktop_Qt_5_3_GCC_64bit-Debug"
If the builddir were just named like the git directory with ".build" appended, having the sources of propgcc and propeller-gcc side by side would not make the build directories clash on the same name.
And a default for PREFIX not being "/opt/parallax" for the new propeller-gcc while being work in progress would be nice. "/opt/parallax-wip"?
That's weird that it doesn't build on the pi. I was able to cross build a pi compiler on my x86 Linux machine, so I don't see any reason that it shouldn't build natively. Actually the "internal compiler error" makes it sound like there is in fact a bug in the gcc 4.6 that you're using on the Raspberry P, rather than a propgcc problem (since propgcc is version 5.0)i. My cross compiler (arm-linux-gnueabihf-gcc) is version 4.8.3. Any chance you can try with a more recent native gcc for the RPi?
I was suspecting this was a compiler version issue.
Problem is that no, I have Raspbian installed on the Pi and whatever GCC version that is then that is what it is.
There is no way I am messing with getting a more recent GCC on the machine. Not until Jessie becomes stable and we upgrade brining whatever GCC version that has with it.
I may try to move the master branch of propeller-gcc back to the old gcc/binutils/lib and move the new gcc/binutils/lib to a branch if I can figure out how to do that with submodules.
Dave Hein: Are you following this thread? Do you have spinsim in a git repository somewhere so I can include it as a submodule of propeller-gcc?
I just pushed changes to the propeller-gcc repository that should fix cross builds and also make the default build directory ../propeller-gcc-build. This moves the generated files out of the source tree. I'd really like to remove the ncurses stuff from the Makefile and just make installing the ncurses library a prerequisite for building propeller-gcc on a platform. It seems to me that that is the normal way of handling this sort of dependency. Does anyone have any objections? I'd rather not pull the sources for every dependent library into the propeller-gcc tree just because some platform doesn't come with it installed by default. Comments?
Comments
I'll see if I can figure out where I got the ncurses source code from and make sure it's OK to check in.
Eric
great!
David, can you merge my pull request? soon as it's merged, I can point TeamCity at your repo instead of mine, then as soon as eric commits the ncurses source code, TeamCity will build us a new raspberry pi binary!
Why put ncurses source in the propgcc repository?
That is assuming we are building from David's propgcc repo on github. Master branch.
Here are my build steps on the Pi itself:
0) Ensure you have 3GB of free space file system. I use an NFS mount for this.
1) Install packages required for building:
$ sudo apt-get install build-essential
$ sudo apt-get install g++
$ sudo apt-get install texinfo
$ sudo apt-get install libncurses5-dev
$ sudo apt-get install bison
$ sudo apt-get install flex
2) Check out propgcc from github:
$ git clone https://github.com/dbetz/propgcc.git
3) Fetch and build openspin and copy it into the propgcc release directory:
$ git clone https://github.com/parallaxinc/OpenSpin.git
$ cd OpenSpin/
$ make
$ cp openspin ../propgcc/release/openspin.linux
$ cd ..
4) Make the directory that progcc is to be installed into:
$ sudo mkdir /opt/parallax
$ sudo chown pi:pi /opt/parallax
5) Build propgcc:
$ export PATH=$PATH:/opt/parallax/bin/
$ cd propgcc
$ make
If you're up for a challenge, try building my new propeller-gcc repository. It should automatically pull openspin and spin2cpp from their respective repositories and build them along with the rest of the gcc toolchain. If you decide to try this, make sure you read through the README.md file because there are a couple of additional steps required from what is needed by propgcc. Also, this repository uses Eric's port of the new version of gcc as well as binutils and lib.
https://github.com/dbetz/propeller-gcc
Weird. It's just two small changes. 1) Add a path in front of the spin compiler variable so that the PATH variable doesn't have be messed with. 2) allow for longer path names (build and prefix)
https://github.com/dbetz/propgcc/pull/73
Didn't know this was live! I'll give this a try too
It was for cross-compilers. I built the RPi binaries on a PC, and the ARM cross-tools didn't come with ncurses, for some reason. But I guess it's arguable whether ncurses should be in the repo or not.
All this will become easier with David's new propeller-gcc repository, which makes the subdirectories into git submodules. Then I think whether or not to pull ncurses from its git (which we won't have to host) will be up to the builder.
Eric
So to build propeller-gcc:
If for some reason you want to install to some directory other than /opt/parallax:
Whether you need to use sudo with that command depends on whether you have write access to /my/install/directory.
I will make these same changes to the propgcc repository shortly.
Great! I like that a lot more. Would that mean that PREFIX doesn't need to be defined uniquely for cross-compiling? I notice the variable is still used for cross compiling at the moment
I'm not a fan of the workspace being ../build either. I'd love to see it get moved underneath the checkout directory. It'd make building in TeamCity a lot easier too, if everything was contained inside the checkout directory.
How did your changes to propgcc get lost? Did I do something wrong?
I don't see any reason it couldn't be ./build instead of ../build. Maybe Eric will comment on why it is the way it is.
There's a pretty strong argument that building should not modify the checkout directory. This is particularly important if you're doing cross-compiles and need to frequently switch build environments. If all the changes are encapsulated in one directory, which can then be placed in .gitignore, then it's not too bad, but I think it's even better to make the object files "out of tree" in a separate directory, leaving the original checked out sources unchanged.
Eric
It might be nice not to use such a simple generic name like "build" for this directory. But something more specific or user defined. qtcreator for example comes up with names like "/opt/qt5.3.1/Examples/Qt-5.3/widgets/mainwindows/build-application-Desktop_Qt_5_3_GCC_64bit-Debug"
And a default for PREFIX not being "/opt/parallax" for the new propeller-gcc while being work in progress would be nice. "/opt/parallax-wip"?
I guess I should raise an issue on Eric's gcc repo or what?
Did you say this was a port of a new version of GCC ?
I was suspecting this was a compiler version issue.
Problem is that no, I have Raspbian installed on the Pi and whatever GCC version that is then that is what it is.
There is no way I am messing with getting a more recent GCC on the machine. Not until Jessie becomes stable and we upgrade brining whatever GCC version that has with it.
Dave Hein: Are you following this thread? Do you have spinsim in a git repository somewhere so I can include it as a submodule of propeller-gcc?