FEM object types

About the development of the FEM module/workbench.

Moderator: bernd

User avatar
bernd
Posts: 5720
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: FEM object types

Postby bernd » Mon May 28, 2018 7:27 pm

HarryvL wrote:
Mon May 28, 2018 4:41 pm
Wooooow. That worked really well. Thanks Bernd.
Everything works now. My new concrete stuff + Boolean Fragments + Netgen (which I never had on Ubuntu).

I see from the script that when it runs it starts from scratch (deletes the whole directory). Can I now do a simple pull request and compile/make to incorporate changes from my repository? Will it know to find OCCT and NETGEN?
sure, best is to use git for this.
User avatar
HarryvL
Posts: 352
Joined: Sat Jan 06, 2018 7:38 pm
Location: Denmark

Re: FEM object types

Postby HarryvL » Mon Jun 11, 2018 8:09 pm

bernd wrote:
Mon May 28, 2018 7:27 pm
HarryvL wrote:
Mon May 28, 2018 4:41 pm
Wooooow. That worked really well. Thanks Bernd.
Everything works now. My new concrete stuff + Boolean Fragments + Netgen (which I never had on Ubuntu).

I see from the script that when it runs it starts from scratch (deletes the whole directory). Can I now do a simple pull request and compile/make to incorporate changes from my repository? Will it know to find OCCT and NETGEN?
sure, best is to use git for this.
Hi Bern, I am back :?

I changed FemVTKTools.cpp as part of my little project to plot stress trajectories and tried to build FC from the same basis that worked so well before. I took your script and ripped out functionality that had to do with downloading and building FC and the dependencies from scratch. So I am simply left with:

Code: Select all

!/bin/bash

cd ~
cd Documents
cd build_FreeCAD
cd freecad
cd build

cmake ../FreeCAD  -DCMAKE_INSTALL_PREFIX:PATH=/opt/local/FreeCAD-0.17  -DBUILD_FEM_NETGEN=1  -DCMAKE_CXX_FLAGS="-DNETGEN_V5"  -DNETGEN_ROOT=/opt/local/FreeCAD-0.17  -DFREECAD_USE_OCC_VARIANT="Official Version"  -DOCC_INCLUDE_DIR=/opt/local/FreeCAD-0.17/include/opencascade  -DOCC_LIBRARY=/opt/local/FreeCAD-0.17/lib/libTKernel.so

make -j 2
sudo make install
this produces the following errors:

Code: Select all

[ 61%] Linking CXX shared library ../../lib/FreeCADGui.so
//usr/lib/x86_64-linux-gnu/libSM.so.6: undefined reference to `uuid_generate@UUID_1.0'
//usr/lib/x86_64-linux-gnu/libSM.so.6: undefined reference to `uuid_unparse_lower@UUID_1.0'
collect2: error: ld returned 1 exit status
src/Main/CMakeFiles/FreeCADMain.dir/build.make:128: recipe for target 'bin/FreeCAD' failed
make[2]: *** [bin/FreeCAD] Error 1
CMakeFiles/Makefile2:839: recipe for target 'src/Main/CMakeFiles/FreeCADMain.dir/all' failed
make[1]: *** [src/Main/CMakeFiles/FreeCADMain.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 61%] Built target FreeCADGuiPy
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
[sudo] password for harry: 
[  1%] Built target SMDS
[  2%] Built target Driver
[  2%] Built target DriverDAT
[  2%] Built target SMESHDS
[  2%] Built target DriverUNV
[  2%] Built target MEFISTO2
[  2%] Built target DriverSTL
[  4%] Built target SMESH
[  6%] Built target StdMeshers
[  7%] Built target NETGENPlugin
[ 10%] Built target FreeCADBase
[ 13%] Built target FreeCADApp
[ 28%] Built target FreeCADGui
[ 28%] Linking CXX executable ../../bin/FreeCAD
//usr/lib/x86_64-linux-gnu/libSM.so.6: undefined reference to `uuid_generate@UUID_1.0'
//usr/lib/x86_64-linux-gnu/libSM.so.6: undefined reference to `uuid_unparse_lower@UUID_1.0'
collect2: error: ld returned 1 exit status
src/Main/CMakeFiles/FreeCADMain.dir/build.make:128: recipe for target 'bin/FreeCAD' failed
make[2]: *** [bin/FreeCAD] Error 1
CMakeFiles/Makefile2:839: recipe for target 'src/Main/CMakeFiles/FreeCADMain.dir/all' failed
make[1]: *** [src/Main/CMakeFiles/FreeCADMain.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
After that I did a fresh download of the FreeCAD/FreeCAD master to try a simple "In-source build". This worked well in the past but now also fails.

What was a sweet dream is gradually becoming an ugly nightmare :D

Do you have any suggestions what I may have broken here?

Could it have to do with recent installation of Anaconda? I get warnings of the type:

Code: Select all

CMake Warning at src/Mod/TechDraw/Gui/CMakeLists.txt:235 (add_library):
  Cannot generate a safe runtime search path for target TechDrawGui because
  files in some directories may conflict with libraries in implicit
  directories:

    runtime library [libfreetype.so.6] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
      /home/harry/anaconda3/lib

  Some of these libraries may not be found correctly.
User avatar
bernd
Posts: 5720
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: FEM object types

Postby bernd » Tue Jun 12, 2018 11:50 am

I have no glue ... I have not installed Anaconda. But this should not make any problems (should ... :shock: :x ) Mhh if a clean build fails but all depencies are found by cmake ... I never had such problems with FreeCAD. For a year now I have such problems with a library we gone use in Arch Module. I'm able to build it in a clean virtual machaine, but even a clean build fails on my system and I'm not able to tackle it down.

You may try with FreeCAD master first. In this regard you could post in install too. There are some far more advanced guys. If you are able to compile FreeCAD master my banch will compile too.

bernd
User avatar
HarryvL
Posts: 352
Joined: Sat Jan 06, 2018 7:38 pm
Location: Denmark

Re: FEM object types

Postby HarryvL » Tue Jun 12, 2018 2:54 pm

Thanks Bernd. This was with the Master. I posted on compile and install https://forum.freecadweb.org/viewtopic.php?f=4&t=29225
User avatar
HarryvL
Posts: 352
Joined: Sat Jan 06, 2018 7:38 pm
Location: Denmark

Re: FEM object types

Postby HarryvL » Tue Jun 12, 2018 8:32 pm

bernd wrote:
Tue Jun 12, 2018 11:50 am
... There are some far more advanced guys. If you are able to compile FreeCAD master my banch will compile too.
UH OH - that will teach me :oops: :
https://forum.freecadweb.org/viewtopic. ... 25#p238962
User avatar
bernd
Posts: 5720
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: FEM object types

Postby bernd » Wed Jun 13, 2018 1:26 pm

HarryvL wrote:
Tue Jun 12, 2018 8:32 pm
bernd wrote:
Tue Jun 12, 2018 11:50 am
... There are some far more advanced guys. If you are able to compile FreeCAD master my banch will compile too.
UH OH - that will teach me :oops: :
https://forum.freecadweb.org/viewtopic. ... 25#p238962
ahh yeah that is what I meant by a CLEAN build ... Sorry I should have been more clear. If you gone do a out of source build, which is what I do, you could just delete all files in this build directory.
User avatar
HarryvL
Posts: 352
Joined: Sat Jan 06, 2018 7:38 pm
Location: Denmark

Re: FEM object types

Postby HarryvL » Tue Jun 19, 2018 10:41 am

bernd wrote:
Wed Jun 13, 2018 1:26 pm
HarryvL wrote:
Tue Jun 12, 2018 8:32 pm
bernd wrote:
Tue Jun 12, 2018 11:50 am
... There are some far more advanced guys. If you are able to compile FreeCAD master my banch will compile too.
UH OH - that will teach me :oops: :
https://forum.freecadweb.org/viewtopic. ... 25#p238962
ahh yeah that is what I meant by a CLEAN build ... Sorry I should have been more clear. If you gone do a out of source build, which is what I do, you could just delete all files in this build directory.
Hi Bernd, I am up and running again. I managed to fork, clone and (out-of-source) build the latest FC Master using the simple scripts from the wiki:

Code: Select all

Out-of-source build

If you intend to follow the fast evolution of FreeCAD, building in a separate folder is much more convenient. Every time you update the source code, cMake will then intelligently distinguish which files have changed, and recompile only what is needed. Out-of-source builds are specially handy when using the Git system, because you can easily try other branches without confusing the build system. To build out-of-source, simply create a build directory, distinct from your FreeCAD source folder, and, from the build folder, point cMake (or if using cmake-gui replace "cmake" in the code below with "cmake-gui") to the source folder:

mkdir freecad-build
cd freecad-build
cmake ../freecad (or whatever the path is to your FreeCAD source folder)
# Note: to speed up build use all CPU cores: make -j$(nproc)
make 

The FreeCAD executable will then reside in the "bin" directory (within your freecad-build directory). 
All dependencies work, except netgen :(

Is there a simple way to include this? I am able to use your script to create a netgen build directory (deleting all the other stuff), but am unable to link this with "make".

Thanks, Harry