Building Clang examples and running

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Building Clang examples and running

Starry-3
Im trying to get the printfn example to work. I go to director and do
sudo make and then sudo make install, i then run

clang -cc1 -load /usr/local/lib/libPrintFunctionNames.so   -plugin help

and i get
clang -cc1 plugins:

which means there are no plugins, indeed when i to prin-fns instead of
help, it says it cant find plugin.

Also, for the two other examples, ther eis no ability to make install,
when i make it i can't find the .so files, only .o files in the debug
directory, so how do i run those?




_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Building Clang examples and running

bruce.r.stephens
Seth Burleigh <[hidden email]> writes:

> Im trying to get the printfn example to work. I go to director and do
> sudo make and then sudo make install, i then run
>
> clang -cc1 -load /usr/local/lib/libPrintFunctionNames.so   -plugin help
>
> and i get
> clang -cc1 plugins:
>
> which means there are no plugins, indeed when i to prin-fns instead of
> help, it says it cant find plugin.

I foung the same.  The only way I managed to get it to work was to
ignore configure and use cmake.  So, in another directory use "ccmake
<path-to-llvm-source>" (where ccmake is one of the frontends to cmake)
and turn on the CMAKE_BUILD_EXAMPLES option (and set
CMAKE_INSTALL_PREFIX if you want) then use make in that directory.
"make install" will also work.

On the downside, I haven't worked out how to produce API documentation,
whereas I could with the in-tree build.
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Building Clang examples and running

Sebastien Binet
On Fri, 11 Jun 2010 14:38:35 +0100, Bruce Stephens <[hidden email]> wrote:

> Seth Burleigh <[hidden email]> writes:
>
> > Im trying to get the printfn example to work. I go to director and do
> > sudo make and then sudo make install, i then run
> >
> > clang -cc1 -load /usr/local/lib/libPrintFunctionNames.so   -plugin help
> >
> > and i get
> > clang -cc1 plugins:
> >
> > which means there are no plugins, indeed when i to prin-fns instead of
> > help, it says it cant find plugin.
>
> I foung the same.  The only way I managed to get it to work was to
> ignore configure and use cmake.  So, in another directory use "ccmake
> <path-to-llvm-source>" (where ccmake is one of the frontends to cmake)
> and turn on the CMAKE_BUILD_EXAMPLES option (and set
> CMAKE_INSTALL_PREFIX if you want) then use make in that directory.
> "make install" will also work.

to have it working with make, see:
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2010-April/008559.html

or there, for an archlinux packaged example:
http://repos.archlinux.org/wsvn/community/llvm/trunk/PKGBUILD
http://repos.archlinux.org/wsvn/community/llvm/trunk/clang-plugin-loader-registry.patch

hth,
sebastien.

--
#########################################
# Dr. Sebastien Binet
# Laboratoire de l'Accelerateur Lineaire
# Universite Paris-Sud XI
# Batiment 200
# 91898 Orsay
#########################################
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

[patch] add --enable-examples and produce docs/doxygen.cfg (was Re: Building Clang examples and running)

bruce.r.stephens
configure also needs to be regenerated (but of course I have a different
version of autoconf, so the diffs aren't enlightening)

diff --git a/Makefile.config.in b/Makefile.config.in
index d073e9b..53fd943 100644
--- a/Makefile.config.in
+++ b/Makefile.config.in
@@ -340,3 +340,6 @@ NO_VARIADIC_MACROS = @NO_VARIADIC_MACROS@
 # Flags supported by the linker.
 # bfd ld / gold --version-script=file
 HAVE_LINK_VERSION_SCRIPT = @HAVE_LINK_VERSION_SCRIPT@
+
+# Whether to build the examples
+BUILD_EXAMPLES = @BUILD_EXAMPLES@
diff --git a/autoconf/configure.ac b/autoconf/configure.ac
index 8ed3987..751cd57 100644
--- a/autoconf/configure.ac
+++ b/autoconf/configure.ac
@@ -886,6 +886,17 @@ else
    AC_SUBST(ENABLE_LLVMC_DYNAMIC_PLUGINS,[[]])
 fi
 
+dnl --enable-examples : should we build the examples?
+AC_ARG_ENABLE(examples,AS_HELP_STRING(
+--enable-examples,
+[Enable building of the examples (default is NO)]),,
+enableval=no)
+if test ${enableval} = "yes" ; then
+   AC_SUBST(BUILD_EXAMPLES,1)
+else
+   AC_SUBST(BUILD_EXAMPLES,[[]])
+fi
+
 dnl===-----------------------------------------------------------------------===
 dnl===
 dnl=== SECTION 4: Check for programs we need and that they are the right version
@@ -1565,6 +1576,9 @@ AC_CONFIG_FILES([tools/llvmc/plugins/Base/Base.td])
 dnl Do the first stage of configuration for llvm-config.in.
 AC_CONFIG_FILES([tools/llvm-config/llvm-config.in])
 
+dnl doxygen configuration
+AC_CONFIG_FILES(docs/doxygen.cfg)
+
 dnl Do special configuration of Makefiles
 AC_CONFIG_COMMANDS([setup],,[llvm_src="${srcdir}"])
 AC_CONFIG_MAKEFILE(Makefile)
@@ -1580,7 +1594,6 @@ AC_CONFIG_MAKEFILE(utils/Makefile)
 AC_CONFIG_MAKEFILE(projects/Makefile)
 AC_CONFIG_MAKEFILE(bindings/Makefile)
 AC_CONFIG_MAKEFILE(bindings/ocaml/Makefile.ocaml)
-AC_CONFIG_MAKEFILE(docs/doxygen.cfg)
 
 dnl Finally, crank out the output
 AC_OUTPUT
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Building Clang examples and running

Starry-3
In reply to this post by Sebastien Binet
tried editing the autoconf and rebuilding, didn't work. When i use make
to build the examples, and then make install, only the print function
exxample is installed, and for the two other examples only a .o file is
produced , and make install skips those two. And then when i try to do
the plugin thing with the .so file installed under /usr/local/bin/, it
says it cant find the plugin. None listed when using -help either.

Also tried using ccmake ~/.tmp/llvm/, came up with an 'empty cache page
0/0' so cant edit anything there.




On Fri, 2010-06-11 at 15:57 +0200, Sebastien Binet wrote:

> On Fri, 11 Jun 2010 14:38:35 +0100, Bruce Stephens <[hidden email]> wrote:
> > Seth Burleigh <[hidden email]> writes:
> >
> > > Im trying to get the printfn example to work. I go to director and do
> > > sudo make and then sudo make install, i then run
> > >
> > > clang -cc1 -load /usr/local/lib/libPrintFunctionNames.so   -plugin help
> > >
> > > and i get
> > > clang -cc1 plugins:
> > >
> > > which means there are no plugins, indeed when i to prin-fns instead of
> > > help, it says it cant find plugin.
> >
> > I foung the same.  The only way I managed to get it to work was to
> > ignore configure and use cmake.  So, in another directory use "ccmake
> > <path-to-llvm-source>" (where ccmake is one of the frontends to cmake)
> > and turn on the CMAKE_BUILD_EXAMPLES option (and set
> > CMAKE_INSTALL_PREFIX if you want) then use make in that directory.
> > "make install" will also work.
>
> to have it working with make, see:
> http://lists.cs.uiuc.edu/pipermail/cfe-dev/2010-April/008559.html
>
> or there, for an archlinux packaged example:
> http://repos.archlinux.org/wsvn/community/llvm/trunk/PKGBUILD
> http://repos.archlinux.org/wsvn/community/llvm/trunk/clang-plugin-loader-registry.patch
>
> hth,
> sebastien.
>


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: [patch] add --enable-examples and produce docs/doxygen.cfg

bruce.r.stephens
In reply to this post by bruce.r.stephens
It appears that BUILD_EXAMPLES doesn't work as I expected.  However, the
trivial addition of

dnl doxygen configuration
AC_CONFIG_FILES(docs/doxygen.cfg)

to autoconf/configure.ac seems worthwhile.  (I think it would also be
useful to be able to build the examples with an option, but I don't know
how and it doesn't seem particularly important---building them
individually is easy enough.)

[...]

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Building Clang examples and running

bruce.r.stephens
In reply to this post by Starry-3
Seth Burleigh <[hidden email]> writes:

[...]

> Also tried using ccmake ~/.tmp/llvm/, came up with an 'empty cache page
> 0/0' so cant edit anything there.

I perhaps explained that poorly, you run ccmake in a fresh directory,
passing it the path to the checked out source.

[...]

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Building Clang examples and running

Starry-3
I did

cd ~/llvm
ccmake ~/.tmp/llvm/

and i get


EMPTY CACHE

Then i hit c for configure and i dont see the build example option. And
then when i do make clean under ~/.tmp/llvm and do the above again, i
get an error when trying to configure, it says there are suspicious
files most likely produced by doing ./configure and then make.

I think i will try to just build the one source example file, I'll see
how that goes, how hard can it be :)

On Fri, 2010-06-11 at 22:45 +0100, [hidden email] wrote:

> Seth Burleigh <[hidden email]> writes:
>
> [...]
>
> > Also tried using ccmake ~/.tmp/llvm/, came up with an 'empty cache page
> > 0/0' so cant edit anything there.
>
> I perhaps explained that poorly, you run ccmake in a fresh directory,
> passing it the path to the checked out source.
>
> [...]
>
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Building Clang examples and running

bruce.r.stephens
Seth Burleigh <[hidden email]> writes:

> I did
>
> cd ~/llvm
> ccmake ~/.tmp/llvm/
>
> and i get
>
>
> EMPTY CACHE
>
> Then i hit c for configure and i dont see the build example option. And
> then when i do make clean under ~/.tmp/llvm and do the above again, i
> get an error when trying to configure, it says there are suspicious
> files most likely produced by doing ./configure and then make.

I apologise.  I was misremembering what I did.  Here's something that I
think actually does work (I just did it):

cmake <path to llvm-toplevel>
ccmake .

So use cmake the first time, then "c" and "g" seem to work.  I guess
cmake the first time does some kind of default configuration or
something.  (I don't really understand cmake very well.)

[...]

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Building Clang examples and running

Starry-3
Yay, it actually built print functions correctly and works!

> I apologise.  I was misremembering what I did.  Here's something that I
> think actually does work (I just did it):
>
> cmake <path to llvm-toplevel>
> ccmake .
>
> So use cmake the first time, then "c" and "g" seem to work.  I guess
> cmake the first time does some kind of default configuration or
> something.  (I don't really understand cmake very well.)
>
> [...]
>
> _______________________________________________
> cfe-dev mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev