2010-10-21 21:53:08     Problem building ndso

Document created by Aaronwu Employee on Aug 23, 2013
Version 1Show Document
  • View in full screen mode

2010-10-21 21:53:08     Problem building ndso

Wojtek Skulski (UNITED STATES)

Message: 94827   

 

I want to develop my own version of ndso (networked oscilloscope). I started by creating my own vendor directory "blkfin-skutek" to avoid messing up ADI's stuff. I copied the entire original ADI's ndso to my directory.

 

I rebuilt the kernel with libpng, libz, and ADI's ndso checked. The kernel built till the very end. I assume it is good news.

 

Then I went to my own ndso directory "/home/uclinux/uClinux-dist/user/blkfin-skutek/ndso". I typed "make all", and gnuplot refused to build. It cannot find the png.h. I serched for "png.h" and I found seven occurrences. Questions:

 

(1) One of these "png.h" must be the correct one, but which one? (The list of all seven is below.)

 

(2) How to modify the ndso Makefile such that I can type "make all" and get my version of ndso compiled?

 

--------   Building gnuplot failed ------

 

The build error messages:

 

$ make all

for i in  thttpd gnuplot src_ndso ; do make -C $i || exit $? ; done

make[1]: Entering directory `/home/uclinux/uClinux-dist/user/blkfin-skutek/ndso/thttpd'

make[1]: Nothing to be done for `all'.

make[1]: Leaving directory `/home/uclinux/uClinux-dist/user/blkfin-skutek/ndso/thttpd'

make[1]: Entering directory `/home/uclinux/uClinux-dist/user/blkfin-skutek/ndso/gnuplot'

cc   -I. -DSHORT_TERMLIST -DHAVE_GETCWD -DHELPFILE=\"/usr/local/share/gnuplot.gih\" -DGNUPLOT_BINDIR=\"/bin\" -DCONTACT=\"bugnuplot@dartmouth.edu\"   -I./term -I/lib/libpng -I/lib/zlib -c term.c

In file included from term.h:62,

                 from term.c:699:

./term/png.trm:95:17: error: png.h: No such file or directory

 

 

---------------------  which png.h is the correct one? -----

 

Which one of the following png.h is to be used, and how to tell make to choose the correct one?

 

$ pwd

/home/uclinux/uClinux-dist

$ find ./ -name png.h -print

./lib/ffmpeg/ffmpeg-svn-11114/libavcodec/png.h

./lib/libpng/libpng-1.2.36/png.h

./lib/libpng/libpng-1.2.35/png.h

./staging/usr/include/png.h

./staging/usr/include/libpng12/png.h

./user/microwin/nxlib/fltk-1.1.8rc3/png/png.h

./user/games/xmame/xmame-0.106/src/png.h

 

 

------------------  make vendor_staging_install   fails -------

 

I made a guess that "staging" is the correct one. So I read the Wiki about "staging" and tried to follow the advice. But it failed as follows. What should I do to make "staging" succeed? (Sudo did not help here. I tried "sudo make vendor_staging_install", but it failed with incorrect PATH. So I gave up on sudo.)

 

$ pwd

/home/uclinux/uClinux-dist

$ make vendor_staging_install

make ARCH=blackfin   -C vendors vendor_staging_install

make[1]: Entering directory `/home/uclinux/uClinux-dist/vendors'

make -C /home/uclinux/uClinux-dist/vendors/SkuTek/BlackVME/. dir_v=/home/uclinux/uClinux-dist/vendors/SkuTek/BlackVME/. -f /home/uclinux/uClinux-dist/vendors/vendors-common.mak vendor_staging_install

make[2]: Entering directory `/home/uclinux/uClinux-dist/vendors/SkuTek/BlackVME'

cp -a /home/uclinux/uClinux-dist/staging/* /opt/uClinux/bfin-uclinux/bfin-uclinux/runtime/

cp /home/uclinux/uClinux-dist/tools/cross-pkg-config /opt/uClinux/bfin-uclinux/bin//bfin-uclinux-pkg-config

cp: cannot create regular file `/opt/uClinux/bfin-uclinux/bin//bfin-uclinux-pkg-config': Permission denied

make[2]: *** [vendor_staging_install] Error 1

make[2]: Leaving directory `/home/uclinux/uClinux-dist/vendors/SkuTek/BlackVME'

make[1]: *** [vendor_staging_install] Error 2

make[1]: Leaving directory `/home/uclinux/uClinux-dist/vendors'

make: *** [vendor_staging_install] Error 2

$

 

----------------------- My ndso Makefile. What is wrong? How to direct it to png.h ? --------

 

My Makefile is derived from ADI's as follows:

 

$ pwd

/home/uclinux/uClinux-dist/user/blkfin-skutek/ndso

$ cat Makefile

dir_y =

dir_n =

dir_  =

 

dir_y += thttpd

dir_y += gnuplot

dir_y += src_ndso

dir_$(CONFIG_USER_NDSO) += src_ndso

dir_$(CONFIG_USER_AWG)  += src_awg

dir_$(CONFIG_USER_PPIFPGACGI)  += src_ppi_fpga_prj

 

all:

        for i in $(dir_y) ; do $(MAKE) -C $$i || exit $$? ; done

 

romfs:

        for i in $(dir_y) ; do $(MAKE) -C $$i $@ || exit $$? ; done

 

        $(ROMFSINST) -e CONFIG_USER_NDSO web_ndso /home/httpd/

        $(ROMFSINST) -e CONFIG_USER_NDSO -s index.htm /home/httpd/index.html

 

        $(ROMFSINST) -e CONFIG_USER_AWG web_awg /home/httpd/

        $(ROMFSINST) -e CONFIG_USER_AWG -s index.htm /home/httpd/index.html

 

        $(ROMFSINST) -e CONFIG_USER_PPIFPGACGI web_ppi_fpga_prj /home/httpd/

        $(ROMFSINST) -e CONFIG_USER_PPIFPGACGI -s index.htm /home/httpd/index.html

 

clean:

        for i in $(dir_y) $(dir_n) $(dir_) ; do $(MAKE) -C $$i $@ || exit $$? ; done

$

QuoteReplyEditDelete

 

 

2010-10-21 21:58:37     Re: Problem building ndso

Mike Frysinger (UNITED STATES)

Message: 94828   

 

if you want to use the vendor staging install stuff, you need write access to the toolchain.  the error output you show is not a bug in the dist.

 

or just use the dist as it was designed:

make user/some/subdir_only

QuoteReplyEditDelete

 

 

2010-10-21 22:19:57     Re: Problem building ndso

Wojtek Skulski (UNITED STATES)

Message: 94829   

 

Mike:

 

thanks a lot. I typed the following and it worked. Where do *you*  find such great tips?

 

$ pwd

/home/uclinux/uClinux-dist

$ make user/blkfin-skutek/ndso_only

$

QuoteReplyEditDelete

 

 

2010-10-22 14:57:14     Re: Problem building ndso

Wojtek Skulski (UNITED STATES)

Message: 94887   

 

Mike:

 

after compiling my own ndso I now want to test it on the board. I chose not to build the entire image because (1) it takes time, and (2) I do not know how to add my own ndso to the menuconfig.

 

So I want to copy my own executable ndso to the board and test it in situ. Here is the problem: when I take the compiled ndso binary and drop it on the board's /bin, it refuses to run correctly. I noticed that the size of my ndso binary is abot 1/2 of the size of ADIs ndso which was in /bin on the board. So my ndso is not a complete file.

 

$ pwd

/home/uclinux/uClinux-dist/user/blkfin-skutek/sdso/src_ndso

$ ls -la ndso

-rwxr--r-- 1 uclinux uclinux 47928 Oct 22 14:24 ndso      <-- 48 kB

 

 

$ pwd

/home/uclinux/uClinux-dist/romfs

$ ls -la ./bin/ndso

-rwxr--r-- 1 uclinux uclinux 84580 Oct 21 20:26 ./bin/ndso    <-- 84 kB

 

I suspect that "make user/blkfin-skutek/ndso_only" is only doing half the job. The other half is romfs installation of the ndso binary. I further suspect that the Makefile is doing romfs install when it is run from menuconfig, but not when it is run by hand.

 

The question: how to run the Makefile such that it will do the complete job of creating the complete ndso binary which I can then copy to the board?

QuoteReplyEditDelete

 

 

2010-10-22 15:23:58     Re: Problem building ndso

Wojtek Skulski (UNITED STATES)

Message: 94888   

 

ooops. I found the file of the proper size. I did not expect that another "ndso" is somewhere else around. It is confusing when several files have the same name.

 

$ pwd

/home/uclinux/uClinux-dist/user/blkfin-skutek/sdso/thttpd

$ ls -la ndso

-rwxr--r-- 1 uclinux uclinux 84580 Oct 22 15:07 ndso    <--- 84 kB

QuoteReplyEditDelete

 

 

2010-10-22 15:46:27     Re: Problem building ndso

Mike Frysinger (UNITED STATES)

Message: 94889   

 

the _only target is doing 100% of what it's supposed to be doing.  if you want to install files into the romfs/ folder, then you need to use the right target.  like `make foo/_romfs`.

QuoteReplyEditDelete

 

 

2010-10-22 19:22:26     Re: Problem building ndso

Wojtek Skulski (UNITED STATES)

Message: 94890   

 

Mike:  There is something weird going on.

 

The targets are working great. In my directory I ran make clean, then make .._only, then make ..._romfs, in this order. I deleted the ndso binary from the romfs/bin, and after make .._romfs it appeared again. Great. But.....

 

...but it is seems to be the same ADI binary all the time. I made changes to the ndso.c file in my own directory. For example, I changed the error mesage from "Can't open /dev/spi" to "Cannot open /dev/spi" in my file. Then I rebuilt ndso as described above. Then I copied from coLinux romfs/bin to the board. Then I started ndso like this "./ndso &".

 

And it still prints the old error message "Can't open /dev/spi" in the web browser. But this original error message no longer exists in the .c file. So it looks as if I am using the original ADI ndso over and over again, rather than mine. It must be hiding somewhere. How is that possible?

 

I cleaned the ADI directory under blkfin-apps. I am not accesing it anyway. Is there any other place on disk where this ADI stuff may be hiding?

QuoteReplyEditDelete

 

 

2010-10-22 21:45:23     Re: Problem building ndso

Wojtek Skulski (UNITED STATES)

Message: 94891   

 

OK, I figured that out. It was very confusing because of file names. The smaller file has to end up on the board in the directory /home/httpd/cgi-bin. Its name should become ndso.cgi. The larger file should end up on the board's directory /bin with a name ndso.

 

It does not seem to be documented anywhere on Wiki. My problems stemmed from the desire to build this stuff by hand and then copy to the board.

 

$ pwd

/home/uclinux/uClinux-dist/user/blkfin-skutek/sdso/src_ndso

$ ls -la ndso

-rwxr--r-- 1 uclinux uclinux 47928 Oct 22 14:24 ndso      <-- becomes  /home/httpd/cgi-bin/ndso.cgi

 

$ pwd

/home/uclinux/uClinux-dist/user/blkfin-skutek/sdso/thttpd

$ ls -la ndso

-rwxr--r-- 1 uclinux uclinux 84580 Oct 22 15:07 ndso    <---becomes /bin/ndso

QuoteReplyEditDelete

 

 

2010-10-26 23:31:23     Re: Problem building ndso

Wojtek Skulski (UNITED STATES)

Message: 95235   

 

A question to Michael Hennerich, who wrote the ndso. (I do not want to start another thread, so let me ask it here.)

 

I am now trying to understand the ndso in order to tweak it to my digitizer, which is quite a bit different from the AD7476-DBRD. In order to tweak I need to understand ndso code. So I started to read the ndso.c and and I was amazed seeing the dac.h and many references to DAC, which does not exist on AD7476-DBRD. Before getting rid of all this stuff, let me make sure I know what is going on. Is DAC intentional, or is it some sort of leftover from a previous project? Is it being used for anything?

Attachments

    Outcomes