Broken Linbox tutorial

81 views
Skip to first unread message

Alexand...@uni.lu

unread,
Mar 8, 2018, 10:34:24 AM3/8/18
to linbox-use
Dear Linbox Team,

In Linbox 1.5.2, it is no more possible to follow the tutorial,
http://linalg.org/linbox-html/tuto.html
because it starts by loading a library for modular fields,
#include <linbox/field/modular.h>
which is no more contained in the linbox/field folder. The latter one contains only
abstract.h   field-interface.h  gf2.inl         map.h             rebind.h
archetype.h  field-traits.h     gmp-rational.h  multimod-field.h
envelope.h   gf2.h              hom.h           param-fuzzy.h
Below, I give details on my installation, but I am sure that modular.h has been absorbed into one of the above named libraries. Namely, if I load all of them, then I can define the modular field the way it is done in the tutorial.

Then the same happens for
 #include <linbox/matrix/blas-matrix.h>
and there are many differently named matrix libraries. Already loading all the fields library makes the compilation process slow, so I guess that loading all the matrix libraries, I would have to wait a lot for compiling code that only needs the former blas-matrix.h.
It would be nice if you could create an updated tutorial, so users can check if their Linbox installation works correctly by compiling the tutorial programs.

Best wishes,

Alexander Rahm

Installation details: As my attempts to install Linbox under Ubuntu and Debian have failed, I have installed Linux Fedora and downloaded Linbox there.
Having prepared the installation with

yum  install gcc
yum install git-core
yum install openblas
and installed the packages gcc-c++-7.3.1-2.fc27.x86_64, libstdc++-devel-7.3.1-2.fc27.x86_64   

it was possible to run
sh linbox-auto-install.sh
without having to change the uncompress function. However, this did produce some error messages, namely

./autogen.sh: line 23: autoreconf: command not found
 * building Givaro...
make  CXXFLAGS+="" LDFLAGS+="-Wl,-rpath,/tmp"
make: *** No targets specified and no makefile found.  Stop.
 * installing Givaro...
make: *** No rule to make target 'install'.  Stop.


and later the same error messages for Fflas-Ffpack and LinBox. So pkg-config did not find any installation of givaro.
Therefore, I have tried the manual installation,

installing GMP manually (required installing lzip and m4 first):
Download from https://gmplib.org/
./configure --enable-cxx
make; make check; make install
export PKG_CONFIG_PATH=/usr/share/pkgconfig/
cp /usr/local/givaro-4.0.4/givaro.pc /usr/share/pkgconfig/

After these operations, linbox-auto-install.sh still has the same errors as mentioned above, but givaro now has flags:
pkg-config --cflags  givaro
yielded
-I/usr/local/include -fabi-version=6
So I went on with
yum install openblas-devel.x86_64
to prepare the installation of fflas-ffpack:

./configure --with-blas-libs="-lopenblas"
make; make install

This did then as well need to be notified to pkg-config:
cp /usr/local/lib/pkgconfig/fflas-ffpack.pc /usr/share/pkgconfig/
Finally, I installed linbox with  ./configure ; make; make install
cp /usr/local/lib/pkgconfig/linbox.pc /usr/share/pkgconfig/
Then
pkg-config --cflags --libs linbox
yielded
-O2 -Wall -g -DNDEBUG -U_LB_DEBUG -DDISABLE_COMMENTATOR -I/usr/local/include -fopenmp -fabi-version=6 -L/usr/local/lib -llinbox -fopenmp -lopenblas -lgivaro -lgmp -lgmpxx
With
pkg-config --cflags --libs givaro
and
 pkg-config --cflags --libs fflas-ffpack
I did only get incantations that are already mentioned in the above incantations for linbox.

The compilation of a test file loading the library
    #include <linbox/solutions/det.h>
with the above listed incantations for linbox did work after having addressed the following issue mentionend in linbox's make install output:
---------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the 'LD_RUN_PATH' environment variable
     during linking
   - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to '/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
For this purpose, I ran
gedit /etc/ld.so.conf.d/linboxLibs.conf
saved a text file containing the path "/usr/local/lib". Then I ordered
ldconfig
as the root user.
_____________________________________________________


--
Dr. Alexander D. Rahm
Scientific researcher at Université du Luxembourg,
Mathematics Research Unit
http://math.uni.lu/~rahm/
Adjunct Lecturer (Mathematics) at National University of Ireland, Galway
http://www.maths.nuigalway.ie/~rahm/




Jean-Guillaume Dumas

unread,
Mar 8, 2018, 11:08:06 AM3/8/18
to linbo...@googlegroups.com
Le 08/03/2018 à 16:34, Alexand...@uni.lu a écrit :
> Dear Linbox Team,
>
> In Linbox 1.5.2, it is no more possible to follow the tutorial,
> http://linalg.org/linbox-html/tuto.html
> because it starts by loading a library for modular fields,
> #include <linbox/field/modular.h>
> which is no more contained in the linbox/field folder. The latter one contains
> only
> abstract.h   field-interface.h  gf2.inl         map.h             rebind.h
> archetype.h  field-traits.h     gmp-rational.h  multimod-field.h
> envelope.h   gf2.h              hom.h           param-fuzzy.h
> Below, I give details on my installation, but I am sure that modular.h has
> been absorbed into one of the above named libraries. Namely, if I load all of
> them, then I can define the modular field the way it is done in the tutorial.
>
> Then the same happens for
>  #include <linbox/matrix/blas-matrix.h>
> and there are many differently named matrix libraries. Already loading all the
> fields library makes the compilation process slow, so I guess that loading all
> the matrix libraries, I would have to wait a lot for compiling code that only
> needs the former blas-matrix.h.
> It would be nice if you could create an updated tutorial, so users can check
> if their Linbox installation works correctly by compiling the tutorial programs.
>
> Best wishes,
>
> Alexander Rahm
Dear Alexander Rahm, yes you are right the tutorial is outdated.
The following version should work better !
Regards,

----
#include <linbox/field/modular.h>
#include <linbox/matrix/blas-matrix.h>
#include <linbox/solutions/det.h>
#include <linbox/util/matrix-stream.h>
using namespace LinBox;
main()
{
    typedef Givaro::Modular<double> Field;
    typedef BlasMatrix<Field> Matrix;
    Field F(65521);
    MatrixStream<Field> ms(F, std::cin);
    Matrix A(ms);
    Field::Element d;
    Method::BlasElimination M;
    det(d, A, M);
    F.write(std::cout << "the determinant is ", d) << std::endl;
}
----

--
Jean-Guillaume Dumas.
____________________________________________________________________
Jean-Guill...@univ-grenoble-alpes.fr Tél.: +33 457 421 732
Professeur, Université Grenoble Alpes. Fax.: +33 457 421 828
Laboratoire Jean Kuntzmann, Mathématiques Appliquées et Informatique
700 avenue centrale, IMAG - CS 40700, 38058 GRENOBLE cedex 9, FRANCE
http://ljk.imag.fr/membres/Jean-Guillaume.Dumas
____________________________________________________________________


--
Jean-Guillaume Dumas.
____________________________________________________________________
Jean-Guill...@univ-grenoble-alpes.fr Tél.: +33 457 421 732
Professeur, Université Grenoble Alpes. Fax.: +33 457 421 828
Laboratoire Jean Kuntzmann, Mathématiques Appliquées et Informatique
700 avenue centrale, IMAG - CS 40700, 38058 GRENOBLE cedex 9, FRANCE
http://ljk.imag.fr/membres/Jean-Guillaume.Dumas
____________________________________________________________________

Alexand...@uni.lu

unread,
Mar 8, 2018, 3:46:47 PM3/8/18
to linbox-use
Dear Prof. Dumas,

Sorry, your above sample program calls precisely the two libraries that have been absorbed into other libraries in Linbox 1.5.2, namely
linbox/field/modular.h and linbox/matrix/blas-matrix.h (these files are no more included in the current Linbox version).
So as I do not want to include libraries by trial and error, I did meanwhile search for suspect files with the commands
grep -rnw 'linbox/field/' -e 'Modular<double>'
grep -rnw 'linbox/matrix/' -e 'BlasMatrix'
from the linbox directory, and then among the displayed matches did (more or less by chance) choose linbox/field/multimod-field.h and linbox/matrix/matrixdomain/blas-matrix-domain.h.
Then I get the following program which compiles without errors nor warnings:

#include <linbox/solutions/det.h>
#include <linbox/util/matrix-stream.h>
#include <linbox/field/multimod-field.h>
#include <linbox/matrix/matrixdomain/blas-matrix-domain.h>
using namespace LinBox;
int main()

{
    typedef Givaro::Modular<double> Field;
    typedef BlasMatrix<Field> Matrix;
    Field F(65521);
    std::cout << "generating a matrix " << std::endl;

    MatrixStream<Field> ms(F, std::cin);
    Matrix A(ms);
    Field::Element d;
    Method::BlasElimination M;
    std::cout << "its determinant is " << std::endl;
    det(d, A, M);
    std::cout << d << std::endl;
    return d;
}

But the compiled program does, after printing "generating a matrix ", continue without any hopes of terminating - the processor usage goes down to zero.

Best wishes,

Alexander

Reply all
Reply to author
Forward
0 new messages