首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在高山Linux Docker容器中构建GNATCOLL

在高山Linux Docker容器中构建GNATCOLL
EN

Stack Overflow用户
提问于 2019-04-09 23:31:49
回答 1查看 365关注 0票数 8

我似乎不能让GNATCOLL在基于高山Linux的Docker Container中编译。

到目前为止我的容器是:

代码语言:javascript
复制
FROM alpine:edge

# Add extra repositories
RUN echo 'http://dl-cdn.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories; \
    echo 'http://dl-cdn.alpinelinux.org/alpine/edge/community' >> /etc/apk/repositories; \
    echo 'http://dl-cdn.alpinelinux.org/alpine/edge/main' >> /etc/apk/repositories;

RUN apk add --no-cache build-base coreutils curl-dev gcc-gnat git gmp-dev openssl

# Bootstrap GPRBuild
RUN git clone https://github.com/AdaCore/xmlada.git; \
    git clone https://github.com/AdaCore/gprbuild.git; \
    cd gprbuild; ./bootstrap.sh --with-xmlada=../xmlada; \
    cd ..; \
    rm -rf xmlada gprbuild

这很好用,并为我提供了一个容器,其中包含一个基于GPR的Ada开发环境。当我尝试在这个容器中安装GNATCOLL时,出现了这个问题。

运行docker run -i -t <built_image>时会发生以下情况:

代码语言:javascript
复制
/ # git clone https://github.com/AdaCore/gnatcoll-core.git
<Typical git clone output>
/ # cd gnatcoll-core/
/gnatcoll-core # make setup
/gnatcoll-core # make
gprbuild -p -m --target=x86_64-linux  -j0 -XGNATCOLL_MMAP=yes -XGNATCOLL_MADVISE=yes -XGNATCOLL_VERSION=0.0 -XGNATCOLL_OS=unix -XBUILD=PROD  -XLIBRARY_TYPE=static -XXMLADA_BUILD=static -XGPR_BUILD=static \
        -XGNATCOLL_MMAP=yes -XGNATCOLL_MADVISE=yes -XGNATCOLL_VERSION=0.0 -XGNATCOLL_OS=unix -XBUILD=PROD gnatcoll.gpr
Setup
   [mkdir]        object directory for project GnatColl
   [mkdir]        library directory for project GnatColl
gnatcoll.gpr:24:06: unknown project file: "gpr"
make: *** [Makefile:128: build-static] Error 4

基于https://github.com/AdaCore/gnatcoll-core/issues/30中的讨论,我检查了我的gprbuild版本:

代码语言:javascript
复制
/gnatcoll-core # gprbuild --version
GPRBUILD Pro 18.0w (19940713) (x86_64-alpine-linux-musl)
Copyright (C) 2004-2016, AdaCore
This is free software; see the source for copying conditions.
See your AdaCore support agreement for details of warranty and support.
If you do not have a current support agreement, then there is absolutely
no warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.

因此,musl的gprbuild似乎非常过时,导致无法构建GNATCOLL。有没有办法获得更新版本的gprbuild for musl-c?如果没有,有没有其他方法可以安装GNATCOLL?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-04-10 01:57:36

问题是gprbuild中的./bootstrap.sh不会安装所有内容,它只是创建了一个最小的gprbuild安装。此外,它不构建gprlib,gprlib是gnatcoll所必需的,也必须安装。

所需的步骤包括:

代码语言:javascript
复制
# As before...
git clone https://github.com/AdaCore/xmlada.git
git clone https://github.com/AdaCore/gprbuild.git
cd gprbuild; ./bootstrap.sh --with-xmlada=../xmlada

# New: build and install xmlada
cd ../xmlada; ./configure && make && make install

# New: build and install gprbuild fully
cd ../gprbuild
export GPR_PROJECT_PATH=/usr/local/share/gpr
make prefix=/usr/local setup && make all && make install

# New: build and install gprlib
make libgpr.build && make libgpr.install

通过这些添加,我能够按照项目中指定的方式构建gnatcoll。

票数 10
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55596398

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档