Frank Winter
2013-Dec-02 20:09 UTC
[LLVMdev] Configuring for cross-compilation doesn't work
Hi, I am trying to build LLVM 3.4 RC1 with the Intel compiler targeting the Xeon Phi (native). In order to skip the building and execution of a test binary during configuration one needs the set the "-host" option indicating a cross compilation. Intel suggests to use "x86_64-unknown-linux-gnu". However, either using "x86_64-unknown-linux-gnu" or something unknown like "unknown" brings me through the configuration: ../llvm/configure CXX=icpc CC=icc CXXFLAGS="-O3 -mmic" CFLAGS="-O3 -mmic" --host=x86_64-unknown-linux-gnu configure: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used. checking for x86_64-unknown-linux-gnu-clang... icc checking for C compiler default output file name... a.out checking whether the C compiler works... yes ... checking for gcc... gcc configure: error: installation or configuration problem: compiler cannot create executables. make: *** No targets specified and no makefile found. Stop. make: *** No rule to make target `install'. Stop. ../llvm/configure CXX=icpc CC=icc CXXFLAGS="-O3 -mmic" CFLAGS="-O3 -mmic" --host=unknown checking for unknown-clang... icc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... yes checking for suffix of executables... configure: WARNING: Configuring LLVM for an unknown target archicture configure: WARNING: Configuring LLVM for an unknown host archicture checking for gcc... gcc configure: error: installation or configuration problem: compiler cannot create executables. Any ideas? Frank
Frank Winter
2013-Dec-02 20:18 UTC
[LLVMdev] Configuring for cross-compilation doesn't work
Let me add that when not specifying the '--host' option, the whole thing fails as well: ../llvm/configure CXX=icpc CC=icc CXXFLAGS="-O3 -mmic" CFLAGS="-O3 -mmic" checking for C compiler default output file name... a.out checking whether the C compiler works... configure: error: cannot run C compiled programs. If you meant to cross compile, use `--host'. Frank On 02/12/13 15:09, Frank Winter wrote:> Hi, > > I am trying to build LLVM 3.4 RC1 with the Intel compiler targeting > the Xeon Phi (native). In order to skip the building and execution of > a test binary during configuration one needs the set the "-host" > option indicating a cross compilation. Intel suggests to use > "x86_64-unknown-linux-gnu". > > However, either using "x86_64-unknown-linux-gnu" or something unknown > like "unknown" brings me through the configuration: > > ../llvm/configure CXX=icpc CC=icc CXXFLAGS="-O3 -mmic" CFLAGS="-O3 > -mmic" --host=x86_64-unknown-linux-gnu > > configure: WARNING: If you wanted to set the --build type, don't use > --host. > If a cross compiler is detected then cross compile mode will be used. > checking for x86_64-unknown-linux-gnu-clang... icc > checking for C compiler default output file name... a.out > checking whether the C compiler works... yes > ... > checking for gcc... gcc > configure: error: installation or configuration problem: compiler > cannot create executables. > make: *** No targets specified and no makefile found. Stop. > make: *** No rule to make target `install'. Stop. > > > > ../llvm/configure CXX=icpc CC=icc CXXFLAGS="-O3 -mmic" CFLAGS="-O3 > -mmic" --host=unknown > checking for unknown-clang... icc > checking for C compiler default output file name... a.out > checking whether the C compiler works... yes > checking whether we are cross compiling... yes > checking for suffix of executables... > > configure: WARNING: Configuring LLVM for an unknown target archicture > configure: WARNING: Configuring LLVM for an unknown host archicture > checking for gcc... gcc > configure: error: installation or configuration problem: compiler > cannot create executables. > > > Any ideas? > > Frank > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Frank Winter
2013-Dec-02 22:00 UTC
[LLVMdev] Configuring for cross-compilation doesn't work
For the record: CMake is needed for cross compilation. There is a small article how to cross compile with CMake for Xeon Phi: http://software.intel.com/en-us/articles/cross-compilation-for-intel-xeon-phi-coprocessor-with-cmake Frank On 02/12/13 15:18, Frank Winter wrote:> Let me add that when not specifying the '--host' option, the whole > thing fails as well: > > ../llvm/configure CXX=icpc CC=icc CXXFLAGS="-O3 -mmic" CFLAGS="-O3 -mmic" > > checking for C compiler default output file name... a.out > checking whether the C compiler works... configure: error: cannot run > C compiled programs. > If you meant to cross compile, use `--host'. > > Frank > > > On 02/12/13 15:09, Frank Winter wrote: >> Hi, >> >> I am trying to build LLVM 3.4 RC1 with the Intel compiler targeting >> the Xeon Phi (native). In order to skip the building and execution of >> a test binary during configuration one needs the set the "-host" >> option indicating a cross compilation. Intel suggests to use >> "x86_64-unknown-linux-gnu". >> >> However, either using "x86_64-unknown-linux-gnu" or something unknown >> like "unknown" brings me through the configuration: >> >> ../llvm/configure CXX=icpc CC=icc CXXFLAGS="-O3 -mmic" CFLAGS="-O3 >> -mmic" --host=x86_64-unknown-linux-gnu >> >> configure: WARNING: If you wanted to set the --build type, don't use >> --host. >> If a cross compiler is detected then cross compile mode will be >> used. >> checking for x86_64-unknown-linux-gnu-clang... icc >> checking for C compiler default output file name... a.out >> checking whether the C compiler works... yes >> ... >> checking for gcc... gcc >> configure: error: installation or configuration problem: compiler >> cannot create executables. >> make: *** No targets specified and no makefile found. Stop. >> make: *** No rule to make target `install'. Stop. >> >> >> >> ../llvm/configure CXX=icpc CC=icc CXXFLAGS="-O3 -mmic" CFLAGS="-O3 >> -mmic" --host=unknown >> checking for unknown-clang... icc >> checking for C compiler default output file name... a.out >> checking whether the C compiler works... yes >> checking whether we are cross compiling... yes >> checking for suffix of executables... >> >> configure: WARNING: Configuring LLVM for an unknown target archicture >> configure: WARNING: Configuring LLVM for an unknown host archicture >> checking for gcc... gcc >> configure: error: installation or configuration problem: compiler >> cannot create executables. >> >> >> Any ideas? >> >> Frank >> >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Richard Pennington
2013-Dec-02 22:45 UTC
[LLVMdev] Configuring for cross-compilation doesn't work
On 12/02/2013 02:18 PM, Frank Winter wrote:> Let me add that when not specifying the '--host' option, the whole > thing fails as well: > > ../llvm/configure CXX=icpc CC=icc CXXFLAGS="-O3 -mmic" CFLAGS="-O3 -mmic" > > checking for C compiler default output file name... a.out > checking whether the C compiler works... configure: error: cannot run > C compiled programs. > If you meant to cross compile, use `--host'. > > FrankYou also need the --build option. --host should be the target system and --build should be set to the build host. Then configure will use the build host's compiler to build stuff that needs to run there, like tblgen. I use this to cross build my clang/LLVM based tool chain, ELLCC. http://ellcc.org -Rich