Help with testing - part 5

About the development of the FEM module/workbench.

Moderator: bernd

drei
Posts: 479
Joined: Sun May 11, 2014 7:47 pm
Location: Mexico
Contact:

Re: Help with testing - part 5

Post by drei »

I'm unable to set a compilation for 64-bit. I've manually set -D_OCC64=1, but CMake still sets the build target to 32 bit. Any suggestions?

My CMake configuration flags (without setting -D_OCC64=1):

Code: Select all

cmake ../fem_src -DPYTHON_EXECUTABLE=/usr/bin/python2 -DFREECAD_USE_EXTERNAL_PIVY=1 -DBUILD_FEM=1 -DBUILD_CAM=0 -DBUILD_COMPLETE=0 -DBUILD_IMAGE=1 -DBUILD_INSPECTION=0 -DBUILD_OPENSCAD=0 -DBUILD_PLOT=1 -DBUILD_POINTS=0 -DBUILD_REVERSEENGINEERING=0 -DBUILD_SHIP=0 -DBUILD_ROBOT=0 -DBUILD_SPREADSHEET=1 -DBUILD_ASSEMBLY=0 -DCMAKE_BUILD_TYPE=Debug -DFREECAD_USE_3DCONNEXION=0 -DBUILD_FEM_NETGEN=0
My system info:

Code: Select all

                   -`
                  .o+`                 isaac@Arch
                 `ooo/                 OS: Arch Linux 
                `+oooo:                Kernel: x86_64 Linux 4.0.1-1-ARCH
               `+oooooo:               Uptime: 30m
               -+oooooo+:              Packages: 836
             `/:-:++oooo+:             Shell: bash 4.3.33
            `/++++/+++++++:            Resolution: 1366x768
           `/++++++++++++++:           DE: KDE5
          `/+++ooooooooooooo/`         WM: KWin
         ./ooosssso++osssssso+`        GTK Theme: Orion [GTK2], Orion [GTK3]
        .oossssso-````/ossssss+`       Icon Theme: breeze-dark
       -osssssso.      :ssssssso.      Font: Montserrat Regular
      :osssssss/        osssso+++.     CPU: Intel Core i5-3337U CPU @ 2.7GHz
     /ossssssss/        +ssssooo/-     RAM: 1053MB / 7871MB
   `/ossssso+/:-        -:/+osssso+-  
  `+sso+:-`                 `.-/+oso: 
 `++:.                           `-/+/
 .`                                 `/
Need help? Feel free to ask, but please read the guidelines first
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Help with testing - part 5

Post by PrzemoF »

Can you try "export CFLAGS=-m64"?
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Help with testing - part 5

Post by PrzemoF »

Latest changes: https://github.com/PrzemoF/FreeCAD_sf_m ... /fem_devel
There is also proper handling of multilple results. Please test & report errors.
Attachments
FreeCAD_FEM_changes_5.png
FreeCAD_FEM_changes_5.png (208.63 KiB) Viewed 1535 times
FreeCAD_FEM_changes_4.png
FreeCAD_FEM_changes_4.png (180.02 KiB) Viewed 1535 times
FreeCAD_FEM_changes_3.png
FreeCAD_FEM_changes_3.png (157.99 KiB) Viewed 1535 times
FreeCAD_FEM_changes_2.png
FreeCAD_FEM_changes_2.png (159.91 KiB) Viewed 1535 times
FreeCAD_FEM_changes_1.png
FreeCAD_FEM_changes_1.png (190.8 KiB) Viewed 1535 times
drei
Posts: 479
Joined: Sun May 11, 2014 7:47 pm
Location: Mexico
Contact:

Re: Help with testing - part 5

Post by drei »

PrzemoF wrote:Can you try "export CFLAGS=-m64"?
Thanks, that fixed it. I'm not sure about what the command did though, could you explain a bit please?
Need help? Feel free to ask, but please read the guidelines first
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Help with testing - part 5

Post by PrzemoF »

I found a similar question and answer here [1]
From man g++:
" -m32
-m64
Generate code for a 32-bit or 64-bit environment. The 32-bit environment sets int, long and pointer to 32 bits. The 64-bit
environment sets int to 32 bits and long and pointer to 64 bits.[..]"

As far as I understand it's safer to run:

Code: Select all

CFLAGS=-m64 cmake whatever_you_want_here
instead of exporting CFLAGS as it sets it globally, so it you try to compile something else it will be affected as well.

[1] http://stackoverflow.com/questions/1272 ... -gcc-cmake
wmayer
Founder
Posts: 20242
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Help with testing - part 5

Post by wmayer »

I'm unable to set a compilation for 64-bit. I've manually set -D_OCC64=1, but CMake still sets the build target to 32 bit.
Setting the _OCC64 is only for OpenCascade-internal stuff. So, with this you can't force a 64-bit build.
CFLAGS=-m64 cmake whatever_you_want_here
I am not sure if the -m64 switch is then stored in the CMake cache. Consider the scenario that you open a terminal, set the environment variable and run cmake. A few days later you update the sources where a CMakeLists.txt file was touched and you now just start make. In case the -m64 switch is not stored in the cache CMake will re-generate the Makefile without this switch.

However, it works for sure to open the cmake-gui and enable the "Advanced view". Then you can manually set this switch for CMAKE_CXX_FLAGS and CMAKE_C_FLAGS.
Post Reply