atlas.sourceforge.net}. After uncompressing it, create a build directory builddir in its top folder, enter it
cd ATLAS/builddir and run (replacing the prefix path with the one where you'd like Atlas to be installed) ../configure --prefix=/usr/local/soft/atlas-3.10.1 -Fa alg -fPIC
Note: on Win32 with cygwin,
- make sure you include -b 32 on the command line of configure to ensure that it does not attempt to build a 64-bit library and fail.
- the configure script may fail to detect the number of cores and decide to abort. Forcing this number to the actual number of processors by modifying the appropriate file would help.
ATLAS/CONFIG/src/config.c
To correct the problem, you need to add one line after the probe "GetIntProbe", as follows: iret = GetIntProbe(verb, ln, "arch", "NCPU", 2048); if (iret == 0) { printf("\nKIRR: ugly hack: forcing NCPU to 2");iret=2;}
After configure succeeds, you need to run "make" to build Atlas, then run
make check
to verify that it works and "make install" to install it.
Note that when building starts, you need an unloaded PC for it to collect the relevant times for self-optimising. For this reason,
cpufreq-selector -g performance
might help to disable power-saving (Atlas calls it "CPU throttling" and attempts to detect it).
You need UMFPACK, {@link http://www.cise.ufl.edu/research/sparse/umfpack/}. Packages to download are AMD, COLAMD, CHOLMOD and SuiteSparse_config. These need to be uncompressed starting from the same directory. Subsequently, configuration needs to be set. The file to edit is SuiteSparse_config/SuiteSparse_config.mk
(or any other depending on whether you use a Mac or GPU. It has to have the following two lines included (which would usually replace the appropriate lines in the file rather than be added at the end): UMFPACK_CONFIG = -fPIC BLAS = -L/usr/local/soft/atlas-3.10.1/lib -lf77blas -latlas -lgfortran
Note the reference to the Atlas installation directory. You may also wish to replace -llf77blas with -lptf77blas, but it should not affect anything. You might also want to
CC = gcc CFLAGS = -O3
or even CC = gcc -fPIC
to ensure that AMD is built as a relocable library - without it Statechum's .so library may fail to build. Win32/cygwin note: if using gcc version 3 rather than 4, use the following line
BLAS = -L/usr/local/soft/atlas-3.8.1/lib -lf77blas -latlas -lg2c
Subsequently, running make in the UMFPACK directory will build UMFPACK (and other libraries). Most likely, you will have to run make install
in all of AMD/CHOLMOD/COLAMD/SuiteSparse_config/UMFPACK in order to get all the files installed. Without them, it will not be possible to build libStatechumsolver The best way to do this is via for D in AMD CHOLMOD COLAMD SuiteSparse_config UMFPACK;do (cd $D;make install );done
If files linear/configure or linear/Makefile.in are not present, you need to build them as follows: cd linear ./bootstrap
Building the interface involves running cd linear ./configure --with-blasdir=/usr/local/soft/atlas-3.10.1/lib --with-umfpack=/usr/local/src/umfpack && make
Note that the above includes both Atlas directory and the one into which UMFPACK was extracted. Subsequently, running make should build the library. If gcc has gcj installed, Sun JDK may include a jni_md.h which will pick gcc's jni_md.h rather than Sun's one and give an error about a boolean. The solution is to do something like
CC='gcc -I/usr/local/soft/jdk1.6.0_16/include/linux/' sh ./configure --with-blasdir=/usr/local/soft/atlas-3.10.1 --with-umfpack=/usr/local/src/umfpack/
On Win32 with cygwin's gcc version 3, this will not work because libtool will not link to static libraries (.a import libraries from .dlls are ok). Linking to all the object files from atlas, amd and umfpack will not work because these .o files have not been built with libtool. The only option is hence to build a .dll from atlas, amd and umfpack and link to that dll. Multi-threaded support does not work because libptf77blas links to cygwin1.dll which we cannot use - this dll does not support being dynamically loaded (a well-documented problem) so the library we build with it will not work with Java (jvm will lock up on LoadLibrary).
The easiest way to build a library is to edit fullrebuild.sh by adding the relevant paths to it and then issue cd linear ./fullrebuild.sh
On Linux, this runs bootstrap and make. On Win32, this script takes all .o files from atlas, umfpack and amd, builds a library out of them, converts it to .dll (following {@link http://www.kevinsheppard.org/research/matlabatlas}) and subsequently links the interface module to that .dll. If any changes are made to the .c or .h file, the library can be rebuilt with make -f Makefile_win32
where the Makefile_win32 is built by fullrebuild.sh. Note that the way the script builds a dll is very ugly but since it seems that cygwin does not do what one would expect it to (build a dll out of static libraries built with -fPIC), I think it is not appropriate to "fix" configure scripts to work around these problems.
In order for the just built library to be picked by Java, you need to pass the following as a JVM option: -Djava.library.path=linear/.libs
MacOS X - specific instructions
It may be advisable to build gcc first (gmp web page suggests it will not work when built with XCode so using a recent gcc may be advisable),
- Using Applications/Utilities/Java/Java Preferences, set the default JVM to be 64-bit version 6.0.
- build gmp
CC='gcc-4.2 -m64' ./configure --prefix=/usr/local/soft_a/gmp make make install
- build mpfr
CC='gcc-4.2 -m64' ./configure --with-gmp=/usr/local/soft_a/gmp --prefix=/usr/local/soft_a/mpfr make make install
- Build gcc,
CC='gcc-4.2 -m64' ./configure --prefix=/usr/local/soft_a/gcc-4.4.1 --with-gmp=/usr/local/soft_a/gmp-4.3.1 --with-mpfr=/usr/local/soft_a/mpfr-2.4.1 --host=x86_64-apple-darwin9.8.0 --build=x86_64-apple-darwin9.8.0 --enable-languages="c c++"
The -m64 ensures all of gcc is built for 64-bit. --host and --build make sure that gcc rebuilds itself for 64-bit. - Now repeat the above but build gmp,mpfr and gcc with the just-built gcc, replacing soft_a with soft above. The distinction between soft_a and soft is whether Apple's gcc (gcc-4.2) has been used to build a library or not.
MacOS X or XCode come with blas libraries, hence one does not need to install Atlas (which can be built using instructions for building Atlas on Linux). If Atlas is installed into somewhere like /usr/local/soft/atlas-3.8.3, in the course of building UMFPACK gcc may choose to pick /usr/lib/libatlas.dylib instead of the newly-installed Atlas library /usr/local/soft/atlas-3.8.3/lib/libatlas.dylib, leading to build errors for umfpack's examples because Atlas's symbols have different names to that of Apples's Atlas.
- After unpacking all three parts of UMFPACK, options to be included in UFconfig/UFconfig.mk are :
UMFPACK_CONFIG = -DNO_TIMER -fPIC BLAS = -L/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A -lblas
- For building Statechum library, the following is done:
cd linear ./configure --with-blasdir=/System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A --with-umfpack=/Users/Shared/experiment/umfpack && make
Where /Users/Shared/experiment/umfpack is where UMFPACK was extracted, it should have subdirectories UMFPACK, AMD and UFconfig. - For testing, providing the -Djava.awt.headless=true option to JVM is necessary on MacOS to stop loading of Statechum's properties from making a connection to a monitor and triggering a bouncing coffee icon in the dock as well as a display of application name in the menu bar. The problem is caused by static data in, for instance, java.awt.Rectangle making the said connection upon classloading of java.awt.Rectangle.
It is worth noting that the full path of the interface is encoded in the shared libraries hence moving this interface is only possible if libraries are rebuilt. For this reason, LSolver is stuck in the rpnicore rather than in learner/linear. Instructions for building OpenBLAS on Linux, Uncompress the .zip, then from the main directory run
make PREFIX=/usr/local/soft/OpenBLAS-be853da DYNAMIC_ARCH=1 UTEST_CHECK=1 NO_LAPACK=1 NO_AFFINITY=1
The first parameter is responsible for building in support for all CPU architectures, otherwise only the current one will This will attempt to download CUnit and then fail.
cd utest;make
should build and install CUnit into utest. Subsequently doing the following command from the main directory (the one just above utest)
ln -s utest/CUnit-2.1-2/include/CUnit .
would fix unit tests that ship with OpenBLAS and they will run when the above make command is run. After doing
make PREFIX=/usr/local/soft/OpenBLAS-be853da DYNAMIC_ARCH=1 UTEST_CHECK=1 NO_LAPACK=1 install
OpenBLAS is available. SuiteSparse_config.mk should have
CC=x86_64-w64-mingw32-gcc AR=x86_64-w64-mingw32-ar RANLIB = x86_64-w64-mingw32-ranlib F77 = x86_64-w64-mingw32-gfortran BLAS = /usr/local/soft/OpenBLAS-be853da/lib/libopenblas.lib INSTALL_LIB=/usr/local/soft/umfpack-5.6.1-openblas/lib INSTALL_INCLUDE=/usr/local/soft/umfpack-5.6.1-openblas/include
OpenBLAS on Windows7-x86_64 First, build OpenBLAS with both options for Unix (above) and those mentioned in quickbuild.64bit.
When building UMFPACK, most options are the same as for Unix but there are a few changes,
- BLAS = /usr/local/soft/OpenBLAS-be853da/lib/libopenblas.lib
- It is worth removing -fPIC from the definition of CF since on Windows all code is position-independent and this eliminates the warning.
- It is worth removing -lrt from definition LIB because the library is missing.
Finally, Makefile in the UMFPACK/Demo directory has the "run" target, where it runs demos and records the results. Every time it runs a demo, the output has to be piped through d2u to correct line endings on Windows and through sed 's/e\([+-]\)0\([0-9]\+\)/e\1\2/g' to convert the differences in which exponents are output on Windows. Hence the extra content is like
... _demo | d2u | sed 's/e\([+-]\)0\([0-9]\+\)/e\1\2/g' > my_ ... .out