clangupc / clang-upc

Clang UPC Front-End
https://clangupc.github.io/
Other
16 stars 5 forks source link

OSX: parallel make failure - related to upc.ld or linker script dependency? #7

Closed swatanabe closed 11 years ago

swatanabe commented 11 years ago

On MacOS, I have tried building Clang UPC twice with -j12 (on an 8 HT/4 core system) and it fails the same way.

Scanning dependencies of target upc-link-script Scanning dependencies of target upc-headers Scanning dependencies of target upc-header Scanning dependencies of target profile_rt-shared Scanning dependencies of target LLVMHello [ 0%] [ 0%] [ 0%] [ 0%] [ 0%] [ 0%] [ 0%] [ 0%] [ 0%] [ 0%] Copying clan g's upc_tick.h... . ^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@[ 0%] Generating ../. ./../../lib/clang/3.1/include/upc-lib.h Copying clang's upc_relaxed.h... Copying clang's upc_collective.h... Generating ../../../../lib/upc.ld Copying clang's upc.h... Building C object runtime/libprofile/CMakeFiles/profile_rt-shared.dir/BasicBlockTr acing.c.o ld: unknown option: --verbose Building C object runtime/libprofile/CMakeFiles/profile_rt-shared.dir/BasicBlockTr acing.c.o ld: unknown option: --verbose Building C object runtime/libprofile/CMakeFiles/profile_rt-shared.dir/CommonProfil ing.c.o Building CXX object lib/Transforms/Hello/CMakeFiles/LLVMHello.dir/Hello.cpp.o Building C object runtime/libprofile/CMakeFiles/profile_rt-shared.dir/GCDAProfilin g.c.o Not a GNU ld script? at /eng/upc/dev/gary/clang/src/llvm/tools/clang/runtime/libup c/gen-upc-ld-script.pl line 44, <> line 1. make[2]: * [lib/upc.ld] Error 255 make[1]: * [tools/clang/runtime/libupc/CMakeFiles/upc-link-script.dir/all] Error 2 make[1]: *\ Waiting for unfinished jobs.... [ 0%] [ 0%] [ 1%] [ 1%] Building C object runtime/libprofile/CMakeFiles/profil e_rt-shared.dir/PathProfiling.c.o Built target upc-headers

However, if I run "make -j1", the compiler appears to build properly ... though it does run into problems compiling the libupc runtime (some files are written in .upc) due to pgm_info bug.

nenadv commented 11 years ago

I was able to build it with "-j8" on my system without running into the problem. Eventually I ran in the section problem the way you did.

The problem with the perl script "gen-upc-ld-script.pl" is that it expects GNU ld, which Mac does not use. I see that for libgupc in GUPC we pass in "--without-gnu-ld" in which case we do not run the script on Mac.

swatanabe commented 11 years ago

Use -DLIBUPC_ENABLE_LINK_SCRIPT=FALSE

nenadv commented 11 years ago

I am getting an error:

/bin/sh: /eng/upc/dev/nenad/clang-upc/src/llvm/tools/clang/runtime/libupc/gen-inline-libupc.pl: Permission denied

Like ${PERL_EXECUTABLE} is not defined.

nenadv commented 11 years ago

Also, note the line:

199 # The link script is always enabled 200 set(HAVE_UPC_LINK_SCRIPT TRUE)

Is this supposed to be conditional on LIBUPC_ENABLE_LINK_SCRIPT?

nenadv commented 11 years ago

I was wondering if we could use

if (APPLE) or if (CMAKE_HOST_APPLE)

to disable a link script on MacOS, without the need to specify that on the command line.?