Install Salome and Code_Aster on Windows

On Linux, the official manner to begin with Code_Aster is to download Salome-Meca from the dedicated Salome-Meca web page on the official Code_Aster website, extract the downloaded archive, and then execute the .run self executable that will install a full functional Salome-Meca on your computer 🙂

Unfortunately, Salome-Meca is only available for Linux. This post intend to give a workaround for Windows users, that have no ability, motivation or time to set up a dual boot or a virtual machine …

Based on the fact that Salome-Meca is a custom Salome with additional stuff like Code_Aster, the workaround is then simple :

  1. install the classic Salome, available for windows,
  2. install the Code_Aster for windows provided in the download page.

Install Salome for windows

Download Salome for windows from the official salome-platform download page.

Download Salome_Meca for Windows 64-bit

Execute the downloaded file. It will self-extract in a SALOME-x.y.z-WIN64 directory.

Extract Salome_Meca for Windows 64-bit

Test your Salome installation

Go into the extracted directory and into the “WORK” directory. Then execute “run_salome.bat”.

First launch Salome_Meca on Windows 7 64-bit

A cmd window will appear and set up things since Salome is running for the first time, be patient … Then another cmd window will effectively launch Salome.

Salome_Meca launch on Windows 7 64-bit

Finally a graphical environment should appear 🙂

Salome_Meca running on Windows 7 64-bit

Install Code_Aster for windows

Download Code_Aster for windows provided in the download page.

Code_Aster for Windows 64-bit download page and download link

Right click on the downloaded file and choose “extract all…”.

Extract Code_Aster for Windows 64-bit

Go into the extracted directory and into the “install” directory,  and execute “create_testing_link.bat”, this will create the “testing” symbolic link in your install directory.

Post install Code_Aster on Windows 7 64-bit

Test your Code_Aster installation

Open a cmd prompt, you can find it from the start menu by typing “cmd” in the search bar.

Open a cmd to run Code_Aster on Windows 7 64-bit

Navigate into the extracted Code_Aster directory with the console and run :

install\bin\as_run.bat --test forma01a

Launch as_run.bat to test Code_Aster for Windows installation on Windows 7 64-bit

Code_Aster will run the predefined testcase forma01a from the testing\tests directory, it should display at the end:

DIAGNOSTIC JOB : OK

Code_Aster for Windows successfully installed and running on Windows 7 64-bit

Conclusion

Once Salome and Code_Aster successfully run on Windows, the post Beginning with Salome and Code_Aster for Windows provide a first step by step example. Then it is possible to retrieve part of the Salome-Meca tutorials to deal with more advanced feature on Code_Aster for Windows.

19 thoughts on “Install Salome and Code_Aster on Windows

  1. Hello, I followed all the steps but I get an issue while trying to run the command “install\bin\as_run.bat –test forma01a”.

    Here is the log :
    ####
    c:\code_aster>install\bin\as_run.bat –test forma01a

    c:\code_aster>echo ON

    c:\code_aster>set ASTER_ROOT_DIR=c:\code_aster\install\bin\..

    c:\code_aster>set PYTHONHOME=c:\code_aster\install\bin\..\Python27

    c:\code_aster>set PYTHONPATH=c:\code_aster\install\bin\..\lib\python2.7\site-packages;c:\code_aster\install\bin\..\lib\python2.7\site-packages

    c:\code_aster>set PATH=c:\code_aster\install\bin\..\Python27;C:\Python27\;C:\Python27\Scripts;C:\ProgramData\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\P
    rogramData\Oracle\Java\javapath;C:\Windows\System32;C:\Program Files (x86)\Skype\Phone\;C:\Program Files (x86)\Skype\Phone\;C:\Program Files (x86)\Skype\Phone\;C:\Windows
    \System32;C:\MinGW\bin;c:\program files (x86)\fluent.inc\ntbin\ntx86

    c:\code_aster>set PYTHONEXECUTABLE=python.exe

    c:\code_aster>set ASTER_TMPDIR=C:\code_aster\temp

    c:\code_aster>python.exe -c “import sys, asrun ; from asrun.main import main,start; del sys.argv[0]; main()” install\bin\as_run.bat –test forma01a
    starting forma01a

    _COPY_ERROR error during copying C:\code_aster\temp\astk_Romain Bousson\Romain Bousson-RomainBousson-profil_astk.2448 to C:\code_aster\temp\Romain Bousson-RomainBo
    usson-interactif.2448\2448.export
    message : Le fichier sp?cifi? est introuvable.

    ———————————————————————————
    cpu system cpu+sys elapsed
    ———————————————————————————
    Total 0.03 0.03 0.06 0.16
    ———————————————————————————

    as_run 1.13.9

    ————————————————————
    — DIAGNOSTIC JOB : _COPY_ERROR
    ————————————————————

    EXIT_CODE=4
    Le fichier spécifié est introuvable.
    Le fichier spécifié est introuvable.
    Le fichier spécifié est introuvable.
    Le chemin d’accès spécifié est introuvable.
    Le fichier spécifié est introuvable.

    c:\code_aster>
    ###

    It looks like there are some files missing, but i can’t find where is the script that controls this copying operation.
    All the paths look OK. I do have python2.7 working.
    Any idea please ? Thanks

    Like

    1. Hello Romain,
      The issue seems to be that there is a space in your username. The best way to solve this is to make sure that your username does not contain spaces (by replacing them with underscores).
      An other possibility (not tested) : Try to modify ASTER_TMPDIR in as_run.bat file, by default %TEMP% path in your case is related to the windows account and contains spaces. You may also modify some python code in install\lib\python2.7\site-packages\asrun, for example line 162 in run.py :

      tmp_user = osp.join(self.config['rep_tmp'],
      'astk_'+getpass.getuser())

      will create a path containing spaces if %USERNAME% contains spaces

      Liked by 1 person

      1. Thank you! It worked!
        I changed the name of my username, which was the hardest task I ever had to do on windows7. And it is indeed a difficult task. Took me an entire afternoon 🙂

        Now, I have written “Diagnostic job OK”,
        but there is still an odd message in the next line :
        “The directory name is invalid.”

        Everything looks good though, exept the log immediately after the end of the Code Aster code:
        #######
        FIN();

        # ——————————————————————————————
        try to add new values in the .comm file…
        0 (‘OK’, ‘XXXX’, ‘308.289244482’, ‘308.289244482’, ‘1.149262E-10%’, ‘0.0001% \r’)
        1 (‘OK’, ‘XXXX’, ‘-88.3181823676’, ‘-88.3181823676’, ‘2.556784E-11%’, ‘0.0001% \r’)
        0 {‘start’: 2649, ‘end’: 2672, ‘val’: ‘308.289244482’, ‘key’: ‘VALE_CALC’}
        1 {‘start’: 3026, ‘end’: 3050, ‘val’: ‘-88.3181823676’, ‘key’: ‘VALE_CALC’}
        Traceback (most recent call last):
        File “C:\code_aster_13-3-win64-beta-0-2\install\13.3\lib\aster\Execution\decorators.py”, line 55, in wrapper
        ret = func(*args, **kwds)
        File “C:\code_aster_13-3-win64-beta-0-2\install\13.3\lib\aster\Execution\E_SUPERV.py”, line 348, in Finish
        testcase_tools.testcase_post()
        File “C:\code_aster_13-3-win64-beta-0-2\install\13.3\lib\aster\Contrib\testcase_tools.py”, line 35, in testcase_post
        change_test_resu()
        File “C:\code_aster_13-3-win64-beta-0-2\install\13.3\lib\aster\Contrib\testcase_tools.py”, line 82, in change_test_resu
        append_to_file(‘fort.6’, howto, stdout=True)
        File “C:\code_aster_13-3-win64-beta-0-2\install\13.3\lib\aster\Contrib\testcase_tools.py”, line 90, in append_to_file
        open(fname, ‘ab’).write(txt)
        IOError: [Errno 13] Permission denied: ‘fort.6’
        continue…
        Code_Aster run ended, diagnostic : OK

        ——————————————————————————–
        Copying results

        OK Code_Aster run ended
        #######

        thanks again

        Like

      2. Thanks for the feedback. The log over Permission denied: ‘fort.6’ is a platform limitation : Windows refuse to open a file already open (fort.6 is already the sdtout of the running process). It does not impact results, this is only used for QA tests.

        “The directory name is invalid.” is an OS message, probably displayed after as_run cleanup process of temporary working files

        Liked by 1 person

  2. Hello, first of all great project. Thanks for bringing Code_Aster on Windows.

    I followed your steps, but get an error executing the test. I can’t quite figure out what the problem might be. Any idea?

    Here the log:

    C:\Users\bp\code_aster_13-3-win64-beta-0-2>install\bin\as_run.bat –test forma01a

    C:\Users\bp\code_aster_13-3-win64-beta-0-2>echo OFF
    starting forma01a

    ——————————————————————————–
    Code_Aster execution

    prepare environment in C:\Users\bp\AppData\Local\Temp\bp-Win-interactif.3273

    ——————————————————————————–
    Copying datas

    copying …\tests\forma01a.comm… copying …\tests\forma01a.datg… copying …\tests\forma01a.mmed… Parameters : memory 506 MB – time limit 60 s

    ——————————————————————————–
    Code_Aster run

    Command line 1 :
    C:\Users\bp\code_aster_13-3-win64-beta-0-2\install\13.3\bin\aster C:\Users\bp\code_aster_13-3-win64-beta-0-2\install\13.3\lib\aster\Execution\E_SUPERV.py -commandes fort.1 –num_job=3273 –mode=interactif –rep_outils=C:\Users\bp\code_aster_13-3-win64-beta-0-2\install\outils –rep_mat=C:\Users\bp\code_aster_13-3-win64-beta-0-2\install\testing\materiau –rep_dex=C:\Users\bp\code_aster_13-3-win64-beta-0-2\install\testing\datg –numthreads=1 –suivi_batch –memjeveux=63.25 –tpmax=60.0
    Usage: ./aster.exe C:\Users\bp\code_aster_13-3-win64-beta-0-2\install\13.3\lib\aster\Execution\E_SUPERV.py [-h|–help] [options]

    aster.exe: error: option ‘–command’ expects an existing file
    Code_Aster run ended, diagnostic : _ABNORMAL_ABORT

    ——————————————————————————–
    Copying results

    _ABNORMAL_ABORT Code_Aster run ended

    ———————————————————————————
    cpu system cpu+sys elapsed
    ———————————————————————————
    Preparation of environment 0.00 0.00 0.00 0.00
    Copying datas 0.02 0.00 0.02 0.05
    Code_Aster run 0.00 0.00 0.00 2.65
    Copying results 0.00 0.00 0.00 0.00
    ———————————————————————————
    Total 0.03 0.03 0.06 2.82
    ———————————————————————————

    as_run 1.13.9

    ————————————————————
    — DIAGNOSTIC JOB : _ABNORMAL_ABORT
    ————————————————————

    EXIT_CODE=4
    The directory name is invalid.

    Like

    1. Hello Robert,
      fort.1 should correspond to install\testing\tests\forma01a.comm after the “Copying data” step. It is very strange in your case, aster.exe complains that fort.1 does not exist, but it should be present in working directory C:\Users\bp\AppData\Local\Temp\bp-Win-interactif.3273 since “Copying data” step (above in the log) seems to be successful

      Like

  3. Thanks for your fast reply! Yes, I can confirm that the working directory is not created. I’ve also tried to run as administrator, just in case there is some rights issue. Same result though.

    I’ll try to investigate a little and report back in case I find something out. Using Windows 10 by the way.

    Thanks,
    Robert

    Like

  4. Hi.. thank you for bringing openfoam to windows.

    It’s seems that in my case the “create_testing_link.bat” can’t generate the testing link. How do I solve that?

    Like

    1. Hi,

      The problem may be related to access rights. You can try to create the link with this command in a cmd prompt :

      mklink /j testing 13.3\share\aster

      It will give you more information about the issue, in case of failure.

      mklink may also not work on windows network drives

      Like

      1. Thank you for the help & response.. I’ve successfully run the diagnostic..

        It’s said that the diagnostic job : OK, but the directory name is invalid. Is it going to be a problem?

        Thanks
        Joko

        Like

      2. Hi,
        Thanks for the feedback, “diagnostic job : OK” means a normal termination of the job.
        “directory name is invalid” is an OS message, related to a temporary no more existing directory after cleanup, there is no problem

        Like

  5. Hello,
    I’ve got a problem with the final step. As i open “forma02a.rmed” using “Open paraVIS file” it appears the message “Fatal error: bad allocation”. I’ve tried to change the file’s directory but it’s still not working.
    I don’t know if the problem is due to the file or it’s some program’s issue.
    Any ideas please ? Thanks

    Like

    1. Hi Francesco,
      You can still run Code_Aster a second time to recreate the “forma02a.rmed”, but I don’t believe that the issue comes from the file if you got it from a Code_Aster successful run.
      You can try to restart Salome, or to reinstall it. You may also try to directly open the file with ParaView, following this post

      Like

  6. Hello, I follow all steps in salome and code aster installation on win 8.1. Salome ran normally, but error appear with code aster diognostic job. Here is the log, Any ideas?

    C:\code_aster>install\bin\as_run.bat –test forma01a

    C:\code_aster>echo OFF
    starting forma01a
    _ABNORMAL_ABORT error getting environment

    ——————————————————————————–

    Code_Aster execution

    prepare environment in C:\Users\asshot\AppData\Local\Temp\asshot-asshot-p
    c-interactif.699

    ——————————————————————————-

    cpu system cpu+sys elapsed

    ——————————————————————————-

    Preparation of environment 0.00 0.00 0.00 0.00

    ——————————————————————————-

    Total 0.02 0.03 0.05 0.06

    ——————————————————————————-

    as_run 1.13.9

    ————————————————————
    — DIAGNOSTIC JOB : _ABNORMAL_ABORT
    ————————————————————

    EXIT_CODE=4

    Like

    1. Hello Dmitry,
      Thanks for the feedback and the log.
      I don’t know if it will solve your issue but it seems that there are some remaining UNIX syntax in file:
      install\13.3\share\aster\profile.bat
      You can try to edit profile.bat file and replace $PYTHONPATH by %PYTHONPATH%

      Like

  7. Thank you very much for the port.
    Any advice to run code aster from any working directory?
    Adding the path “%codeaster%\install\bin\ ” in the PATH environment variable?

    Like

    1. Hello Roberto,
      As you suggested, it is possible to launch as_run from any working directory (without specifying the full %codeaster% path) by adding “%codeaster%\install\bin\” in the Windows PATH environment variable.
      Thanks for the advice

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s