2

I have downloaded and installed a Windows native compiled OpenFOAM from here. But when I try to run any of the OF commands (e.g., blockMesh, foamDictionary, ...) in the MSYS2 terminal I get the message:

path/to/folder/v2106/msys64/home/ofuser/OpenFOAM/OpenFOAM-v2106/platforms/win64MingwDPInt32Opt/bin/blockMesh.exe: error while loading shared libraries: libstdc++-6.dll: cannot open shared object file: No such file or directory

and in the cmd terminal, I get the error message:

                      

System Error
The code execution cannot proceed because msmpi.dll was not found. Reinstalling the program may fix this problem.

From here, I see that I might have to reinstall OpenFOAM in admin mode, which I don't have on this work machine. so I tried installing MSMPI using pacman -S msmpi as I used to do here. But I get the error message:

error: target not found: msmpi

My goal is to install and use the OpenFOAM software, doesn't matter which release, on this Windows machine without admin privileges. I would appreciate it if you could help me know how can I fix the above problems, or find another way around.

P.S.1. Searching the installation directory, I see that the libstdc++-6.dll file is in the path\to\folder\v2106\msys64\home\ofuser\OpenFOAM\OpenFOAM-v2106\platforms\win64MingwDPInt32Opt\bin. So I wonder I get the first error message. Maybe OF is not compiled properly against the library? Should I try removing the path\to\folder\v2106\msys64\usr\lib\gcc\x86_64-pc-msys\7.4.0\libstdc++.dll.a as suggested here?

P.S.2. I had written this post ages ago about different ways to install OpenFOAM on Windows. Sadly it is still a big effort to get it up and running.

P.S.3. A follow-up on this issue here on the MSYS2 Discord server.

P.S.4. Opened a new issue here on the OpenFOAM repository.

Foad S. Farimani
  • 12,396
  • 15
  • 78
  • 193
  • Is there a `lib` directory under `path\to\folder\v2106\msys64\home\ofuser\OpenFOAM\OpenFOAM-v2106\platforms\win64MingwDPInt32Opt\` ? Try to install/update libstdc++: `pacman -Su mingw-w64-x86_64-gcc-libs` – s.ouchene Dec 07 '21 at 08:13
  • @s.ouchene there is just a `bin` folder there. should I make a `lib` folder manually? The installation fails with `error: failed to init transaction (unable to lock database) error: could not lock database: File exists if you're sure a package manager is not already running, you can remove /var/lib/pacman/db.lck`. let me restart my system and try again. – Foad S. Farimani Dec 07 '21 at 08:26
  • @s.ouchene can't install. Getting [this error](https://pastebin.com/hF7PJKtd) it seems like the servers are down or something. – Foad S. Farimani Dec 07 '21 at 08:48
  • Try to download it manually from [msys2 website](https://packages.msys2.org/package/mingw-w64-x86_64-gcc-libs) and install it manually: `pacman -U packagename`. Unfortunately, I don't have a Window Machine in front of me to test that. More details, on how to install packages offline, can be found here: https://wiki.archlinux.org/title/offline_installation_of_packages – s.ouchene Dec 07 '21 at 09:08
  • But before you try to run install it, what is the output of: `locate libstdc++` ? – s.ouchene Dec 07 '21 at 09:15
  • @s.ouchene it doesn't return anything. empty output! – Foad S. Farimani Dec 07 '21 at 09:23
  • @s.ouchene trying to install those packages manually, I get [these error messages](https://pastebin.com/EEJbG7ZQ) – Foad S. Farimani Dec 07 '21 at 09:32
  • 1
    Try to manually extract that package, you will find DLL files inside, copy them to: `path\to\folder\v2106\msys64\home\ofuser\OpenFOAM\OpenFOAM-v2106\platforms\win64MingwDPInt32Opt\bin\` – s.ouchene Dec 07 '21 at 09:38
  • 1
    I believe you get the error because you haven't Admin privileges. But anyway try that, if doesn't work, consider using blueCFD version (based on OF8). MSMPI is needed only to run utilities/solver in parallel but it shouldn't be mandatory. – s.ouchene Dec 07 '21 at 09:41
  • @s.ouchene I did try bleCFD as well, [it failed](https://www.cfd-online.com/Forums/openfoam/239224-using-openfoam-run-2d-convection-diffusion-simulation-compressible-steady-s.html#post818045). You may see the error messages I get in [the link](https://www.cfd-online.com/Forums/openfoam/239224-using-openfoam-run-2d-convection-diffusion-simulation-compressible-steady-s.html#post818045) – Foad S. Farimani Dec 07 '21 at 09:49
  • @s.ouchene I also tried [these instructions](https://github.com/appveyor/ci/issues/3458#issuecomment-863473813), to no avail. – Foad S. Farimani Dec 07 '21 at 09:50
  • 1
    For BlueCFD, I believe if you post that here: https://github.com/blueCFD/Core/issues you will get a confirmation from the maintainer if that could work or not. – s.ouchene Dec 07 '21 at 09:59
  • @s.ouchene opened a [new issue](https://github.com/blueCFD/Core/issues/185). – Foad S. Farimani Dec 07 '21 at 10:25

1 Answers1

2

With OpenFOAM-v2112 it is now possible to install without windows admin permissions. The original problem will still be evident with older OpenFOAM versions since they relied on installing msmpi separately.

Mark.O
  • 94
  • 6
  • thanks, Mark. I really appreciate your follow-up on this matter and kind support. – Foad S. Farimani Jan 12 '22 at 07:23
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - [From Review](/review/late-answers/30793505) – smaudet Jan 15 '22 at 01:39
  • @smaudet - how can I improve the answer? Based on the original question the cross-compilation and installer for OpenFOAM were changed so that it now works. What would the appropriate phrasing for the answer be? – Mark.O Jan 16 '22 at 10:13
  • @Mark.O apologies for the late response, I don't often check my messages - it looked like the request wanted to know a specific solution, whereas you provided a "install latest" solution. Its not clear at least from your answer that you addressed the issue (install on mingw in non-admin mode), after following your link I was able to deduce that you answered, however I would recommend you clarify what is install-able where. – smaudet Feb 08 '23 at 18:07