On 06/19/2014 12:19 PM, Ilya Verbin wrote:
On 18 Jun 16:22, Bernd Schmidt wrote:
What I think you need to do is
For the first compiler:
--enable-as-accelerator-for=x86_64-pc-linux-gnu
--target=x86_64-intelmic-linux-gnu --prefix=/somewhere
No --enable-accelerator options at all. This should work, if it
doesn't let me know what you find in /somewhere after installation
for both compilers.
It doesn't work without --enable-accelerator:
--enable-as-accelerator-for requires --enable-accelerator
make[1]: *** [configure-gcc] Error 1
Sorry for the delayed reply, I was travelling. There seem to be some
thinkos in the configure script and Makefile; can you try the following
(don't forget to regenerate configure)? It seems to work for ptx (with
some additional changes to allow ptx builds without --enable-accelerator).
Bernd
Index: configure.ac
===================================================================
--- configure.ac (revision 435407)
+++ configure.ac (working copy)
@@ -905,15 +905,12 @@ AC_SUBST(enable_accelerator)
AC_ARG_ENABLE(as-accelerator-for,
[AS_HELP_STRING([--enable-as-accelerator-for], [build compiler as accelerator target for given host])],
[
- if test $enable_accelerator = no; then
- echo "--enable-as-accelerator-for requires --enable-accelerator"
- exit 1;
- fi
AC_DEFINE(ACCEL_COMPILER, 1,
[Define if this compiler should be built and used as the target
device compiler for OpenACC.])
enable_as_accelerator=yes
- tool_prefix=${enable_as_accelerator_for}-accel-${enable_accelerator}
+ sedscript="s#${target_noncanonical}#${enable_as_accelerator_for}-accel-${target_noncanonical}#"
+ program_transform_name=`echo $program_transform_name | sed $sedscript`
accel_dir_suffix=/accel/${target_noncanonical}
real_target_noncanonical=${enable_as_accelerator_for}
ALL_ACCEL=all-accel
Index: Makefile.in
===================================================================
--- Makefile.in (revision 435407)
+++ Makefile.in (working copy)
@@ -69,7 +69,6 @@ program_transform_name := @program_trans
# Normally identical to target_noncanonical, except for compilers built
# as accelerator targets.
-tool_prefix = @tool_prefix@
accel_dir_suffix = @accel_dir_suffix@
# Directory where sources are, from where we are.
@@ -777,7 +776,7 @@ BUILD_CPPFLAGS= -I. -I$(@D) -I$(srcdir)
# Actual name to use when installing a native compiler.
GCC_INSTALL_NAME := $(shell echo gcc|sed '$(program_transform_name)')
-GCC_TARGET_INSTALL_NAME := $(tool_prefix)-$(shell echo gcc|sed '$(program_transform_name)')
+GCC_TARGET_INSTALL_NAME := $(target_noncanonical)-$(shell echo gcc|sed '$(program_transform_name)')
CPP_INSTALL_NAME := $(shell echo cpp|sed '$(program_transform_name)')
GCOV_INSTALL_NAME := $(shell echo gcov|sed '$(program_transform_name)')
@@ -3247,25 +3246,21 @@ install-common: native lang.install-comm
# Install the driver program as $(target_noncanonical)-gcc,
# $(target_noncanonical)-gcc-$(version), and also as gcc if native.
install-driver: installdirs xgcc$(exeext)
- -install_name=$(GCC_INSTALL_NAME); \
- if test "@enable_as_accelerator@" = "yes" ; then \
- install_name=$(GCC_TARGET_INSTALL_NAME); \
- fi; \
- rm -f $(DESTDIR)$(bindir)/$${install_name}$(exeext); \
- $(INSTALL_PROGRAM) xgcc$(exeext) $(DESTDIR)$(bindir)/$${install_name}$(exeext)
+ -rm -f $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext)
+ -$(INSTALL_PROGRAM) xgcc$(exeext) $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext)
-if test "@enable_as_accelerator@" != "yes" ; then \
- if [ "$(GCC_INSTALL_NAME)" != "$(tool_prefix)-gcc-$(version)" ]; then \
- rm -f $(DESTDIR)$(bindir)/$(tool_prefix)-gcc-$(version)$(exeext); \
- ( cd $(DESTDIR)$(bindir) && \
- $(LN) $(GCC_INSTALL_NAME)$(exeext) $(tool_prefix)-gcc-$(version)$(exeext) ); \
- fi; \
- if [ ! -f gcc-cross$(exeext) ] \
- && [ "$(GCC_INSTALL_NAME)" != "$(GCC_TARGET_INSTALL_NAME)" ]; then \
- rm -f $(DESTDIR)$(bindir)/$(tool_prefix)-gcc-tmp$(exeext); \
- ( cd $(DESTDIR)$(bindir) && \
- $(LN) $(GCC_INSTALL_NAME)$(exeext) $(tool_prefix)-gcc-tmp$(exeext) && \
- mv -f $(tool_prefix)-gcc-tmp$(exeext) $(GCC_TARGET_INSTALL_NAME)$(exeext) ); \
- fi; \
+ if [ "$(GCC_INSTALL_NAME)" != "$(target_noncanonical)-gcc-$(version)" ]; then \
+ rm -f $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-$(version)$(exeext); \
+ ( cd $(DESTDIR)$(bindir) && \
+ $(LN) $(GCC_INSTALL_NAME)$(exeext) $(target_noncanonical)-gcc-$(version)$(exeext) ); \
+ fi; \
+ if [ ! -f gcc-cross$(exeext) ] \
+ && [ "$(GCC_INSTALL_NAME)" != "$(GCC_TARGET_INSTALL_NAME)" ]; then \
+ rm -f $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-tmp$(exeext); \
+ ( cd $(DESTDIR)$(bindir) && \
+ $(LN) $(GCC_INSTALL_NAME)$(exeext) $(target_noncanonical)-gcc-tmp$(exeext) && \
+ mv -f $(target_noncanonical)-gcc-tmp$(exeext) $(GCC_TARGET_INSTALL_NAME)$(exeext) ); \
+ fi; \
fi
# Install the info files.