Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Portable installation of ED #22

Open
fabeit opened this issue Feb 10, 2015 · 6 comments
Open

Portable installation of ED #22

fabeit opened this issue Feb 10, 2015 · 6 comments

Comments

@fabeit
Copy link
Contributor

fabeit commented Feb 10, 2015

Maybe this has already been discussed by other people, but given the not so easy installation and compiling of ED, and the many different versions of libraries and compilers, what about making a portable installation of ED? Something I can compile on say the pecan VM and just copy a folder or the ED executable and the ED2IN file to another computer and run. Fortran code can be compiled with the -static option and the exe can include static loaded libraries. It seems from what I have found online that it is also possible to use dlopen and dlsym to dynamically load .so .I tried to compile using some of the -static flags but the executable didn't run on another machine, and I am sure it is more complex than that. If anybody is interested in this please let me know and we can discuss this further.

@mdietze
Copy link
Contributor

mdietze commented Feb 10, 2015

@fabeuw Yes, the fact that models (not just ED) can be a pain to install is one of the main reasons that we include the models pre-compiled on the PEcAn VM. If you think you can compile ED2 into a version that's going to be machine-independent, and document how you did that, we'd be happy to include it in the PEcAn VM and document that the version can be copied. That said, I'm a bit skeptical that this will actually work except when moving the executable to other machines with the same architecture and the same flavor of *NIX. @robkooper any experience with this?

@fabeit
Copy link
Contributor Author

fabeit commented Feb 10, 2015

@mdietze I see moving from linux to windows unlikely, but I was thinking at least within the NIX domain. Ideally it would be possible to make the ED executable run on a default fresh installation of Ubuntu, for example, without the need to install any additional packages or compiling the code. The latest code could be easily compiled on an online server, connected to github, and then a zip folder can be generated that contains all the necessary libs to run the exe.

@robkooper
Copy link
Contributor

Besides different architectures (x86 vs x86_64 vs ARM) all of which are Ubuntu, it will also depend on some of the libraries installed. You can see what libraries are needed to be installed using the following command: ldd edbinary. For example this is what it returns for me:

ldd /usr/local/bin/ed2.r82 
    linux-vdso.so.1 =>  (0x00007fff8afdb000)
    libhdf5_fortran.so.6 => /usr/lib/libhdf5_fortran.so.6 (0x00007f90a5f85000)
    libhdf5.so.6 => /usr/lib/libhdf5.so.6 (0x00007f90a59ea000)
    libmpi_f77.so.0 => /usr/lib/libmpi_f77.so.0 (0x00007f90a57b6000)
    libgfortran.so.3 => /usr/lib/x86_64-linux-gnu/libgfortran.so.3 (0x00007f90a549f000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f90a51a3000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f90a4f8c000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f90a4bcd000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f90a49b0000)
    libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f90a4798000)
    libmpi.so.0 => /usr/lib/libmpi.so.0 (0x00007f90a44e7000)
    libquadmath.so.0 => /usr/lib/x86_64-linux-gnu/libquadmath.so.0 (0x00007f90a42b1000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f90a61d6000)
    libopen-rte.so.0 => /usr/lib/libopen-rte.so.0 (0x00007f90a4062000)
    libopen-pal.so.0 => /usr/lib/libopen-pal.so.0 (0x00007f90a3e0b000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f90a3c07000)
    libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1 (0x00007f90a3a03000)

This shows it depends on gfortran as well as hdf5 libraries that need to be installed. Installing those will probably be enough to copy the library across. I have not tried static when compiling so I don't really know how it will affect it.

@lucianainpa
Copy link

Hi,
Anybody know how I can to resolve that problem?

root@alunos-desktop:/home/alunos/ED2-master/ED/build# sudo ./ed_2.1-opt
./ed_2.1-opt: error while loading shared libraries: libhdf5_fortran.so.9: cannot open shared object file: No such file or directory
root@alunos-desktop:/home/alunos/ED2-master/ED/build#

@fabeit
Copy link
Contributor Author

fabeit commented Mar 13, 2015

@lucianainpa your issue is related to either a compiler error or you did not load the modules. You can load the modules with commands such as
module load intel/13.1.1
module load openmpi/1.6.4
module load hdf5/1.8.10
but of course you have to check the version of the library you have installed. You should open a new issue because this thread is about something else.

@lucianainpa
Copy link

Thanks fabeuw ,
Finally I managed to install.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants