How can I compile CLAPACK for STM32?

Discuss how to use the features of Atollic TrueSTUDIO, including the editor, assembler, C/C++ compiler, linker, debugger, static code analysis and team collaboration tools.

Moderators: Markus Girdland, Mattias Norlander

volvo742
Posts: 1
Joined: Wed Feb 13, 2019 5:24 pm

How can I compile CLAPACK for STM32?

Postby volvo742 » Wed Feb 13, 2019 5:33 pm

Hello!

I have a question about compile CLapack for STM32. Clapack is a library for numerical linear algebra written in Fortran 90, but converted to C-code. I wonder how should I compile CLapack for STM32.

If you go to this page and downloa clapack.tar.gz
https://www.netlib.org/clapack/

Unpack the file and open the make.inc.example file and then you can find this text. On this case, the default compiler is gcc. I have tried to use

Code: Select all

arm-atollic-eabi-gcc -c -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -std=c11


But it won't work. Look at this output. The first I need to to, according to the README.install, I need to use make f2clib, but I having some issues. Do you know how I should do to compile Clapack for STM32?

Code: Select all

dell@dell-Precision-M6400:~/Program/CLAPACK-3.2.1-ARM$ make f2clib
( cd F2CLIBS/libf2c; make )
make[1]: Go to folder ”/home/dell/Program/CLAPACK-3.2.1-ARM/F2CLIBS/libf2c”
arm-atollic-eabi-gcc -c -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -std=c11 -c f77vers.c
as: unknow flag ”-mcpu=cortex-m4”
Makefile:90: recipe for target 'f77vers.o' failed
make[1]: *** [f77vers.o] Error 1
make[1]: Leaving the folder ”/home/dell/Program/CLAPACK-3.2.1-ARM/F2CLIBS/libf2c”
Makefile:41: recipe for target 'f2clib' failed
make: *** [f2clib] Error 2
dell@dell-Precision-M6400:~/Program/CLAPACK-3.2.1-ARM$


More information

Code: Select all

dell@dell-Precision-M6400:~/Program/CLAPACK-3.2.1-ARM$ arm-atollic-eabi-gcc -v
Using built-in specs.
COLLECT_GCC=arm-atollic-eabi-gcc
COLLECT_LTO_WRAPPER=/usr/bin/../lib/gcc/arm-atollic-eabi/6.3.1/lto-wrapper
Target: arm-atollic-eabi
Configured with: /home/build/gcc-arm-none-eabi-6-2017-q1-update/src/gcc/configure --target=arm-atollic-eabi --prefix=/home/build/gcc-arm-none-eabi-6-2017-q1-update/install-native --libexecdir=/home/build/gcc-arm-none-eabi-6-2017-q1-update/install-native/lib --infodir=/home/build/gcc-arm-none-eabi-6-2017-q1-update/install-native/share/doc/gcc-arm-atollic-eabi/info --mandir=/home/build/gcc-arm-none-eabi-6-2017-q1-update/install-native/share/doc/gcc-arm-atollic-eabi/man --htmldir=/home/build/gcc-arm-none-eabi-6-2017-q1-update/install-native/share/doc/gcc-arm-atollic-eabi/html --pdfdir=/home/build/gcc-arm-none-eabi-6-2017-q1-update/install-native/share/doc/gcc-arm-atollic-eabi/pdf --enable-languages=c,c++ --enable-plugins --disable-decimal-float --disable-libffi --disable-libgomp --disable-libmudflap --disable-libquadmath --disable-libssp --disable-libstdcxx-pch --disable-nls --disable-shared --disable-threads --disable-tls --with-gnu-as --with-gnu-ld --with-newlib --with-headers=yes --with-python-dir=share/gcc-arm-atollic-eabi --with-sysroot=/home/build/gcc-arm-none-eabi-6-2017-q1-update/install-native/arm-atollic-eabi --build=x86_64-linux-gnu --host=x86_64-linux-gnu --with-gmp=/home/build/gcc-arm-none-eabi-6-2017-q1-update/build-native/host-libs/usr --with-mpfr=/home/build/gcc-arm-none-eabi-6-2017-q1-update/build-native/host-libs/usr --with-mpc=/home/build/gcc-arm-none-eabi-6-2017-q1-update/build-native/host-libs/usr --with-isl=/home/build/gcc-arm-none-eabi-6-2017-q1-update/build-native/host-libs/usr --with-libelf=/home/build/gcc-arm-none-eabi-6-2017-q1-update/build-native/host-libs/usr --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-pkgversion='GNU Tools for ARM Embedded Processors (Build 17.03)' --with-multilib-list=atollicprofile
Thread model: single
gcc version 6.3.1 20170215 (release) [ARM/embedded-6-branch revision 245512] (GNU Tools for ARM Embedded Processors (Build 17.03))
dell@dell-Precision-M6400:~/Program/CLAPACK-3.2.1-ARM$



Compile make file for Clapack.

Code: Select all

# -*- Makefile -*-
####################################################################
#  LAPACK make include file.                                       #
#  LAPACK, Version 3.2.1                                           #
#  June 2009                                                     #
####################################################################
#
# See the INSTALL/ directory for more examples.
#
SHELL = /bin/sh
#
#  The machine (platform) identifier to append to the library names
#
PLAT = _LINUX

#  Modify the FORTRAN and OPTS definitions to refer to the
#  compiler and desired compiler options for your machine.  NOOPT
#  refers to the compiler options desired when NO OPTIMIZATION is
#  selected.  Define LOADER and LOADOPTS to refer to the loader
#  and desired load options for your machine.
#
#######################################################
# This is used to compile C libary
CC        = arm-atollic-eabi-gcc -c -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -std=c11
# if no wrapping of the blas library is needed, uncomment next line
#CC        = gcc -DNO_BLAS_WRAP
CFLAGS    = -O3 -I$(TOPDIR)/INCLUDE
LOADER    = gcc
LOADOPTS  =
NOOPT     = -O0 -I$(TOPDIR)/INCLUDE
DRVCFLAGS = $(CFLAGS)
F2CCFLAGS = $(CFLAGS)
#######################################################################

#
# Timer for the SECOND and DSECND routines
#
# Default : SECOND and DSECND will use a call to the EXTERNAL FUNCTION ETIME
# TIMER    = EXT_ETIME
# For RS6K : SECOND and DSECND will use a call to the EXTERNAL FUNCTION ETIME_
# TIMER    = EXT_ETIME_
# For gfortran compiler: SECOND and DSECND will use a call to the INTERNAL FUNCTION ETIME
# TIMER    = INT_ETIME
# If your Fortran compiler does not provide etime (like Nag Fortran Compiler, etc...)
# SECOND and DSECND will use a call to the Fortran standard INTERNAL FUNCTION CPU_TIME
TIMER    = INT_CPU_TIME
# If neither of this works...you can use the NONE value... In that case, SECOND and DSECND will always return 0
# TIMER     = NONE
#
#  The archiver and the flag(s) to use when building archive (library)
#  If you system has no ranlib, set RANLIB = echo.
#
ARCH     = ar
ARCHFLAGS= cr
RANLIB   = ranlib
#
#  The location of BLAS library for linking the testing programs.
#  The target's machine-specific, optimized BLAS library should be
#  used whenever possible.
#
BLASLIB      = ../../blas$(PLAT).a
#
#  Location of the extended-precision BLAS (XBLAS) Fortran library
#  used for building and testing extended-precision routines.  The
#  relevant routines will be compiled and XBLAS will be linked only if
#  USEXBLAS is defined.
#
# USEXBLAS    = Yes
XBLASLIB     =
# XBLASLIB    = -lxblas
#
#  Names of generated libraries.
#
LAPACKLIB    = lapack$(PLAT).a
F2CLIB       = ../../F2CLIBS/libf2c.a
TMGLIB       = tmglib$(PLAT).a
EIGSRCLIB    = eigsrc$(PLAT).a
LINSRCLIB    = linsrc$(PLAT).a
F2CLIB       = ../../F2CLIBS/libf2c.a

Return to “Atollic TrueSTUDIO tool discussions”

Who is online

Users browsing this forum: No registered users and 4 guests