CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (https://www.cfd-online.com/Forums/openfoam-installation/)
-   -   [OpenFOAM.org] Moving OF-bin from fedora over to ubuntu 19.10 (https://www.cfd-online.com/Forums/openfoam-installation/222834-moving-bin-fedora-over-ubuntu-19-10-a.html)

JonW December 10, 2019 16:14

Moving OF-bin from fedora over to ubuntu 19.10
 
I usually compile openfoam on a fedora pc and thereafter just tarball the whole thing and put it (i.e. the OF) on the computer it needs to be on. Recently, I have set up ubuntu 19.10 on one of the pc at work. However, moving binaries between fedora and ubuntu requires only few mods and the following is what I have done,...

(1)
sudo ln -s /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so.40.10.3 /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi.so.20

(2)
...and to make paraview work as before, then...

sudo ln -s /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi_cxx.so.40.10.0 /usr/lib/x86_64-linux-gnu/openmpi/lib/libmpi_cxx.so.20

(3)
Finally in .bash_alias, then I but...

alias of6='export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/openmpi/lib/:$LD_LIBRARY_PATH && source $HOME/OpenFOAM/OpenFOAM-6/etc/bashrc && PS1="[of6][\W] " '


This has worked on OpenFOAM 6, as well as on OpenFOAM 2.3.1 (haven't tested this on other versions).NB! This might also work if you are working with opensuse/ubuntu as well.


Hope this is of some help
cheers

wyldckat December 27, 2019 16:22

Quick question: But are you now able to compile new custom code with OpenFOAM on the Ubuntu machine?
Because that is usually the only problem that can happen in this kind of installation transfer between two different Linux Distributions and/or versions.

Another detail to keep in mind is that the symbolic links you are creating should be for compatible MPI libraries.

Beyond this, if you're willing to look into it, there is something named AppImage https://appimage.org/ - which allows compiling an application in one distribution and deploy it in any other. I have been wanting to look into this myself, but haven't found the time to do it, but for OpenFOAM it's less straight forward as well, given that OpenFOAM does not provide only a single executable...

JonW December 30, 2019 16:33

Quote:

Originally Posted by wyldckat (Post 753325)
Quick question: But are you now able to compile new custom code with OpenFOAM on the Ubuntu machine?
Because that is usually the only problem that can happen in this kind of installation transfer between two different Linux Distributions and/or versions.

Another detail to keep in mind is that the symbolic links you are creating should be for compatible MPI libraries.

Beyond this, if you're willing to look into it, there is something named AppImage https://appimage.org/ - which allows compiling an application in one distribution and deploy it in any other. I have been wanting to look into this myself, but haven't found the time to do it, but for OpenFOAM it's less straight forward as well, given that OpenFOAM does not provide only a single executable...


Hi and sorry for the late reply
Yes, new solvers can be compiled.
The funny thing is, before I made the link to the mpilibs, nothing worked, not even what had already been compiled. What I got for any app I tried was...

[2.3.1][~] foamToVTK -help
foamToVTK: error while loading shared libraries: libmpi.so.20: cannot open shared object file: No such file or directory

I guessing many of the classes either has-a or is-a base-class that includes mpi stuff (?)

Cheers
J.


P.S. I will look at the stuff you recommended above, thanks for the info.

JonW January 20, 2020 09:05

moving Fedora 29 bins over to fresh install of Fedora 31
 
Dear fedora folks:

...same problem when moving bins from f29 over to f31 (i.e. with fresh install of f31).

Do...

sudo ln -s /usr/lib64/openmpi/lib/libmpi.so.40.20.2 /usr/lib64/openmpi/lib/libmpi.so.20
sudo ln -s /usr/lib64/openmpi/lib/libmpi_cxx.so.40.20.1 /usr/lib64/openmpi/lib/libmpi_cxx.so.20

...and with .bashrc (at least this works for me)...

alias of23x='export PATH=/usr/lib64/openmpi/bin/:$PATH && export LD_LIBRARY_PATH=/usr/lib64/openmpi/lib/:$LD_LIBRARY_PATH && source $HOME/OpenFOAM/OpenFOAM-2.3.x/etc/bashrc && PS1="[2.3.x][\W] " '

Hope this helps
cheers
J.


New info: I was bit too fast here
this works for OF2.3.1, but not for higher versions. Fedora 31 is apparently little bit more trouble than ubuntu 19.10.


All times are GMT -4. The time now is 14:44.