Adding external libraries to Octave

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

Adding external libraries to Octave

Abdallah Elshamy
Dear All,

My GSoC project [1] requires the external library RapidJSON [2] which is a header-only library. So, I was searching about how to add libraries to Octave. I think that one way to do this is to put the library in a suitable place inside "liboctave" folder and modifying and/or creating the required "module.mk" files. Am I on the right track here? Please let me know.

Another option that was suggested by my mentor (Mr. Kai Torben Ohlhus) is to modify the "bootstrap" script so that it fetches the latest version of the library online and integrates it during building.  

I would like to know your evaluation of both methods and if you have any suitable alternatives.

Thanks for your time,
Abdallah


Reply | Threaded
Open this post in threaded view
|

Re: Adding external libraries to Octave

John W. Eaton
Administrator
On 5/12/20 12:08 PM, Abdallah Elshamy wrote:

> Dear All,
>
> My GSoC project [1] requires the external library RapidJSON [2] which is
> a header-only library. So, I was searching about how to add libraries to
> Octave. I think that one way to do this is to put the library in a
> suitable place inside "liboctave" folder and modifying and/or creating
> the required "module.mk <http://module.mk>" files. Am I on the right
> track here? Please let me know.
>
> Another option that was suggested by my mentor (Mr. Kai Torben Ohlhus)
> is to modify the "bootstrap" script so that it fetches the latest
> version of the library online and integrates it during building.
>
> I would like to know your evaluation of both methods and if you have any
> suitable alternatives.
>
> Thanks for your time,
> Abdallah
>
>
> [1] https://summerofcode.withgoogle.com/projects/#6263027378159616
> [2] https://rapidjson.org/

It looks like rapidjson is packaged for Debian (for example) so why not
just check for it like other dependencies?  If it is not installed, then
the user should do that first, before building.  Same as for other
dependencies.

I don't think we should be distributing the header files as part of
Octave, so there should be no reason to add it to the liboctave directory.

jwe

Reply | Threaded
Open this post in threaded view
|

Re: Adding external libraries to Octave

siko1056
On 5/13/20 2:12 AM, John W. Eaton wrote:

> On 5/12/20 12:08 PM, Abdallah Elshamy wrote:
>> Dear All,
>>
>> My GSoC project [1] requires the external library RapidJSON [2] which
>> is a header-only library. So, I was searching about how to add
>> libraries to Octave. I think that one way to do this is to put the
>> library in a suitable place inside "liboctave" folder and modifying
>> and/or creating the required "module.mk <http://module.mk>" files. Am
>> I on the right track here? Please let me know.
>>
>> Another option that was suggested by my mentor (Mr. Kai Torben Ohlhus)
>> is to modify the "bootstrap" script so that it fetches the latest
>> version of the library online and integrates it during building.
>>
>> I would like to know your evaluation of both methods and if you have
>> any suitable alternatives.
>>
>> Thanks for your time,
>> Abdallah
>>
>>
>
> It looks like rapidjson is packaged for Debian (for example) so why not
> just check for it like other dependencies?  If it is not installed, then
> the user should do that first, before building.  Same as for other
> dependencies.
>
> I don't think we should be distributing the header files as part of
> Octave, so there should be no reason to add it to the liboctave directory.
>
> jwe


My suggestion was inspired by Andy's "octave-rapidjson" [3] which pulls
a certain git commit of RapidJSON like a charm before building the package.

You are right jwe, when I add the RapidJSON dependency into bootstrap,
we have to distribute it unnecessarily with each Octave release tarball,
as bootstrap is not available there.

Luckily, RapidJSON seemed to be quite matured.  The latest official
release 1.1.0 from 2016 is packaged in all Linux distributions I care
about [4,5,6].  Only some recently fixed bugs might be missing, but that
is an upstream problem.  Probably it is better to check for this
dependency, as for any other and to extend configure.ac.

Kai


[1] https://summerofcode.withgoogle.com/projects/#6263027378159616
[2] https://rapidjson.org/
[3] https://github.com/Andy1978/octave-rapidjson
[4] https://packages.debian.org/search?keywords=rapidjson
[5] https://software.opensuse.org/package/rapidjson
[6]
https://centos.pkgs.org/7/epel-x86_64/rapidjson-devel-1.1.0-2.el7.noarch.rpm.html

Reply | Threaded
Open this post in threaded view
|

Re: Adding external libraries to Octave

Carlo de Falco-2


Il giorno 13 mag 2020, alle ore 15:10, Kai Torben Ohlhus <[hidden email]> ha scritto:

Luckily, RapidJSON seemed to be quite matured.  The latest official
release 1.1.0 from 2016 is packaged in all Linux distributions I care
about [4,5,6].

FYI : a rapidjson-devel package at version 1.1.0 is also available in macports for macos.
c.


Reply | Threaded
Open this post in threaded view
|

Re: Adding external libraries to Octave

Andrew Janke-2


On 5/13/20 11:57 AM, Carlo De Falco wrote:


Il giorno 13 mag 2020, alle ore 15:10, Kai Torben Ohlhus <[hidden email]> ha scritto:

Luckily, RapidJSON seemed to be quite matured.  The latest official
release 1.1.0 from 2016 is packaged in all Linux distributions I care
about [4,5,6].

FYI : a rapidjson-devel package at version 1.1.0 is also available in macports for macos.
c.


And in Homebrew[1]. It should be readily available in any macOS environment that wants to build Octave.

Cheers,
Andrew

[1] https://github.com/Homebrew/homebrew-core/blob/master/Formula/rapidjson.rb