Py3 Mac app for testing

Having trouble installing or compiling FreeCAD? Get help here.
peterl94
Posts: 999
Joined: Thu May 23, 2013 7:31 pm
Location: United States

Py3 Mac app for testing

Postby peterl94 » Wed Jan 02, 2019 7:02 am

Thanks to the great work looo has done with conda packaging, I was able to put together a mac app using python 3.6. I only used conda for installing the dependencies and compiled the app manually. Eventually it would be good to be able to create an app from the freecad conda package. Anyway, here is a direct link if you want to try it out: https://github.com/FreeCAD/FreeCAD/rele ... t5-Py3.dmg. It might work on macOS versions as far back as 10.9. Interestingly the .dmg increased by 200MB, but I haven't looked into why.

I hadn't really considered changing to using conda instead of homebrew for macOS packaging, since homebrew is pretty standard for developers using macOS. However, with the change to py3, and all the required packages already available with conda, and my very limited time....it is sounding like a pretty good idea to me right now.
chrisb
Posts: 19589
Joined: Tue Mar 17, 2015 9:14 am

Re: Py3 Mac app for testing

Postby chrisb » Wed Jan 02, 2019 10:22 am

This is great! All workbenches are working again (Path, Draft, Arch). From my side it could well replace the current 15310.
Jee-Bee
Posts: 1968
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: Py3 Mac app for testing

Postby Jee-Bee » Wed Jan 02, 2019 11:37 am

congrats @Looo and @peterl94 Nice to see a OSX version again!!
blacey
Posts: 367
Joined: Tue Dec 08, 2015 11:28 pm

Re: Py3 Mac app for testing

Postby blacey » Wed Jan 02, 2019 1:36 pm

Jee-Bee wrote:
Wed Jan 02, 2019 11:37 am
congrats @Looo and @peterl94 Nice to see a OSX version again!!
@peterl94 and @loo - well done. I'm onboard with this for all platforms as I stated here about a week ago - https://github.com/FreeCAD/FreeCAD-AppI ... -450514116 and in some back and forth with peterl4 and looo. Resurrecting Homebrew builds is within https://travis-ci.org/FreeCAD/homebrew- ... /473602650 but I am a firm believer, if possible, that we should invest in a singular, cross-platform solution over more redundantly laborious platform-specific solutions to efficiently maintain cadence across platforms. Of course, @looo's spear-heading of Conda illuminated the possibility of such a path early on...
chrisb
Posts: 19589
Joined: Tue Mar 17, 2015 9:14 am

Re: Py3 Mac app for testing

Postby chrisb » Wed Jan 02, 2019 7:14 pm

I am not sure what triggers it, becuase it usually happens when I am doing nothing, so perhaps it has to do with the autosave mechanism or some other timer triggered event.
I sometimes get the error message

Code: Select all

Traceback (most recent call last):
  File "/Users/cb/Desktop/FreeCAD.app/Contents/lib/python3.6/json/__init__.py", line 231, in dumps
    return _default_encoder.encode(obj)
  File "/Users/cb/Desktop/FreeCAD.app/Contents/lib/python3.6/json/encoder.py", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/Users/cb/Desktop/FreeCAD.app/Contents/lib/python3.6/json/encoder.py", line 257, in iterencode
    return _iterencode(o, 0)
  File "/Users/cb/Desktop/FreeCAD.app/Contents/lib/python3.6/json/encoder.py", line 180, in default
    o.__class__.__name__)
<class 'TypeError'>: Object of type 'dict_items' is not JSON serializable
I don't have any fancy characters or blanks in the path, neither to the program, nor to the file nor to my home directory.

OS: macOS 10.13
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.15525 (Git)
Build type: Release
Branch: master
Hash: 1a7d3d9a37fe43468c8ac84590c1db53e2b2000a
Python version: 3.6.7
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)
User avatar
sgrogan
Posts: 5468
Joined: Wed Oct 22, 2014 5:02 pm

Re: Py3 Mac app for testing

Postby sgrogan » Wed Jan 02, 2019 11:22 pm

peterl94 wrote:
Wed Jan 02, 2019 7:02 am
Interestingly the .dmg increased by 200MB, but I haven't looked into why.
I think it's mostly libmkl, similar on Win.
peterl94
Posts: 999
Joined: Thu May 23, 2013 7:31 pm
Location: United States

Re: Py3 Mac app for testing

Postby peterl94 » Thu Jan 03, 2019 6:24 am

sgrogan wrote:
Wed Jan 02, 2019 11:22 pm
I think it's mostly libmkl, similar on Win.
Indeed! ~580MB.
peterl94
Posts: 999
Joined: Thu May 23, 2013 7:31 pm
Location: United States

Re: Py3 Mac app for testing

Postby peterl94 » Thu Jan 03, 2019 6:25 am

chrisb wrote:
Wed Jan 02, 2019 7:14 pm
I sometimes get the error message
I'll see what I can find. I wonder why it is not a problem on linux.
looo
Posts: 2951
Joined: Mon Nov 11, 2013 5:29 pm

Re: Py3 Mac app for testing

Postby looo » Thu Jan 03, 2019 9:57 am

thanks @peterl94 for your efforts to create a mac-bundle.

Some thoughts on the creation of the bundle:
1. when you create the environment use an additional constraint: blas=*=openblas
This will make sure openblas is used instead of mkl. (mkl is very big in size)

2. conda ships static libs and shared libs together. For the appimage we remove all the static libs after the env-creation. Maybe this works also for the mac-bundle: https://github.com/FreeCAD/FreeCAD-AppI ... .sh#L33L34 (Also removing unnecessary stuff from bin and include should result in a smaller size)

3. Maybe it's also possible to ship calculix within the bundle. (The package is not very big: https://anaconda.org/conda-forge/calculix/files)


Btw.: I am still using a patch for osx-builds.
1. https://github.com/looooo/freecad-feeds ... /osx.patch

Did building FreeCAD without this patch worked for you? If so I will try to remove it for the next weekly conda-build.
please help with my conda-packaging efforts: https://liberapay.com/looooo/
chrisb
Posts: 19589
Joined: Tue Mar 17, 2015 9:14 am

Re: Py3 Mac app for testing

Postby chrisb » Thu Jan 03, 2019 11:34 am

peterl94 wrote:
Thu Jan 03, 2019 6:25 am
chrisb wrote:
Wed Jan 02, 2019 7:14 pm
I sometimes get the error message
I'll see what I can find.
I might add that this does not lead to any further problems.