MBDyn sim suite
Installing the Python package on win32Until now the only way to install it is to follow the developer steps. As the package did not run correctly on Win32, it was not seen as relevant to build an installer. However some of the tests work. So if you would like to see the current status or investigate the remaining problems, the following notes are for you.
PrerequisitesThe list of prerequisites are:
- Python, install it with its current Windows installer. However you are done only when the interpreter starts by entering 'python' in a command prompt. Those explanations will help you for that step. They will also help each time a new entry needs to be done in the 'Path' variable. In that example, 'C:\Python25' was first added and the version 2.5.1 was used.
To ease the prerequisites installation, download the file 'ez_enstaller_setup.py'
at the Enthought website.
Double click on it and it should install the program 'Enstaller' in your
program menu. You will be able to browse a repositories of packages, you can
also learn more about that step.
The packages to select for installation are:
- matplotlib, for plotting the results
- mingw, that will include the gcc, g++ and g77 compilers
- numpy, for matrix manipulation in Python
- SWIG, for building the bindings to the MBDyn code
- Scons, download and install its stable version. The version used was 0.97.
- MSYS (Minimal System), needed to use the programs 'tar', 'sh' and 'patch'. You can get it on the page for the MinGW installer. In those notes, the path added to the 'Path' variable was 'C:\msys\1.0\bin', the version used was 1.0.10. You are done when entering 'tar' in a command prompt returns a description message.
- GDB, the GNU debugger; optional, but it is already known that the program will crash. You can get it in the the MinGW installer download part. In those notes, the version 6.6 was a package, saved in 'C:\msys\1.0'. Then the archive was uncompressed from there by using the 'tar' command.
MBDyn service for PythonFirst the bindings to MBDyn need to be built, it will require to turn the MBDyn sources into Python module used as a Dll. # python setup.py build
To install it to its standard location: # python setup.py install
Tests and examplesYou can as an example starts in the cantilever directory: # cd doc\example\cantilever_beam
Then try the 4 tests (it should work): # python test.py
A known problem on a fresh win32 install is the lack of the 'MSVCP71.dll' for Matplotlib. In that case download it from a web research and put it, for example, in the place where 'python.exe' is ('C:\Python25' in that example), you are then sure that the system will find it.
Now we will make the package crash. Go to the rigid pendulum example: # cd ..\rigid_pendulum
Run the case 1 of this example: # python rigid_pendulum3cases.py
The last simulation, the fixed distance between the two nodes, should return a run time error. The problem is at the line 34, the coma separator is not returned any more. A GDB investigation has revealed that the 'iostream' library of MinGW 3.4.5 did not return the right string. This problem is still very mysterious.
You can also have a look at the current documentation to understand the package concept. A big user of py-mbdyn-sim-suite is certainly the wind-sim-suite project.