Upgrade nightmare with FreeCAD

Having trouble installing or compiling FreeCAD? Get help here.
User avatar
microartisan
Posts: 12
Joined: Fri Mar 23, 2018 11:52 am
Location: beijing
Contact:

Re: Upgrade nightmare with FreeCAD

Postby microartisan » Mon Apr 02, 2018 9:45 am

@federico.carminati this is my situation, maybe will have a bit help to you.

https://github.com/FreeCAD/homebrew-freecad/issues/86

my computer is macOS High Sierra version 10.13.3(17D102)
  • i install pyenv by homebrew and install python2.7 by pyenv.
  • brew install --only-dependencies freecad --with-packaging-utils
  • copyand rename /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk to /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk
then start compile and pass
User avatar
federico.carminati
Posts: 49
Joined: Thu May 18, 2017 1:01 pm

Re: Upgrade nightmare with FreeCAD

Postby federico.carminati » Mon Apr 02, 2018 5:38 pm

Since I was not getting anywhere, I reinstalled EVERYTHING, but home-brew stopped immediately

This formula was found in a tap:
caskroom/cask/freecad
To install it, run:
brew install caskroom/cask/freecad
[/Users/fca] brew install --only-dependencies caskroom/cask/freecad


I hope I am doing this right. Best,
Federico Carminati
Switzerland/Suisse
peterl94
Posts: 1001
Joined: Thu May 23, 2013 7:31 pm
Location: United States

Re: Upgrade nightmare with FreeCAD

Postby peterl94 » Mon Apr 02, 2018 6:04 pm

No, you need add the freecad tap. The cask is something else and not what you want.

Code: Select all

brew tap FreeCAD/freecad
User avatar
federico.carminati
Posts: 49
Joined: Thu May 18, 2017 1:01 pm

Re: Upgrade nightmare with FreeCAD

Postby federico.carminati » Tue Apr 03, 2018 8:54 am

OK,
I zapped everything and reinstalled. It worked "almost" out of the box:

Fasteners workbench Loaded
During initialization the error "'RaytracingWorkbench' already exists." occurred in /Applications/FreeCAD.app/Contents/Mod/JtReader/InitGui.py
Please look into the log file for further information
dlopen(/Applications/FreeCAD.app/Contents/lib/WebGui.so, 2): Library not loaded: @rpath/libpng16.16.dylib
Referenced from: /Applications/FreeCAD.app/Contents/lib/QtWebKit
Reason: Incompatible library version: QtWebKit requires version 51.0.0 or later, but libpng16.16.dylib provides version 38.0.0
Traceback (most recent call last):
File "<string>", line 43, in Initialize

It turns out libpng 38 was brought in by matplotlib

[...r/local/FreeCAD/build] for i in `find /usr/local -name libpng16.16.dylib` ; do otool -L $i ; done
/usr/local/lib/libpng16.16.dylib:
/usr/local/opt/libpng/lib/libpng16.16.dylib (compatibility version 51.0.0, current version 51.0.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.0.0)
/usr/local/lib/python2.7/site-packages/matplotlib/.dylibs/libpng16.16.dylib:
/DLC/matplotlib/libpng16.16.dylib (compatibility version 38.0.0, current version 38.0.0)
@loader_path/libz.1.2.10.dylib (compatibility version 1.0.0, current version 1.2.10)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.60.2)
/usr/local/Cellar/libpng/1.6.34/lib/libpng16.16.dylib:
/usr/local/opt/libpng/lib/libpng16.16.dylib (compatibility version 51.0.0, current version 51.0.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.0.0)
[

I "fixed" it the hard way

$ sudo mv /usr/local/lib/python2.7/site-packages/matplotlib/.dylibs/libpng16.16.{,ori.}dylib
$ sudo cp /usr/local/lib/libpng.dylib /usr/local/lib/python2.7/site-packages/matplotlib/.dylibs/libpng16.16.dylib

Still there is one problem with one of the workbenches: Drawing Dimensioning

type object 'PySide2.QtWidgets.QApplication' has no attribute 'UnicodeUTF8'

and the workbench toolbar is empty.
Federico Carminati
Switzerland/Suisse
User avatar
microartisan
Posts: 12
Joined: Fri Mar 23, 2018 11:52 am
Location: beijing
Contact:

Re: Upgrade nightmare with FreeCAD

Postby microartisan » Tue Apr 03, 2018 10:36 am

currently , if you upgrade brew, your python will become python3. to compile freecad, you need python2. right?

and if you use the newest xcode , it will use MacOSX10.13.sdk.

In my case , I think some of freecad/freecad dependencies from brew still use MacOSX10.12.sdk. That is why I copy and rename MacOSX10.13.sdk to MacOSX10.12.sdk
Last edited by microartisan on Tue Apr 03, 2018 10:43 am, edited 1 time in total.
User avatar
federico.carminati
Posts: 49
Joined: Thu May 18, 2017 1:01 pm

Re: Upgrade nightmare with FreeCAD

Postby federico.carminati » Tue Apr 03, 2018 10:38 am

Correct, and the dependency which is installed is python2.7, which is correct.
Federico Carminati
Switzerland/Suisse
User avatar
microartisan
Posts: 12
Joined: Fri Mar 23, 2018 11:52 am
Location: beijing
Contact:

Re: Upgrade nightmare with FreeCAD

Postby microartisan » Tue Apr 03, 2018 10:47 am

befor I rename to MacOSX10.12.sdk

i got this error:

Code: Select all

Determining if the include file GL/gl.h exists failed with the following output:
Change Dir: /Users/apple/Documents/caad/caad.xyz/homebrew-freecad/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_e8299/fast"
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_e8299.dir/build.make CMakeFiles/cmTC_e8299.dir/build
Building C object CMakeFiles/cmTC_e8299.dir/CheckIncludeFile.c.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc    -o CMakeFiles/cmTC_e8299.dir/CheckIncludeFile.c.o   -c /Users/apple/Documents/caad/caad.xyz/homebrew-freecad/CMakeFiles/CMakeTmp/CheckIncludeFile.c
/Users/apple/Documents/caad/caad.xyz/homebrew-freecad/CMakeFiles/CMakeTmp/CheckIncludeFile.c:1:10: fatal error: 'GL/gl.h' file not found
#include <GL/gl.h>
         ^~~~~~~~~
1 error generated.
make[1]: *** [CMakeFiles/cmTC_e8299.dir/CheckIncludeFile.c.o] Error 1
make: *** [cmTC_e8299/fast] Error 2
after rename, compiler let me pass.
User avatar
federico.carminati
Posts: 49
Joined: Thu May 18, 2017 1:01 pm

Re: Upgrade nightmare with FreeCAD

Postby federico.carminati » Tue Apr 03, 2018 10:51 am

This should be part of the Darwin framework. I have

OPENGL_INCLUDE_DIR /System/Library/Frameworks/OpenGL.framework
OPENGL_gl_LIBRARY /System/Library/Frameworks/OpenGL.framework
OPENGL_glu_LIBRARY /System/Library/Frameworks/OpenGL.framework

and cmake finds it by itself.
Federico Carminati
Switzerland/Suisse
User avatar
microartisan
Posts: 12
Joined: Fri Mar 23, 2018 11:52 am
Location: beijing
Contact:

Re: Upgrade nightmare with FreeCAD

Postby microartisan » Tue Apr 03, 2018 10:54 am

thanks, next time I will try your options setting :)