conda, osx-arm64, occt7.6

This subforum is specifically to discuss packaging issues on different platforms (windows, mac, linux), and using different packaging systems (conda, etc...)
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: conda, osx-arm64, occt7.6

Post by looo »

I Found these lines in the smesh sources:
https://github.com/trelau/SMESH/blob/ma ... txt#L59L62

Code: Select all

if(CMAKE_SIZEOF_VOID_P STREQUAL 8)
    add_definitions(-D_OCC64)
    add_definitions(-DSALOME_USE_64BIT_IDS)
endif(CMAKE_SIZEOF_VOID_P STREQUAL 8)
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: conda, osx-arm64, occt7.6

Post by looo »

I wasn't able to test this as I didn't succeed in compiling smesh with these changes:
https://github.com/trelau/SMESH/issues/67
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: conda, osx-arm64, occt7.6

Post by looo »

@wmayer using int32 for the external smesh worked. Now the question is if smesh should use int32 or freecad should use int64?
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: conda, osx-arm64, occt7.6

Post by adrianinsaval »

Since FreeCAD is compiled for x86_64 shouldn't it use int64 by default? Or is it explicitly using int32? (I have very limited c++ knowledge so excuse if I'm talking nonsense :) )
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: conda, osx-arm64, occt7.6

Post by looo »

adrianinsaval wrote: Sun Jul 10, 2022 2:24 pm Since FreeCAD is compiled for x86_64 shouldn't it use int64 by default? Or is it explicitly using int32? (I have very limited c++ knowledge so excuse if I'm talking nonsense :) )
I am also not sure if I am talking nonsense here :) Let's wait for @wmayer explaining what should be done...

In the meantime I looked at the osx-arm64 bundle and saw that several run-dependencies are still missing:
- opencamlib x
- CalculiX x
- spooles as a dependency of calculux x
- ifcopenshell

anyway I will upload the bundle for osx-arm64 (without these libraries), so it can be tested.
https://github.com/FreeCAD/FreeCAD-Bund ... kly-builds

It is good to know the external smesh is still working with freecad. So we are now able to update the other builds to occt7.6 too. What I am not sure yet, is if it's possible to create the osx-arm64 bundle with osx64 because there is no GitHub action for osx-arm64 available right now. So currently the bundles must be created manually.
Last edited by looo on Mon Jul 11, 2022 10:58 pm, edited 2 times in total.
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: conda, osx-arm64, occt7.6

Post by adrianinsaval »

Isn't the bundling action just downloading and repackaging already built binaries? Can't conda be forced to download some specific architecture?
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: conda, osx-arm64, occt7.6

Post by looo »

adrianinsaval wrote: Sun Jul 10, 2022 4:42 pm Isn't the bundling action just downloading and repackaging already built binaries? Can't conda be forced to download some specific architecture?
absolutely but I have no idea how to do it. I know how to install osx64 packages on osxarm64 but not the other way. Maybe it is as simple as doing it the other way:

Code: Select all

export CONDA_SUBDIR=osx-arm64
let's try :D
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: conda, osx-arm64, occt7.6

Post by looo »

actually freecad is called in the bundling process to get the Freecad-version...:

Code: Select all

Bad CPU type in executable
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: conda, osx-arm64, occt7.6

Post by adrianinsaval »

I take it everything else works? Then what we need is another way of determining the version, right? Perhaps including Version.h somewhere in the conda package so it can be just parsed during bundling?

This would also need to be manually set for arm: https://github.com/FreeCAD/FreeCAD-Bund ... ion.py#L12 since it would report i386 (which is also incorrect for x86_64 IMO but apple disagrees apparently)
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: conda, osx-arm64, occt7.6

Post by wmayer »

looo wrote: Sun Jul 10, 2022 1:40 pm @wmayer using int32 for the external smesh worked. Now the question is if smesh should use int32 or freecad should use int64?
On a 64-bit system it preferably should use int64_t. However, it looks like Salome has used int32_t for 64-bit systems too and only has changed this recently to use int64_t instead. The difficulty for FreeCAD is that there is no way to determine whether smesh was built with SALOME_USE_64BIT_IDS or not.

The proper way actually would be that smesh offered a CMake file with defines that must be set in client code or does not even bother client code at all.
For example, OCC doesn't require to set _OCC64 in client code but handles it by itself.

Now we have two options:
  • we change the smesh code to not set SALOME_USE_64BIT_IDS
  • we add a build option in FreeCAD to set SALOME_USE_64BIT_IDS on request. The modules that link smesh libs must define SALOME_USE_64BIT_IDS if this build option is on. This will affect MeshPart, Fem and possibly FemGui.
Post Reply