FindNETGEN rework

About the development of the FEM module/workbench.

Moderator: bernd

User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: FindNETGEN rework

Post by sgrogan »

Fat-Zer wrote: I don't know a lot about windows build... could you link me to some notes what netgen package looks like there.
Also could you provide CMakeCache.txt and CMakeFiles/CMakeError.log to see what gone wrong...
There's no url to the contents of the libacks, per sey.On Windows it's not necessary to have a compiled NETGEN. From the the libpack we use nglib. I believe there is a .dll in\bin, plus /netgen + /lib and + /include sub-directories. I'll try to make this understandable and post back.
Attachments
CMakeCache.txt
(131.26 KiB) Downloaded 52 times
CMakeOutput.log
(22.26 KiB) Downloaded 51 times
CMakeError.log
(20.95 KiB) Downloaded 53 times
"fight the good fight"
django013
Posts: 106
Joined: Tue Jan 13, 2015 7:51 am

Re: FindNETGEN rework

Post by django013 »

It's true only if package provides version information somehow, e.g. via pkg-config
Ok, on debian based systems, you can query version information for each officially installed package with dpkg:

Code: Select all

dpkg -l | grep <package-name>
A complete commandline to get the version of developer library of i.e. libavcodec looks like:

Code: Select all

dpkg -l | grep libavcodec-dev | head -1 | awk '{ print $3; }'
... by the way: netgen provides version informations in CMakeLists.txt in root directory

Code: Select all

if(NOT CMAKE_BUILD_TYPE)
    set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING INTERNAL)
endif(NOT CMAKE_BUILD_TYPE)

cmake_minimum_required(VERSION 2.8.9)
project(Netgen)
set(NETGEN_VERSION_MAJOR 6)
set(NETGEN_VERSION_MINOR 1)
set(NETGEN_VERSION "${NETGEN_VERSION_MAJOR}.${NETGEN_VERSION_MINOR}-dev")
set(PACKAGE_VERSION "${NETGEN_VERSION}")
... so version information could be obtained with grep

Sad to say - netgens executable is a poor one. It does not support the standard version query like "netgen --version"
OS: Linux Debian Jessie amd64 - FC: Git Master
Fat-Zer
Posts: 176
Joined: Thu Oct 30, 2014 10:38 pm

Re: FindNETGEN rework

Post by Fat-Zer »

sgrogan, thanks for your input... It will be helpfull...

Ok, There is one pretty easy to fix:

Code: Select all

cl /c /IC:\Users\Chris\Desktop\FClibs_vc12_x64\FreeCADLibs_11.1_x64_VC12\include\netgen\occ /IC:\Users\Chris\Desktop\FClibs_vc12_x64\FreeCADLibs_11.1_x64_VC12\include\netgen\general /IC:\Users\Chris\Desktop\FClibs_vc12_x64\FreeCADLibs_11.1_x64_VC12\include\netgen\meshing /IC:\Users\Chris\Desktop\FClibs_vc12_x64\FreeCADLibs_11.1_x64_VC12\include\netgen\linalg /IC:\Users\Chris\Desktop\FClibs_vc12_x64\FreeCADLibs_11.1_x64_VC12\lib\cmake\..\..\include\oce /Zi /W3 /WX- /Od /Ob0 /D WIN32 /D _WINDOWS /D NETGEN_WITH_OCC /D _DEBUG /D NO_PARALLEL_THREADS /D OCCGEOMETRY /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /GR /Fo"cmTryCompileExec2733992907.dir\Debug\\" /Fd"cmTryCompileExec2733992907.dir\Debug\vc120.pdb" /Gd /TP /errorReport:queue "C:\Users\Chris\GitHub\Find-Netgen-build\CMakeFiles\CMakeTmp\src.cxx"
"C:\Users\Chris\GitHub\Find-Netgen-build\CMakeFiles\CMakeTmp\cmTryCompileExec2733992907.vcxproj" (default target) (1) ->
  c:\users\chris\desktop\fclibs_vc12_x64\freecadlibs_11.1_x64_vc12\include\netgen\general\gzstream.h(35): fatal error C1083: Cannot open include file: 'zlib.h': No such file or directory [C:\Users\Chris\GitHub\Find-Netgen-build\CMakeFiles\CMakeTmp\cmTryCompileExec2733992907.vcxproj]
    0 Warning(s)
    1 Error(s)
Time Elapsed 00:00:00.57
Source file was:
#include <occgeom.hpp>
    int main() { netgen::OCCGeometry foo; }
It just requires zlib... don't know if it will require link to the dll, but yet another find_package() should fix this issue... But I suppose it will break on the the second one issue like two other tests.

But I don't really know what to do with this one:

Code: Select all

ClCompile:
  C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64\CL.exe /c /IC:\Users\Chris\Desktop\FClibs_vc12_x64\FreeCADLibs_11.1_x64_VC12\include\netgen\general /Zi /W3 /WX- /Od /Ob0 /D WIN32 /D _WINDOWS /D NETGEN_WITH_PARALLEL_THREADS /D _DEBUG /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /GR /Fo"cmTryCompileExec2620214328.dir\Debug\\" /Fd"cmTryCompileExec2620214328.dir\Debug\vc120.pdb" /Gd /TP /errorReport:queue "C:\Users\Chris\GitHub\Find-Netgen-build\CMakeFiles\CMakeTmp\src.cxx"
  Microsoft (R) C/C++ Optimizing Compiler Version 18.00.31101 for x64
  Copyright (C) Microsoft Corporation.  All rights reserved.
  cl /c /IC:\Users\Chris\Desktop\FClibs_vc12_x64\FreeCADLibs_11.1_x64_VC12\include\netgen\general /Zi /W3 /WX- /Od /Ob0 /D WIN32 /D _WINDOWS /D NETGEN_WITH_PARALLEL_THREADS /D _DEBUG /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /GR /Fo"cmTryCompileExec2620214328.dir\Debug\\" /Fd"cmTryCompileExec2620214328.dir\Debug\vc120.pdb" /Gd /TP /errorReport:queue "C:\Users\Chris\GitHub\Find-Netgen-build\CMakeFiles\CMakeTmp\src.cxx"
  src.cxx
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include\afx.h(24): fatal error C1189: #error :  Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d] [C:\Users\Chris\GitHub\Find-Netgen-build\CMakeFiles\CMakeTmp\cmTryCompileExec2620214328.vcxproj]
Done Building Project "C:\Users\Chris\GitHub\Find-Netgen-build\CMakeFiles\CMakeTmp\cmTryCompileExec2620214328.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\Users\Chris\GitHub\Find-Netgen-build\CMakeFiles\CMakeTmp\cmTryCompileExec2620214328.vcxproj" (default target) (1) ->
(ClCompile target) -> 
  C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include\afx.h(24): fatal error C1189: #error :  Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d] [C:\Users\Chris\GitHub\Find-Netgen-build\CMakeFiles\CMakeTmp\cmTryCompileExec2620214328.vcxproj]
    0 Warning(s)
    1 Error(s)
Time Elapsed 00:00:00.43
Source file was:
 #include <myadt.hpp>
    int main() { netgen::NgMutex foo; }  
can somebody point me out whay should I include/define to make the /MDd happy? may be it will be enough to just define _AFXDLL? may it be empty?
I suppose /MDd should be there itself because there are other tests built well with it...

Code: Select all

//Path to a library.
NETGEN_LIBRARY_mesh:FILEPATH=NETGEN_LIBRARY_mesh-NOTFOUND

//Path to a library.
NETGEN_LIBRARY_occ:FILEPATH=NETGEN_LIBRARY_occ-NOTFOUND
Are there any *{occ,mesh}.{lib,dll} in your netgen distribution? Is it version 5+?
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: FindNETGEN rework

Post by sgrogan »

According to the build script it should be 5.1
https://github.com/peterl94/clbundler-f ... /netgen.py

In
LibPack/bin/ there is nglib.dll

In
Libpack/include/netgen/csg
Libpack/include/netgen/meshing
Libpack/include/netgen/occ
etc.
These directories contain only header files (.hpp)

In
Libpack/lib/ there is nglib.lib
"fight the good fight"
Fat-Zer
Posts: 176
Joined: Thu Oct 30, 2014 10:38 pm

Re: FindNETGEN rework

Post by Fat-Zer »

Sorry, that I haven't replied for a while...
I can't fix the test code compilation on MSVC, so I've just disabled it... that should be enough to make it work... please check...
django013 wrote:Ok, on debian based systems, you can query version information for each officially installed package with dpkg:
It's not an option to query package manager from cmake...
django013 wrote:... by the way: netgen provides version informations in CMakeLists.txt in root directory
first, it's only for version six, which is not released yet (at least there is no stable release), 5.x still uses autotools, secondly the CMakeLists.txt is not being installed to the system... so unless upstream will provide it's own FindNETGEN module it's useless...
django013 wrote:Sad to say - netgens executable is a poor one. It does not support the standard version query like "netgen --version"
even if it were, we couldn't lay on that this executable is installed on the building system due to freecad doesn't depends upon netgen itself, but only on the nglib...
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: FindNETGEN rework

Post by sgrogan »

Every thing appears to be OK on win.
OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.5240 (Git)
Build type: Release
Branch: FindNETGEN-rework
Hash: f97593084e371ef2eeec15b0ed56cd41afd033c9
Python version: 2.7.8
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
"fight the good fight"
Fat-Zer
Posts: 176
Joined: Thu Oct 30, 2014 10:38 pm

Re: FindNETGEN rework

Post by Fat-Zer »

Thanks, for testing...
I'll wait for some time if there will be some positive or negative feedbacks from mingw or mac users... And if there won't be any I'll pull-requst...
wmayer
Founder
Posts: 20309
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: FindNETGEN rework

Post by wmayer »

Could you postpone this until Friday next week or so?
Fat-Zer
Posts: 176
Joined: Thu Oct 30, 2014 10:38 pm

Re: FindNETGEN rework

Post by Fat-Zer »

wmayer wrote:Could you postpone this until Friday next week or so?
sure, no hurry here...
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: FindNETGEN rework

Post by PrzemoF »

I can't (was: can) wait to start building FreeCAD rpm packages from the master branch for fedora witn netgen switched on 8-)

Edit: Thanks wmayer for catching the typo!
Post Reply