ifc openshell on Ubuntu PPA

This forum section is only for IFC-related issues
User avatar
sgrogan
Posts: 5252
Joined: Wed Oct 22, 2014 5:02 pm

ifc openshell on Ubuntu PPA

Postby sgrogan » Thu Jan 28, 2016 10:00 pm

I have an idea to try to add ifcopenshell-python the the FreeCAD community extras PPA.
My idea to start would be to limit the effort to a very FreeCAD centric offering. Python 2.7 version only.
Is the audience/utility large enough to justify the effort?
If so, First question is ifcopenshell-python is all that FreeCAD needs now? I believe so based on the Windows builds.
Are python-dev, swig, and, oce the only dependencies?
The first step would be to build ifcopenshell-python27 on trusty locally (I'm gonna do this anyway)
Thoughts, ideas, advice?

EDIT: next question

Code: Select all

[100%] Built target _ifcopenshell_wrapper
sgrogan@sgrogan-HP-ZBook-17:~/ifcOpenShell-Python27$ make install
[ 39%] Built target IfcParse
[ 69%] Built target IfcGeom
[ 90%] Built target IfcConvert
[ 93%] Built target IfcGeomServer
[ 96%] Swig source
[100%] Building CXX object ifcwrap/CMakeFiles/_ifcopenshell_wrapper.dir/IfcPythonPYTHON_wrap.cxx.o
Linking CXX shared module _ifcopenshell_wrapper.so
[100%] Built target _ifcopenshell_wrapper
Install the project...
-- Install configuration: "Release"
CMake Error at cmake_install.cmake:36 (FILE):
  file cannot create directory: /usr/local/include/ifcgeom.  Maybe need
  administrative privileges.


make: *** [install] Error 1
Should have been "sudo make install" Is it normal to install something here? On Windows it would be just stuff to the Python/Lib/SitePackages directory, I think.
EDIT 2: After "sudo make install" What do you guys think of a few sample .ifc files in the FreeCAD/Examples GitHub repo?
I get what I think are some KDE specific warnings, but it looks like this will work.

Code: Select all

Active view is Unnamed : 1[*] (at 0x3aebe20)
Active document is Unnamed (at 0x3adfe10)
KGlobal::locale(): Warning your global KLocale is being recreated with a valid main component instead of a fake component, this usually means you tried to call i18n related functions before your main component was created. You should not do that since it most likely will not work
X Error: BadWindow (invalid Window parameter) 3
  Major opcode: 31 (X_GrabKeyboard)
  Resource id:  0x0
Active view is Unnamed : 1[*] (at 0x3aebe20)
Finished importing.
User avatar
yorik
Site Admin
Posts: 11458
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: ifc openshell on Ubuntu PPA

Postby yorik » Fri Jan 29, 2016 2:06 am

It is a good idea! I would definitely drop a note about this on the ifcopenshell forum (still on sourceforge... poor them ;) ) as thomas krijnen (the author) might be interested in this and maybe joint efforts.
sgrogan wrote:If so, First question is ifcopenshell-python is all that FreeCAD needs now?
Yes. (It is actually the entire ifcopenshell... the rest are plugins for other apps)
sgrogan wrote:Are python-dev, swig, and, oce the only dependencies?
I believe so
sgrogan wrote:Thoughts, ideas, advice?
If you build a package, you should change the prefix from /usr/local to /usr. Packages install in /usr, while /usr/local is reserved for the stuff that the user compiles himself.
The KDE warnings seem unimportant. To test if it is correctly installed and working, simply type this in a python console:

Code: Select all

import ifcopenshell
About IFC files, I'm not sure it's very useful... There are test files a bit everywhere on the net... There is always my Arch test file: https://github.com/yorikvanhavre/FreeCAD-testhouse Maybe I should include it in FreeCAD sources at some point...
User avatar
sgrogan
Posts: 5252
Joined: Wed Oct 22, 2014 5:02 pm

Re: ifc openshell on Ubuntu PPA

Postby sgrogan » Fri Jan 29, 2016 2:49 am

yorik wrote:It is a good idea! I would definitely drop a note about this on the ifcopenshell forum
I used this git repohttps://github.com/IfcOpenShell/IfcOpenShell
yorik wrote:About IFC files, I'm not sure it's very useful
I wasn't thinking in the code. On the FreeCAD/Examples GitHub repo maybe? I found myself searching the FreeCAD forum.. simple file, big file, file with special characters to test. A folder on the github repo would just simplify this. Everything locally seems to work so I will work towards the PPA.
I've noticed that for the FreeCAD Daily PPA we have copies of the oce packages from the "stable PPA" The next thing (among many other next things, is to figure out if this is also necessary on the community PPA if it's a dependency of a package)

If some people want to help I guess we could try to set up a real ifcOpenShell PPA. I have no knowledge to set up a PPA from scatch. I think I can add an additional package to the FreeCAD community extras PPA with some research. At present all the packages on the community PPA are pure python with no Cmake or compiling, although we do have some dependencies (and some missing ones to fix) and FreeCAD itself to use as a template.

For everybody compiling themselves, if you could check, I think all that all that the PPA should install is the Python/Lib/sitpackages stuff.
@bernd, as the muti-OS/cross platform expert can you check when you have a chance?
jmaustpc
Posts: 9558
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: ifc openshell on Ubuntu PPA

Postby jmaustpc » Fri Jan 29, 2016 1:33 pm

yorik wrote:It is a good idea! I would definitely drop a note about this on the ifcopenshell forum (still on sourceforge... poor them ;) )
It might not be so much "poor them" any longer now that SourceForge has been sold! :)
User avatar
yorik
Site Admin
Posts: 11458
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: ifc openshell on Ubuntu PPA

Postby yorik » Fri Jan 29, 2016 2:30 pm

jmaustpc wrote:now that SourceForge has been sold!
really? I didn't know... Now we'll see if it's for good or worse! :)

*EDIT* oh yeah, fresh news from yesterday!
User avatar
bernd
Posts: 8242
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: ifc openshell on Ubuntu PPA

Postby bernd » Sat Jan 30, 2016 12:28 pm

Great idea to add it to ppa on ubuntu!
sgrogan wrote:
yorik wrote:It is a good idea! I would definitely drop a note about this on the ifcopenshell forum
I used this git repohttps://github.com/IfcOpenShell/IfcOpenShell
You will be fine. It is the official IfcOpenShell Repo. It is the one the Windows version is based too.

Have you had success in compiling, installing ifcopenshell and importing it into python on ubuntu ?
User avatar
sgrogan
Posts: 5252
Joined: Wed Oct 22, 2014 5:02 pm

Re: ifc openshell on Ubuntu PPA

Postby sgrogan » Sat Jan 30, 2016 3:49 pm

bernd wrote: Have you had success in compiling, installing ifcopenshell and importing it into python on ubuntu ?
Yes, this actually was remarkably easy :)
I have unchecked everything in cmake except building the python wrapper and unicode support. i can import ifcopenshell from python2.7, FreeCAD python console, and import files directly into FreeCAD. Only problems are the kde errors posted above, don't think they are relevant at the moment.
Next step is to add "ifcopenshell-python27" package to the FreeCAD "community extras" PPA. https://launchpad.net/~freecad-communit ... ubuntu/ppa
I need to work out:
1. package name
2. install locations
3. control file for the PPA to actually compile

Long term goal would be to make a new Ifcopshell daily ppa and provide the whole package.
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: ifc openshell on Ubuntu PPA

Postby NormandC » Sat Apr 16, 2016 4:27 pm

@ sgrogan

Friendly bump, I just found this topic. Should this be added to the PPA TODO list?

I'm not sure this should go into freecad-extras, as it is not a supplementary module/workbench, but a third-party library used by an existing WB. Maybe it could be added to the Daily and Stable PPAs instead, just like we've done for packages as calculix-ccx and netgen.

That way, people who want IFC support in the FreeCAD package they installed from PPA can install the ifcopenshell package without having to add a separate PPA. In any case I'm guessing it will need to be built with the same OCE version as FreeCAD.
User avatar
sgrogan
Posts: 5252
Joined: Wed Oct 22, 2014 5:02 pm

Re: ifc openshell on Ubuntu PPA

Postby sgrogan » Sat Apr 16, 2016 5:21 pm

We can definitely add this to the list, at the bottom ;) . I'm actually leaning towards a separate daily PPA (skinny kid at the all you can eat buffet again). The release version of ifcopenshell is really not what is needed in FreeCAD. There is a lot of synergy between the FreeCAD developement and the ifcopenshell development (bernd is in pretty regular contact with them. For Windows I forked the ifcopenshell repo and post builds on the the releases page of the forked repo (not for a while though)
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: ifc openshell on Ubuntu PPA

Postby NormandC » Sat Apr 16, 2016 9:33 pm

sgrogan wrote:I'm actually leaning towards a separate daily PPA (skinny kid at the all you can eat buffet again).
:D

It makes sense. You know that you can add a PPA dependency to another PPA. This means that on your IfcOpenShell Daily PPA, you set a PPA dependency to our OCE Releases PPA. This way, the ifcopenshell-python packages will build with the same OCE version used in the Stable and Daily PPAs rather than with the default Ubuntu repo packages.

I am not sure if the end user would also need to add the OCE Releases PPA to their software sources. That's the reason I copy the liboce packages to the Stable and Daily PPAs, to avoid the hindrance for the user.