ana(conda) windows packaging

Having trouble installing or compiling FreeCAD? Get help here.
looo
Posts: 706
Joined: Mon Nov 11, 2013 5:29 pm

Re: ana(conda) windows packaging

Postby looo » Mon Mar 20, 2017 8:11 am

there are some netgen builds available for win and oce. So I think there has to be a solution :-)
https://anaconda.org/pythonocc/netgen

If you add conda-forge to the channels it will automatically pull the newest win version. We should maybe use the same version as conda-forge. The pinned versions can be seen here: https://github.com/conda-forge/staged-r ... pendencies
So we should go with 1.8.17|1.8.17.*

Thanks looo! This is for sure way difficult. All you efforts are for sure appreciated. I have VC14 and conda installed on my win system so I can try anything you like.


I think you should have all the dependencies. It would be nice if you could try to build the libmed library. Simple adding an equivalent bld.bat file and running "conda build .".

I have also started a little documentation how to build with conda on windows: https://github.com/looooo/FreeCAD_Conda ... windows.md
If you have something to add there it would be nice if you could send me or create PR.
looo
Posts: 706
Joined: Mon Nov 11, 2013 5:29 pm

Re: ana(conda) windows packaging

Postby looo » Mon Mar 20, 2017 9:55 am

I was able to build with gui=off, python=off.
Now one warning occurs. I don't know if it is relevant:

Code: Select all

[150/151] Install the project...
CMake Warning (dev) at cmake_install.cmake:5 (set):
  Syntax error in cmake code at

    C:/Users/fc_builder/Miniconda3/conda-bld/netgen_1490002516470/work/build/cmake_install.cmake:5

  when parsing string

    C:\Users\fc_builder\Miniconda3\conda-bld\netgen_1490002516470\_b_env\Library

  Invalid escape sequence \U

  Policy CMP0010 is not set: Bad variable reference syntax is an error.  Run
  "cmake --help-policy CMP0010" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.
This warning is for project developers.  Use -Wno-dev to suppress it.


Also on linux we need the config.h. I think the things @jobermayer introduced to the cmake were not windows relevant. So I do not copy this file with windows. Maybe we have to do this later on. Also I have noticed the header files were installed. So maybe the manual copying of these isn't necessary in windows. We will see.

I am using this branch of netgen now: https://github.com/looooo/netgen/commits/6.2rebased I had to experiment a bit with some cmake stuff. Once we have something working I will try to clean this and send patches to netgen. Especially the use-no-gui things should be fixed.

The build is uploaded to anaconda: https://anaconda.org/freecad/netgen/files
looo
Posts: 706
Joined: Mon Nov 11, 2013 5:29 pm

Re: ana(conda) windows packaging

Postby looo » Mon Mar 20, 2017 6:22 pm

PySide is included in the conda-forge pyside package. I have never seen that. So this dependency is obsolet (linux and windows)

Btw.: Why are we building occt with tk? The best option would be to get rid of tk.
User avatar
NormandC
Posts: 12077
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: ana(conda) windows packaging

Postby NormandC » Tue Mar 21, 2017 1:41 am

looo wrote:Btw.: Why are we building occt with tk? The best option would be to get rid of tk.

See this reply from an OCCT developer. https://forum.freecadweb.org/viewtopic.php?f=4&t=17501&start=80#p142368

gkv311 wrote:Tcl/Tk, mandatory for Draw Harness module.

https://www.opencascade.com/content/draw-test-harness
looo
Posts: 706
Joined: Mon Nov 11, 2013 5:29 pm

Re: ana(conda) windows packaging

Postby looo » Tue Mar 21, 2017 8:43 am

thanks, normandC. So with occt this makes sense.

Regarding libmed I get the following problem:

Code: Select all

C:\Users\fc_builder\Miniconda3\conda-bld\libmed_1490081839217\_b_env\Library\bin\hdf5.dll : fatal er
ror LNK1107: Ungültige oder beschädigte Datei: Lesen bei 0x348 nicht möglich.
LINK Pass 1 failed. with 1107

-> Not valid or damaged file...
User avatar
sgrogan
Posts: 3005
Joined: Wed Oct 22, 2014 5:02 pm

Re: ana(conda) windows packaging

Postby sgrogan » Tue Mar 21, 2017 4:58 pm

looo wrote:-> Not valid or damaged file...

Try adding this to cmake section

Code: Select all

-DHDF5_LIBRARIES=$PREFIX/lib/libhdf5.lib

See also here: http://forum.freecadweb.org/viewtopic.php?f=27&t=15756&start=30#p126231
looo
Posts: 706
Joined: Mon Nov 11, 2013 5:29 pm

Re: ana(conda) windows packaging

Postby looo » Tue Mar 21, 2017 6:11 pm

Thanks. First try didn't work. I have this in the lib dir:

Code: Select all

hdf5.lib      hdf5_hl_cpp.lib  libhdf5.settings  libhdf5_hl_cpp.lib  zdll.lib
hdf5_cpp.lib  hdf5_tools.lib   libhdf5_cpp.lib   libhdf5_tools.lib   zlib.lib
hdf5_hl.lib   libhdf5.lib      libhdf5_hl.lib    z.lib               zlibstatic.lib


The conda hdf5 library is build as a dynamic library. Does libmed need the dll from the bin or is only $PREFIX/lib/libhdf5.lib relevant?

ps.:
in case you would like to experiment with this you can use this branch: https://github.com/looooo/FreeCAD_Conda ... ed/bld.bat
Once everything is ready I will clean the commits and merge it into the master. I think at some point I should stop messing arround with git, so it's easier for others to contribute.
User avatar
sgrogan
Posts: 3005
Joined: Wed Oct 22, 2014 5:02 pm

Re: ana(conda) windows packaging

Postby sgrogan » Tue Mar 21, 2017 6:23 pm

looo wrote:The conda hdf5 library is build as a dynamic library. Does libmed need the dll from the bin or is only $PREFIX/lib/libhdf5.lib relevant?

hmm? I had to link against the static lib or I got all kinds of "unresolved externals" you could try linking against hdf5.lib instead, that's the dynamic library. What version of libmed?
looo
Posts: 706
Joined: Mon Nov 11, 2013 5:29 pm

Re: ana(conda) windows packaging

Postby looo » Tue Mar 21, 2017 6:40 pm

hdf5.lib is also not working. same problem as posted above.

libmed is from here: https://github.com/vejmarie/libMED.git
hdf5 is 1.8.17

The error is in C:\Users\fc_builder\Miniconda3\conda-bld\libmed_1490081839217\_b_env\Library\bin\hdf5.dll
I am wondering if the cmake is using the wrong library to link to.
looo
Posts: 706
Joined: Mon Nov 11, 2013 5:29 pm

Re: ana(conda) windows packaging

Postby looo » Tue Mar 21, 2017 6:54 pm

Code: Select all

-- Check for HDF5 ...
-- Found HDF5: C:\Users\fc_builder\Miniconda3\conda-bld\libmed_1490118785021\_b_env\Library\lib\hdf.lib;C:/Users/fc_builder/Miniconda3/conda-bld/libmed_1490118785021/_b_env/Library/bin/hdf5.dll (found version "1.8.17")