Circular Deps from CMake build using makefile

[ 73%] Regenerating
/Users/samuraicrow/Documents/workspace/llvm-trunk-build/tools/llvm-config/LibDeps.txt.tmp

[ 73%] Updating
/Users/samuraicrow/Documents/workspace/llvm-trunk-build/tools/llvm-config/LibDeps.txt
if necessary...
[ 73%] Checking for cyclic dependencies between LLVM libraries.
find-cycles.pl: Circular dependency between *.a files:
find-cycles.pl: libLLVMAsmPrinter.a libLLVMXCoreAsmPrinter.a
find-cycles.pl: Circular dependency between *.a files:
find-cycles.pl: libLLVMSupport.a libLLVMSystem.a
make[2]: *** [tools/llvm-config/FinalLibDeps.txt] Error 2
make[1]: *** [tools/llvm-config/CMakeFiles/llvm-config.target.dir/all] Error 2
make: *** [all] Error 2

That is the error I get when building with make -j2 on my Mac Mini. (It is a
Core 2 Duo with 2 GB of RAM.)

I have been able to build LLVM with XCode projects created with CMake 2.8-3
before but when building Clang also, the build scripts take up too much RAM.
(About 2.6 GB virtual memory not counting the usage by GCC to execute the
build.) I thought I'd try building with Make instead to alleviate some memory
problems. Is there something wrong with the bundled version of PERL that comes
with MacOSX 10.6.6? Will building from the configure script fix matters at all?

Thanks for answering my questions,

--Sam Crow

Samuel Crow <samuraileumas@yahoo.com> writes:

[ 73%] Regenerating
/Users/samuraicrow/Documents/workspace/llvm-trunk-build/tools/llvm-config/LibDeps.txt.tmp

[ 73%] Updating
/Users/samuraicrow/Documents/workspace/llvm-trunk-build/tools/llvm-config/LibDeps.txt
if necessary...
[ 73%] Checking for cyclic dependencies between LLVM libraries.
find-cycles.pl: Circular dependency between *.a files:
find-cycles.pl: libLLVMAsmPrinter.a libLLVMXCoreAsmPrinter.a

Hmmm...

find-cycles.pl: Circular dependency between *.a files:
find-cycles.pl: libLLVMSupport.a libLLVMSystem.a

This one is very odd.

make[2]: *** [tools/llvm-config/FinalLibDeps.txt] Error 2
make[1]: *** [tools/llvm-config/CMakeFiles/llvm-config.target.dir/all] Error 2
make: *** [all] Error 2

That is the error I get when building with make -j2 on my Mac Mini. (It is a
Core 2 Duo with 2 GB of RAM.)

Cannot reproduce on Linux.

Please try this:

make clean
make -j2

If that fails,

make clean
make

I have been able to build LLVM with XCode projects created with CMake 2.8-3
before but when building Clang also, the build scripts take up too much RAM.
(About 2.6 GB virtual memory not counting the usage by GCC to execute the
build.) I thought I'd try building with Make instead to alleviate some memory
problems. Is there something wrong with the bundled version of PERL that comes
with MacOSX 10.6.6? Will building from the configure script fix matters at all?

If the above fails, it would be helpful to know if configure&&make works
(on a new build directory).

Hello Óscar,

The single-threaded build failed the same place as the double threaded build
failed which is the same place I just indicated in my previous post. The
../llvm/configure script version failed with OCaml building with about 600
assembler errors since I built it in AMD64 mode. (Oops.) Should I disable
OCaml from the configure script and try again?

Assembler error, input left in file
/var/folders/5x/5xY2twDzGEKM1pioemi4uE+++TM/-Tmp-/camlasma657d2.s
make[3]: ***
[/Users/samuraicrow/Documents/workspace/trunk-build2/bindings/ocaml/llvm/Debug+Asserts/llvm.cmx]
Error 2
make[2]: *** [all] Error 1
make[1]: *** [ocaml/.makeall] Error 2

Thanks for helping,

--Sam

Samuel Crow <samuraileumas@yahoo.com> writes:

The single-threaded build failed the same place as the double threaded build
failed which is the same place I just indicated in my previous post. The
../llvm/configure script version failed with OCaml building with about 600
assembler errors since I built it in AMD64 mode. (Oops.) Should I disable
OCaml from the configure script and try again?

Yes, please. (The cmake build ignores the OCaml bindings)

Hello Óscar,

This time the autotools version of LLVM trunk build with Clang trunk compiled in
Debug+Asserts mode without complaint with --enable-bindings=none. I suspect
this makes something fishy looking with the CMake build. Do you need logfiles
from configure?

Thanks again,

--Sam

Samuel Crow <samuraileumas@yahoo.com> writes:

This time the autotools version of LLVM trunk build with Clang trunk compiled in
Debug+Asserts mode without complaint with --enable-bindings=none. I suspect
this makes something fishy looking with the CMake build. Do you need logfiles
from configure?

I'm clueless about what's happening there. The cyclic dependency among
LLVMSupport and LLVMSystem makes no sense (the other cyclic dependency
is a different history) Others are using cmake on OS/X and didn't report
any problem. I'll like to help, but can't think of anything that could
be wrong on the cmake build (apart from compiler options: make VERBOSE=1
will show the full command lines and you can compare the invocations or
the compiler and linker for the cmake and the `configure' build.) Sorry.

I have attached the logfiles here.

Thanks again for helping me,

--Sam

cmake.log (911 KB)

automake.log (2.14 MB)

Samuel Crow <samuraileumas@yahoo.com> writes:

I have attached the logfiles here.

I think you didn't set CMAKE_BUILD_TYPE while configuring the cmake
build. On your build directory, please do:

make clean
cmake -DCMAKE_BUILD_TYPE=Debug path/to/your/llvm/source/root
make

If that doesn't work, show the exact command lines you used for invoking
cmake and the `configure' script.

Sorry I wasted your time Óscar and the rest of the mailing list,

I discovered the problem: I was building in one directory but generating the
CMake build scripts in an identically named folder in the parent directory. I
was using stale build scripts. That's why they looked the same each time
despite my having regenerated the build-scripts with the CMake GUI. Once I got
the scripts generated in the right directory, they built 100% correctly.

My apologies,

--Sam Crow