在最新的 UBUNTU 上安装旧的 32 位软件

在最新的 UBUNTU 上安装旧的 32 位软件

我正在尝试在 64 位 LINUX HPC 集群上安装旧版软件(32 位)。这是 2005 年的相当老的软件了。

软件位于https://www.drive5.com/pals/

操作系统详细信息是PRETTY_NAME="Ubuntu 18.04.2 LTS"

使给出:

g++ -c -O3 -march=pentiumpro -mcpu=pentiumpro -funroll-loops -Winline -DNDEBUG=1  aligntraps.cpp -o aligntraps.o
g++: warning: ‘-mcpu=’ is deprecated; use ‘-mtune=’ or ‘-march=’ instead
cc1plus: error: CPU you selected does not support x86-64 instruction set
Makefile:22: recipe for target 'aligntraps.o' failed
make: *** [aligntraps.o] Error 1

有人可以建议如何更改 Makefile(如下所示),以便我的软件编译 make 步骤能够成功完成吗?

CFLAGS = -O3 -march=pentiumpro -mcpu=pentiumpro -funroll-loops -Winline -DNDEBUG=1
LDLIBS = -lm -static
# LDLIBS = -lm

OBJ = .o
EXE =

RM = rm -f
CP = cp

GPP = g++
LD = $(GPP) $(CFLAGS)
CPP = $(GPP) -c $(CFLAGS) 
CC = gcc -c $(CFLAGS) 

all: pals

CPPSRC = $(sort $(wildcard *.cpp))
CPPOBJ  = $(subst .cpp,.o,$(CPPSRC))

$(CPPOBJ): %.o: %.cpp
    $(CPP) $< -o $@

pals: $(CPPOBJ)
    $(LD) -o pals $(CPPOBJ) $(LDLIBS)

答案1

注意 - 尽管您的问题的标题是关于“安装旧的 32 位软件”,但似乎没有特别的理由不将该程序构建为本机 64 位软件。但是,如果您确实需要构建 32 位版本(用于基准测试,或用于精确再现以前发布的结果),那么请按以下步骤操作。


并不是说我的系统是 64 位 Ubuntu 18.04 和 gcc/g++ 7

$ uname -a
Linux t400s 4.15.0-45-generic #48-Ubuntu SMP Tue Jan 29 16:28:13 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

$ g++ --version
g++ (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

在这种特殊情况下,您尝试构建的软件似乎没有使用除 之外的任何库,并且安装该软件包(将安装并作为依赖项)libm.a似乎就足够了,然后修改 Makefile以包含g++-multilibgcc-multiliblibc6-dev-x32CFLAGS-m32

所以

sudo apt install g++-multilib

然后

$ head -3 Makefile 
CFLAGS = -m32 -O3 -march=pentiumpro -mcpu=pentiumpro -funroll-loops -Winline -DNDEBUG=1
LDLIBS = -lm -static
# LDLIBS = -lm

$ make

您会收到一些警告

g++: warning: ‘-mcpu=’ is deprecated; use ‘-mtune=’ or ‘-march=’ instead

但是该pals程序应该构建:

$ file pals
pals: ELF 32-bit LSB executable, Intel 80386, version 1 (GNU/Linux), statically linked, for GNU/Linux 3.2.0, BuildID[sha1]=1b9e369acf2aa7c6448b4132a203b8dccde16a7d, not stripped

并运行

$ ./pals

PALS v1.0
http://www.drive5.com/pals
Written by Bob Edgar and Gene Myers.
This software is donated to the public domain.
Please visit web site for requested citation.


Usage:
    pals -target <fastafile> -query <fastafile>
    pals -self <fastafile>

Options:
    -out <outfile>       (default standard output)
    -fwdonly             don't align reverse strand
    -filterout <file>    save filter hits to file

Alignment parameters can be specified in three ways:
    (1) Defaults         -length 400 -pctid 94
    (2) Specify -length <minhitlength> -pctid <minhitid>
    (3) Specify all filter and d.p. parameters:
           -wordsize     Filter word size
           -seedlength   Seed hit length
           -seeddiffs    Max #diffs in seed hit
           -length       Min length of final hit
           -pctid        Min %id of final hit
           -tubeoffset   (Optional)

For further information, please see the User Guide.

Must specify either -self or both -target and -query

答案2

您是否尝试从 Makefile 中删除 -march=pentiumpro -mcpu=pentiumpro

它对其进行编译并使用此处的文件运行此处,从而进行更改。

https://molb7621.github.io/workshop/Miscellaneous/data.html

./pals -self example.fa 并得到

 0 secs       1 Mb (  0%) Reading sequence
 0 secs      12 Mb (  1%) Reading sequence done (0s).

序列长度 3092 个碱基 (0 Mb),4 个重叠群

……一大堆线……

0 DP 命中,总长度 0 运行时间 0 秒,峰值内存使用 280 M

相关内容