ana(conda) windows packaging

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
zbigg
Posts: 136
Joined: Tue Dec 19, 2017 1:11 pm

Re: ana(conda) windows packaging

Post by zbigg »

As told already Ive built built qt 5.11.1 /latest/ with MSVC2017 x64.

Whats so worse in MSVC2017 comparing to eg 2015 that makes building FC harder?
Its has less problems with vcvars/setting the environment than 2015...
cheers,
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: ana(conda) windows packaging

Post by looo »

Maybe it's possible, but I see people (you) constantly complaining about problems with msvc17, so I guess it's still a bit too early to use it. ;)
If you want to push for newer libraries conda-forge is the place to do so....
User avatar
zbigg
Posts: 136
Joined: Tue Dec 19, 2017 1:11 pm

Re: ana(conda) windows packaging

Post by zbigg »

looo wrote: Wed Aug 08, 2018 12:53 pm Maybe it's possible, but I see people (you) constantly complaining about problems with msvc17, so I guess it's still a bit too early to use it. ;)
If you want to push for newer libraries conda-forge is the place to do so....
My pleasure, I personally find less problems with MSVC2017 than former versions - I tried various dep libs for Blender, FC, Boost etc.
Just one more thing: would you point to most up-to-date conda-forge link /in forum?/ ?
cheers,
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: ana(conda) windows packaging

Post by sgrogan »

looo wrote: Wed Aug 08, 2018 6:50 am (so conda-forge will be more like a release-channel
looo wrote: Wed Aug 08, 2018 6:50 am Once this is done I will try to apply your suggestion to the conda-forge packages.
If the conda-forge packages are "release" you can pull the source tarball from the FreeCAD-stable PPA. This already has the version.h file "injected" into the source.
For example (caution download link): https://launchpad.net/~freecad-maintain ... 4.1.tar.gz

The only problem I see is that the source tree is actually 1 level deeper under a "recipe" sub-directory. I think CMake should be able to handle this easily.

EDIT: What does BUILD_WITH_CONDA do?
"fight the good fight"
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: ana(conda) windows packaging

Post by looo »

EDIT: What does BUILD_WITH_CONDA do?
It's mainly used for osx. It:s simple to disable some homebrew steps. There is not very much difference between osx and Unix if you build with conda. But the cmake includes a lot of homebrew stuff...
Just one more thing: would you point to most up-to-date conda-forge link /in forum?/ ?
Conda-forge is a community effort to provide conda-packages. What exactly do you want? Google: conda-forge freecad and there will be a link to the freecad recipe in the first results. Same should be true for any other package.
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: ana(conda) windows packaging

Post by sgrogan »

looo wrote: Thu Aug 09, 2018 7:00 am It's mainly used for osx. It:s simple to disable some homebrew steps. There is not very much difference between osx and Unix if you build with conda. But the cmake includes a lot of homebrew stuff...
Thanks. Do you think we can use this for Win too. Like we have FREECAD_LIBPACK_USE? They're are a number of CMake flags that must be set to use Conda as a package manager on Win, maybe we can do it here.

Anyway, I got it working for me, and there is a new portable build here: https://github.com/FreeCAD/FreeCAD/rele ... 015_x64.7z
"fight the good fight"
UR_
Veteran
Posts: 1355
Joined: Tue Jan 03, 2017 8:42 pm

Re: ana(conda) windows packaging

Post by UR_ »

sgrogan wrote: Sun Aug 12, 2018 5:03 pm Anyway, I got it working for me
Please, can you provide a more or less (hopefully more :D ) detailed summary of how you did it :roll:
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: ana(conda) windows packaging

Post by sgrogan »

UR_ wrote: Sun Aug 12, 2018 6:00 pm Please, can you provide a more or less (hopefully more :D ) detailed summary of how you did it :roll:
Open an Anaconda prompt

Code: Select all

conda create --name freecad_py3 python=3.6 freecad
conda activate freecad_py3
conda install eigen
conda install swig
conda install pybind11
Exit the conda promt
Navigate to YourPathToConda/envs/freecad_py3/Library in Windows Explorer (or your preferred file management gui)
cmake_conda.bat.txt
(1.08 KiB) Downloaded 65 times
Add and run the cmake_conda.bat from here (it's a fake txt, rename to cmake_conda.bat)

If this succeeds, a FreeCAD_trunk.sln will be created. double-click on the file and the VS2015 IDE should open, set the release and x64 tabs, then build all. If compilation succeeds, then close VS and open an Anaconda prompt

Code: Select all

conda activate freecad_py3
freecad


If CMake fails during the .bat script, navigate to YourPathToConda/envs/freecad_py3 directory, highlight the Library, right-click and open a Git Bash Here window. Then run

Code: Select all

cmake-gui .
Bang away until everything works. Don't choose any paths higher than YourPathToConda/envs/freecad_py3
Once config and generate pass without error, run VS2015 as above.

I need a little more time to make the instructions for making the build portable. The key thing is that the PathtoConda/envs/freecad_py3/Library dir is the normal build dir, but in the conda environment all/most of the python stuff is one level up in the directory tree. Running freecad in an activated conda environment solves this. To make it portable some stuff must be moved around.
"fight the good fight"
User avatar
zbigg
Posts: 136
Joined: Tue Dec 19, 2017 1:11 pm

Re: ana(conda) windows packaging

Post by zbigg »

Thx. Succeeded with the build but /since I got env etc etc on the drive other than C it needed some playing with the paths in cmake_conda.bat /.
The build is unusable though, got no icons on Freecad Start Center, it cant find relevant modules: eg. ArchDesign.py.
Would be really great if we could structure and simplify dep and prebuilt process/settings.
Adding/replacing for newer deps /Qt, boost / is pointless for now. ))
Dont know why but FC call these modules from conda's environment but on 'C' drive
while I have it/and built FC/ on 'D' drive.
Maybe its conda's problem with different locations of user's profile and actual conda environment?
cheers,
UR_
Veteran
Posts: 1355
Joined: Tue Jan 03, 2017 8:42 pm

Re: ana(conda) windows packaging

Post by UR_ »

Works straight of of the box, here :lol:

Had only to tweak:
- of course my sources aren't here: "C:\Users\Chris\GitHub\FreeCAD"
- cmake's location isn't included to system path (checkbox wasn't checked while installing :( )
zbigg wrote: Wed Aug 15, 2018 8:30 am The build is unusable though, got no icons on Freecad Start Center
Yes, icons are lost. Didn't noticed this at first look.
zbigg wrote: Wed Aug 15, 2018 8:30 am cant find relevant modules: eg. ArchDesign.py
Can't confirm. ArchWB starts as usual.

But just some drawbacks:
- lots of warnings (472!!) while compiling

- qt5 stuff like this:
Arch workbench activated
C:\Users\aio\Miniconda3\envs\freecad_py3\lib\site-packages\matplotlib\__init__.py:908: MatplotlibDeprecationWarning: The backend.qt4 rcParam was deprecated in version 2.2. In order to force the use of a specific Qt binding, either import that binding first, or set the QT_API environment variable.
mplDeprecation)


- py3 stuff
Init: Initializing C:\Users\aio\AppData\Roaming\FreeCAD\Mod\Part-o-magic... failed
----------------------------------------------------------------------------------------------------
Traceback (most recent call last):
File "<string>", line 120, in InitApplications
File "<string>", line 11, in <module>
File "C:\Users\aio\AppData\Roaming\FreeCAD\Mod\Part-o-magic\PartOMagic\__init__.py", line 19, in importAll
mod.importAll()
File "C:\Users\aio\AppData\Roaming\FreeCAD\Mod\Part-o-magic\PartOMagic\Gui\__init__.py", line 20, in importAll
from . import Observer
File "C:\Users\aio\AppData\Roaming\FreeCAD\Mod\Part-o-magic\PartOMagic\Gui\Observer.py", line 348
print "entering "+cnt.Name
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("entering "+cnt.Name)?
----------------------------------------------------------------------------------------------------

During initialization the error Missing parentheses in call to 'print'. Did you mean print("entering "+cnt.Name)? (Observer.py, line 348) occurred in C:\Users\aio\AppData\Roaming\FreeCAD\Mod\Part-o-magic\InitGui.py
Please look into the log file for further information

unfortunately one of my favorite WBs :o

All in all good work! Thank you!
Post Reply