CBLAS not found: error installing iml-1.0.4p1

175 views
Skip to first unread message

Caleb Reister

unread,
Apr 2, 2015, 4:01:00 AM4/2/15
to sage-s...@googlegroups.com

Context

I am wanting to build a calculator similar in form to the TI-92 using a Raspberry Pi Model B. Its most popular, Raspbian (based on Debian), comes with Wolfram Mathematica preinstalled, and I intend to have Octave, Maxima, and possibly other mathematical packages installed. I have decided that SAGE would be a great addition since it can provide a single interface to all of those tools and comes with numerous others. I found a binary of SAGE for the RPi, but it is old and I wanted to gain experience in compiling large packages.

I have installed all of the prerequisites. In order to save time in the compilation process, I have installed GCC 4.8 and ATLAS via apt-get.

Hardware

raspberrypi
    description: Computer
    product: Raspberry Pi Model B
    width: 32 bits
  *-core
       description: Motherboard
       physical id: 0
       capabilities: brcm_bcm2708
     *-memory
          description: System memory
          physical id: 0
          size: 435MiB
     *-cpu
          physical id: 1
          bus info: cpu@0
          size: 700MHz
          capacity: 700MHz
          capabilities: cpufreq

CPU Details

processor    : 0
model name    : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS    : 2.00
Features    : half thumb fastmult vfp edsp java tls 
CPU implementer    : 0x41
CPU architecture: 7
CPU variant    : 0x0
CPU part    : 0xb76
CPU revision    : 7

Hardware    : BCM2708
Revision    : 000e
Serial        : 000000006ae395ee

Software

My list of installed apt-get packages can be found in pkgs.log. I am trying to compile

Operating System

Linux raspberrypi 3.18.7+ #755 PREEMPT Thu Feb 12 17:14:31 GMT 2015 armv6l GNU/Linux
Raspbian GNU/Linux 7 \n \l

Compilers

gcc-4.8 (Raspbian 4.8.2-21~rpi3rpi1) 4.8.2
g++-4.8 (Raspbian 4.8.2-21~rpi3rpi1) 4.8.2
GNU Fortran (Raspbian 4.8.2-21~rpi3rpi1) 4.8.2

ATLAS

This is the tree of my ATLAS installation.

/usr/lib/atlas-base
├── atlas
│   ├── libblas.so.3 -> libblas.so.3.0
│   ├── libblas.so.3.0
│   ├── liblapack.so.3 -> liblapack.so.3.0
│   └── liblapack.so.3.0
├── libatlas.so.3 -> libatlas.so.3.0
├── libatlas.so.3.0
├── libcblas.so.3 -> libcblas.so.3.0
├── libcblas.so.3.0
├── libf77blas.so.3 -> libf77blas.so.3.0
├── libf77blas.so.3.0
├── liblapack_atlas.so.3 -> liblapack_atlas.so.3.0
└── liblapack_atlas.so.3.0

1 directory, 12 files

Build Process

I have created a script to run the build process…

#!/bin/sh

export CC='gcc-4.8' \
       CXX='g++-4.8' \
       FC='gfortran-4.8' \
       SAGE_KEEP_BUILD_SPKGS='yes'
       SAGE_INSTALL_GCC='no' \
       SAGE_ATLAS_LIB='/usr/lib/atlas-base'

#Install prerequisites
sudo apt-get install gcc-4.8 g++-4.8 gfortran-4.8 \
                     libatlas3-base libatlas-dev libatlas-test libatlas-doc \
                     liblapack3 libblas3 libblas-dev \
                     tcl tk-dev dpkg-dev binutils \
                     texlive dvipng imagemagick

read -p "Prerequisites installed. Continue [y/n]? " cont
if [ "$cont=y" ]; then
    cd sage-*
    ./configure | tee -a config.log
    make | tee -a build.log
fi

The Problem

Here is the output of Make starting at the first sign of error. I have attached iml-1.0.4p1.log and atlas-3.10.2.log.

...
checking for CBLAS... configure: WARNING: CBLAS not found!
Please make sure that --with-cblas=<linker flags> and optional --with-cblas-include=<path> and --with-cblas-lib=<path> are correctly set.
Trying legacy ATLAS configuration.
checking for ATLAS >= 3.0... configure: error: ATLAS not found!
ATLAS version 3.0 or greater is required for this library to compile. Please make sure ATLAS is installed and specify the header and libraries location with the options --with-atlas-include=<path> and --with-atlas-lib=<path> respectively when running configure.
Error configuring IML.

real    1m13.834s
user    0m34.830s
sys    0m11.480s
************************************************************************
Error installing package iml-1.0.4p1
************************************************************************
Please email sage-devel (http://groups.google.com/group/sage-devel)
explaining the problem and including the relevant part of the log file
  /home/pi/Desktop/sage-6.5/logs/pkgs/iml-1.0.4p1.log
Describe your computer, operating system, etc.
If you want to try to fix the problem yourself, *don't* just cd to
/home/pi/Desktop/sage-6.5/local/var/tmp/sage/build/iml-1.0.4p1 and type 'make' or whatever is appropriate.
Instead, the following commands setup all environment variables
correctly and load a subshell for you to debug the error:
  (cd '/home/pi/Desktop/sage-6.5/local/var/tmp/sage/build/iml-1.0.4p1' && '/home/pi/Desktop/sage-6.5/sage' --sh)
When you are done debugging, you can type "exit" to leave the subshell.
************************************************************************
Makefile:658: recipe for target '/home/pi/Desktop/sage-6.5/local/var/lib/sage/installed/iml-1.0.4p1' failed
make[2]: *** [/home/pi/Desktop/sage-6.5/local/var/lib/sage/installed/iml-1.0.4p1] Error 1
make[2]: Leaving directory '/home/pi/Desktop/sage-6.5/build'
Makefile:391: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/pi/Desktop/sage-6.5/build'

real    1m24.092s
user    0m41.020s
sys    0m12.750s
***************************************************************
Error building Sage.

The following package(s) may have failed to build:

package: iml-1.0.4p1
log file: /home/pi/Desktop/sage-6.5/logs/pkgs/iml-1.0.4p1.log
build directory: /home/pi/Desktop/sage-6.5/local/var/tmp/sage/build/iml-1.0.4p1

The build directory may contain configuration files and other potentially
helpful information. WARNING: if you now run 'make' again, the build
directory will, by default, be deleted. Set the environment variable
SAGE_KEEP_BUILT_SPKGS to 'yes' to prevent this.

Makefile:19: recipe for target 'build' failed
make: *** [build] Error 1

Note: libcblas is clearly listed in /usr/lib/atlas-base, and I believe it meets the requirements of these instructions. Specifically, this excerpt…

SAGE_ATLAS_LIB - if you have an installation of ATLAS on your system and you want Sage to use it instead of building and installing its own version of ATLAS, set this variable to be the directory containing your ATLAS installation. It should contain the files libatlas, liblapack, libcblas, libf77blas (and optionally libptcblas and libptf77blas for multi-threaded computations), with extensions .a, .so, or .dylib. For backward compatibility, the libraries may also be in the subdirectory SAGE_ATLAS_LIB/lib/.

pkgs.log
iml-1.0.4p1.log
atlas-3.10.2.log

Dima Pasechnik

unread,
Apr 2, 2015, 4:37:47 AM4/2/15
to sage-s...@googlegroups.com
Make sure that you install development headers for ATLAS,
something like

apt-get install libatlas-dev

You need to set SAGE_ATLAS_LIB to point to the place where
your ATLAS libs can be found:
i.e. before running make at the shell prompt, do

export SAGE_ATLAS_LIB=/usr/lib

HTH,
Dima
Message has been deleted

Caleb Reister

unread,
Apr 2, 2015, 6:38:09 PM4/2/15
to sage-s...@googlegroups.com
I installed `libatlas-dev` when I installed ATLAS (line 230 of `pkgs.log`). I also just noticed a missing backslash in my environment variables. That could be the problem.

Caleb Reister

unread,
Apr 2, 2015, 7:01:41 PM4/2/15
to sage-s...@googlegroups.com

It still doesn’t work. I have also tried changing SAGE_ATLAS_LIB to /usr/lib. There are three possibilities I can think of: (1) the preprocessor can’t find the header files, (2) there is a permissions issue preventing the compiler from accessing the library files, or (3) the compiler is not finding the files because version numbers are appended to the extensions (ex: libcblas.so.3 instead of libcblas.so). Any ideas?

Caleb Reister

unread,
Apr 2, 2015, 7:24:56 PM4/2/15
to sage-s...@googlegroups.com
I also have one more idea: I have located the file that is running and raising the error, and it seems that the configure script for iml is not receiving the correct arguments. I am backing up my current partial installation and then am going to try modifying that file.

Caleb Reister

unread,
Apr 3, 2015, 12:17:37 AM4/3/15
to sage-s...@googlegroups.com

I’ve tried all of those ideas, and none of them have worked. I have also found this discussion and tried some of its suggestions.


François

unread,
Apr 3, 2015, 2:51:24 PM4/3/15
to sage-s...@googlegroups.com
I need the config,log in /home/pi/Desktop/sage-6.5/local/var/tmp/sage/build/iml-1.0.4p1 (it may be in
a subfolder called "src").

François

Caleb Reister

unread,
Apr 3, 2015, 4:12:57 PM4/3/15
to sage-s...@googlegroups.com
Here it is.
config.log

François

unread,
Apr 5, 2015, 9:06:09 AM4/5/15
to sage-s...@googlegroups.com
OK, that seem to be useful. While you are ATLAS provided by the system the ATLAS spkg is still
installed but because you are using system libraries only links are created in local/lib to the system
provided one.
In your case it looks like those links are missing. 
First look if the link are in /home/pi/Desktop/sage-6.5/local/lib if they are we'll go back to
the drawing board. If, as I suspect, they aren't we can try the following:
./sage -f atlas-3.10.2
If the link are still missing after that, create the links manually:
In local/lib do
ln -s /usr/lib/lib$lib.so lib$lib.so 
fot $lib in atlas, cblas, f77blas and lapack.

François
Reply all
Reply to author
Forward
0 new messages