Understanding the compile process

Applications, development tools, FPGA, C, WEB
Post Reply
laurencebarker
Posts: 4
Joined: Mon Nov 14, 2016 5:08 pm

Understanding the compile process

Post by laurencebarker » Mon Nov 14, 2016 8:48 pm

Hi everyone

I am a new user. I'm new to the Red Pitaya, new to using linux and haven't done FPGA development for 20 years - so I'm treating this as a learning exercise. I understand programming in windows. I will be planning to do some SDR development, just so I can say I've done it. I understand DSP.

I generally learn reasonably quickly, and don't ask too many questions on forums - but I'm stuck getting started!

I've got a laptop with a clean install of Ubuntu 16.04 (not a VM) as a development machine. I'm following the instructions at https://github.com/RedPitaya/RedPitaya

(initially I was following Pavel Demin's instructions, but they seemed to change from ubuntu to debian, and that sounded bad... it may be that moving from one set of instructions to another has missed a critical step)

I want to get to the point where I can follow the instructions and compile all the code, *and understand what I did*. Thereafter Ill probably be able to design myself a radio.

early into the process there is a step "sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6":
lib32bz2-1.0 was reported as not being available. I've found some advice about getting instead "libbz2-1.0:i386" which seems to have worked.

I got to the stage "make -f Makefile.x86". The computer seemed to start the vivado tools, which after around an hour exited with an error reported. I don't have the error message. Later I progressed further and got to the point that arm-linux-gnueabihf-gcc wasn't available. (I had followed Pavels instructions at first, and changed the name of a directory tree "aarch32" to disable the compiler tools.) That's now fixed.

I can now progress through the 5 lines "to build everything..." but there are some issues:

1. in the C compile phase I get a lot of warnings, particularly in a section referring to json - is that normal?

2. the FPGA code doesn't seem to be getting rebuilt - it just says "there was nothing to do" in that section of the output from the script. I know that it hasn't yet succeeded.

3. I don't understand what the process I'm following means. Can someone explain please what these steps in the process mean:

"make -f Makefile.x86" (this I assume makes all the code into its own directories)

"schroot -c red-pitaya-ubuntu <<-EOL_CHROOT (I have no idea what these 3 lines do)
make
EOL_CHROOT"

"make -f Makefile.x86 zip" (I assume this makes a zip file from the earlier results)

"To get an itteractive ARM shell do:

schroot -c red-pitaya-ubuntu" (No idea what this is doing, but the terminal had very strange behaviour afterwards)



4. I've tried going into the fpga directory to get it to recompile.
"make clean" doesn't seem to force the Makefile.x86 to rebuild the FPGA

I tried "make -f Makefile" and I end up with some errors, from which I'm stuck. There were critical warnings before that.

ERROR: [BD 41-237] Bus Interface property CLK_DOMAIN does not match between /axis_clock_converter_i1/S_AXIS(system_S_AXI_STR_RX1_aclk) and /S_AXI_STR_RX1(system_S_AXI_STR_RX2_aclk)
ERROR: [BD 41-237] Bus Interface property CLK_DOMAIN does not match between /M_AXI_STR_TX1(system_M_AXI_STR_TX1_aclk1) and /axis_clock_converter_o1/M_AXIS(system_M_AXI_STR_TX1_aclk)
ERROR: [BD 41-1031] Hdl Generation failed for the IP Integrator design /home/laurence/software/redpitaya/RedPitaya/fpga/prj/logic/.srcs/sources_1/bd/system/system.bd



I don't know how to proceed - any help gratefully appreciated please!

Nils Roos
Posts: 1441
Joined: Sat Jun 07, 2014 12:49 pm
Location: Königswinter

Re: Understanding the compile process

Post by Nils Roos » Tue Nov 15, 2016 1:28 am

1. I seem to recall that the things surrounding the bazaar extension did produce a lot of warnings.

2. Try to do it on a fresh clone of the repo - I just verified that it can build successfully when following the instructions.

3.
"make -f Makefile.x86" builds all components that are required to bring the system up to the point where the OS can take over. These are the fpga logic bitstream, the first and second stage bootloaders (fsbl and u-boot), the linux kernel, and the devicetree.

"schroot -c red-pitaya-ubuntu <<-EOL_CHROOT (I have no idea what these 3 lines do)
make
EOL_CHROOT"
This calls "make" in an encapsulated environment that resembles the circumstances on the Red Pitaya but runs on your host.
The call to make will build all the special software that belongs to the RP ecosystem, like nginx with the bazaar plugin, the web-apps, some utilities, etc. It will also install these components into the chrooted environment.

"To get an itteractive ARM shell do: ..." see above, your shell was working like it would on the RP from that point on.

4. see 2.

laurencebarker
Posts: 4
Joined: Mon Nov 14, 2016 5:08 pm

Re: Understanding the compile process

Post by laurencebarker » Tue Nov 15, 2016 10:10 pm

Thank you - very clear explanation.

However.... Oh dear.... i've moved backwards.

I redid the step "git clone ...." to get a new copy of the software - essentially starting again. re-did the intermediate steps.

"make -f Makefile.x86"
I now get an error instantly:

make: *** No rule to make target 'fpga.zip', needed by 'build/fpga'. Stop.

I note that some of the files on the github site have changed in the last few days and hours - has something important changed?

Nils Roos
Posts: 1441
Joined: Sat Jun 07, 2014 12:49 pm
Location: Königswinter

Re: Understanding the compile process

Post by Nils Roos » Tue Nov 15, 2016 11:05 pm

I note that some of the files on the github site have changed in the last few days and hours - has something important changed?
Seems so, a bunch of changes was pushed today - among them a new target prerequisite of FPGA_TAR=fpga.zip was introduced into Makefile.x86 without a matching rule - *sigh*.

If you checkout this commit in your local fork, it should work:
db21df6b908bf656a0bffe48e1d8009534b0c6dd

laurencebarker
Posts: 4
Joined: Mon Nov 14, 2016 5:08 pm

Re: Understanding the compile process

Post by laurencebarker » Wed Nov 16, 2016 10:39 pm

Thank you... I've made progress and vivado now runs correctly.

However now I get a problem with gcc reporting unrecognised command line switches (see the last section from the make output below). Something's still not right! is it somehow using the wrong compiler?

Sorry to keep asking questions - once I've got through the complete process and the tools work I will be on better footing.


make[1]: Entering directory '/home/laurence/software/redpitaya/RedPitaya/tmp/linux-xlnx-xilinx-v2016.1'
scripts/kconfig/conf --silentoldconfig Kconfig
CHK include/config/kernel.release
WRAP arch/arm/include/generated/asm/bitsperlong.h
WRAP arch/arm/include/generated/asm/cputime.h
WRAP arch/arm/include/generated/asm/current.h
WRAP arch/arm/include/generated/asm/emergency-restart.h
WRAP arch/arm/include/generated/asm/errno.h
WRAP arch/arm/include/generated/asm/ioctl.h
WRAP arch/arm/include/generated/asm/exec.h
WRAP arch/arm/include/generated/asm/ipcbuf.h
WRAP arch/arm/include/generated/asm/kdebug.h
WRAP arch/arm/include/generated/asm/irq_regs.h
WRAP arch/arm/include/generated/asm/local.h
WRAP arch/arm/include/generated/asm/local64.h
WRAP arch/arm/include/generated/asm/mm-arch-hooks.h
WRAP arch/arm/include/generated/asm/msgbuf.h
WRAP arch/arm/include/generated/asm/msi.h
WRAP arch/arm/include/generated/asm/parport.h
WRAP arch/arm/include/generated/asm/param.h
WRAP arch/arm/include/generated/asm/poll.h
WRAP arch/arm/include/generated/asm/resource.h
WRAP arch/arm/include/generated/asm/preempt.h
WRAP arch/arm/include/generated/asm/rwsem.h
WRAP arch/arm/include/generated/asm/seccomp.h
WRAP arch/arm/include/generated/asm/sections.h
WRAP arch/arm/include/generated/asm/segment.h
WRAP arch/arm/include/generated/asm/sembuf.h
WRAP arch/arm/include/generated/asm/serial.h
WRAP arch/arm/include/generated/asm/shmbuf.h
WRAP arch/arm/include/generated/asm/siginfo.h
WRAP arch/arm/include/generated/asm/simd.h
WRAP arch/arm/include/generated/asm/sizes.h
WRAP arch/arm/include/generated/asm/socket.h
WRAP arch/arm/include/generated/asm/sockios.h
WRAP arch/arm/include/generated/asm/termbits.h
WRAP arch/arm/include/generated/asm/termios.h
WRAP arch/arm/include/generated/asm/timex.h
WRAP arch/arm/include/generated/asm/trace_clock.h
WRAP arch/arm/include/generated/asm/unaligned.h
CHK include/generated/uapi/linux/version.h
UPD include/generated/uapi/linux/version.h
UPD include/config/kernel.release
HOSTCC scripts/basic/bin2c
CHK include/generated/utsrelease.h
UPD include/generated/utsrelease.h
Generating include/generated/mach-types.h
CC scripts/mod/empty.o
gcc: error: unrecognized argument in option ‘-mabi=aapcs-linux’
gcc: note: valid arguments to ‘-mabi=’ are: ms sysv
HOSTCC scripts/genksyms/genksyms.o
HOSTCC scripts/dtc/dtc.o
gcc: error: unrecognized command line option ‘-mlittle-endian’
gcc: error: unrecognized command line option ‘-mno-thumb-interwork’
gcc: error: unrecognized command line option ‘-mfpu=vfp’
scripts/Makefile.build:258: recipe for target 'scripts/mod/empty.o' failed
make[3]: *** [scripts/mod/empty.o] Error 1
scripts/Makefile.build:403: recipe for target 'scripts/mod' failed
make[2]: *** [scripts/mod] Error 2
make[2]: *** Waiting for unfinished jobs....
SHIPPED scripts/genksyms/parse.tab.c
HOSTCC scripts/dtc/flattree.o
HOSTCC scripts/dtc/fstree.o
CC kernel/bounds.s
gcc: error: unrecognized argument in option ‘-mabi=aapcs-linux’
gcc: note: valid arguments to ‘-mabi=’ are: ms sysv
gcc: error: unrecognized command line option ‘-mlittle-endian’
gcc: error: unrecognized command line option ‘-mno-thumb-interwork’
gcc: error: unrecognized command line option ‘-mfpu=vfp’
Kbuild:44: recipe for target 'kernel/bounds.s' failed
make[2]: *** [kernel/bounds.s] Error 1
Makefile:986: recipe for target 'prepare0' failed
make[1]: *** [prepare0] Error 2
make[1]: *** Waiting for unfinished jobs....
HOSTCC scripts/dtc/data.o
HOSTCC scripts/dtc/livetree.o
SHIPPED scripts/genksyms/lex.lex.c
SHIPPED scripts/genksyms/keywords.hash.c
SHIPPED scripts/genksyms/parse.tab.h
HOSTCC scripts/genksyms/parse.tab.o
HOSTCC scripts/dtc/treesource.o
HOSTCC scripts/dtc/srcpos.o
HOSTCC scripts/dtc/checks.o
HOSTCC scripts/dtc/util.o
HOSTCC scripts/genksyms/lex.lex.o
SHIPPED scripts/dtc/dtc-lexer.lex.c
SHIPPED scripts/dtc/dtc-parser.tab.h
SHIPPED scripts/dtc/dtc-parser.tab.c
HOSTCC scripts/dtc/dtc-lexer.lex.o
HOSTCC scripts/dtc/dtc-parser.tab.o
HOSTLD scripts/dtc/dtc
HOSTLD scripts/genksyms/genksyms
Makefile:545: recipe for target 'scripts' failed
make[1]: *** [scripts] Error 2
make[1]: Leaving directory '/home/laurence/software/redpitaya/RedPitaya/tmp/linux-xlnx-xilinx-v2016.1'
Makefile.x86:163: recipe for target 'tmp/linux-xlnx-xilinx-v2016.1/arch/arm/boot/uImage' failed
make: *** [tmp/linux-xlnx-xilinx-v2016.1/arch/arm/boot/uImage] Error 2

laurencebarker
Posts: 4
Joined: Mon Nov 14, 2016 5:08 pm

Re: Understanding the compile process

Post by laurencebarker » Sat Nov 19, 2016 11:20 pm

Interesting.... I have re-downloaded the code and re-run make and the process now worked.

The only difference was: I did the export LD_LIBRARY_PATH="" step before running make.

So my sequence will have been something like:

git clone https://github.com/RedPitaya/RedPitaya.git
cd redPitaya
git checkout db21df6b908bf656a0bffe48e1d8009534b0c6dd

. settings.sh
export LD_LIBRARY_PATH=""
mkdir -p dl
export DL=$PWD/dl

make -f Makefile.x86


I've also been able to build Pavel Demin's LED blinker code (Pavel's example was base on a debian development environment, so I wasn't sure of the compile tools would be the same).

xyefa
Posts: 54
Joined: Tue Feb 02, 2016 8:42 pm

Re: Understanding the compile process

Post by xyefa » Wed Jan 11, 2017 7:10 pm

Are these instructions correct? Is there a way to correct the GitHub HEAD so things build out-of-the-box?

<

Nils Roos
Posts: 1441
Joined: Sat Jun 07, 2014 12:49 pm
Location: Königswinter

Re: Understanding the compile process

Post by Nils Roos » Sat Jan 14, 2017 1:53 am

I'd suggest to open an issue about it on github. The Red Pitaya developers probably just forgot to commit some things that they have in their internal repository.

As for the instructions, they should still be valid.

xyefa
Posts: 54
Joined: Tue Feb 02, 2016 8:42 pm

Re: Understanding the compile process

Post by xyefa » Wed Feb 22, 2017 6:36 pm

HrRossi commented on Jan 23
I found out yesterday that it succeeds if you do "make -f Makefile.x86 fpga_all" before, which creates the fpga.zip . Still, it would be nice if the build works out-of-the-box.

Post Reply
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie

Who is online

Users browsing this forum: Google [Bot] and 99 guests