[LLVMdev] Building LLVM on Cygwin.

215 views
Skip to first unread message

Anand Arumugam

unread,
Feb 9, 2011, 9:09:57 AM2/9/11
to llv...@cs.uiuc.edu
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.

-------------------------

P.S: Following is the directory structure I am using:

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

The llvm-2.8 was built from
/cygdrive/c/llvm-2.8 folder.

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

The llvm-gcc-4.2-2.8 was built from /cygdrive/c/llvm-gcc-4.2-2.8 folder.

And the directory and its contents where make install is stopping:

aarumug@aarumgxp /cygdrive/c/llvm-2.8
$ cd include/

aarumug@aarumgxp /cygdrive/c/llvm-2.8/include
$ ls
llvm/  llvm-c/

aarumug@aarumgxp /cygdrive/c/llvm-2.8/include
$ cd llvm

aarumug@aarumgxp /cygdrive/c/llvm-2.8/include/llvm
$ ls
ADT/                CallingConv.h     GlobalValue.h     IntrinsicsARM.td      Metadata.h             SymbolTableListTraits.h
AbstractTypeUser.h  CodeGen/          GlobalVariable.h  IntrinsicsAlpha.td    Module.h               System/
Analysis/           CompilerDriver/   InlineAsm.h       IntrinsicsCellSPU.td  OperandTraits.h        Target/
Argument.h          Config/           InstrTypes.h      IntrinsicsPowerPC.td  Operator.h             Transforms/
Assembly/           Constant.h        Instruction.def   IntrinsicsX86.td      Pass.h                 Type.h
Attributes.h        Constants.h       Instruction.h     IntrinsicsXCore.td    PassAnalysisSupport.h  TypeSymbolTable.h
AutoUpgrade.h       DerivedTypes.h    Instructions.h    LLVMContext.h         PassManager.h          Use.h
BasicBlock.h        ExecutionEngine/  IntrinsicInst.h   LinkAllPasses.h       PassManagers.h         User.h
Bitcode/            Function.h        Intrinsics.gen    LinkAllVMCore.h       PassRegistry.h         Value.h
CMakeLists.txt      GVMaterializer.h  Intrinsics.h      Linker.h              PassSupport.h          ValueSymbolTable.h
CallGraphSCCPass.h  GlobalAlias.h     Intrinsics.td     MC/                   Support/

aarumug@aarumgxp /cygdrive/c/llvm-2.8/include/llvm
$ cd ../llvm-c

aarumug@aarumgxp /cygdrive/c/llvm-2.8/include/llvm-c
$ ls
Analysis.h   BitWriter.h  EnhancedDisassembly.h  LinkTimeOptimizer.h  Transforms/
BitReader.h  Core.h       ExecutionEngine.h      Target.h             lto.h

NAKAMURA Takumi

unread,
Feb 9, 2011, 9:40:47 AM2/9/11
to Anand Arumugam, llvmdev
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
_______________________________________________
LLVM Developers mailing list
LLV...@cs.uiuc.edu http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

Anand Arumugam

unread,
Feb 9, 2011, 1:19:00 PM2/9/11
to NAKAMURA Takumi, llvmdev
On Wed, Feb 9, 2011 at 9:40 AM, NAKAMURA Takumi <geek4...@gmail.com> wrote:
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?

NAKAMURA Takumi

unread,
Feb 9, 2011, 8:32:08 PM2/9/11
to Anand Arumugam, llvmdev
On Thu, Feb 10, 2011 at 3:19 AM, Anand Arumugam <anand....@gmail.com> wrote:
> [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'"

> 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)

Csaba Raduly

unread,
Feb 10, 2011, 6:38:40 AM2/10/11
to Anand Arumugam, llvmdev
Hi Anand

On Wed, Feb 9, 2011 at 7:19 PM, Anand Arumugam wrote:


> On Wed, Feb 9, 2011 at 9:40 AM, NAKAMURA Takumi wrote:
>>
>> 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
--
GCS a+ e++ d- C++ ULS$ L+$ !E- W++ P+++$ w++$ tv+ b++ DI D++ 5++
Life is complex, with real and imaginary parts.
"Ok, it boots. Which means it must be bug-free and perfect. " -- Linus Torvalds
"People disagree with me. I just ignore them." -- Linus Torvalds

Anand Arumugam

unread,
Feb 10, 2011, 10:58:37 PM2/10/11
to geek4...@gmail.com, Csaba Raduly, llvmdev
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.
Reply all
Reply to author
Forward
0 new messages