On Mar 14, 2006, at 2:22 PM, Chris Lattner wrote:>> Gnome (and many other Unix projects with massively ugly >> dependencies) can be linked trivially using a "foo-config" script. >> If LLVM had something similar, it might save new LLVM developers >> several hours of digging through manuals and Makefiles. > > This would be very very cool to have.OK! Would something like the following interface be a reasonable first approach? llvm-config (--cxxflags | --ldflags | --libs) (all | jit) --cxxflags: Flags to use when compiling C++ source code. --ldflags: Linker flags to use when linking against LLVM. --libs: Libraries needed to link the current configuration. all: Link all LLVM libraries for the current platform. jit: Link the libraries needed by the standard JIT/interpreter configuration. This fits nicely into the autoconf/autoconf view of the world, and would only take an evening to get working. If llvm-gcc 4.0 requires a specific subset of libraries, we could add a third hard-coded configuration. Later on, we could consider adding fine-grained control over which libraries get linked, perhaps based on output from GenLibDeps.pl. But that would require making GenLibDeps.pl more portable (it currently uses some non-portable nm flags). In any case, I'm mostly focused on making things easy for first-time LLVM users.> For what it's worth, linking is significantly faster for a release > build than a debug build. Also, if you're on linux, updating to a > new binutils can help things significantly.Thanks for the tips! I've been writing a (very primitive) llvm-grep program as a warmup exercise, and I was able to JIT good code within a day of getting started. Many thanks for releasing such a cool project! Cheers, Eric
On Wed, 15 Mar 2006, Eric Kidd wrote:> On Mar 14, 2006, at 2:22 PM, Chris Lattner wrote: >>> Gnome (and many other Unix projects with massively ugly dependencies) can >>> be linked trivially using a "foo-config" script. If LLVM had something >>> similar, it might save new LLVM developers several hours of digging >>> through manuals and Makefiles. >> >> This would be very very cool to have. > > OK! Would something like the following interface be a reasonable first > approach? > > llvm-config (--cxxflags | --ldflags | --libs) (all | jit) > --cxxflags: Flags to use when compiling C++ source code. > --ldflags: Linker flags to use when linking against LLVM. > --libs: Libraries needed to link the current configuration. > all: Link all LLVM libraries for the current platform. > jit: Link the libraries needed by the standard JIT/interpreter > configuration.Sounds great.> This fits nicely into the autoconf/autoconf view of the world, and would only > take an evening to get working. If llvm-gcc 4.0 requires a specific subset of > libraries, we could add a third hard-coded configuration.Ok.> Later on, we could consider adding fine-grained control over which libraries > get linked, perhaps based on output from GenLibDeps.pl. But that would > require making GenLibDeps.pl more portable (it currently uses some > non-portable nm flags). In any case, I'm mostly focused on making things easy > for first-time LLVM users.I would be quite happy to have a hard-coded list of library dependencies, even if it means that we need to manually maintain them. This will force us to realize and think about what dependencies there are between libraries.>> For what it's worth, linking is significantly faster for a release build >> than a debug build. Also, if you're on linux, updating to a new binutils >> can help things significantly. > > Thanks for the tips! I've been writing a (very primitive) llvm-grep program > as a warmup exercise, and I was able to JIT good code within a day of getting > started.Cool! -Chris -- http://nondot.org/sabre/ http://llvm.org/
Eric Kidd
2006-Mar-18 22:25 UTC
[LLVMdev] llvm-config prototype (was: Getting Started with LLVM)
On Mar 16, 2006, at 2:16 AM, Chris Lattner wrote:> On Wed, 15 Mar 2006, Eric Kidd wrote: >> OK! Would something like the following interface be a reasonable >> first approach? >> >> llvm-config (--cxxflags | --ldflags | --libs) (all | jit) >> --cxxflags: Flags to use when compiling C++ source code. >> --ldflags: Linker flags to use when linking against LLVM. >> --libs: Libraries needed to link the current configuration. >> all: Link all LLVM libraries for the current platform. >> jit: Link the libraries needed by the standard JIT/interpreter >> configuration. > > Sounds great.OK! I've implemented a simple version of llvm-config, just to give us something concrete to talk about. :-) I'll send you the patch in a separate, off-list message. If anybody else would like a copy, just ask. llvm-config supports the following options: --version LLVM version. --prefix Installation prefix. --bindir Directory containing LLVM executables. --includedir Directory containing LLVM headers. --libdir Directory containing LLVM libraries. --cxxflags C++ compiler flags for file which include LLVM headers. --ldflags Linker flags. --libs <COMPONENT>... Libraries needed to link against LLVM components. Right now, the only useful component is the JIT: jit LLVM JIT compiler. I get this set of dependencies using: LLVMLIBS := JIT SUB_JITOBJS=$(LLVMUsedLibs) It's very easy to dump a Makefile variable to the llvm-config script, so the only obstacle to adding more configurations is modularizing the code which processes LLVMLIBS.> I would be quite happy to have a hard-coded list of library > dependencies, even if it means that we need to manually maintain > them. This will force us to realize and think about what > dependencies there are between libraries.This is a good idea. I'm not quite sure how to process a dependency list using /bin/sh, but maybe inspiration will strike me. :-) If there's any changes you'd like me to make to this patch, please let me know! This is just a minimalist version to spur further discussion. Cheers, Eric