在64位Ubuntu 16.04上构建LAPACK 3.7.1会忽略32位标志,使用make

时间:2017-08-11 14:34:31

标签: c ubuntu cmake gfortran lapack

我试图在Ubuntu 16.04 64位上使用netlib构建最新的LAPACK库(3.7.1),用于32位应用程序(不是最好的想法,我知道,但我只限于这个操作系统)。我对此做的研究表明我应该在gfortran和gcc标志中添加-m32标志。这些库是构建的,但仍然是64位。

尝试链接时,会为库中的每个对象显示以下错误:

i386:x86-64 architecture of input file `x' is incompatible with i386 output

安装LAPACK的说明说只需要修改make.inc文件,但它们似乎有点过时了。

到目前为止,我已经尝试将-m32标志添加到gcc CFLAGS和gfortran OPTS,以及将-melf_i386添加到gfortran加载程序选项中,而输出文件格式没有变化。

这是我现在正在使用的make.inc:

#################################################################### # LAPACK make include file. # # LAPACK, Version 3.7.1 # # June 2017 # #################################################################### SHELL = /bin/sh # CC is the C compiler, normally invoked with options CFLAGS. # CC = gcc CFLAGS = -O3 -m32 -fPIC # 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. # # Note: During a regular execution, LAPACK might create NaN and Inf # and handle these quantities appropriately. As a consequence, one # should not compile LAPACK with flags such as -ffpe-trap=overflow. # FORTRAN = gfortran OPTS = -O2 -m32 -frecursive -fPIC DRVOPTS = $(OPTS) NOOPT = -O0 -m32 -frecursive -fPIC # Define LOADER and LOADOPTS to refer to the loader and desired # load options for your machine. # LOADER = gfortran LOADOPTS = -melf_i386 # The archiver and the flag(s) to use when building an archive # (library). If your system has no ranlib, set RANLIB = echo. # ARCH = ar ARCHFLAGS = cr RANLIB = ranlib # 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 # INTERNAL FUNCTION CPU_TIME #TIMER = INT_CPU_TIME # If none of these work, you can use the NONE value. # In that case, SECOND and DSECND will always return 0. #TIMER = NONE # Uncomment the following line to include deprecated routines in # the LAPACK library. # #BUILD_DEPRECATED = Yes # LAPACKE has the interface to some routines from tmglib. # If LAPACKE_WITH_TMG is defined, add those routines to LAPACKE. # #LAPACKE_WITH_TMG = Yes # 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 = -lxblas # The location of the libraries to which you will link. (The # machine-specific, optimized BLAS library should be used whenever # possible.) # BLASLIB = ../../librefblas.a CBLASLIB = ../../libcblas.a LAPACKLIB = liblapack.a TMGLIB = libtmglib.a LAPACKELIB = liblapacke.a

由于这可能是相关的,我已经安装了gfortran,gcc,g ++ -multilib软件包,而我尝试链接库的应用程序与其他32位库(libjpeg:i386和libquadmaths:例如i386。

我花了几个小时寻找解决方案,并希望能够获得任何洞察力!

干杯,

Cavusa

0 个答案:

没有答案