Epiphany build and test: build runtest for Epiphany #230

Closed
wants to merge 1 commit into
from

Projects

None yet

2 participants

@peteasa
Contributor
peteasa commented Sep 9, 2016

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 peteasa Epiphany build and test: build runtest for Epiphany
Fixes Epiphany build and test.
Creates runtest
links to the correct location for test-driver script

Signed-off-by: Peter Saunderson <peteasa@gmail.com>
22bf315
@olajep

This looks wrong, I don't even understand what you're trying to solve?
How does the tests not work for you?
Please elaborate / provide some output.

Thanks,
Ola

@peteasa
Contributor
peteasa commented Sep 17, 2016

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
Contributor
peteasa commented Sep 21, 2016 edited

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
Member
olajep commented Sep 21, 2016

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
Member
olajep commented Sep 21, 2016 edited

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

@olajep olajep added a commit that referenced this pull request Sep 27, 2016
@olajep olajep build: Fix pure in-tree build
As described in a comment here:
#230

Since make uses VPATH as a search list for both prerequisites and
TARGETS of rules we must not output the host build in the source
tree, which will be in the VPATH for device builds.

This commit moves the host build to a separate directory.
So now we have top level configure, host configure, and (optional)
device configure.

I was going for a separate configure.ac and Makefile.am for the
toplevel, but Autotools didn't want to play along.

Instead we use exactly the same configure.ac and Makefile.am for both
toplevel and subdirs. Add PAL_IS_TOPDIR/PAL_IS_SUBDIR environment
variables and Automake conditionals. These are used to break recursion
(only toplevel have subdirs) and decide what to be built (toplevel only
builds docs).

EXTRA_DIST does not work well with conditional includes so all those
occurances are replaced with noinst_HEADERS.

Signed-off-by: Ola Jeppsson <ola@adapteva.com>
5544875
@peteasa peteasa closed this Nov 4, 2016
@peteasa peteasa deleted the peteasa:epiphany-test branch Nov 4, 2016
@peteasa
Contributor
peteasa commented Nov 4, 2016

Thanks for your fixes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment