Page 1 of 2

Problem building clang on Windows 7

Posted: Wed Dec 11, 2013 3:22 pm
by tikkun
Hey.
Followed the instructions for installing Codelite and clang found here on the website,(you forgot to add the MinGW bin folder to the PATH variable btw... :) )
Everything was cool until:

Code: Select all

[ 86%] Built target clangFrontend
[ 86%] Building CXX object tools/clang/lib/CodeGen/CMakeFiles/clangCodeGen.dir/CGBuiltin.cpp.ob
j
C:\clang-src\llvm\tools\clang\lib\CodeGen\CGBuiltin.cpp: In function 'llvm::Value* EmitAArch64S
calarBuiltinExpr(clang::CodeGen::CodeGenFunction&, unsigned int, const clang::CallExpr*)':
C:\clang-src\llvm\tools\clang\lib\CodeGen\CGBuiltin.cpp:2134:11: error: 'aarch64_neon_vcvtint2f
ps' is not a member of 'llvm::Intrinsic'
C:\clang-src\llvm\tools\clang\lib\CodeGen\CGBuiltin.cpp:2139:11: error: 'aarch64_neon_vcvtint2f
pu' is not a member of 'llvm::Intrinsic'
C:\clang-src\llvm\tools\clang\lib\CodeGen\CGBuiltin.cpp:2537:11: error: 'aarch64_neon_vcvtfxs2f
p_n' is not a member of 'llvm::Intrinsic'
C:\clang-src\llvm\tools\clang\lib\CodeGen\CGBuiltin.cpp:2542:11: error: 'aarch64_neon_vcvtfxu2f
p_n' is not a member of 'llvm::Intrinsic'
C:\clang-src\llvm\tools\clang\lib\CodeGen\CGBuiltin.cpp:2547:11: error: 'aarch64_neon_vcvtfp2fx
s_n' is not a member of 'llvm::Intrinsic'
C:\clang-src\llvm\tools\clang\lib\CodeGen\CGBuiltin.cpp:2552:11: error: 'aarch64_neon_vcvtfp2fx
u_n' is not a member of 'llvm::Intrinsic'
tools\clang\lib\CodeGen\CMakeFiles\clangCodeGen.dir\build.make:129: recipe for target `tools/cl
ang/lib/CodeGen/CMakeFiles/clangCodeGen.dir/CGBuiltin.cpp.obj' failed
mingw32-make[2]: *** [tools/clang/lib/CodeGen/CMakeFiles/clangCodeGen.dir/CGBuiltin.cpp.obj] Er
ror 1
CMakeFiles\Makefile2:11424: recipe for target `tools/clang/lib/CodeGen/CMakeFiles/clangCodeGen.
dir/all' failed
mingw32-make[1]: *** [tools/clang/lib/CodeGen/CMakeFiles/clangCodeGen.dir/all] Error 2
makefile:135: recipe for target `all' failed
mingw32-make: *** [all] Error 2

...not sure what is needed to fix this since I'm a relative n00b, so I ask with all sincerity, HELP!
END TRANSMISSION...

Re: Problem building clang on Windows 7

Posted: Wed Dec 11, 2013 5:09 pm
by eranif
I could try this at home, but I think it is a question that should be as on the clang/llvm dev list, or on their IRC channel

Eran

Re: Problem building clang on Windows 7

Posted: Wed Dec 11, 2013 5:44 pm
by tikkun
Crap! I was hoping you'd run afoul of the issue previously... oh well. I'll take a further look myself and xpost as you suggested. I will post back with solution, when found. Pax.

END TRANSMISSION...

Re: Problem building clang on Windows 7

Posted: Thu Dec 12, 2013 8:54 am
by tikkun
Hey again.
Well after not hearing back from the clang/llvm lists, I tried my own methods:
  • 1. deleted the contents of the build directory and restarted from scratch... failed.

    2. read the clang webpage found here which uses Visual Studio as an example.

    3. web searched and found a similar problem with the solution here. didn't feel like MinGW64 was necessary, I just downloaded the MSYS files.

    4. Trashed the build directory then noticed that it was in the llvm directory(trashed it as well); recreated it in the clang-src directory.

    5. I had a feeling from the errors that maybe it was SlikSvn, so I used the svn version that came with the MSYS binaries to checkout the sources again.

    6. ran cmake: C:\clang-src\build>cmake -G "MSYS Makefiles" ..\llvm (Yeah.)

    7. then: C:\clang-src\build>mingw32-make (it got to about 42% completion before it choked on SlikSvn[culprit?] using a new format) promptly removed it from the PATH.

    8. ran mingw32-make again: it completed successfully about thirty minutes ago.
I'm too tired to take clang and Codelite out for a test drive now... tomorrow's soon enough.

Re: Problem building clang on Windows 7

Posted: Thu Dec 12, 2013 9:57 am
by eranif
You should know that clang is not ready for prime time on Windows
The generated code will crash too often (especially when exceptions are involved)

Eran

Re: Problem building clang on Windows 7

Posted: Thu Dec 12, 2013 8:49 pm
by tikkun
Hola.
read here that clang WORKS with cygwin 1.7.... hmmm. I'll get back to you on that one.
I did take test drive: new project clang console app
  • dropped clang.exe into the MinGW binaries folder

    ran build>build project :
    • Code: Select all

      C:\Windows\system32\cmd.exe /c "mingw32-make.exe -j 2 -e -f  Makefile"
      ----------Building project:[ test - Debug ]----------
      mingw32-make[1]: Entering directory `C:/Users/xxxx/Documents/test/test'
      codelitegcc clang -c  "C:/Users/xxxx/Documents/test/test/main.c" -g -O0 -Wall  -o ./Debug/main.o -I. -I.
      In file included from C:/Users/xxxx/Documents/test/test/main.c:1:
      c:\MinGW-4.7.1\bin\..\lib\clang\3.5\../../../include\stdio.h:26:10: fatal error: 'stddef.h' file not found
      #include <stddef.h>
               ^
      1 error generated.
      mingw32-make[1]: *** [Debug/main.o] Error 1
      test.mk:92: recipe for target `Debug/main.o' failed
      mingw32-make[1]: Leaving directory `C:/Users/xxxx/Documents/test/test'
      mingw32-make.exe: *** [All] Error 2
      Makefile:4: recipe for target `All' failed
      1 errors, 1 warnings
      
    I tried deleting clang.exe and just made it a shortcut, but windows ain't Unix..., so I finally gave up and copied the lib/clang folder from the build directory into the MinGW lib directory. Works fine now ...
I see that you previously had an option to tell Codelite(<5.2?) where clang.exe was located; any plans on putting that back?(seeing all the fun I just had a real n00b would be crying right about now...). Thanks.

Re: Problem building clang on Windows 7

Posted: Thu Dec 12, 2013 9:41 pm
by eranif
tikkun wrote:I see that you previously had an option to tell Codelite(<5.2?) where clang.exe was located; any plans on putting that back?(seeing all the fun I just had a real n00b would be crying right about now...). Thanks.
Settings -> Build Settings -> Compilers -> clang++ -> Tools

Just set the path the clang's bin folder in the 'PATH environment variable' field:

Code: Select all

$PATH;C:\path\to\clang\bin\folder
When I last tried clang (3.3) it crashed miserably on Windows whenver I used STL code
I will build clang 3.5 now and give it another try
Eran

Re: Problem building clang on Windows 7

Posted: Thu Dec 12, 2013 10:13 pm
by eranif
I just updated to clang trunk ran a quick test:
- Debugging is very limited (I can not set breakpoints inside classes...)
- Linking will fail when using exceptions, I needed to compile my sample code with -fno-exceptions flags passed to the compiler

So it is still not ready for prime time
Eran

Re: Problem building clang on Windows 7

Posted: Thu Dec 12, 2013 10:23 pm
by tikkun
Hey Eran.
Scrapped what I had(deleted clang.exe from MinGW bin folder and clang directory from MinGW lib folder). Did the PATH update as requested, result:

Code: Select all

C:\Windows\system32\cmd.exe /c "mingw32-make.exe -j 2 -e -f  Makefile"
----------Building project:[ test - Debug ]----------
mingw32-make[1]: Entering directory `C:/Users/nikita/Documents/test/test'
codelitegcc clang -c  "C:/Users/xxxx/Documents/test/test/main.c" -g -O0 -Wall  -o ./Debug/main.o -I. -I.
C:/Users/xxxx/Documents/test/test/main.c:1:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
         ^
1 error generated.
mingw32-make[1]: *** [Debug/main.o] Error 1
mingw32-make.exe: *** [All] Error 2
test.mk:92: recipe for target `Debug/main.o' failed
mingw32-make[1]: Leaving directory `C:/Users/xxxx/Documents/test/test'
Makefile:4: recipe for target `All' failed
1 errors, 0 warnings

not really sure what to do next about this... I will still investigate cygwin though.

Re: Problem building clang on Windows 7

Posted: Thu Dec 12, 2013 11:48 pm
by tikkun
Still getting the error for missing header... took screenshot and attached. This is what you wanted, correct?
build-settings.png