Contact me: hankecnc@gmail.com

编译错误 #1749

推推 grbl 3年前 (2023-01-30) 295次浏览
打开
3个任务
jack9603301 打开了这个问题 2022 年 5 月 29 日 · 5 条评论
打开
3个任务

编译错误#1749

jack9603301 打开了这个问题 2022 年 5 月 29 日 · 5 条评论

注释

编译错误 #1749
杰克9603301 评论了 2022 年 5 月 29 日  

以下是我重现该问题所遵循的步骤:

使用 Gentoo ebuild 编译如下:

# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI="7"

PYTHON_COMPAT=( python3_10 )

inherit autotools eutils flag-o-matic multilib python-single-r1

DESCRIPTION="LinuxCNC "
HOMEPAGE="http://linuxcnc.org/"
#SRC_URI="mirror://sourceforge/gentoocnc/distfiles/${P}.tar.gz"
#SRC_URI="https://github.com/LinuxCNC/linuxcnc/archive/2.7.zip"
SRC_URI="https://github.com/LinuxCNC/linuxcnc/archive/refs/tags/v2.8.2.tar.gz"

S="${WORKDIR}"/linuxcnc-2.8.2/src

LICENSE="LGPL-3"
SLOT="linuxcnc-2.8"
KEYWORDS="~amd64 ~x86"
IUSE="+python +uspace +X +gtk -rt gstreamer modbus simulator usb"
# TODO: add shmdrv use flag


# --disable-python uses python anyways and fails so python is a required use flag
REQUIRED_USE="
    python
    python? ( ${PYTHON_REQUIRED_USE} )
	rt? ( !simulator )
	"

DEPEND="dev-lang/tcl
	dev-lang/tk
	dev-tcltk/tkimg
	dev-tcltk/tclx
	dev-libs/boost[python]
	modbus? ( <dev-libs/libmodbus-3.1 )
	dev-tcltk/bwidget
	gtk? ( x11-libs/gtk+ )
    gstreamer? (
        dev-python/gst-python:0.10
        media-libs/gst-plugins-base:0.10
    )
	|| (
        net-analyzer/netcat
        net-analyzer/netcat6
    )
	x11-libs/libXinerama
	usb? ( virtual/libusb )
	dev-lang/python:3.10[tk]
	$(python_gen_cond_dep 'dev-python/lxml[${PYTHON_USEDEP}]')
	$(python_gen_cond_dep 'dev-python/numpy[${PYTHON_USEDEP}]')
	$(python_gen_cond_dep 'dev-python/configobj[${PYTHON_USEDEP}]')
	$(python_gen_cond_dep 'dev-python/pillow[tk,${PYTHON_USEDEP}]')
	media-libs/mesa
    x11-apps/mesa-progs
	X? (
        x11-libs/libXaw
        $(python_gen_cond_dep 'dev-python/python-xlib[${PYTHON_USEDEP}]')
    )
	rt? ( sys-kernel/rt-sources )
	virtual/opengl
	virtual/glu
	${PYTHON_DEPS}
	sys-devel/gettext
	sys-process/procps
    sys-process/psmisc
    net-firewall/iptables
    media-gfx/graphviz
"
RDEPEND="${DEPEND}
	python? ( dev-python/yapps )"

src_prepare() {
    default
    eautoreconf
}

src_configure() {
	#myconf="--prefix=${EPREFIX}/usr --with-kernel-headers=/usr/src/linux/ $(use_with modbus libmodbus)"
	myconf="--prefix=${EPREFIX}/usr --enable-non-distributable=yes --with-boost-python=boost_python310 $(use_with modbus libmodbus)"

	use !gtk && myconf="${myconf} --disable-gtk"
	use rt && myconf="${myconf} --with-realtime=uspace"
	use simulator && myconf="${myconf} --with-realtime=uspace"
	use !usb && myconf="${myconf} --without-libusb-1.0"
#	use rtai && myconf="${myconf} --with-realtime=${EPREFIX}/usr/realtime --with-module-dir=${EPREFIX}/usr/lib/linuxcnc/rtai/"
	use X && myconf="${myconf} --with-x"

	# TODO: fix that - get python version
	#use python && myconf="${myconf} --with-python=/usr/bin/python3.10"
	use !python && myconf="${myconf} --disable-python"

	econf ${myconf}
}

src_install() {
	PORTAGE_COMPRESS=""
	emake DESTDIR="${D}" install

	local envd="${T}/51linuxcnc"
	cat > "${envd}" <<-EOF
		LDPATH="${EPREFIX}/usr/$(get_libdir)/linuxcnc"
	EOF
	doenvd "${envd}"
	
	insinto "/usr/share/linuxcnc/"
	doins Makefile.inc
	
	insinto "/etc/linuxcnc/"
	doins "../scripts/rtapi.conf"

	doicon "../linuxcncicon.png"
	make_desktop_entry linuxcnc LinuxCNC linuxcnc 'Science;Robotics'
}

pkg_postinst() {
	elog "The compiled software may not be redistributed due to use of packages with incompatible licenses."
	elog "Opening machine configuration files from older Versions can crash the application as it cannot load old named modules, e.g. probe_parport.so not found"
	elog "This is not a Gentoo- or build related error. It looks like linuxcnc 2.8 will have some kind of converter for them."
	elog "If you created them with stepconf. You can just open the stepconf file and create them new. Don't forget to backup any manual changes (e.g. backlash!) from the .hal and .ini files and make them again."
}

实际上。这是手动编译的自动化实现。因此,可以在一定程度上忽略不相关的部分

这是我期望发生的事情:

至少编译正常

这是发生了什么:

出现以下编译错误:

    inlined from ‘int Interp::arc_data_ijk(int, int, double, double, double, double, int, double, double, int, double*, double*, int*, double, double, double)’ at emc/rs274ngc/interp_arc.cc:294:3:
/usr/include/bits/string_fortified.h:95:34: warning: ‘char* __builtin_strncpy(char*, const char*, long unsigned int)’ output truncated copying 80 bytes from a string of length 140 [-Wstringop-truncation]
   95 |   return __builtin___strncpy_chk (__dest, __src, __len,
      |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
   96 |                                   __glibc_objsize (__dest));
      |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~
In function ‘char* strncpy(char*, const char*, size_t)’,
    inlined from ‘int Interp::arc_data_ijk(int, int, double, double, double, double, int, double, double, int, double*, double*, int*, double, double, double)’ at emc/rs274ngc/interp_arc.cc:309:5:
/usr/include/bits/string_fortified.h:95:34: warning: ‘char* __builtin_strncpy(char*, const char*, long unsigned int)’ output truncated copying 80 bytes from a string of length 140 [-Wstringop-truncation]
   95 |   return __builtin___strncpy_chk (__dest, __src, __len,
      |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
   96 |                                   __glibc_objsize (__dest));
      |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~
In function ‘char* strncpy(char*, const char*, size_t)’,
    inlined from ‘int Interp::arc_data_r(int, int, double, double, double, double, double, int, double*, double*, int*, double)’ at emc/rs274ngc/interp_arc.cc:370:3:
/usr/include/bits/string_fortified.h:95:34: warning: ‘char* __builtin_strncpy(char*, const char*, long unsigned int)’ output truncated copying 80 bytes from a string of length 109 [-Wstringop-truncation]
   95 |   return __builtin___strncpy_chk (__dest, __src, __len,
      |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
   96 |                                   __glibc_objsize (__dest));
      |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~
In function ‘char* strncpy(char*, const char*, size_t)’,
    inlined from ‘int Interp::arc_data_r(int, int, double, double, double, double, double, int, double*, double*, int*, double)’ at emc/rs274ngc/interp_arc.cc:376:3:
/usr/include/bits/string_fortified.h:95:34: warning: ‘char* __builtin_strncpy(char*, const char*, long unsigned int)’ output truncated copying 80 bytes from a string of length 109 [-Wstringop-truncation]
   95 |   return __builtin___strncpy_chk (__dest, __src, __len,
      |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
   96 |                                   __glibc_objsize (__dest));
      |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~
In function ‘char* strncpy(char*, const char*, size_t)’,
    inlined from ‘int Interp::arc_data_comp_r(int, int, int, double, double, double, double, double, double, int, double*, double*, int*, double)’ at emc/rs274ngc/interp_arc.cc:219:3:
/usr/include/bits/string_fortified.h:95:34: warning: ‘char* __builtin_strncpy(char*, const char*, long unsigned int)’ output truncated copying 80 bytes from a string of length 127 [-Wstringop-truncation]
   95 |   return __builtin___strncpy_chk (__dest, __src, __len,
      |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
   96 |                                   __glibc_objsize (__dest));
      |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~
Compiling emc/rs274ngc/interp_base.cc
cc1plus: warning: ‘-Werror=’ argument ‘-Werror=implicit-function-declaration’ is not valid for C++
Compiling emc/rs274ngc/interp_check.cc
cc1plus: warning: ‘-Werror=’ argument ‘-Werror=implicit-function-declaration’ is not valid for C++
Compiling emc/rs274ngc/interp_convert.cc
cc1plus: warning: ‘-Werror=’ argument ‘-Werror=implicit-function-declaration’ is not valid for C++
emc/task/taskclass.cc: In function ‘int return_int(const char*, PyObject*)’:
emc/task/taskclass.cc:404:10: error: ‘PyInt_Check’ was not declared in this scope; did you mean ‘PySet_Check’?
  404 |         (PyInt_Check(retval))) {
      |          ^~~~~~~~~~~
      |          PySet_Check
emc/task/taskclass.cc:405:16: error: ‘PyInt_AS_LONG’ was not declared in this scope; did you mean ‘PyLong_AS_LONG’?
  405 |         return PyInt_AS_LONG(retval);
      |                ^~~~~~~~~~~~~
      |                PyLong_AS_LONG
emc/task/taskclass.cc:409:26: error: ‘PyString_AsString’ was not declared in this scope
  409 |                          PyString_AsString(retval),
      |                          ^~~~~~~~~~~~~~~~~
emc/task/taskclass.cc: At global scope:
emc/task/taskclass.cc:444:31: error: invalid conversion from ‘void (*)()’ to ‘PyObject* (*)()’ {aka ‘_object* (*)()’} [-fpermissive]
  444 |     { (char *) "interpreter", initinterpreter },
      |                               ^~~~~~~~~~~~~~~
      |                               |
      |                               void (*)()
emc/task/taskclass.cc:445:28: error: invalid conversion from ‘void (*)()’ to ‘PyObject* (*)()’ {aka ‘_object* (*)()’} [-fpermissive]
  445 |     { (char *) "emccanon", initemccanon },
      |                            ^~~~~~~~~~~~
      |                            |
      |                            void (*)()
emc/task/taskclass.cc:446:27: error: invalid conversion from ‘void (*)()’ to ‘PyObject* (*)()’ {aka ‘_object* (*)()’} [-fpermissive]
  446 |     { (char *) "emctask", initemctask },
      |                           ^~~~~~~~~~~
      |                           |
      |                           void (*)()
make: *** [Makefile:222: objects/emc/task/taskclass.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from /usr/include/string.h:519,
                 from emc/rs274ngc/interp_convert.cc:20:
In function ‘char* strncpy(char*, const char*, size_t)’,
    inlined from ‘int Interp::convert_threading_cycle(block_pointer, setup_pointer, double, double, double)’ at emc/rs274ngc/interp_convert.cc:4717:5:
/usr/include/bits/string_fortified.h:95:34: warning: ‘char* __builtin_strncpy(char*, const char*, long unsigned int)’ output truncated copying 80 bytes from a string of length 89 [-Wstringop-truncation]
   95 |   return __builtin___strncpy_chk (__dest, __src, __len,
      |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
   96 |                                   __glibc_objsize (__dest));
      |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~
In function ‘char* strncpy(char*, const char*, size_t)’,
    inlined from ‘int Interp::convert_threading_cycle(block_pointer, setup_pointer, double, double, double)’ at emc/rs274ngc/interp_convert.cc:4720:5:
/usr/include/bits/string_fortified.h:95:34: warning: ‘char* __builtin_strncpy(char*, const char*, long unsigned int)’ output truncated copying 80 bytes from a string of length 89 [-Wstringop-truncation]
   95 |   return __builtin___strncpy_chk (__dest, __src, __len,
      |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
   96 |                                   __glibc_objsize (__dest));
      |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~

在此之前它工作正常:

(如果在对硬件或软件进行特定更改后行为发生了变化
,请描述您认为负责的更改。例如,“
从 LinuxCNC 2.7.3 升级到 2.7.4 后”)

有关我的硬件和软件的信息:

  • 我正在使用这个 Linux 发行版和版本(通常用 表示lsb_release -a):gentoo linux
  • 我正在使用这个内核版本(显示为uname -a):Linux jack-B250-HD3 5.17.1-zen1 Seb/master/hm2 watchdog  #5 ZEN SMP PREEMPT Mon May 16 23:19:10 CST 2022 x86_64 Intel(R) Core( TM) i5-6600K CPU @ 3.50GHz GenuineIntel GNU/Linux
  • 我在跑步 …
    • 来自 linuxcnc.org 的二进制版本(包括 buildbot.linuxcnc.org)
    • 我自己构建的二进制文件
    • 来自 linuxcnc.org 之外的其他来源的二进制版本
  • 我正在使用这个 LinuxCNC 版本(显示在包管理器中,或者对于 git 版本,scripts/get-version-from-git):2.8.2 标签
  • 我正在使用此用户界面 (GUI)(例如 AXIS、Touchy、gmoccapy 等):
  • 我正在使用这个接口硬件供应商和芯片组(例如,并行端口、以太网端口、FPGA 卡):
编译错误 #1749

py3下好像只能建master

编译错误 #1749
合作者

是的,只有 master 支持 py3,而且只支持 py3。

编译错误 #1749
作者
杰克9603301 评论了 2022 年 5 月 29 日  

@rene-dev 但是,我发现了以下问题。我不知道我是否需要安装任何额外的模块:

┌─(/var/db/repos/gentoo_overlay_local)─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────(jack@jack-B250-HD3:pts/4)─┐
└─(19:24:02 on main)──> linuxcnc                                                                                                                                                                                             ──(日,5月29)─┘
LINUXCNC - 2.9.0~pre0
Machine configuration directory is '/home/jack/linuxcnc/configs/sim.axis'
Machine configuration file is 'axis.ini'
can't find package Linuxcnc
    while executing
"package require Linuxcnc "
    (file "/usr/share/linuxcnc/hallib/check_config.tcl" line 187)
check_config validation failed
LinuxCNC terminated with an error.  You can find more information in the log:
    /home/jack/linuxcnc_debug.txt
and
    /home/jack/linuxcnc_print.txt
as well as in the output of the shell command 'dmesg' and in the terminal
┌─(/var/db/repos/gentoo_overlay_local)──────────────────────────────────────
编译错误 #1749
合作者

找不到软件包 Linuxcnc
意味着 python 没有找到 linuxcnc 模块。要么是路径问题,要么是 python 版本不匹配。

编译错误 #1749

貌似是linuxcnc的TCL包路径没有设置到环境变量导致的问题

免费注册 在 GitHub 上加入此对话。已有帐户? 登录评论
标签
还没有
项目

还没有

发展

没有分支机构或拉取请求

2名参加者
编译错误 #1749编译错误 #1749

喜欢 (0)