Errors building clang with mingw

I followed the instructions on the clang "Getting Started" page. running '../llvm/configure' worked fine. Running 'make' worked for a long while but finally gave me this error:

"make[1]: Entering directory `/c/Programming/VersionControl/clangbuild/tools/llvm-config'
llvm[1]: Regenerating LibDeps.txt.tmp
'C:' is not recognized as an internal or external command,
operable program or batch file.
nm failed at c:/Programming/VersionControl/llvm/utils/GenLibDeps.pl line 230.
make[1]: *** [/c/Programming/VersionControl/clangbuild/tools/llvm-config/LibDeps.txt.tmp] Error 255
make[1]: Leaving directory `/c/Programming/VersionControl/clangbuild/tools/llvm-config'
make: *** [all] Error 1"

I then tried running "make" again and eventually received:

"make[2]: Leaving directory `/c/Programming/VersionControl/clangbuild/tools/llvm-config'
llvm-config: unknown component name: bitreader
make[2]: Entering directory `/c/Programming/VersionControl/clangbuild/tools/opt'
/c/Programming/VersionControl/llvm/Makefile.rules:959: *** llvm-config --libs failed. Stop.
make[2]: Leaving directory `/c/Programming/VersionControl/clangbuild/tools/opt'
make[1]: *** [opt/.makeall] Error 2
make[1]: Leaving directory `/c/Programming/VersionControl/clangbuild/tools'
make: *** [all] Error 1"

Anybody have any idea what has gone wrong in this process ?

I followed the instructions on the clang "Getting Started" page. running
'../llvm/configure' worked fine. Running 'make' worked for a long while
but finally gave me this error:

"make[1]: Entering directory
`/c/Programming/VersionControl/clangbuild/tools/llvm-config'
llvm[1]: Regenerating LibDeps.txt.tmp
'C:' is not recognized as an internal or external command,
operable program or batch file.
nm failed at c:/Programming/VersionControl/llvm/utils/GenLibDeps.pl line
230.
make[1]: ***
[/c/Programming/VersionControl/clangbuild/tools/llvm-config/LibDeps.txt.tmp]
Error 255
make[1]: Leaving directory
`/c/Programming/VersionControl/clangbuild/tools/llvm-config'
make: *** [all] Error 1"

I then tried running "make" again and eventually received:

"make[2]: Leaving directory
`/c/Programming/VersionControl/clangbuild/tools/llvm-config'
llvm-config: unknown component name: bitreader
make[2]: Entering directory
`/c/Programming/VersionControl/clangbuild/tools/opt'
/c/Programming/VersionControl/llvm/Makefile.rules:959: *** llvm-config
--libs failed. Stop.
make[2]: Leaving directory
`/c/Programming/VersionControl/clangbuild/tools/opt'
make[1]: *** [opt/.makeall] Error 2
make[1]: Leaving directory `/c/Programming/VersionControl/clangbuild/tools'
make: *** [all] Error 1"

Anybody have any idea what has gone wrong in this process ?

When I want to build with MinGW I do this from the normal cmd.exe
command prompt:

cd C:\llvm
mkdir Build
cd Build
cmake -G "MinGW Makefiles" ..
make

Binaries will be in llvm\Build\bin

Edward Diener <eldlistmailingz@tropicsoft.com>
writes:

I followed the instructions on the clang "Getting Started" page. running
'../llvm/configure' worked fine. Running 'make' worked for a long while
but finally gave me this error:

"make[1]: Entering directory
`/c/Programming/VersionControl/clangbuild/tools/llvm-config'
llvm[1]: Regenerating LibDeps.txt.tmp
'C:' is not recognized as an internal or external command,
operable program or batch file.
nm failed at c:/Programming/VersionControl/llvm/utils/GenLibDeps.pl line
230.
make[1]: ***
[/c/Programming/VersionControl/clangbuild/tools/llvm-config/LibDeps.txt.tmp]
Error 255
make[1]: Leaving directory
`/c/Programming/VersionControl/clangbuild/tools/llvm-config'
make: *** [all] Error 1"

Most likely the build is using a non-MSYS Perl install.

I then tried running "make" again and eventually received:

"make[2]: Leaving directory
`/c/Programming/VersionControl/clangbuild/tools/llvm-config'
llvm-config: unknown component name: bitreader
make[2]: Entering directory
`/c/Programming/VersionControl/clangbuild/tools/opt'
/c/Programming/VersionControl/llvm/Makefile.rules:959: *** llvm-config
--libs failed. Stop.
make[2]: Leaving directory
`/c/Programming/VersionControl/clangbuild/tools/opt'
make[1]: *** [opt/.makeall] Error 2
make[1]: Leaving directory `/c/Programming/VersionControl/clangbuild/tools'
make: *** [all] Error 1"

That's probably due to the failed generaion of llvm-config
above. llvm-config is an script used for determining library
dependencies and is used by the configure&make build. At some point on
the build a tool determines the mutual dependencies among the multiple
LLVM libraries and that information is embedded on llvm-config.

[snip]

This gives me:

CMake Error: The source directory "C:/Programming/VersionControl/llvm/build" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.

I do not see how you can build from a 'build" directory if CMake needs to be in some other directory to generate its files.

Did you miss the ".." at the end of the cmake command?

Reid

Reid Kleckner <reid.kleckner@gmail.com>
writes:

When I want to build with MinGW I do this from the normal cmd.exe
command prompt:

cd C:\llvm
mkdir Build
cd Build
cmake -G "MinGW Makefiles" ..
make

Binaries will be in llvm\Build\bin

This gives me:

CMake Error: The source directory
"C:/Programming/VersionControl/llvm/build" does not appear to contain
CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.

I do not see how you can build from a 'build" directory if CMake needs
to be in some other directory to generate its files.

Did you miss the ".." at the end of the cmake command?

Two more notes:

If you want to build optimized binaries, use

cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release ..

When you are using makefiles, it is a good thing to specify if you want
optimized or debug binaries.

Second, for MinGW makefiles instead of `make' maybe you need
`mingw32-make'. Or just use

cmake --build .

(note the last dot) which invokes the build tool for you.

I installed MSYS perl. I can see it in my msys/bin directory as perl.exe and perl5.6.1.exe. When I tried to run 'configure' again it now gives me:

checking for perl... /bin/perl
checking for Perl 5.006 or newer... not found
configure: error: perl is required but was not found, please install it

I have no idea why it thinks that perl does not exist or is not the right version.

Edward Diener <eldlistmailingz@tropicsoft.com>
writes:

Most likely the build is using a non-MSYS Perl install.

I installed MSYS perl. I can see it in my msys/bin directory as perl.exe
and perl5.6.1.exe. When I tried to run 'configure' again it now gives me:

checking for perl... /bin/perl
checking for Perl 5.006 or newer... not found
configure: error: perl is required but was not found, please install it

I have no idea why it thinks that perl does not exist or is not the
right version.

Maybe you have the other perl before the MSYS one on the PATH?

Check the output of

perl --version

from the MSYS shell.

I did not have MSYS perl at all. Now that I have it I will try ../llvm/configure and make again.

I am now getting, from make:

make[2]: Leaving directory `/c/Programming/VersionControl/clangbuild/tools/llvm- config'
llvm-config: unknown component name: bitreader
make[2]: Entering directory `/c/Programming/VersionControl/clangbuild/tools/opt'
/c/Programming/VersionControl/llvm/Makefile.rules:959: *** llvm-config --libs fa iled. Stop.
make[2]: Leaving directory `/c/Programming/VersionControl/clangbuild/tools/opt'
make[1]: *** [opt/.makeall] Error 2
make[1]: Leaving directory `/c/Programming/VersionControl/clangbuild/tools'
make: *** [all] Error 1

Edward,

I installed MSYS perl. I can see it in my msys/bin directory as perl.exe
and perl5.6.1.exe. When I tried to run 'configure' again it now gives me:

checking for perl... /bin/perl
checking for Perl 5.006 or newer... not found
configure: error: perl is required but was not found, please install it

Weird! Please show us generated "config.log", "Makefile.config" and
"include/llvm/Config/config.h" ?

and please try;
$ make VERBOSE=1 -C tools/llvm-config

In my config.log,
configure:8018: checking for perl
configure:8049: result: /bin/perl
configure:8058: checking for Perl 5.006 or newer
configure:8061: result: yes

$ type perl
perl is hashed (/bin/perl)
$ perl --version

This is perl, v5.8.8 built for msys

ps. I am suspicious;

llvm[1]: Regenerating LibDeps.txt.tmp
'C:' is not recognized as an internal or external command,
operable program or batch file.
nm failed at c:/Programming/VersionControl/llvm/utils/GenLibDeps.pl line
230.

would 'nm' be not passed to genlibdeps.pl?

...Takumi

I have missed this article. Please show us your generated files if you
got any troubles on.

...Takumi