blob: ca038913a6aa37e4ebb9548398778c61531102f6 [file] [log] [blame]
John Criswellc310f622003-10-13 16:13:06 +00001<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
3<h1>
4<center>
5LLVM: Frequently Asked Questions
6</center>
7</h1>
8
9<hr>
10
11<!--=====================================================================-->
12<h2>
Vikram S. Adve04da65a2003-10-25 17:06:55 +000013<a name="license">Licenses</a>
14</h2>
15<!--=====================================================================-->
16
17<dl compact>
18 <dt> <b>Why are the LLVM source code and the front-end distributed
19 under different licenses?</b>
20 <dd>
21 The C/C++ front-ends are based on GCC and must be distributed under
22 the GPL. Our aim is to distribute LLVM source code are a <em>much
23 less restrictive</em> license, in particular one that does not
24 compel users who distribute tools based on modifying the source to
25 redistribute the modified source code as well.
Vikram S. Adve168da7d2003-10-25 17:14:52 +000026 <p>
Vikram S. Adve04da65a2003-10-25 17:06:55 +000027 <dt><b>Does the Illinois Open Source License really qualify
28 as an "open source" license?</b>
29 <dd>The
30 <a href="http://www.opensource.org/licenses/UoI-NCSA.php">
31 UI Open Source License</a> is certified by the
32 Open Source Initiative (OSI).
Vikram S. Adve168da7d2003-10-25 17:14:52 +000033 <p>
Vikram S. Adve04da65a2003-10-25 17:06:55 +000034 <dt> <b>Can I modify LLVM source code and redistribute the modified
35 source?</b>
36 <dd>
37 Yes. The modified source distribution must retain notice both the
38 copyright notice and follow the three bulletted conditions listed in
39 the <a href="releases/1.0/LICENSE.txt">LLVM license</a>.
Vikram S. Adve168da7d2003-10-25 17:14:52 +000040 <p>
Vikram S. Adve04da65a2003-10-25 17:06:55 +000041 <dt> <b>Can I modify LLVM source code and redistribute binaries or
Vikram S. Adve168da7d2003-10-25 17:14:52 +000042 other tools based on it, without redistributing the source?</b>
Vikram S. Adve04da65a2003-10-25 17:06:55 +000043 <dd>
44 Yes, this is why we distribute LLVM under a less restrictive license
45 than GPL, as explained in the first question above.
46 <p>
47</dl>
48<hr>
49
50<!--=====================================================================-->
51<h2>
John Criswellc310f622003-10-13 16:13:06 +000052<a name="source">Source Code</a>
53</h2>
54<!--=====================================================================-->
55
56<dl compact>
57 <dt> <b>In what language is LLVM written?</b>
58 <dd>
59 All of the LLVM tools and libraries are written in C++ with extensive use
60 of the STL.
61 <p>
62
63 <dt><b>How portable is the LLVM source code?</b>
64 <dd>
65 The LLVM source code should be portable to most modern UNIX-like operating
66 systems. Most of the code is written in standard C++ with operating
67 system services abstracted to a support library. The tools required to
68 build and test LLVM have been ported to a plethora of platforms.
69 <p>
70 Some porting problems may exist in the following areas:
71 <ul>
72 <li>The GCC front end code is not as portable as the LLVM suite, so it
73 may not compile as well on unsupported platforms.
74
75 <p>
76
77 <li>The Python test classes are more UNIX-centric than they should be,
78 so porting to non-UNIX like platforms (i.e. Windows, MacOS 9) will
79 require some effort.
80 <p>
81
82 <li>The LLVM build system relies heavily on UNIX shell tools, like the
83 Bourne Shell and sed. Porting to systems without these tools (MacOS 9,
84 Plan 9) will require more effort.
85 </ul>
86</dl>
87
88<hr>
89
90<!--=====================================================================-->
91<h2>
92<a name="build">Build Problems</a>
93</h2>
94<!--=====================================================================-->
95
96<dl compact>
97 <dt><b>When I run configure, it finds the wrong C compiler.</b>
98 <dd>
99 The <tt>configure</tt> script attempts to locate first <tt>gcc</tt> and
100 then <tt>cc</tt>, unless it finds compiler paths set in <tt>CC</tt> and
101 <tt>CXX</tt> for the C and C++ compiler, respectively.
102
103 If <tt>configure</tt> finds the wrong compiler, either adjust your
104 <tt>PATH</tt> environment variable or set <tt>CC</tt> and <tt>CXX</tt>
105 explicitly.
106 <p>
107
108 <dt><b>I compile the code, and I get some error about /localhome</b>.
109 <dd>
110 There are several possible causes for this. The first is that you
111 didn't set a pathname properly when using <tt>configure</tt>, and it
112 defaulted to a pathname that we use on our research machines.
113 <p>
114 Another possibility is that we hardcoded a path in our Makefiles. If
115 you see this, please email the LLVM bug mailing list with the name of
116 the offending Makefile and a description of what is wrong with it.
117
118 <dt><b>The <tt>configure</tt> script finds the right C compiler, but it
119 uses the LLVM linker from a previous build. What do I do?</b>
120 <dd>
121 The <tt>configure</tt> script uses the <tt>PATH</tt> to find
122 executables, so if it's grabbing the wrong linker/assembler/etc, there
123 are two ways to fix it:
124 <ol>
125 <li>Adjust your <tt>PATH</tt> environment variable so that the
126 correct program appears first in the <tt>PATH</tt>. This may work,
127 but may not be convenient when you want them <i>first</i> in your
128 path for other work.
129 <p>
130
131 <li>Run <tt>configure</tt> with an alternative <tt>PATH</tt> that
132 is correct. In a Borne compatible shell, the syntax would be:
133 <p>
134 <tt>PATH=<the path without the bad program> ./configure ...</tt>
135 <p>
136 This is still somewhat inconvenient, but it allows
137 <tt>configure</tt> to do its work without having to adjust your
138 <tt>PATH</tt> permanently.
139 </ol>
140
141 <dt><b>When creating a dynamic library, I get a strange GLIBC error.</b>
142 <dd>
143 Under some operating systems (i.e. Linux), libtool does not work correctly
144 if GCC was compiled with the --disable-shared option. To work around this,
145 install your own version of GCC that has shared libraries enabled by
146 default.
147 <p>
148
149 <dt><b>I've updated my source tree from CVS, and now my build is trying to
150 use a file/directory that doesn't exist.</b>
151 <dd>
152 You need to re-run configure in your object directory. When new Makefiles
153 are added to the source tree, they have to be copied over to the object
154 tree in order to be used by the build.
155 <p>
156
157 <dt><b>I've modified a Makefile in my source tree, but my build tree keeps
158 using the old version. What do I do?</b>
159 <dd>
160 If the Makefile already exists in your object tree, you can just run the
161 following command in the top level directory of your object tree:
162 <p>
163 <tt>./config.status &lt;relative path to Makefile&gt;</tt>
164 <p>
165 If the Makefile is new, you will have to modify the configure script to copy
166 it over.
167 <p>
168
169 <dt><b>I've upgraded to a new version of LLVM, and I get strange build
170 errors.</b>
171 <dd>
172 Sometimes changes to the LLVM source code alters how the build system
173 works. Changes in libtool, autoconf, or header file dependencies are
174 especially prone to this sort of problem.
175 <p>
176 The best thing to try is to remove the old files and re-build. In most
177 cases, this takes care of the problem. To do this, just type <tt>make
178 clean</tt> and then <tt>make</tt> in the directory that fails to build.
179 <p>
John Criswellf08c5d82003-10-24 22:48:20 +0000180
181 <dt><b>I've built LLVM and am testing it, but the tests freeze.</b>
182 <dd>
183 This is most likely occurring because you built a profile or release
184 (optimized) build of LLVM and have not specified the same information on
185 the <tt>gmake</tt> command line.
186 <p>
187 For example, if you built LLVM with the command:
188 <p>
189 <tt>gmake ENABLE_PROFILING=1</tt>
190 <p>
191 ...then you must run the tests with the following commands:
192 <p>
193 <tt>cd llvm/test<br>gmake ENABLE_PROFILING=1</tt>
194 <p>
195
196 <dt><b>Why do test results differ when I perform different types of
197 builds?</b>
198 <dd>
199 The LLVM test suite is dependent upon several features of the LLVM tools
200 and libraries.
201 <p>
202 First, the debugging assertions in code are not enabled in optimized or
203 profiling builds. Hence, tests that used to fail may pass.
204 <p>
205 Second, some tests may rely upon debugging options or behavior that is
206 only available in the debug build. These tests will fail in an optimized
207 or profile build.
John Criswellc310f622003-10-13 16:13:06 +0000208</dl>
209<hr>
210
John Criswellf08c5d82003-10-24 22:48:20 +0000211<a href="http://llvm.cs.uiuc.edu">The LLVM Compiler Infrastructure</a>
212<br>
213
John Criswellc310f622003-10-13 16:13:06 +0000214</body>
215</html>