Where is the red pitaya directory ?

Just about everything about Red Pitaya
Post Reply
gregoire_thomas
Posts: 15
Joined: Tue May 17, 2016 12:18 pm

Where is the red pitaya directory ?

Post by gregoire_thomas » Tue May 24, 2016 9:54 am

Hi,

I have followed the instructions given here about "Compiling and running on target" :
http://redpitaya.com/examples-new/

Now i'm able to run the example programs of the Red Pitaya library.
But I can't find the red pitaya directory. Where is it installed ?
I would like to add my own programs in it, in order to compile and run them with :

Code: Select all

make my_program
LD_LIBRARY_PATH=/opt/redpitaya/lib ./my_program
Any ideas ?
Thanks

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

Re: Where is the red pitaya directory ?

Post by Nils Roos » Tue May 24, 2016 11:14 am

If you followed the instructions, the cloned repository is in /root/RedPitaya/

You have (at least) two options to compile your code:

- you put your sourcecode where the Makefile is ("Examples/C/" in the cloned repository) and do "make my_program" in this directory

- you can compile your program anywhere with

Code: Select all

gcc -g -std=gnu99 -Wall -Werror -I/root/RedPitaya/api/include/ -L/root/RedPitaya/api/lib/ -lm -lpthread -lrp -o my_program my_program.c

gregoire_thomas
Posts: 15
Joined: Tue May 17, 2016 12:18 pm

Re: Where is the red pitaya directory ?

Post by gregoire_thomas » Tue May 24, 2016 11:53 am

I forgot to mention that I program in C language ,in Visual Programming, and with a Windows OS.
So I execute the linux commands in the Visual Programming shell.

Maybe that's why the second option that you propose doesn't work.
I get this error : my_program.c : No such file or directory

For the first option is it possible to put my sourcecode I wrote in Visual Programming to the cloned repository ?
I tried this :

Code: Select all

cp my_program.c  RedPitaya/Examples/C/my_program.c
But i get the same error : cp: cannot stat 'my_program.c' : No such file or directory

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

Re: Where is the red pitaya directory ?

Post by Nils Roos » Tue May 24, 2016 12:00 pm

I have no idea how the Visual Programming shell works, so I can't really provide explicit instructions.

It seems to me you should first copy your sourcefile to the desired place in the Red Pitaya's filesystem (eg. with WinSCP).

gregoire_thomas
Posts: 15
Joined: Tue May 17, 2016 12:18 pm

Re: Where is the red pitaya directory ?

Post by gregoire_thomas » Thu May 26, 2016 4:42 pm

Hi,

I'm now working with ubuntu.

I have compiled my code with :

Code: Select all

gcc -g -std=gnu99 -Wall -Werror -I/root/RedPitaya/api/include/ -L/root/RedPitaya/api/lib/ -lm -lpthread -lrp -o my_program my_program.c
but redpitaya/rp.h is not found.

So I'm trying to follow the instructions that you gave on this topic :
viewtopic.php?f=8&t=1411

but I can't build the RP API because :

Code: Select all

cd /root/RedPitaya/
give me a "permission denied" error.
I tried :

Code: Select all

sudo -i
cd RedPitaya
But there is no such file or directory.

Any ideas please ?

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

Re: Where is the red pitaya directory ?

Post by Nils Roos » Thu May 26, 2016 8:06 pm

Maybe it is not so clear in the posts, but these instruction are for compiling on the Red Pitaya in a remote shell, not on your host system.

A more complete list of steps is:
  1. make sure your Red Pitaya can connect to the internet
  2. login to your Red Pitaya with ssh (linux) or PuTTY (Windows)
  3. after login with user root, you are in the /root/ directory
  4. clone the Red Pitaya repository with

    Code: Select all

    git clone https://github.com/RedPitaya/RedPitaya.git
    this will create the RedPitaya/ directory and load all the sources into it
  5. Code: Select all

    cd RedPitaya
  6. Code: Select all

    make api
  7. now your Red Pitaya is prepared to compile your own program with the gcc... command

gregoire_thomas
Posts: 15
Joined: Tue May 17, 2016 12:18 pm

Re: Where is the red pitaya directory ?

Post by gregoire_thomas » Fri May 27, 2016 9:56 am

Thanks that's why I didn't understand !

The last problem is when I use gcc to compile, my code is not found (because it is located on the host system in /home/myname/Documents).
So when I do :

Code: Select all

cd /home/myname/Documents
There is no such file or directory.
Even the gcc command to compile anywhere doesn't work and tells me there's no such file or directory.

How do I copy my code from /home/myname/Documents to /root/RedPitaya/Examples/C ?
I successfully did it but not with the terminal. Now when i do the "ls" command all the examples programs appear but not mine.

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

Re: Where is the red pitaya directory ?

Post by Nils Roos » Fri May 27, 2016 12:59 pm

I should have qualified 'anywhere' a little more carefully :mrgreen:
It's supposed to mean "anywhere on your Red Pitaya's local filesystem."

You can copy files from your system to the Red Pitaya's Examples/C/ folder with

Code: Select all

scp /home/myname/Documents/myfile root@<RedPitaya IP>:/root/RedPitaya/Examples/C/

gregoire_thomas
Posts: 15
Joined: Tue May 17, 2016 12:18 pm

Re: Where is the red pitaya directory ?

Post by gregoire_thomas » Fri May 27, 2016 1:55 pm

Thank you so much, it works now ! :D

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: fbalakirev, KSS and 89 guests