Discussion:
source directory already configured
t***@avm.de
2015-03-23 07:26:26 UTC
Permalink
Hello,

I came across the following issue:

We have one source directory, and part of that is built twice. Once for our
target platform (cross compile, in-tree build) and once for build host (to
make some tests, out-of-tree build).

Now we would like to use the same configure script, just with different
arguments, for the two builds. However when I execute configure the second
time in the build directory for host build then configure exits with the
error message "source directory already configured; run "make distclean"
there first". I understand that this is because the first configure was run
in the actual source directory because we do in-tree builds there.

However, to my understanding it should not be a problem to re-run configure
for an out-of-tree build because the outputs (config.status etc.) are
placed in the out-of-tree directory, so overwriting of files created by the
first configure run is not possible. Indeed, configure does not give an
error when the first build is out-of-tree too, which suggests there is no
conflict between two builds generated by same configure script.

Can you suggest a solution for this, preferably one that does not imply
doing out-of-tree builds for the cross compiled built too. Can I make
configure simply skip that change somehow?

Best regards and thank you in advance
Thomas Martitz
Bert Wesarg
2015-03-23 09:39:35 UTC
Permalink
Thomas,
Post by t***@avm.de
Hello,
We have one source directory, and part of that is built twice. Once for our
target platform (cross compile, in-tree build) and once for build host (to
make some tests, out-of-tree build).
Now we would like to use the same configure script, just with different
arguments, for the two builds. However when I execute configure the second
time in the build directory for host build then configure exits with the
error message "source directory already configured; run "make distclean"
there first". I understand that this is because the first configure was run
in the actual source directory because we do in-tree builds there.
However, to my understanding it should not be a problem to re-run configure
for an out-of-tree build because the outputs (config.status etc.) are
placed in the out-of-tree directory, so overwriting of files created by the
first configure run is not possible. Indeed, configure does not give an
error when the first build is out-of-tree too, which suggests there is no
conflict between two builds generated by same configure script.
Can you suggest a solution for this, preferably one that does not imply
doing out-of-tree builds for the cross compiled built too. Can I make
configure simply skip that change somehow?
we (from the HPC community) are facing a similar problem, we solved it
in Score-P [1] by having a new top-level configure, which calls
sub-configures for the actual builds twice, one for the cross-compile
and one for the build host, each with different arguments (this is a
very simplified scatch of our approach). Though it is not done with
vanilla autotools features, but we try to keep this build framework
generic and it is used by multiple (tightly coupled) packages already.

If this sounds like a approach you are willing to pursuit, than don't
hesitate to contact the ScoreP team.

Regards,
Bert

[1] score-p.org
Post by t***@avm.de
Best regards and thank you in advance
Thomas Martitz
_______________________________________________
Autoconf mailing list
https://lists.gnu.org/mailman/listinfo/autoconf
Loading...