Personal tools
You are here: Home Forum Install & build Salome 7.8 on Mac OS X

Salome 7.8 on Mac OS X

Up to Install & build


This forum is DEPRECATED, please create new topics in the new SALOME forum.
For existing topics please transfer them to the new forum.

Salome 7.8 on Mac OS X

Posted by bvenkat at January 01. 2017

Good day,

 

I would like to share some patches & instructions for building / running Salome 7.8 on Mac OS X (tested on El Capitan).  These requires Apple System Integrity Protection to be turned off, so use at your own risk.

 

Links to patches / screenshot at bottom of the post (because of 100 kb limit in the forum).

 

Notes:

 

1. Salome makes extensive use of DYLD_* environment variables, in a manner which is not compatible with Apple System Integrity Protection (El Capitan & later) and this is not possible to easily fix/work around.  The only option is to disable it, more info here:

 

https://developer.apple.com/library/content/documentation/Security/Conceptual/System_Integrity_Protection_Guide/ConfiguringSystemIntegrityProtection/ConfiguringSystemIntegrityProtection.html

http://www.imore.com/el-capitan-system-integrity-protection-helps-keep-malware-away

 

2. Prerequisite SIP requires Python to be built as a framework for python.  However then cmake has some problems detecting the python framework outside standard paths (see https://cmake.org/Bug/view.php?id=14809) therefore the attached patches modify the Salome code to query the compiler flags from the python executable instead of the standard FindPackage usage.

 

3. Qt 4.8.4 is not compatible with recent Mac OS X & you will need to download & use 4.8.6.

 

4. OpenCascade/Cocoa - it appears that GNU autotools are not able to build cocoa version hence I have used cmake.  In order to do so, you will need to download OCCT 6.9.1 from OCC web site separately & prepare it for use.

 

5. Non-Apple compilers cannot be used to build Python & Qt, as a result, I have built all the pre-requisites & salome itself using only Apple compilers.  Among other dependencies, I have GNU Autotools installed at /opt/local using macports & a fortran compiler (gfortran 4.9).

 

Steps for compiling:

 

1. Download a complete linux version of Salome, I have used the one for Fedora 22.  In these instructions, I have assumed that salome will be installed in /opt/salome.  Extract the downloaded Salome binaries into this folder & delete the linux binaries as we will be building from source.

<code>

tar --gunzip -xf /path/to/SALOME-7.8.0-OPENSOURCE-FD22.tgz

mv SALOME-7.8.0-OPENSOURCE-FD22 /opt/salome

 

cd /opt/salome

 

rm -rf PREREQUISITES/INSTALL/*

rm -rf INSTALL/*

</code>

 

2. Download Qt 4.8.6 & OCC 6.9.1, prepare tarballs for both.  For OCCT 6.9.1, you need to apply a patch that is included in the salome distribution.

<code>

tar --gunzip -xf opencascade-6.9.1.tgz

cd opencascade-6.9.1/

patch -p1 < /opt/salome/PREREQUISITES/Patches/OCCT-6.9.1.patch

rm -rf doc/

cd ..

mv opencascade-6.9.1 CAS-6.9.1p1

tar --gzip -cf CAS-6.9.1p1.tar.gz CAS-6.9.1p1

 

tar --gunzip -xf qt-everywhere-opensource-src-4.8.6.tar.gz

mv qt-everywhere-opensource-src-4.8.6 qt-4.8.6

tar --gzip -cf qt-4.8.6.tar.gz qt-4.8.6

 

cp CAS-6.9.1p1.tar.gz /opt/salome/PREREQUISITES/SOURCES/

cp qt-4.8.6.tar.gz /opt/salome/PREREQUISITES/SOURCES/

</code>

 

3. Download patches (from the links below) into same folder & extract it.

<code>

tar --gunzip -xf salome_7.8_mac.tar.gz

</code>

 

4. Apply the patches against the prerequisites & salome tools:

<code>

patch -p1 < salome_7.8_mac/Salome_prerequisites.patch

</code>

 

5. Prepare the Salome sources & apply patch for salome sources:

<code>

 ./sat prepare SALOME_7_8_0_OPENSOURCE

patch -p0 < salome_7.8_mac/Salome_srcs.patch

</code>

 

6. Copy the patches & files to be used by the salomeTools intaller:

 

<code>

cp salome_7.8_mac/qt-4.8.6.patch PREREQUISITES/Patches/

cp salome_7.8_mac/python-2.7.10.patch PREREQUISITES/Patches/

cp salome_7.8_mac/cppunit-1.2.1.patch PREREQUISITES/Patches/

cp salome_7.8_mac/freeimage-3.1.6.patch PREREQUISITES/Patches/

cp salome_7.8_mac/CAS-6.9.1p1-mac.patch PREREQUISITES/Patches/

cp salome_7.8_mac/CAS-6.9.1-xcode.patch PREREQUISITES/Patches/

cp salome_7.8_mac/tk-8.6.0.patch PREREQUISITES/Patches/

cp salome_7.8_mac/libxml2-2.9.0.patch PREREQUISITES/Patches/

cp salome_7.8_mac/scotch-5.1.12.patch PREREQUISITES/Patches/

cp salome_7.8_mac/opencv-2.4.6.1.patch PREREQUISITES/Patches/

cp salome_7.8_mac/netgen-4.9.13.patch PREREQUISITES/Patches/

cp salome_7.8_mac/ParaView.patch PREREQUISITES/Patches/

cp salome_7.8_mac/CAS_6.9.1-cmake.sh salomeTools/data/compil_scripts/prerequisites/

</code>

 

7. Compile the pre-requisites, this could take a few hours:

<code>

./sat prerequisite SALOME_7_8_0_OPENSOURCE

</code>

 

8. Once all pre-requisites are compiled successfully, compile the Salome sources

<code>

./sat compile SALOME_7_8_0_OPENSOURCE

</code>

 

9. Create the launcher

<code>

./sat launcher SALOME_7_8_0_OPENSOURCE

</code>

 

10. Run Salome:

<code>

export SALOME_VERBOSE=1

./salome

</code>

 

Links:

Patches: https://drive.google.com/file/d/0B0hN-su06AafZHVObDhMOUJ3OVE/view?usp=sharing

Screenshot: https://drive.google.com/open?id=0B0hN-su06AafTFFWbTFfQy1ZSGc

 

Regards,

Venkat

 

Re: Salome 7.8 on Mac OS X

Posted by GillesDavid at January 04. 2017

Hello Venkat

That's a impressive job you just did ! I'm not a Mac user but congrats to successfully have compiled SALOME on this platform !

I'm pretty confident that many users will be happy to test this version. 

Best regards,

Gilles

Re: Salome 7.8 on Mac OS X

Posted by bourcier at January 11. 2017

Congrats Venkat for this work! Could you provide a package so that we can test this more easily? We don't have computers with Mac OS X in Salome team, but we can try at home. We could add official Mac OS X support if the tests results are good.

Thank you and best regards,

Christophe

Re: Salome 7.8 on Mac OS X

Posted by bvenkat at January 12. 2017

Good day Christophe,

I am not sure if I can create a self-contained binary package, there may be some stray dependencies or version conflicts on dylibs/frameworks outside of the /opt/salome folder.  Though that should be a long term goal.

Would it be possible for you to try installing from source on the mac computer.  The procedure is really quite simple because of salome tools & is exactly the same as for linux but for the following differences, which are described above:

  •  Disabling of system integrity protection - this requires a reboot.
  •  GNU Autotools need to be installed, possibly via macports / fink / homebrew.
  •  Downloading & repackaging of Qt-4.8.6 & OCCT 6.9.1.
  •  Applying all the patches.


If that is not possible then let me know and I can try to zip and upload the complete salome folder somewhere, (around 2.9GB).  Note that my machine is running El Capitan and this may not work on Sierra.

It will certainly be great to have official support for Mac OS X and I will be happy to assist in any way possible.

Regards,

Venkat

Re: Salome 7.8 on Mac OS X

Posted by Kunda at February 10. 2017

@venkat would you be interested in helping some FreeCAD devs get Salome included in to the Homebrew-science package manager repository?

Here is the current forumula: https://github.com/FreeCAD/homebrew-freecad/blob/master/med-file.rb

Here is the issue: https://github.com/FreeCAD/homebrew-freecad/issues/27

Any other folks interested in volunteering, please make yourselves heard on the above github issue thread.

Cheers!

Re: Salome 7.8 on Mac OS X

Posted by Kunda at April 01. 2017

A med formula was submitted successfully to Homebrew: https://github.com/Homebrew/homebrew-science/blob/master/med-file.rb

It does use a patch to make the install work which is mentioned in:

https://github.com/Homebrew/homebrew-science/blob/f554f665ad5090b9c0fdfa3fded30d6fb59c9565/med-file.rb#L26-L29

and specifically:

https://raw.githubusercontent.com/Homebrew/formula-patches/720fedf/med-file/libc%2B%2B_and_python_bindings_fixes.diff

But after med-3.2.1 the patch does not work anymore. Would the MED devs consider integrating it fully?

Re: Salome 7.8 on Mac OS X

Posted by Kunda at April 01. 2017

FYI, the current downstream discussion for med-3.2.1 is happening at https://github.com/Homebrew/homebrew-science/pull/5357


This forum is DEPRECATED, please create new topics in the new SALOME forum.
For existing topics please transfer them to the new forum.

Powered by Ploneboard
Document Actions