ana(conda) windows packaging

Having trouble installing or compiling FreeCAD? Get help here.
DeepSOIC
Posts: 4670
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: ana(conda) windows packaging

Postby DeepSOIC » Mon Mar 27, 2017 10:19 pm

this appears to have worked, thanks peter!

Code: Select all

conda config --add channels conda-canary
conda update conda

Now to figure out how do I run FreeCAD...
DeepSOIC
Posts: 4670
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: ana(conda) windows packaging

Postby DeepSOIC » Mon Mar 27, 2017 10:27 pm

The instruction says to activate the environment using source activate <env-name>
Doesn't work.

Code: Select all

(T:\Py\Miniconda3) T:\Py\Miniconda3>source activate fc_test
"source" не является внутренней или внешней
командой, исполняемой программой или пакетным файлом.
(translate: "source" is not a command or an executable)

Sorry for being a conda noob, but I have no clue how to use it.
I also tried launching freecad.exe from explorer, it fired a few messageboxes telling python35.dll is missing.
DeepSOIC
Posts: 4670
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: ana(conda) windows packaging

Postby DeepSOIC » Mon Mar 27, 2017 10:30 pm

RTFM'ed, I need to use activate fc_test on windows.

haha, running!

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.10699 (Git)
Build type: Release
Branch: py3-25
Hash: b62c69aa62fa0714fc3f5b462817aaf0c8fe1cd0
Python version: 3.5.3
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
DeepSOIC
Posts: 4670
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: ana(conda) windows packaging

Postby DeepSOIC » Mon Mar 27, 2017 10:36 pm

Same problem with sketch. Can't create a sketch.

The only add-on workbench that made it to the list was Lattice2, which fails to activate. I'll try solving that ;)
Looking forward to fixes around sketcher. Reading the internet, I found that /GR- flag should be added to compiler for dynamic_casts to work.
DeepSOIC
Posts: 4670
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: ana(conda) windows packaging

Postby DeepSOIC » Mon Mar 27, 2017 10:59 pm

Curious to know... can I use the installation as a "libpack" to compile FreeCAD?
DeepSOIC
Posts: 4670
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: ana(conda) windows packaging

Postby DeepSOIC » Mon Mar 27, 2017 11:08 pm

Lattice2 fails to load resource py file. I don't know how to fix it, it looks like pyside-rcc isn't in conda installation. PySide's QtCore.qRegisterResourceData says it wants (int,unicode,unicode,unicode) but got (int,str,str,str). And AFAIK, unicode is no longer there in Py3, so everything is screwed?
peterl94
Posts: 662
Joined: Thu May 23, 2013 7:31 pm
Location: United States

Re: ana(conda) windows packaging

Postby peterl94 » Tue Mar 28, 2017 12:06 am

DeepSOIC wrote:can I use the installation as a "libpack" to compile FreeCAD?

Yes, if you want to do things manually. This is what needs to be done (not tested):

Code: Select all

set PREFIX=C:\path\to\Miniconda3\envs\your_env_name
set LIBRARY_PREFIX=%PREFIX%\Library
set PATH=%PREFIX%;%LIBRARY_PREFIX%;%PATH%

mkdir build
cd build

cmake .. -G "Visual Studio 14 2015 Win64" ^
      -DCMAKE_BUILD_TYPE=Release ^
      -DFREECAD_LIBPACK_USE=FALSE ^
      -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
      -DCMAKE_PREFIX_PATH=%LIBRARY_PREFIX% ^
      -DCMAKE_INCLUDE_PATH=%LIBRARY_PREFIX%/include ^
      -DCMAKE_LIBRARY_PATH=%LIBRARY_PREFIX%/lib ^
      -DNETGENDATA=%LIBRARY_PREFIX%/include ^
      -DNETGEN_INCLUDEDIR=%LIBRARY_PREFIX%/include/netgen ^
      -DNGLIB_INCLUDE_DIR=%LIBRARY_PREFIX%/include/nglib ^
      -DOCC_INCLUDE_DIR=%LIBRARY_PREFIX%/include/opencascade ^
      -DOCC_LIBRARY_DIR=%LIBRARY_PREFIX%/lib ^
      -DOCC_LIBRARIES=%LIBRARY_PREFIX%/lib CACHE ^
      -DFREECAD_USE_OCC_VARIANT="Official Version" ^
      -DOCC_OCAF_LIBRARIES=%LIBRARY_PREFIX%/lib ^
      -DSWIG_DIR=%LIBRARY_PREFIX%/share/swig/3.0.8 ^
      -DSWIG_EXECUTABLE=%LIBRARY_PREFIX%/bin/swig ^
      -DPYTHON_EXECUTABLE=%PYTHON% ^
      -DBUILD_REVERSEENGINEERING=NO


Note that only release (and maybe RelWithDebInfo) works at the moment.

Edit: and you have to use this branch: https://github.com/looooo/FreeCAD/tree/py3-25
Last edited by peterl94 on Tue Mar 28, 2017 12:22 am, edited 1 time in total.
peterl94
Posts: 662
Joined: Thu May 23, 2013 7:31 pm
Location: United States

Re: ana(conda) windows packaging

Postby peterl94 » Tue Mar 28, 2017 12:12 am

DeepSOIC wrote:Reading the internet, I found that /GR- flag should be added to compiler for dynamic_casts to work

I saw that too, but I checked the compiler flags and /GR is present. I wonder if it is a problem with a 3rd party library.
DeepSOIC
Posts: 4670
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: ana(conda) windows packaging

Postby DeepSOIC » Tue Mar 28, 2017 12:27 am

Could you try replacing all dynamic_cast with static_cast within sketcher? I've just tested that it works with static_casts. So if it fixes the RTTI error, it is freecad compile problem, otherwise it's a dependency...
User avatar
sgrogan
Posts: 3042
Joined: Wed Oct 22, 2014 5:02 pm

Re: ana(conda) windows packaging

Postby sgrogan » Tue Mar 28, 2017 12:36 am

peterl94 wrote: DeepSOIC wrote:
can I use the installation as a "libpack" to compile FreeCAD?
Yes, if you want to do things manually. This is what needs to be done (not tested):

@DeepSOIC, you need VC14