Building LLVM on Cygwin.

Hi,

I followed the build instructions at http://www.aarongray.org/LLVM/BuildingLLVMonCygwin.html to build LLVM and LLVM GCC. Everything went fine except for the ‘make install’ step of llvm. At this step, I am getting a big list of files which are under /cygdrive/c/llvm-2.8/include/llvm and /cygdrive/c/llvm-2.8/include/llvm-c. The error I am getting is:

/usr/bin/install: ./llvm-c/ExecutionEngine.h' and /cygdrive/c/llvm-2.8/include/./llvm-c/ExecutionEngine.h’ are the same file
/usr/bin/install: ./llvm-c/LinkTimeOptimizer.h' and /cygdrive/c/llvm-2.8/include/./llvm-c/LinkTimeOptimizer.h’ are the same file
/usr/bin/install: ./llvm-c/lto.h' and /cygdrive/c/llvm-2.8/include/./llvm-c/lto.h’ are the same file
/usr/bin/install: ./llvm-c/Target.h' and /cygdrive/c/llvm-2.8/include/./llvm-c/Target.h’ are the same file
/usr/bin/install: ./llvm-c/Transforms/IPO.h' and /cygdrive/c/llvm-2.8/include/./llvm-c/Transforms/IPO.h’ are the same file
/usr/bin/install: ./llvm-c/Transforms/Scalar.h' and /cygdrive/c/llvm-2.8/include/./llvm-c/Transforms/Scalar.h’ are the same file
make: *** [install-local] Error 1

I am not sure what I am doing wrong. I also tried a ‘make clean’ and ‘make’. The ‘make’ completed successfully, but it is ‘make install’ that’s giving me the error. Can you please tell me whats going wrong? The built executable are in /cygdrive/c/llvm-2.8/include/llvm/Release/bin.

Thank you.

Sincerely,
Anand Arumugam.

Anand,

I have not tried building llvm-gcc, though, ...

Please show me "/path/to/config.status --version".

I doubt you did configure with "--prefix= /cygdrive/c/llvm-2.8" and
you were trying to build llvm on /cygdrive/c/llvm-2.8
, ... it would be wrong.

In common sense, build directory must be under your home directory or
temporary directory.

...Takumi

Anand,

I have not tried building llvm-gcc, though, …

Please show me “/path/to/config.status --version”.

[Anand] Here is the config.status output taken from ‘/cygdrive/c/llvm-2.8’:

./config.status --version
llvm config.status 2.8
configured by src/configure, generated by GNU Autoconf 2.60,
with options “’–prefix=/cygdrive/c/llvm-2.8’”

I doubt you did configure with “–prefix= /cygdrive/c/llvm-2.8” and
you were trying to build llvm on /cygdrive/c/llvm-2.8
, … it would be wrong.

In common sense, build directory must be under your home directory or
temporary directory.

[Anand] The build has to be done from a different directory than the source. I was doing it from one level up. Whats wrong in the way I had it setup?

So if I have given a different prefix other than the directory from where the build is done, then it will work. Is that what you are saying?

Sure.

And, ... I missed your former article; I guess below.

  - You had attempted iteratively "make install"
  - At your 1st configure, your build directory /cygdrive/c/llvm-2.8
would not contain /cygdrive/c/llvm-2.8/include/llvm_c.
  - At your 1st "make install", you might get failure to attempt to
install include/llvm/Config/* to same directory on the filesystem.
(would succeed to install other include/llvm/*, include/llvm_c/* INTO
THE BUILD DIRECTORY!)
  - At your 2nd build and install, everything went messily!

Do you understand what "--prefix=/cygdrive/c/llvm-2.8" means?
I recommend you should erase all src, build, install directories(rm
-rf /cygdrive/c/llvm-2.8), and retry building on separated directory.

ps. I don't also recommend to build on upper directory
(src=/cygdrive/c/llvm-2.8/src, build=/cygdrive/c/llvm-2.8). Then you
would lose benefit to clean up a build with "rm -rf {build
directory}". An example of recommendation is;
  - src: /home/tsundere/sources/llvm-2.8
  - build: /home/tsundere/working/directory/to/build/llvm
  --prefix=/cygdrive/c/llvm-2.8 (I suggest it would be possible with
--prefix=/usr/local on cygwin)

...Takumi

Hi Anand

Anand,

I have not tried building llvm-gcc, though, ...

Please show me "/path/to/config.status --version".

[Anand] Here is the config.status output taken from '/cygdrive/c/llvm-2.8':

./config.status --version
llvm config.status 2.8
configured by src/configure, generated by GNU Autoconf 2.60,
with options "'--prefix=/cygdrive/c/llvm-2.8'"

...

[Anand] The build has to be done from a different directory than the source.
I was doing it from one level up. Whats wrong in the way I had it setup?

So if I have given a different prefix other than the directory from where
the build is done, then it will work. Is that what you are saying?

Hi Anand,
In your first mail, you wrote:

/cygdrive/c/llvm-2.8/src <--- contains the source extracted from the
llvm-2.8 tar ball.

With "--prefix= /cygdrive/c/llvm-2.8" you are dangerously mixing the
source and install directories.

I usually build from the Subversion, with the following setup:

$HOME/LLVM/llvm <- sources
$HOME/LLVM/build-release <- build dir
--prefix=/usr/local

Csaba

Thanks to both Nakamura & Csaba Raduly. My directory structure was the culprit. I was able to build and install LLVM and LLVM-GCC successfully.

The README.LLVM file that comes with the source is not very clear. It jumps between platforms and makes it difficult to follow it.

Cheers,
Anand.