BMI
Table of content
Introduction
The BLAD - MULTIPLE - INTERFACES library is a C library which implements interfaces between the BLAD libraries, and various computer algebra systems such as MAPLE and SAGE. The corresponding MAPLE package is called DifferentialAlgebra. The corresponding SAGE package is currently under development. The BMI library is protected by the Lesser General Public License.
Version numbers
The first open source version bmi-2.0 was released on October 25th, 2010. The version bmi-3.0 was released on February 3rd, 2012. Starting from release 3.10, the version number of BMI follows the one of BLAD, i.e. bmi-3.10 is supposed to be used with blad-3.10.
Download
BMI version 3.10.5 was released on February 1st, 2013 (it works with BLAD version 3.10.4).
- the source code bmi-3.10.5.tgz
- the source code and dynamic libraries for Windows: bmi-windows.3.10.4.tgz
- the documentation alone bmi-3.10.5.pdf
Upgrading MAPLE dynamic libraries
Last update of these instructions: January 22, 2013, with MAPLE 16.
The following instructions aim at upgrading the versions of BLAD and BMI which are shipped with MAPLE using more recent ones. They build a directory tree which eventually looks as follows (there is a slight variant for users who download source code directly from the svn repository https://forge.lifl.fr/DifferentialAlgebra).
Linux and Solaris
The following instructions are supposed to work with MAPLE 14, 15 and 16 over LINUX. They should also work on Sun Solaris, though I lack feedback concerning this platform.
- Create the directory
DifferentialAlgebra(say, in$HOME)mkdir $HOME/DifferentialAlgebra
cd $HOME/DifferentialAlgebra - Recover the source code of BLAD and create thereby the
bladdirectory.- Normal users: it is assumed that the current version is
blad-3.10(you may need to change it) and thatblad-3.10.tgzis present in theDifferentialAlgebradirectorytar xzf blad-3.10.tgzmv blad-3.10 blad - svn users: the source code is not located directly under
bladbut underblad/trunksvn checkout --username your-login https://forge.lifl.fr/DifferentialAlgebra/svn/main/blad
- Normal users: it is assumed that the current version is
- [svn users only] Create the
blad/trunk/configurefile.cd blad/trunk
mkdir config
libtoolize --force --copy
aclocal
autoheader
automake --add-missing --copy
autoconf- Note: You may need to install
automakeandautoconf.
- Note: You may need to install
- Configure BLAD for your machine
cd $HOME/DifferentialAlgebra
mkdir blad-build
cd blad-build
../blad/configure --prefix=$HOME/DifferentialAlgebra/blad-install- Note: svn users should call
../blad/trunk/configureat line 4. - Note: you may need to install the GMP development library
libgmp-dev, because you need the header filegmp.h. If this library is installed in some directory (say)/usr/local/gmp, which is not automatically scanned by the C compiler, you should pass the option--with-gmp=/usr/local/gmpat line 4. - Note: strictly speaking, one should use the GMP dynamic library shipped with MAPLE, which can be downloaded from this page. However, the use of the standard GMP development library was never reported to create any problem on Linux and Solaris (this is not the case for MAC OS, as explained below).
- Note: svn users should call
- Compile and install BLAD, creating thereby the
blad-installdirectory and the filesblad-install/lib/libblad.so.*make
make check [optional]
make install - Recover the source code of BMI and create thereby the
bmidirectory (see remarks at step 2).- Normal users
tar xzf bmi-3.10.tgz
mv bmi-3.10 bmi - svn users
svn checkout --username your-login https://forge.lifl.fr/DifferentialAlgebra/svn/main/bmi
- Normal users
- [svn users only] Create the
bmi/trunk/configurefile (see remarks at step 3).cd bmi/trunk
mkdir config
libtoolize --force --copy
aclocal
autoheader
automake --add-missing --copy
autoconf - Configure BMI for your machine
cd $HOME/DifferentialAlgebra
mkdir bmi-build
cd bmi-build
../bmi/configure --prefix=$HOME/DifferentialAlgebra/bmi-install --with-blad=$HOME/DifferentialAlgebra/blad-install --enable-maple=yes- Note: svn users should call
../bmi/trunk/configureat line 4. - Note: If the GMP development library is installed in some directory (say)
/usr/local/gmp, which is not automatically scanned by the C compiler, you should pass the option--with-gmp=/usr/local/gmpat line 4. - Note: If the MAPLE you want to use is located in some directory (say)
/usr/local/maple16, you should specify it at the beginning of line 4, starting the command by:MAPLE=/usr/local/maple16/bin/maple ../bmi/configure
- Note: svn users should call
- Compile and install BMI, creating thereby the
bmi-installdirectory and the filebmi-install/lib/libbmi.somake
make install- Note: the experimental
DifferentialAlgebra0package is created and installed in thebmi-install/mapledirectory.
- Note: the experimental
- Change the MAPLE dynamic libraries. Please, read carefully the notes below before proceeding.
cd /usr/local/maple/bin.OS
mv libblad.so libblad.so.orig
mv libbmi.so libbmi.so.orig
ln -s $HOME/DifferentialAlgebra/blad-install/lib/libblad.so.0.0.0 libblad.so
ln -s $HOME/DifferentialAlgebra/bmi-install/lib/libbmi.so.0.0.0 libbmi.so- Note: The
OSsuffix at line 1 depends on your architecture (e.g.X86_64_LINUXon a 64 bits Linux). This directory can be determined using thekernelopts(bindir)command, in MAPLE. - Note: Depending on your installation, you may need to become a superuser before modifying the files, or to use the
sudocommand. - Note: Lines 2 and 3 rename the original dynamic libraries, for safety. Make sure they were successfully performed before proceeding.
- Note: Lines 4 and 5 replace the old libraries by symbolic links to the new ones. Let us explain the idea which lies under these commands. The symbolic links should have the same name as the old dynamic libraries. In the
blad-install/libandbmi-install/libdirectories, there are actual dynamic libraries and various symbolic links. Usingls -land looking at the sizes of the files, it is easy to find out the names of the actual dynamic libraries. The symbolic links should point to these libraries. - Note: You could also copy the new libraries in the MAPLE
bindirdirectory. The advantage/drawback of symbolic links is: next time you upgrade BLAD and BMI, MAPLE gets automatically updated.
- Note: The
- Final test. It the following command fails, then something went wrong and you may want to replace the symbolic links
libblad.soandlibbmi.soby the original files, in the MAPLEbin.OSdirectory (see former step).$ maple
> with (DifferentialAlgebra):
> R := DifferentialRing (derivations = [x], blocks = [y]); - Using the experimental
DifferentialAlgebra0package. It is sufficient to modify the MAPLElibnamevariable, so that it mentions the$HOME/DifferentialAlgebra/bmi-install/mapledirectory. Observe that shell variables have to be replaced by their values. Here is an example.$ maple
> libname := "/home/boulier/DifferentialAlgebra/bmi-install/maple", libname:
> integrate := DifferentialAlgebra0:-Integrate;- Note: Both packages
DifferentialAlgebraandDifferentialAlgebra0take advantage of the new libraries. They can be used at the same time.
- Note: Both packages
- Next time you want to update BLAD and BMI, it is sufficient to update the source codes of BLAD and BMI (svn users only need to perform
svn updatecommands) and to perform again steps 3 to 5 and 7 to 9.
MAC OS
On this platform, this issue lies in the fact that MAPLE uses a specific GMP (the names of the GMP functions and the name of the library itself are not the standard ones) and that BLAD and BMI must use it. In the following, we assume that MAPLE is installed in /Library/Framework/Maple.Framework/Versions/16.
- Create the directory
DifferentialAlgebra(say, in$HOME)mkdir $HOME/DifferentialAlgebra
cd $HOME/DifferentialAlgebra - Recover the source code of BLAD and create thereby the
bladdirectory.- Normal users: it is assumed that the current version is
blad-3.10(you may need to change it) and thatblad-3.10.tgzis present in theDifferentialAlgebradirectorytar xzf blad-3.10.tgz
mv blad-3.10 blad - svn users: the source code is not located directly under
bladbut underblad/trunksvn checkout --username your-login https://forge.lifl.fr/DifferentialAlgebra/svn/main/blad
- Normal users: it is assumed that the current version is
- [svn users only] Create the
blad/trunk/configurefile.cd blad/trunk
mkdir config
glibtoolize --force --copy
aclocal
autoheader
automake --add-missing --copy
autoconf- Note: You may need to install
automakeandautoconf. - Note: Observe MAC OS users must use
glibtoolizeinstead oflibtoolize.
- Note: You may need to install
- Prepare GMP for MAPLE. We need this specific gmp.h header file. We assume it is downloaded in the
DifferentialAlgebradirectory. For the GMP dynamic library, we reuse the one of MAPLE.cd $HOME/DifferentialAlgebra
mkdir maplegmp
mkdir maplegmp/include
mkdir maplegmp/lib
mv gmp.h maplegmp/include
ln -s /Library/Frameworks/Maple.framework/Versions/16/bin.APPLE_UNIVERSAL_OSX/libmgmp.dylib maplegmp/lib/libgmp.dylib - Configure BLAD for your machine
cd $HOME/DifferentialAlgebra
mkdir blad-build
cd blad-build
../blad/configure --prefix=$HOME/DifferentialAlgebra/blad-install --with-gmp=$HOME/DifferentialAlgebra/maplegmp- Note: svn users should call
../blad/trunk/configureat line 4.
- Note: svn users should call
- Compile and install BLAD, creating thereby the
blad-installdirectory and the filesblad-install/lib/libblad.dylibmake
make install- Note:
make checkis not supposed to work with this version of GMP.
- Note:
- Recover the source code of BMI and create thereby the
bmidirectory (see remarks at step 2).- Normal users
tar xzf bmi-3.10.tgz
mv bmi-3.10 bmi - svn users
svn checkout --username your-login https://forge.lifl.fr/DifferentialAlgebra/svn/main/bmi
- Normal users
- [svn users only] Create the
bmi/trunk/configurefile (see remarks at step 3).cd bmi/trunk
mkdir config
glibtoolize --force --copy
aclocal
autoheader
automake --add-missing --copy
autoconf - Configure BMI for your machine
cd $HOME/DifferentialAlgebra
mkdir bmi-build
cd bmi-build
../bmi/configure --prefix=$HOME/DifferentialAlgebra/bmi-install --with-blad=$HOME/DifferentialAlgebra/blad-install --with-gmp=$HOME/DifferentialAlgebra/maplegmp --enable-maple=yes- Note: svn users should call
../bmi/trunk/configureat line 4. - Note: To be on the safe side, you could specify the MAPLE to be used at the beginning of line 4, starting the command by:
MAPLE=/Library/Frameworks/Maple.framework/Versions/16/bin/maple ../bmi/configure
- Note: svn users should call
- Compile and install BMI, creating thereby the
bmi-installdirectory and the filesbmi-install/lib/libbmi.dylibmake
make install- Note: the experimental
DifferentialAlgebra0package is created and installed in thebmi-install/mapledirectory.
- Note: the experimental
- [optional] Test the libraries are correctly built.
otool -L $HOME/DifferentialAlgebra/blad-install/lib/libblad.dylib
...
libmgmp.dylib (compatibility version 8.0.0, current version 8.1.0)
...
nm $HOME/DifferentialAlgebra/blad-install/lib/libblad.dylib | grep gmp
U ___maple_gmp_get_memory_functions
U ___maple_gmp_set_memory_functions
U ___maple_gmpn_lshift
...- Note: In the result of the first command, one should see
libmgmp, notlibgmp. In the result of the second command, one should see the___maple_prefix before all GMP functions.
- Note: In the result of the first command, one should see
- Change the MAPLE dynamic libraries. Please, read carefully the notes below before proceeding.
cd /Library/Frameworks/Maple.framework/Versions/16/bin.APPLE_UNIVERSAL_OSX
mv libblad.dylib libblad.dylib.orig
mv libbmi.so libbmi.so.orig
ln -s $HOME/DifferentialAlgebra/blad-install/lib/libblad.0.dylib libblad.dylib
ln -s $HOME/DifferentialAlgebra/bmi-install/lib/libbmi.0.dylib libbmi.so- Note: Depending on your installation, you may need to become a superuser before modifying the files, or to use the
sudocommand. - Note: Lines 2 and 3 rename the original dynamic libraries, for safety. Make sure they were successfully performed before proceeding.
- Note: Lines 4 and 5 replace the old libraries by symbolic links to the new ones. Let us explain the idea which lies under these commands. The symbolic links should have the same name as the old dynamic libraries. In the
blad-install/libandbmi-install/libdirectories, there are actual dynamic libraries and various symbolic links. Usingls -land looking at the sizes of the files, it is easy to find out the names of the actual dynamic libraries. The symbolic links should point to these libraries.
- Note: Depending on your installation, you may need to become a superuser before modifying the files, or to use the
- Final test. It the following command fails, then something went wrong and you may want to replace the symbolic links
libblad.dylibandlibbmi.soby the original files, in the MAPLEbin.APPLE_UNIVERSAL_OSXdirectory (see former step).$ maple
> with (DifferentialAlgebra):
> R := DifferentialRing (derivations = [x], blocks = [y]); - Using the experimental
DifferentialAlgebra0package. It is sufficient to modify the MAPLElibnamevariable, so that it mentions the$HOME/DifferentialAlgebra/bmi-install/mapledirectory. Observe that shell variables have to be replaced by their values. Here is an example.$ maple
> libname := "/home/boulier/DifferentialAlgebra/bmi-install/maple", libname:
> integrate := DifferentialAlgebra0:-Integrate;- Note: Both packages
DifferentialAlgebraandDifferentialAlgebra0take advantage of the new libraries. They can be used at the same time.
- Note: Both packages
- Next time you want to update BLAD and BMI, it is sufficient to update the source codes of BLAD and BMI (svn users only need to perform
svn updatecommands), to recompile them and to reinstall them inblad-installandbmi-install.
Windows
Download the blad-windows-* and bmi-windows-* tarballs from the BLAD page and this one.
- Obtain the two dynamic libraries
blad.dllandbmi.dll, plus the MAPLE library filesmaple.ind,maple.libandmaple.hdbcontaining the experimentalDifferentialAlgebra0package, for your platform. There are two possible methods- Compile BLAD, BMI and create the MAPLE library files using the instructions provided in the tarballs
- Use the files provided in the tarballs. However, beware to the version of MAPLE actually used to build
bmi.dll.
- Replace the old
blad.dllandbmi.dllby the new ones. It is recommended to make a copy of the old files before replacement. These files are located in a directory calledbin.winorbin.X86_64_WINDOWS, depending on the architecture of the machine. The location of this directory can be determined using thekernelopts(bindir)command, in MAPLE. - Using the experimental
DifferentialAlgebra0package. It is sufficient to list the directory containing the MAPLE library files in the MAPLElibnamevariable.
How to extend DifferentialAlgebra0
To be done