Re: 3 aap suggestions

Bram Moolenaar <[email protected]> Sat, 26 Nov 2005 15:26:33 +0100
Newsgroups gmane.comp.tools.aap.devel
Message-ID <[email protected]>
Pavol Juhas wrote:

> I have been using aap (version 1.079) for some time and I am quite
> impressed.  However, there are few things that could be improved:
>=20
> (1) aap is not using correct linker when linking c++ objects.
>=20
> Example:
>     # main.aap contains single line ":program hello : hello.cpp"
>     # clean build works
>     $ aap
>     Aap:  g++       -MM hello.cpp > build-Linux2_6_12_1_1381_FC3/hello.=
cpp.aap
>     Aap: g++    -O2  -c -o build-Linux2_6_12_1_1381_FC3/hello.o hello.c=
pp
>     Aap: g++  -O2 -o hello build-Linux2_6_12_1_1381_FC3/hello.o=20
>     # but building from objects does not
>     $ rm hello                              =20
>     $ aap
>     Aap: cc  -O2 -o hello build-Linux2_6_12_1_1381_FC3/hello.o=20
>     build-Linux2_6_12_1_1381_FC3/hello.o(.text+0x12): In function `main=
':
>     : undefined reference to `std::cout'
>     ...
>=20
> Can this be fixed so that aap uses g++ as a linker when linking c++ obj=
ects?

This is a known problem: Object files as such don't have an indication
that they come from a C++ file.  It works when Aap also does the
compilation, because an attribute is added to the object file then.

A solution would be to store the attributes for the object file in the
signature file AAPDIR/sign.  That's not a small change though...

> (2) :toolsearch raises exception when it cannot find some tool.
>=20
> I am running my code on 2 different architectures - on the group linux
> box and on university x86_64 high-performance linux cluster.  The later
> system has Intel c-compiler, which is not available on the group
> machine.  I created new tools file, intelcc.py, put it to the
> ~/.aap/tools directory on cluster and used
>=20
>     :toolsearch intelcc gcc
>=20
> in my main.aap.  I thought this would work on both systems and aap woul=
d
> choose gcc if intelcc was not defined.  However aap raises an exception
> and dies if it cannot find intelcc.py

What is the exception?

> (3) when ~/.aap/tools contains some files, aap ignores default tools in=
=20
>     /usr/local/share/aap/tools
>=20
> doc/aap/ref-commands.html#cmd-usetool  says that 3 directories are
> searched for compiler tools, and they must contain __init__.py.   In
> fact only one directory is searched.  Python uses for all imports the
> first package directory that contains __init__.py, therefore aap can
> find only tools in ~/.aap/tools, and the remaining directories are
> ignored.  I think the solution would be to add all tools directories
> into sys.path (maybe only temporarily inside toolsearch or usetool
> functions) or to use lower-level python import statements, so that all
> tools directories could be searched.

Aap already uses sys.path to do this.  I can't say why it doesn't work
for you...  If you know a bit of python, look in the Commands.py file,
the aap_toolsearch() function.

--=20
hundred-and-one symptoms of being an internet addict:
214. Your MCI "Circle of Friends" are all Hayes-compatible.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \=
\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ =
\\\
\\\        download, build and distribute -- http://www.A-A-P.org        =
///
 \\\            help me help AIDS victims -- http://www.ICCF.nl         /=
//


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log fi=
les
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=3D7637&alloc_id=3D16865&op=3Dclick