Install Code_Aster on Windows

On Linux, the official manner to install code_aster as a standalone package is to download the souces and compile from scratch. We provide here an easy way to install Code_Aster on Windows.

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

That’s it ! For users of the previous version, the mklink symbolic link is not needed anymore.

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 Code_Aster successfully runs on your Windows machine, you may consider to use a graphical interface such as Salome. Then, the post Beginning with Salome and Code_Aster for Windows provides a first step by step example, and  Salome-Meca tutorials deal with more advanced feature.

29 thoughts on “Install 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

  8. Greetings,
    I’m in trouble in Salome install process. I followed the steps and when Salome should start, stay in the prompt windows and nothing happens. I have already waited for a long time.
    That is what appear to me.
    runSalome running on Familia
    Searching for a free port for naming service: 2816 – OK
    Searching Naming Service found in 0.0 seconds
    Searching /Registry in Naming Service + found in 0.5 seconds
    Searching /Kernel/ModulCatalog in Naming Service +th. 00000000018AFAF0 – Trace ..\..\..\..\KERNEL_SRC\src\ModuleCatalog\SALOME_ModuleCatalog_Server.cxx [101] : Module Catalog Server: Naming Service was found
    found in 0.5 seconds
    RunStudy
    Searching /myStudyManager in Naming Service ++++++ found in 3.0 seconds
    Warning, no type found for resource “localhost”, using default value “single_machine”
    Searching /Containers/Familia/FactoryServer in Naming Service +++ found in 1.5 seconds
    Start SALOME, elapsed time : 0.0 seconds

    And in the code aster install process, when “create testing link.bat” is clicked the folder does not appear.

    How can I proceed? Thanks

    Like

    1. Hello,
      For Salome, it could be your firewall or maybe something got wrong during archive extraction. You can try to re-extract it.
      For Code aster, you can try to run “create_testing_link.bat” in a cmd prompt and see what append.
      A new package is available in our download page. It’s a preliminary release that contains salome + code aster 13.4 + asterstudy. In this package, Code aster can be launched graphically in asterstudy module, and is still usable with cmd prompt. Code_Aster subdirectory is PRODUCTS\code_aster, the “create_testing_link.bat” is no more needed in this package.

      Like

      1. Thanks for the reply, and I still with the error.
        I already re-extract Salome, delete all files, downloaded the new package, re-extract again, I have allowed all firewall requirements and I still have the same problem, Salome does not start.

        cmd log:
        runSalome running on Familia
        Searching for a free port for naming service: 2817 – OK
        Searching Naming Service found in 0.0 seconds
        Searching /Registry in Naming Service + found in 0.5 seconds
        Searching /Kernel/ModulCatalog in Naming Service +th. 0000000001CDFD30 – Trace ..\..\..\..\KERNEL_SRC\src\ModuleCatalog\SALOME_ModuleCatalog_Server.cxx [101] : Module Catalog Server: Naming Service was found
        found in 0.5 seconds
        RunStudy
        Searching /myStudyManager in Naming Service + found in 0.5 seconds
        Warning, no type found for resource “localhost”, using default value “single_machine”
        Searching /Containers/Familia/FactoryServer in Naming Service + found in 0.5 seconds
        Start SALOME, elapsed time : 0.0 seconds

        Like

      2. I found this post related to a similar issue. It’s suggested to edit run_salome.bat and replace “SET SALOME_VERBOSE=0” by “SET SALOME_VERBOSE=1” and see what append …
        If the problem persist using the official salome package, you may look for help on salome forum

        Like

  9. Now this.

    Configure parser: processing C:\Users\ManassÚs\Downloads\code aste\MODULES\GUI\RELEASE\GUI_INSTALL\share\salome\resources\gui\SalomeApp.xml …
    Configure parser: Error : can not read configuration file C:\Users\ManassÚs\Downloads\code aste\MODULES\GUI\RELEASE\GUI_INSTALL\share\salome\resources\gui\SalomeApp.xml
    Configure parser: user configuration file is
    Configure parser: Warning : can not find user configuration file
    Configure parser: processing C:\Users\ManassÚs\Downloads\code aste\MODULES\GUI\RELEASE\GUI_INSTALL\share\salome\resources\gui\SalomeApp.xml …
    Configure parser: Error : can not read configuration file C:\Users\ManassÚs\Downloads\code aste\MODULES\GUI\RELEASE\GUI_INSTALL\share\salome\resources\gui\SalomeApp.xml
    Configure parser: processing C:\Users\ManassÚs\Downloads\code aste\MODULES\GUI\RELEASE\GUI_INSTALL\share\salome\resources\gui\SalomeApp.xml …
    Configure parser: Error : can not read configuration file C:\Users\ManassÚs\Downloads\code aste\MODULES\GUI\RELEASE\GUI_INSTALL\share\salome\resources\gui\SalomeApp.xml
    Configure parser: user configuration file is
    Configure parser: Warning : can not find user configuration file
    runSalome running on Familia
    Searching for a free port for naming service: 2818 – OK
    startSalome {‘foreground’: 1, ‘save_config’: True, ‘valgrind_session’: False, ‘file’: 0, ‘plugins’: [], ‘ddd_session’: False, ‘port’: ‘2818’, ‘appname’: ‘SalomeApp’, ‘user_config’: ”, ‘splash’: False, ‘killall’: 0, ‘shutdown_servers’: 0, ‘logger’: 0, ‘session_gui’: False, ‘portkill’: 0, ‘pinter’: 0, ‘xterm’: 0, ‘pyscript’: [], ‘wake_up_session’: False, ‘study_hdf’: None, ‘key’: [], ‘gdb_session’: False, ’embedded’: [], ‘standalone’: [], ‘gui’: 0, ‘modules’: [], ‘batch’: False, ‘noexcepthandler’: 0}
    Launch Naming Service++ Name Service… ss = [‘NameService=corbaname::Familia:2818’] … ok
    to list contexts and objects bound into the context with the specified name : showNS
    Searching Naming Service found in 0.0 seconds
    Searching /Registry in Naming Service + found in 0.5 seconds
    Searching /Kernel/ModulCatalog in Naming Service +th. 000000000225F680 – Trace ..\..\..\..\KERNEL_SRC\src\ModuleCatalog\SALOME_ModuleCatalog_Server.cxx [101] : Module Catalog Server: Naming Service was found
    found in 0.5 seconds
    RunStudy
    Searching /myStudyManager in Naming Service + found in 0.5 seconds
    Searching /Containers/Familia/FactoryServer in Naming Service +Warning, no type found for resource “localhost”, using default value “single_machine”
    found in 0.5 seconds

    Start SALOME, elapsed time : 0.0 seconds
    additional external python interpreters: 0
    addToKillList: 9536 : SALOMEDS_Server
    addToKillList: 3360 : SALOME_Container
    addToKillList: 10328 : SALOME_LauncherServer
    addToKillList: 13044 : SALOME_Registry_Server
    addToKillList: 2264 : SALOME_ModuleCatalog_Server
    addToKillList: 13276 : omniNames
    addToKillList: 12536 : SALOME_ConnectionManagerServer

    Saving of the dictionary of Salome processes in c:\users\manass~1\appdata\local\temp\logs\Manasses\.Manasses_Familia_2818_SALOME_pidict
    To kill SALOME processes from a console (kill all sessions from all ports):
    python killSalome.py
    To kill SALOME from the present interpreter, if it is not closed :
    killLocalPort() –> kill this session
    (use CORBA port from args of runSalome)
    givenPortKill(port) –> kill a specific session with given CORBA port
    killAllPorts() –> kill all sessions

    runSalome, with –killall option, starts with killing
    the processes resulting from the previous execution.

    — registered objects tree in Naming Service —

    Registry.object
    Kernel.dir

    ModulCatalog.object
    Study.dir

    myStudyManager.object
    ConnectionManager.object
    ResourcesManager.object
    ContainerManager.object
    SalomeLauncher.object
    DataServerManager.object
    DataServerManager.dir

    Default.object
    Containers.dir

    Familia.dir

    FactoryServer.object

    Like

    1. Thanks for the trace, I was able to reproduce this issue simply by adding a “é” character in the path. It seems that salome does not like special characters in the path. You can try to move your install directory elsewhere to avoid this. By the way, you should also avoid spaces in the path that could lead to dysfunctions in the current version of code_aster.

      Like

  10. Now it’s working. But when I’ve clicked on create a new AsterStudy the following error appears.
    “Failed to activate module AsterStudy”.
    But anyway thank you for the support so far.

    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