Re: indexing expression performance

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

Re: indexing expression performance

Jordi Gutiérrez Hermoso
2009/1/16 Jaroslav Hajek <[hidden email]>:

> On Fri, Jan 16, 2009 at 3:07 PM, Jordi Gutiérrez Hermoso
>> I didn't quite follow the discussion, so please tell me again why it's
>> desirable to package this library?
>>
>
> Octave uses it to implement the qrupdate, qrinsert, qrdelete, qrshift,
> cholupdate, cholinsert, choldelete and cholshift functions. Up to now
> a snapshot of version 0 of the lib was included directly in Octave
> sources. During December I finally got to rewriting the library to get
> a more robust interface and incorporate various improvements, and I
> released it (it was GPLed from the beg) on SourceForge.

Oh, it's your code? You're my upstream? Nice. :-)

> So, the question is, how much effort does it take to package a
> (Fortran) library?

I'll give it a shot tonight. If I run into problems, I'll let you and
the rest of the DOG know.

- Jordi G. H.

Reply | Threaded
Open this post in threaded view
|

Re: indexing expression performance

Jaroslav Hajek-2
On Fri, Jan 16, 2009 at 10:52 PM, Jordi Gutiérrez Hermoso
<[hidden email]> wrote:

> 2009/1/16 Jaroslav Hajek <[hidden email]>:
>> On Fri, Jan 16, 2009 at 3:07 PM, Jordi Gutiérrez Hermoso
>>> I didn't quite follow the discussion, so please tell me again why it's
>>> desirable to package this library?
>>>
>>
>> Octave uses it to implement the qrupdate, qrinsert, qrdelete, qrshift,
>> cholupdate, cholinsert, choldelete and cholshift functions. Up to now
>> a snapshot of version 0 of the lib was included directly in Octave
>> sources. During December I finally got to rewriting the library to get
>> a more robust interface and incorporate various improvements, and I
>> released it (it was GPLed from the beg) on SourceForge.
>
> Oh, it's your code? You're my upstream? Nice. :-)
>
>> So, the question is, how much effort does it take to package a
>> (Fortran) library?
>
> I'll give it a shot tonight. If I run into problems, I'll let you and
> the rest of the DOG know.
>

Cool. Please note that I changed the file release to have a -src
suffix (if there will be binaries) and fixed a bug (in the future,
releases should probably not be altered in such a way, but right now
it doesn't mind).
I have the integration of the new codes into Octave ready (as an
external dependency), so I'll be glad if you say it's possible
(there's probably no need to actually release the package anywhere
until next snapshot release from development branch).

cheers

--
RNDr. Jaroslav Hajek
computing expert
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz

Reply | Threaded
Open this post in threaded view
|

Re: indexing expression performance

Jordi Gutiérrez Hermoso
Okay, so I worked on the library a little. It looks like it's very
easy, since it's a very small library, and it's kinda nice how fast
Fortran compiles compared to C or C++ code.

However, my Fortran ignorance begins to show. How are you supposed to
use Fortran libraries? You don't use header files as with C and C++,
right? All that a -dev package needs to ship is the .so binary,
correct? The EXPORTS file is presumably documentation that should go
in a -doc package (doing that is my job, not yours, just thinking out
loud).

I also don't think it's necessary name your package -src. It's on
Sourceforge, of course it's source. :-)

Documentation seems to be all in the source files... does Fortran have
something like Doxygen that can extract documentation from source? If
not, maybe I should write a Perlism to do so. That should be easy,
since all the documentation is in the source files right after the
copyright notice, correct?

- Jordi G. H.
Reply | Threaded
Open this post in threaded view
|

Re: indexing expression performance

Jaroslav Hajek-2
On Sat, Jan 17, 2009 at 6:20 PM, Jordi Gutiérrez Hermoso
<[hidden email]> wrote:
> Okay, so I worked on the library a little. It looks like it's very
> easy, since it's a very small library, and it's kinda nice how fast
> Fortran compiles compared to C or C++ code.
>

Yes, this is always something I liked when compiling Octave - libcruft
is compiled in a flash. Using more advanced F95 or F2003 features
slows it down, but still not anywhere near C++.

> However, my Fortran ignorance begins to show. How are you supposed to
> use Fortran libraries? You don't use header files as with C and C++,
> right?

For using them from Fortran, no, you can use the implicit interface
generated for every call. For using them from C, a header file can be
written. So far I didn't do it, because it appears that providing it
is actually inconvenient for C++; in C++, it's more convenient to use
references than pointers (as in Octave's sources).

> All that a -dev package needs to ship is the .so binary,
> correct?

Yes. Same as is done, for instance, by lapack.  Maybe you may also
ship the static library (depends probably on a distro's culture).

> The EXPORTS file is presumably documentation that should go
> in a -doc package (doing that is my job, not yours, just thinking out
> loud).

The EXPORTS file just lists all the functions (C names) that need to
be exported from the dynamic library. It appears that it's not needed,
though, at least on Linux, the linker does export the symbols
automatically.

>
> I also don't think it's necessary name your package -src. It's on
> Sourceforge, of course it's source. :-)
>

OK. I thought it's standard, but after a little inspection, apparently
it's not really common. I'll rename the tarball back (last time,
hopefully).

> Documentation seems to be all in the source files... does Fortran have
> something like Doxygen that can extract documentation from source? If
> not, maybe I should write a Perlism to do so. That should be easy,
> since all the documentation is in the source files right after the
> copyright notice, correct?
>

Yes, including the subroutine statement (that should probably be
included). It should be fairly easy to extract with AWK, Perl, Python
or whatever (maybe even sed).


> - Jordi G. H.
>



--
RNDr. Jaroslav Hajek
computing expert
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz

Reply | Threaded
Open this post in threaded view
|

Re: indexing expression performance

John W. Eaton
Administrator
On 17-Jan-2009, Jaroslav Hajek wrote:

| For using them from Fortran, no, you can use the implicit interface
| generated for every call. For using them from C, a header file can be
| written. So far I didn't do it, because it appears that providing it
| is actually inconvenient for C++; in C++, it's more convenient to use
| references than pointers (as in Octave's sources).

You could write a header with some macro goo something like this:

  #if defined __cplusplus && defined (QRUPDATE_USE_REFERENCES)
  #define QRUPDATE_PTR_ARG(T) T&
  #else
  #define QRUPDATE_PTR_ARG(T) T*
  #endif

  #if defined (__cplusplus)
  extern "C" {
  #endif

  F77_FUNC_RET_T
  F77_FUNC (qrupdatefcn, QRUPDATEFCN) (const QRUPDATE_PTR_ARG (double),
                                       QRUPDATE_PTR_ARG (double), int)
  ...

  #if defined (__cplusplus)
  }
  #endif

But I'm not sure it is really worth it.

jwe