#17 problemcompiling gentoo ebuild dev-python/cgkit-2.0.0_alpha8

closed
nobody
None
5
2008-08-26
2008-08-25
Anonymous
No

samh@trevor ~ $ eix cgkit
[U] dev-python/cgkit
Available versions: 2.0.0_alpha8 {3ds}
Installed versions: 2.0.0_alpha7(14:55:00 11/04/07)(3ds -ogre)
Homepage: http://cgkit.sourceforge.net
Description: Python library for creating 3D images

samh@trevor ~ $ cat /usr/portage/dev-python/cgkit/cgkit-2.0.0_alpha8.ebuild
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-python/cgkit/cgkit-2.0.0_alpha8.ebuild,v 1.3 2008/05/22 20:46:25 maekke Exp $

inherit distutils flag-o-matic

MY_P=${P/_/}
DESCRIPTION="Python library for creating 3D images"
SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"
HOMEPAGE="http://cgkit.sourceforge.net"
RDEPEND="dev-lang/python
dev-python/pyrex
dev-libs/boost
dev-python/pyprotocols
dev-python/pyopengl
dev-python/pygame
dev-python/imaging
3ds? ( media-libs/lib3ds )"
DEPEND="${RDEPEND}
dev-util/scons"

SLOT="0"
LICENSE="LGPL-2.1 MPL-1.1 GPL-2"
KEYWORDS="~amd64 ~ppc x86"
IUSE="3ds"

S=${WORKDIR}/${MY_P}

src_unpack() {
unpack ${A}
cd "${S}"

sed -i -e "s/fPIC/fPIC\",\"${CFLAGS// /\",\"}/" supportlib/SConstruct
cp config_template.cfg config.cfg
echo 'LIBS += ["GL", "GLU", "glut"]' >> config.cfg
if use 3ds; then
echo 'LIB3DS_AVAILABLE = True' >> config.cfg
fi

# Ogre viewer is no longer maintained by upstream
# bug 210731
#if use ogre; then
# echo 'OGRE_AVAILABLE = True' >> config.cfg
# echo 'INC_DIRS += ["/usr/include/OGRE"]' >> config.cfg
# echo 'MACROS += [("EXT_HASH", None),("GCC_3_1",None)]' >> config.cfg
# sed -i -e "s/#include <Math.h>//" wrappers/ogre/OgreCore.h
#fi

sed -i -e "s:INC_DIRS = \[\]:INC_DIRS = \['/usr/include'\]:" "${S}"/setup.py
}

src_compile() {
cd "${S}"/supportlib
scons ${MAKEOPTS}
cd "${S}"
distutils_src_compile
}

src_test() {
cd unittests
# Remove failing tests due to non-existing files
rm test_maimport.py test_mayaascii.py test_mayabinary.py test_ri.py \ test_slparams.py
PYTHONPATH=$(ls -d ../build/lib*) ${python} all.py || die "tests failed"
}

here is the error

i686-pc-linux-gnu-g++ -pthread -DNDEBUG -O2 -march=prescott -pipe -fomit-frame-pointer -fPIC -DLIB3DS_AVAILABLE -Isupportlib/include -I/usr/include -I/usr/include/python2.5 -c -DLIB3DS_AVAILABLE -Isupportlib/include -I/usr/include -I/usr/include/python2.5 -c wrappers/rply/rply/rply.c -o build/temp.linux-i686-2.5/wrappers/rply/rply/rply.o
wrappers/rply/rply/rply.c: In function ‘void ply_property_init(t_ply_property_*)’:
wrappers/rply/rply/rply.c:1019: error: invalid conversion from ‘int’ to ‘e_ply_type’
wrappers/rply/rply/rply.c:1020: error: invalid conversion from ‘int’ to ‘e_ply_type’
wrappers/rply/rply/rply.c:1021: error: invalid conversion from ‘int’ to ‘e_ply_type’
wrappers/rply/rply/rply.c: In function ‘int ply_read_header_format(t_ply_*)’:
wrappers/rply/rply/rply.c:1079: error: invalid conversion from ‘int’ to ‘e_ply_storage_mode’
wrappers/rply/rply/rply.c: In function ‘int ply_read_header_property(t_ply_*)’:
wrappers/rply/rply/rply.c:1119: error: invalid conversion from ‘int’ to ‘e_ply_type’
wrappers/rply/rply/rply.c:1124: error: invalid conversion from ‘int’ to ‘e_ply_type’
wrappers/rply/rply/rply.c:1127: error: invalid conversion from ‘int’ to ‘e_ply_type’
wrappers/rply/rply/rply.c: At global scope:
wrappers/rply/rply/rply.c:1416: error: redefinition of ‘t_ply_idriver ply_idriver_ascii’
wrappers/rply/rply/rply.c:177: error: ‘t_ply_idriver ply_idriver_ascii’ previously declared here
wrappers/rply/rply/rply.c:1426: error: redefinition of ‘t_ply_idriver ply_idriver_binary’
wrappers/rply/rply/rply.c:178: error: ‘t_ply_idriver ply_idriver_binary’ previously declared here
wrappers/rply/rply/rply.c:1436: error: redefinition of ‘t_ply_idriver ply_idriver_binary_reverse’
wrappers/rply/rply/rply.c:179: error: ‘t_ply_idriver ply_idriver_binary_reverse’ previously declared here
wrappers/rply/rply/rply.c:1446: error: redefinition of ‘t_ply_odriver ply_odriver_ascii’
wrappers/rply/rply/rply.c:180: error: ‘t_ply_odriver ply_odriver_ascii’ previously declared here
wrappers/rply/rply/rply.c:1456: error: redefinition of ‘t_ply_odriver ply_odriver_binary’
wrappers/rply/rply/rply.c:181: error: ‘t_ply_odriver ply_odriver_binary’ previously declared here
wrappers/rply/rply/rply.c:1466: error: redefinition of ‘t_ply_odriver ply_odriver_binary_reverse’
wrappers/rply/rply/rply.c:182: error: ‘t_ply_odriver ply_odriver_binary_reverse’ previously declared here
error: command 'i686-pc-linux-gnu-g++' failed with exit status 1
*
* ERROR: dev-python/cgkit-2.0.0_alpha8 failed.
* Call stack:
* ebuild.sh, line 49: Called src_compile
* environment, line 2669: Called distutils_src_compile
* environment, line 788: Called die
* The specific snippet of code:
* ${python} setup.py build "$@" || die "compilation failed"
* The die message:
* compilation failed
*
* If you need support, post the topmost build error, and the call stack if relevant.
* A complete build log is located at '/var/tmp/portage/dev-python/cgkit-2.0.0_alpha8/temp/build.log'.
* The ebuild environment file is located at '/var/tmp/portage/dev-python/cgkit-2.0.0_alpha8/temp/environment'.
*

* Messages for package dev-python/cgkit-2.0.0_alpha8:

*
* ERROR: dev-python/cgkit-2.0.0_alpha8 failed.
* Call stack:
* ebuild.sh, line 49: Called src_compile
* environment, line 2669: Called distutils_src_compile
* environment, line 788: Called die
* The specific snippet of code:
* ${python} setup.py build "$@" || die "compilation failed"
* The die message:
* compilation failed
*
* If you need support, post the topmost build error, and the call stack if relevant.
* A complete build log is located at '/var/tmp/portage/dev-python/cgkit-2.0.0_alpha8/temp/build.log'.
* The ebuild environment file is located at '/var/tmp/portage/dev-python/cgkit-2.0.0_alpha8/temp/environment'.
*

I have put in a gentoo bug, now I thought I would let you know.

Im wanting to do some particle stuff with 3delight volume shaders and opende

Sam

Discussion

  • samhodge
    samhodge
    2008-08-25

    Logged In: YES
    user_id=1573289
    Originator: NO

    I have downloaded the rply source and got it to compile locally

    using autotools

    and I have made the convert binary

    So I cant really isolate the problem to the rply source

    is it possible to remove rply from cgkit as it is not a feature I need to use

    Sam

     
  • samhodge
    samhodge
    2008-08-26

    Logged In: YES
    user_id=1573289
    Originator: NO

    OK so when I use the following two files

    confiugure.ac:

    # -*- Autoconf -*-
    # Process this file with autoconf to produce a configure script.

    AC_PREREQ(2.61)
    AC_INIT(rply, 1.01, diego@princeton)
    AC_CONFIG_SRCDIR([rply.c])
    AC_CONFIG_HEADER([config.h])

    # Checks for programs.
    AC_PROG_CC
    AC_PROG_MAKE_SET

    # Checks for libraries.

    # Checks for header files.
    AC_HEADER_STDC
    AC_CHECK_HEADERS([float.h limits.h stddef.h stdlib.h string.h])

    # Checks for typedefs, structures, and compiler characteristics.
    AC_C_CONST
    AC_TYPE_SIZE_T

    # Checks for library functions.
    AC_FUNC_ERROR_AT_LINE
    AC_FUNC_MALLOC
    AC_FUNC_REALLOC
    AC_FUNC_STRTOD
    AC_FUNC_VPRINTF
    AC_CHECK_FUNCS([memmove strchr strcspn strspn strtol])

    AC_CONFIG_FILES([Makefile])
    AM_INIT_AUTOMAKE(convert,0.1)
    AC_OUTPUT

    Makefile.am:

    bin_PROGRAMS = convert sconvert dump
    convert_SOURCES = rply.h rply.c etc/convert.c
    sconvert_SOURCES = rply.h rply.c etc/sconvert.c
    dump_SOURCES = rply.h rply.c etc/dump.c

    and hit it with:

    aclocal
    autoheader
    automake
    ./configure
    make

    It builds without error

    so it seems that rply and my system are friends

    Sam

     
  • samhodge
    samhodge
    2008-08-26

    Logged In: YES
    user_id=1573289
    Originator: NO

    here is the problem:

    gcc is happy
    > gcc -c rply.c -o temp.o

    g++ isnt happy
    > g++ -c rply.c -o temp.o
    rply.c: In function ‘void ply_property_init(t_ply_property_*)’:
    rply.c:1019: error: invalid conversion from ‘int’ to ‘e_ply_type’
    rply.c:1020: error: invalid conversion from ‘int’ to ‘e_ply_type’
    rply.c:1021: error: invalid conversion from ‘int’ to ‘e_ply_type’
    rply.c: In function ‘int ply_read_header_format(t_ply_*)’:
    rply.c:1079: error: invalid conversion from ‘int’ to ‘e_ply_storage_mode’
    rply.c: In function ‘int ply_read_header_property(t_ply_*)’:
    rply.c:1119: error: invalid conversion from ‘int’ to ‘e_ply_type’
    rply.c:1124: error: invalid conversion from ‘int’ to ‘e_ply_type’
    rply.c:1127: error: invalid conversion from ‘int’ to ‘e_ply_type’
    rply.c: At global scope:
    rply.c:1416: error: redefinition of ‘t_ply_idriver ply_idriver_ascii’
    rply.c:177: error: ‘t_ply_idriver ply_idriver_ascii’ previously declared here
    rply.c:1426: error: redefinition of ‘t_ply_idriver ply_idriver_binary’
    rply.c:178: error: ‘t_ply_idriver ply_idriver_binary’ previously declared here
    rply.c:1436: error: redefinition of ‘t_ply_idriver ply_idriver_binary_reverse’
    rply.c:179: error: ‘t_ply_idriver ply_idriver_binary_reverse’ previously declared here
    rply.c:1446: error: redefinition of ‘t_ply_odriver ply_odriver_ascii’
    rply.c:180: error: ‘t_ply_odriver ply_odriver_ascii’ previously declared here
    rply.c:1456: error: redefinition of ‘t_ply_odriver ply_odriver_binary’
    rply.c:181: error: ‘t_ply_odriver ply_odriver_binary’ previously declared here
    rply.c:1466: error: redefinition of ‘t_ply_odriver ply_odriver_binary_reverse’
    rply.c:182: error: ‘t_ply_odriver ply_odriver_binary_reverse’ previously declared here

     
  • samhodge
    samhodge
    2008-08-26

    Logged In: YES
    user_id=1573289
    Originator: NO

    but this does work:

    g++ -x c -c rply.c -o temp.o

    maybe it would be worth adding the -x flag via the SConscript

     
  • Matthias Baas
    Matthias Baas
    2008-08-26

    • status: open --> closed
     
  • Matthias Baas
    Matthias Baas
    2008-08-26

    Logged In: YES
    user_id=211477
    Originator: NO

    Well, you have already found the problem yourself. The file rply.c is a C file but it was compiled using a C++ compiler (not every valid C file is also a valid C++ file). This might be a bug in the gentoo build environment as it really should have picked a C compiler (in my case, it just runs gcc).

    Just recently, someone else also stumbled over this and sent me a patch that converts the code into valid C++ code. This patch is in svn, so if it is an option for you to compile the latest svn version then the issue might go away.

    Otherwise you might try setting CXX (or what is the environment var that determines the compiler?) to something else (like gcc), or set CXXFLAGS so that it contains the -x option (but maybe you need to do that once the real C++ files have already been compiled).

    (as the patch has already been applied and I rather think it's a problem with the build environment anyway instead of a bug in cgkit, I'm closing this bug report)

    - Matthias -

     
  • Logged In: NO

    I tend to agree

    I looked into the python distutils and it said that it would automatically recognise .c files and use cpp and .cpp files and use g++

    This is clearly not the case.

    Thanks for applying the patch to the rply code.

    When the package makes it into gentoo portage tree it will be fixed, requiring no futher action from you.

    I will chase up the distutils in Gentoo.

    Thanks for all the hard work

    Sam

     
  • Logged In: NO

    I can confirm that setting

    CC=/usr/bin/cpp
    CXX=/usr/bin/cpp
    CPP=/usr/bin/cpp

    make the current ebuild work

    I am chasing up the python distutils so that is 'Does the right thing' out of the box for other gentoo users

    Sam

     
  • Matthias Baas
    Matthias Baas
    2008-08-27

    Logged In: YES
    user_id=211477
    Originator: NO

    Thanks!
    When is that portage tree updated? Do they also use svn snapshots or are the gentoo packages always based on official releases? I have no plans yet about when to do the next release, but I could just aim for another one within the next few weeks.

     
  • Logged In: NO

    It compiled, but I am not sure if it "worked"

    but I have checked out the SVN version and I am looking forward to playing with cg kit you have done an awesome job