View Issue Details

IDProjectCategoryView StatusLast Update
0000918FreeCADBugpublic2014-09-22 13:33
Reporterbeckcb2004 Assigned To 
PrioritylowSeverityminorReproducibilityalways
Status closedResolutionwon't fix 
Summary0000918: Problem when compile FreeCAD. Fails on Ubuntu 13.04.Amd64. Multiple Python versions. (2.7 and 3).
DescriptionProblem:
Problem when compile FreeCAD. Fails on Ubuntu 13.04. Multiple Python versions. (2.7 and 3).

I run alpa releas of Ubuntu version 13.04, and downloads daily build of FreeCAD via git.

I suppose the error occurs because of duplicate versions of Python interpreter.
Both are devel versions of libraries installed

cbe@B9Lap:/LxSrc/Src.dwl/freecad.git$ python
Python 2.7.3 (default, Dec 12 2012, 19:00:09)
[GCC 4.7.2] on linux2

cbe@B9Lap:/LxSrc/Src.dwl/freecad.git$python3
Python 3.3.0 (default, Dec 12 2012, 19:03:06)
[GCC 4.7.2] on linux

I suppose this will be a problem on coming releases due to the following:
kde uses Python 3
coin uses Python 2.7

I have tried different parameters on the cmake and ./configure to specify that I want
Python 2.7 but without luck.

Could you please provide a description on how to set parameters for compiling,
and post it on freecad wiki,
How to properly select the correct Python version when compiling.
================

I do the following to get error:
git pull
cmake .
make
 or
./configure

The following errors occurs:

When running freecad CMAKE:
============================
cbe@B9Lap:/LxSrc/Src.dwl/freecad-build$cmake ../freecad.git .
This runs ok through.

cbe@B9Lap:/LxSrc/Src.dwl/freecad-build$ make
[ 0%] Building CXX object src/3rdParty/Pivy-0.5/CMakeFiles/coin.dir/coin_wrap.cpp.o
/LxSrc/Src.dwl/freecad.git/src/3rdParty/Pivy-0.5/coin_wrap.cpp:145:20: fatal error: Python.h: No such file or directory
compilation terminated.
make[2]: *** [src/3rdParty/Pivy-0.5/CMakeFiles/coin.dir/coin_wrap.cpp.o] Error 1
make[1]: *** [src/3rdParty/Pivy-0.5/CMakeFiles/coin.dir/all] Error 2
make: *** [all] Error 2
cbe@B9Lap:/LxSrc/Src.dwl/freecad-build$

===================
When running ./configure:checking for python script directory... ${prefix}/lib/python2.7/site-packages
checking for python extension module directory... ${exec_prefix}/lib/python2.7/site-packages
checking Python.h usability... no
checking Python.h presence... no
checking for Python.h... no
configure: error:
    **** Cannot find Python2.7 devel files. ****
    
cbe@B9Lap:/LxSrc/Src.dwl/freecad.git$

==========================
Thank you very much for your time,
and merry Christmas to all of you out there.

Christian.
TagsNo tags attached.
FreeCAD Information

Activities

beckcb2004

2012-12-18 20:59

reporter   ~0002665

"coin uses Python 2.7"
Should not say coin but python-pivy.
 
python-pivy
depends python(<2.8)
depends python(>=2.7)

wmayer

2012-12-19 11:31

administrator   ~0002667

> Problem when compile FreeCAD. Fails on Ubuntu 13.04. Multiple Python versions. (2.7 and 3).
Having python 2 & 3 installed at the same time shouldn't be a problem.

> Python.h: No such file or directory
It seems you haven't installed libpython2.7-dev

beckcb2004

2012-12-19 19:27

reporter   ~0002673

Thank you for your quick response.
The libpython2.7-dev package is already installed as shown below.

As of Wednesday 12/19/2012 21:00:

To verify this problem I will document a fresh install as follows:
I will do a apt-get purge on libpython2.7-dev and then
install libpython2.7-dev again, before I do
another freecad git pull,
cmake ../freecad.git .
and make

I will also do a ./configure to show the error coming up.

==========
I list the already installed package:

cbe@B9Lap:~$ dpkg -l libpython2.7-dev
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-============-============-=================================
ii libpython2.7-d 2.7.3-12ubun amd64 Header files and a static library
cbe@B9Lap:~$
cbe@B9Lap:~$
===============

Here I do a purge on libpython2.7-dev from within synaptic:
(Reading database ... 598491 files and directories currently installed.)
Removing python-all-dev ...
Removing python-dev ...
Removing libpython-dev:amd64 ...
Removing python2.7-dev ...
Processing triggers for man-db ...
debconf: unable to initialize frontend: Dialog
debconf: (Dialog frontend requires a screen at least 13 lines tall and 31 columns wide.)
debconf: falling back to frontend: Readline
(Reading database ... 598467 files and directories currently installed.)
Removing libpython2.7-dev:amd64 ...
Processing triggers for man-db ...
debconf: unable to initialize frontend: Dialog
debconf: (Dialog frontend requires a screen at least 13 lines tall and 31 columns wide.)
debconf: falling back to frontend: Readline

Successfully applied all changes. You can close the window now.
=============

Then I installed python-all-dev again:

Setting up libpython2.7-dev:amd64 (2.7.3-12ubuntu2) ...
Setting up libpython-dev:amd64 (2.7.3-10ubuntu3) ...
Setting up python2.7-dev (2.7.3-12ubuntu2) ...
Setting up python-dev (2.7.3-10ubuntu3) ...
Setting up python-all-dev (2.7.3-10ubuntu3) ...

Successfully applied all changes. You can close the window now.

==============
Now a fresh version of the dev library is installed inclusive Python.h file:
cbe@B9Lap:~$
cbe@B9Lap:~$ locate Python.h
...
...
/usr/include/python2.7/Python.h
/usr/include/python3.3dm/Python.h
/usr/include/python3.3m/Python.h
...
...
cbe@B9Lap:~$

========
Then I do another "git pull" to get a fresh freecad version:

cbe@B9Lap:/LxSrc/Src.dwl/freecad.git$ git pull
....
....

cbe@B9Lap:/LxSrc/Src.dwl/freecad.git$ cd ../free*bui*
cbe@B9Lap:/LxSrc/Src.dwl/freecad-build$
cbe@B9Lap:/LxSrc/Src.dwl/freecad-build$ cmake ../freecad.git .
-- prefix: /usr/local
....
....
-- Configuring done
-- Generating done
-- Build files have been written to: /LxSrc/Src.dwl/freecad-build
cbe@B9Lap:/LxSrc/Src.dwl/freecad-build$

Everything looks nice and correct,
I try to do make and get the error:
===========
cbe@B9Lap:/LxSrc/Src.dwl/freecad-build$ make
[ 0%] Building CXX object src/3rdParty/Pivy-0.5/CMakeFiles/coin.dir/coin_wrap.cpp.o
/LxSrc/Src.dwl/freecad.git/src/3rdParty/Pivy-0.5/coin_wrap.cpp:145:20: fatal error: Python.h: No such file or directory
compilation terminated.
make[2]: *** [src/3rdParty/Pivy-0.5/CMakeFiles/coin.dir/coin_wrap.cpp.o] Error 1
make[1]: *** [src/3rdParty/Pivy-0.5/CMakeFiles/coin.dir/all] Error 2
make: *** [all] Error 2
cbe@B9Lap:/LxSrc/Src.dwl/freecad-build$


===================
If I do the
./configure
command from freecad.git directory I get the error as follows:

checking for inflate in -lz... yes
checking for a Python interpreter with version >= 2.5... python
checking for python... /usr/bin/python
checking for python version... 2.7
checking for python platform... linux2
checking for python script directory... ${prefix}/lib/python2.7/site-packages
checking for python extension module directory... ${exec_prefix}/lib/python2.7/site-packages
checking Python.h usability... no
checking Python.h presence... no
checking for Python.h... no
configure: error:
    **** Cannot find Python2.7 devel files. ****
    
cbe@B9Lap:/LxSrc/Src.dwl/freecad.git$
========================

And from here I am totally lost.
Since I have installed a fresh version of the python development environment
including libpython2.7-dev.

So what could be wrong?
Something pointing in wrong direction?
or environment variables set wrong to look in wrong directories?
Or conflict between Python 2.7 and Pyton3?
Or should I override with --Python-lib, --Python-include.... or whatever from the cmake command?
I dont know ;-)

Is there a download repository for daily-build of freecad on Ubuntu 13.04 (Raring)?

Well this was a lot of output,
to your information.
If you can point me in right direction I would be grateful.

And once again thank's for your time.

Regards
Christian.

beckcb2004

2012-12-20 12:16

reporter   ~0002677

Hello again.

Today I did a
apt-get purge on the cmake package,
and installed once again
hen I did another freecad git pull.

Now CMAKE reports a more informative error message:
==================================

cbe@B9Lap:/LxSrc/Src.dwl/freecad.git$ git pull
Already up-to-date.
cbe@B9Lap:/LxSrc/Src.dwl/freecad.git$ cd ../fr*b
bash: cd: ../fr*b: No such file or directory
cbe@B9Lap:/LxSrc/Src.dwl/freecad.git$ cd ..
cbe@B9Lap:/LxSrc/Src.dwl$ cd fr*b*
cbe@B9Lap:/LxSrc/Src.dwl/freecad-build$ cmake ../freecad.git .
-- prefix: /usr/local
-- datadir: data
-- docdir: doc
-- includedir: include
CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:97 (message):
  Could NOT find PythonLibs (missing: PYTHON_INCLUDE_DIRS)
Call Stack (most recent call first):
  /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:291 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-2.8/Modules/FindPythonLibs.cmake:208 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:174 (find_package)


-- Configuring incomplete, errors occurred!
cbe@B9Lap:/LxSrc/Src.dwl/freecad-build$ cmake ../freecad.git .

===============================
This launchpad ppa user also has problems with daily-build (about 14 hours ago) See following URL:

https://launchpadlibrarian.net/126185071/buildlog_ubuntu-raring-amd64.freecad_0.13-git201212192148~raring1_FAILEDTOBUILD.txt.gz

/usr/include/python2.7/Python.h:8:22: fatal error: pyconfig.h: No such file or directory
compilation terminated.

===============================
Could this be related to the earlier bug reported on following URL?:
Debian Bug report logs - #677598
find_package: PythonInterp and PythonLibs are conflicting

If you play with the attached CMakeLists.txt file on a debian/sid system you'll notice that PythonInterp find python 2.7 while PythonLibs always find 3.2.
-- Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS)

Look at following URL:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=677598

===================

Just some additional information

Thanks

Christian.

Jriegel

2012-12-20 18:51

administrator   ~0002687

Hunt bugs on Ubuntu Version that early makes not much sense...
A month before release we can talk again.

beckcb2004

2012-12-20 20:43

reporter   ~0002710

Ok. Thanks for your response and time anyway.
I will await further actions.
Case closed.
Happy Christmas and Bye from here ;-)

wmayer

2012-12-20 21:39

administrator   ~0002720

Maybe you can upload the config.log file from your automake/configure attempt. This should have more details of what could have gone wrong.

beckcb2004

2012-12-21 07:34

reporter   ~0002738

Hello again
I send you the output files from freecad configuration using cmake
as attachments.
I didn't find any upload commands on sourceforge, so I send it on your email account.

One of the files shows program code as output (at the end of the file)
There is also a lot of uninitiated variables shown.

I did the cmake command as follows:
cmake --debug-output --trace --warn-uninitialized --warn-unused-vars --check-system-vars ../freecad.git . 2>&1 | tee cmake.cbe.out.txt

Attached is 3 files:
CMakefiles/CMakeError.log
CMakefiles/CMakeOutput.log
cmake.cbe.out.txt

Hopefully you can get some useful information.

regards

Christian

2012-12-21 07:57

 

cmake.cbe.out.txt.zip (Attachment missing)

2012-12-21 07:59

 

CMakeError.log (Attachment missing)

2012-12-21 07:59

 

CMakeOutput.log (Attachment missing)

wmayer

2012-12-21 10:17

administrator   ~0002742

I'm not familiar with the output of cmake. There I didn't find a hint why it fails to detect the python headers.

So, can you please try again with ./configure where you also get a problem with python? Therefore I need the file config.log which contains all the relevant information.

BTW, on my private email I didn't get a message.

wmayer

2012-12-22 09:51

administrator   ~0002748

This is the relevant section:

configure:23430: checking Python.h usability
configure:23430: g++ -c -g -O2 -I/usr/include/python2.7 conftest.cpp >&5
In file included from conftest.cpp:87:0:
/usr/include/python2.7/Python.h:8:22: fatal error: pyconfig.h: No such file or directory

If you search for packages containing pyconfig.h on versions prior to Raring you'll find it in python2.7-minimal.

But the same package for Raring doesn't have this file. The package libpython2.7-dev provides this file but in another directory /usr/include/i386-linux-gnu/python2.7 (32-bit) or /usr/include/x86_64-linux-gnu/python2.7 (64-bit).

Now the problem is that this path isn't listed as include directory when doing the tests with ./configure or cmake and hence the failure.

sliptonic

2013-04-28 11:01

manager   ~0003119

I saw the same thin in 32bit version. Luke posted on the forum about the problem and noted a missing symlink. I added the symlink and still get the error from cmake but it did compile.

http://forum.freecadweb.org/viewtopic.php?f=4&t=3987

Issue History

Date Modified Username Field Change
2012-12-18 20:44 beckcb2004 New Issue
2012-12-18 20:59 beckcb2004 Note Added: 0002665
2012-12-19 11:31 wmayer Note Added: 0002667
2012-12-19 19:27 beckcb2004 Note Added: 0002673
2012-12-20 12:16 beckcb2004 Note Added: 0002677
2012-12-20 18:51 Jriegel Note Added: 0002687
2012-12-20 18:51 Jriegel Priority normal => low
2012-12-20 18:51 Jriegel Status new => feedback
2012-12-20 20:43 beckcb2004 Note Added: 0002710
2012-12-20 21:39 wmayer Note Added: 0002720
2012-12-21 07:34 beckcb2004 Note Added: 0002738
2012-12-21 07:57 Jriegel File Added: cmake.cbe.out.txt.zip
2012-12-21 07:59 Jriegel File Added: CMakeError.log
2012-12-21 07:59 Jriegel File Added: CMakeOutput.log
2012-12-21 10:17 wmayer Note Added: 0002742
2012-12-22 09:51 wmayer Note Added: 0002748
2013-04-28 11:01 sliptonic Note Added: 0003119
2014-09-22 13:33 shoogen Status feedback => closed
2014-09-22 13:33 shoogen Resolution open => won't fix