parallella / pal

An optimized C library for math, parallel processing and data movement
Apache License 2.0
301 stars 110 forks source link

Epiphany build and test: build runtest for Epiphany #230

Closed peteasa closed 8 years ago

peteasa commented 8 years ago

Fixes Epiphany build and test. Creates runtest links to the correct location for test-driver script

Signed-off-by: Peter Saunderson peteasa@gmail.com

peteasa commented 8 years ago

I provided brief comments to the forum - https://parallella.org/forums/viewtopic.php?f=54&t=3771

devices/epiphany/tests/runtest is not created so the epiphany tests dont run

Also make check looks for the configuration scripts in devices/epiphany/config/test-driver and that does not exist.

I can provide more logs if you require them when I am back in the office

Peter

peteasa commented 8 years ago

PalTestForOla.tar.gz

Uploaded logs as per request git clone https://github.com/parallella/pal.git autoreconf -i --force ./configure --enable-device-epiphany make -k > make.log 2>&1 ; make install > make-install.log 2>&1 make check > make-check.log 2>&1

pal/devices/epiphany/config.log -> configDevicesEpiphany.log etc.

Note that runtest is not created in devices/epiphany/tests/runtest # ls devices/epiphany/tests/runtest ls: cannot access 'devices/epiphany/tests/runtest': No such file or directory Note devices/epiphany/Makefile (MakefileDevicesEpiphany): am__append_39 = tests/runtest$(BUILD_EXEEXT) am__append_40 = tests

Note that devices/epiphany/Makefile (MakefileDevicesEpiphany): LOG_DRIVER = $(SHELL) $(top_builddir)/config/test-driver

but top_builddir is pal/devices/epiphany..

olajep commented 8 years ago

make.log:

/usr/lib/epiphany-elf/gcc/epiphany-elf/5.2.0/../../../../../epiphany-elf/bin/ld: section .data_bank1 loaded at [0000000000002000,00000000000027ff] overlaps section .text loaded at [00000000000007c8,0000000000002763]
/usr/lib/epiphany-elf/gcc/epiphany-elf/5.2.0/../../../../../epiphany-elf/bin/ld: section .fini loaded at [0000000000002764,000000000000277d] overlaps section .data_bank1 loaded at [0000000000002000,00000000000027ff]
collect2: error: ld returned 1 exit status
Makefile:6299: recipe for target 'examples/math/matmul/matmul-dev-epiphany' failed
make[2]: *** [examples/math/matmul/matmul-dev-epiphany] Error 1

Not related, (but I will fix it).

(I'll address the real issue in a separate comment)

olajep commented 8 years ago

Pure in-tree builds are broken:

So this won't work:

git clone https://github.com/parallella/pal.git
cd pal
./bootstrap
./configure --enable-device-epiphany
make
...

... but this will:

git clone https://github.com/parallella/pal.git
cd pal
./bootstrap
mkdir build
cd build
../configure --enable-device-epiphany
make
...

... and this:

git clone https://github.com/parallella/pal.git
cd pal
./bootstrap
cd ..
mkdir build
cd build
../pal/configure --enable-device-epiphany
make
...

The pure in-tree build is broken because IMHO make VPATH is broken by design because of this:

make uses VPATH as a search list for both prerequisites and TARGETS of rules

So when you build the device in a pure in-tree build the Automake will set VPATH to point to the top level source directory, so source files can be found. But this directory is also the output directory for the host build! Example:

$ make tests/runtest
gcc -g -O2   tests/runtest.simple.c -o tests/runtest 
$ cd devices/epiphany
$ make tests/runtest
make: `./../../tests/runtest' is up to date.
$ ls tests/runtest
ls: cannot access tests/runtest: No such file or directory

Ugh!

... so we need to configure the host build in a separate directory, but we want to use the same configure.ac and Makefile.am (+all Makemodule.am files) across host/device...

Note that devices/epiphany/Makefile (MakefileDevicesEpiphany): LOG_DRIVER = $(SHELL) $(top_builddir)/config/test-driver

but top_builddir is pal/devices/epiphany..

That's weird, this is what I have:

grep "LOG_DRIVER =" devices/epiphany/Makefile 
LOG_DRIVER = $(SHELL) $(top_srcdir)/config/test-driver
TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/config/test-driver

Does it help if you add --force to autoreconf?

autoreconf -i --force

// Ola

peteasa commented 8 years ago

Thanks for your fixes