coin3d / pivy

python bindings to coin3d
ISC License
53 stars 37 forks source link

Unable to build Debian package #28

Closed silopolis closed 5 years ago

silopolis commented 6 years ago

Hi, As I may have a pivy issue with the version distributed with my OS (SolydK 9), and encouraged by @yorikvanhavre , I tried to build and install it from this repo by building the Debian package but after a couple of trials and errors, I'm stuck with the following error:

~/Sources/pivy/> sudo apt-get install  python-stdeb libsoqt4-dev libcoin80-dev libsimage-dev swig
~/Sources/pivy/> py2dsc pivy-0.6.3.zip
~/Sources/pivy/> cd deb_dist/pivy-0.6.3
~/Sources/pivy/>  l
total 12
drwxr-xr-x  3 tarax tarax 4096 févr. 11 20:18 debian
drwxr-xr-x 13 tarax tarax 4096 janv.  3 23:04 pivy-0.6.3
~/Sources/pivy/deb_dist/pivy-0.6.3> echo "Source: pivy
Maintainer: Tamer Fahmy <tamer@sim.no>
Section: python
Priority: optional
Build-Depends: dh-python, python-all (>= 2.6.6-3), debhelper (>= 9), python-support, python-all-dev, libsoqt4-dev, libcoin80-dev, libsimage-dev, swig
Standards-Version: 3.9.6
Homepage: http://pivy.coin3d.org/

Package: python-pivy
Architecture: all
Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}, python-qt4-gl
Description: A Python binding for Coin
 Pivy is a Coin binding for Python. Coin is a high-level 3D graphics
 library with a C++ Application Programming Interface. Coin uses
 scene-graph data structures to render real-time graphics suitable for
 mostly all kinds of scientific and engineering visualization
 applications.
 ." > debian/control
~/Sources/pivy/deb_dist/pivy-0.6.3> export PYBUILD_SYSTEM=distutils
~/Sources/pivy/deb_dist/pivy-0.6.3> dpkg-buildpackage -rfakeroot -uc -us
dpkg-buildpackage: info: paquet source pivy
dpkg-buildpackage: info: version source 0.6.3-1
dpkg-buildpackage: info: distribution source unstable
dpkg-buildpackage: info: source changé par Tamer Fahmy <tamer@sim.no>
dpkg-buildpackage: info: architecture hôte amd64
 dpkg-source --before-build pivy-0.6.3
 fakeroot debian/rules clean
dh clean --with python2 --buildsystem=pybuild
   dh_testdir -O--buildsystem=pybuild
   dh_auto_clean -O--buildsystem=pybuild
I: pybuild base:184: python2.7 setup.py clean 
python2.7: can't open file 'setup.py': [Errno 2] No such file or directory
E: pybuild pybuild:283: clean: plugin distutils failed with: exit code=2: python2.7 setup.py clean 
dh_auto_clean: pybuild --clean -i python{version} -p 2.7 returned exit code 13
debian/rules:7 : la recette pour la cible « clean » a échouée
make: *** [clean] Erreur 25
dpkg-buildpackage: erreur: fakeroot debian/rules clean a produit une erreur de sortie de type 2

Problem originaly reported here: https://forum.freecadweb.org/viewtopic.php?f=3&t=26563&p=214825#p214575

looooo commented 6 years ago

hmm I don't know what the problem is. If I remeber correctly I was taking another approach to create some packages for ubuntu ppa. You can also try to build pivy with distutils:

# clone/download pivy (+extracting)
cd pivy
python setup.py build
sudo python setup.py install # if the previous step worked

The master currently doesn't support building with older coin version. You have to use the cmake-branch for coin. Also I think it's not possible to build with qt4. Maybe it's better to use 0.6.2 to try building with qt4. Anyway, a proper solution would be to package coin and dependencies with cmake/qt5 support and afterwards build pivy.

silopolis commented 6 years ago

Built 0.6.2 but doesn't seem to solve my issue. No chance with newer versions

Platform...linux2
Python version...2.7.13
Checking for swig...
'/usr/bin/swig'
Checking for SWIG version...
3.0.10
Warning: Pivy has only been tested with the following SWIG versions: 1.3.31 1.3.33 1.3.35 1.3.40.
Checking for coin-config...
'/usr/bin/coin-config'
Coin version...
4.0.0a
** Warning: Pivy has only been tested with Coin versions Coin-dev 3.
Checking for Coin features...
vrml97 
sound 
threads 
threadsafe 
()
Checking for soqt-config...
'/usr/bin/soqt-config'
Checking for soqt version...
1.6.0a
Checking for soxt-config...
not found.
Checking for sogtk-config...
not found.
Checking for sowin-config...
not found.
Checking for simvoleon-config...
not found.
Preparing Inventor headers:.
=== pivy/gui/soqt_wrap.cpp for pivy.gui.soqt already exists! ===
=== pivy/coin_wrap.cpp for pivy.coin already exists! ===
running build_py
package init file 'pivy/quarter/plugins/designer/python/__init__.py' not found (or not a regular file)
file pivy/graphics/.py (for module pivy.graphics.) not found
[...]
looooo commented 6 years ago

have you tried to use:

python setup.py build
python setup.py install

?

silopolis commented 6 years ago

Trying again:

~/Sources/pivy> git clone https://github.com/FreeCAD/pivy.git
~/Sources/pivy> cd pivy
~/Sources/pivy/pivy> python setup.py build
running build
...
                           Welcome to Pivy 0.6.4!
                 Building Pivy has never been so much fun!

Platform...linux2
Python version...2.7.13
Checking for swig...
'/usr/bin/swig'
Checking for SWIG version...
3.0.10
calling: cmake 
CMake Error at CMakeLists.txt:4 (find_package):
  Could not find a package configuration file provided by "Coin" with any of
  the following names:

    CoinConfig.cmake
    coin-config.cmake

  Add the installation prefix of "Coin" to CMAKE_PREFIX_PATH or set
  "Coin_DIR" to a directory containing one of the above files.  If "Coin"
  provides a separate development package or SDK, be sure it has been
  installed.

checking for COIN via cmake

checking for SOQT via cmake
Traceback (most recent call last):
  File "setup.py", line 662, in <module>
    platforms=['Any']
  File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "setup.py", line 584, in run
    self.pivy_configure()
  File "setup.py", line 449, in pivy_configure
    self.check_with_cmake()
  File "setup.py", line 225, in check_with_cmake
    if config_dict['SOQT_FOUND'] == 'false':
KeyError: 'SOQT_FOUND'
looooo commented 6 years ago

this problem is because there is no cmake-config file for coin. This file is only installed if you install coin with cmake. Soqt shouldn't matter that much although the reported problem leads to the assumption the problem is to due soqt.

If you want to use qt4 with pivy please use the 0.6.2 release.

silopolis commented 6 years ago

Hi,

2018-04-02 18:19 GMT+02:00 lorenz notifications@github.com:

this problem is because there is no cmake-config file for coin. This file is only installed if you install coin with cmake. Soqt shouldn't matter that much although the reported problem leads to the assumption the problem is to due soqt.

If you want to use qt4 with pivy please use the 0.6.2 release.

  • donwload & extract
  • python setuup.py build
  • sudo python setup.py install

Sorry, I think we misunderstood each other :/ That's what I meant in the message before I retried: build and install 0.6.2, and this worked... But didn't solve my original problem !

Hope you had a nice Easter and thank you for your support

looooo commented 6 years ago

sry, I didn't read about your origin problem.

('[Draft.todo.commit] Unexpected error:', <type 'exceptions.SyntaxError'>, 'in ', <bound method arcTracker._removeSwitch of <DraftTrackers.arcTracker instance at 0x7f3f55280c20>>, '(', <pivy.coin.SoSwitch; proxy of <Swig Object of type 'SoSwitch *' at 0x7f3f5533b510> >, ')')

the workbench somehow hides the error reports, which is in my mind not a good solution. You can search in the code for '[Draft.todo.commit] Unexpected error:' and do some modification to find out what the problem in your case is.

J-Dunn commented 5 years ago

this problem is because there is no cmake-config file for coin. This file is only installed if you install coin with cmake. Soqt shouldn't matter that much although the reported problem leads to the assumption the problem is to due soqt.

If you want to use qt4 with pivy please use the 0.6.2 release.

* donwload & extract

* python setuup.py build

* sudo python setup.py install

the workaround to get this to build is to add env var , eg.
export CMAKE_PREFIX_PATH=/usr/local/lib64/cmake/Coin-4.0.0

looooo commented 5 years ago

CMAKE_PREFIX_PATH=/usr/local/lib64/cmake/Coin-4.0.0

So this is not a std-path cmake is looking for configs?

J-Dunn commented 5 years ago

So , I'm just providing a work around to get the damned thing to compile. I'm not explaining the bug or suggesting this is a permanent fix. Hoping this info may lead to a better solution and not having to spend days screwing around just to get a compiler run.

If we are going to hand compile stuff into secondary locations, maybe some config changes are needed. At least of certain distros.

looooo commented 5 years ago

So , I'm just providing a work around to get the damned thing to compile.

I am only testing with conda (win/osx/linux). I know that there will be errors for distro a.b. And if we solve for distro a.b there are still errors for distro c.d. Thats why I don't want to spend any time with packaging for distros. But for sure I will include any feedback if reported. But most people seem to be interested in compiling and do not report back the problems. That's why this is not getting better. (So I guess it's up to you to make this situation better ; )

J-Dunn commented 5 years ago

But most people seem to be interested in compiling and do not report back the problems. That's why this is not getting better. (So I guess it's up to you to make this situation better ; )

So should I read that as : "thanks for your feedback, this will help us improve it for others. Thank you for taking the time to report the error on your platform and the workaround you found" ?

looooo commented 5 years ago

Do you think this damn feedback is worth any $? (To say it in your words)

But yes a little bit of feedback is better than no feedback. And I am happy to make this library more solid.

J-Dunn commented 5 years ago

I never suggested it was worth $, but if it saves others from wasting the time I've had to waste just to get the compile off the ground, that will be worth the effort of reporting. That's fundamentally how OSS works. If you are happy to improve the library we are pulling together.

looooo commented 5 years ago

Is this still valid? I think I have applied all patches used for the debian packages. @kkremitzki ?

kkremitzki commented 5 years ago

This doesn't seem relevant to the current Debian package as far as I can tell.

looooo commented 5 years ago

anyway, I close this one for now. I think the debian packages should work now without any additional patches. If there are some please report them to this repo.

berndhahnebach commented 5 years ago

have you tried to use:

python setup.py build
python setup.py install

I tried to build pivy with this commands many times, too. See https://forum.freecadweb.org/viewtopic.php?f=4&t=33262 I gave up ... It works if a deb package is created. Since this works, I just use it. Eventually I have a pivy on my github which I use fo my compile scripts ...

https://github.com/berndhahnebach/FreeCAD_bhb/releases/tag/1

and

https://github.com/berndhahnebach/FreeCAD_bhb/blob/4b63b9b7bea5a9e3d37a94931cef333988159254/compile/Linux_Debian_10_Buster_FreeCAD_018_Qt5_Py3.sh#L112-L116

looooo commented 5 years ago

There are several issues. One is the coin library which is used in an unreleased state. For conda I am maintainer of both, pivy and coin so I know which coin works with which pivy. And I have to admit that I don't care much about other distros package managers. But as I am testing Cross Plattform with conda I don't think this is a big issue.