FEAP User Forum

FEAP => Installation => Topic started by: Giorgio Zavarise on October 30, 2019, 06:53:17 AM

Title: Self-consistent installation on MAC
Post by: Giorgio Zavarise on October 30, 2019, 06:53:17 AM
Hello FEAP users,

I know that on Windows it is possible to get a self-consistent FEAP.exe or a FEAPpv.exe. I means the executable can be moved on any PC and it works fine.
On the contrary, if you get an executable FEAP on MAC, and then you move it on another MAC it will not work, since it will not find some libraries.
It seems that you need Xcode, gfortran and x11 installed to permit FEAP to find all the libraries.
I have discovered that for gfortran there exist the option "-static", but this option is not enough to solve the problem.
Any suggestion for solving it?
Giorgio Zavarise
Title: Re: Self-consistent installation on MAC
Post by: Prof. S. Govindjee on October 30, 2019, 08:59:00 AM
When I look at the FEAP executable I see the following dynamically loaded libraries on my mac
Code: [Select]
Sanjays-MacBook-Pro2018:main sg$ otool -L ./feap
./feap:
/opt/X11/lib/libX11.6.dylib (compatibility version 10.0.0, current version 10.0.0)
/usr/local/opt/jpeg/lib/libjpeg.9.dylib (compatibility version 13.0.0, current version 13.0.0)
/usr/local/opt/gcc/lib/gcc/8/libgfortran.5.dylib (compatibility version 6.0.0, current version 6.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1279.0.0)
/usr/local/lib/gcc/8/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/local/opt/gcc/lib/gcc/8/libquadmath.0.dylib (compatibility version 1.0.0, current version 1.0.0)

For my FEAPpv installation I see
Code: [Select]
Sanjays-MacBook-Pro2018:main sg$ otool -L ./feappv
./feappv:
/opt/local/lib/libX11.6.dylib (compatibility version 10.0.0, current version 10.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.50.4)
So I think the main question is to figure out (1) if there are static libraries for these two libs and then how to force the loading of them.  I'll try to search around.
Title: Re: Self-consistent installation on MAC
Post by: Giorgio Zavarise on October 31, 2019, 01:14:43 AM
Hi Sanjai

I was able to make a small step forward modifying the makefile inside the MAIN folder:

feappv: $(OBJECTS) $(ARFEAPPV)
   ranlib $(ARFEAPPV)
   $(FF) -o feappv $(OBJECTS) $(ARFEAPPV) \
   $(LDOPTIONS) -static-libgfortran

As you can see, I added -static to the option -libgfortran, and this has produced a feappv which size has grown from 1.6 MB to 1.8 MB. Then, if I move the executable on another Mac, it does not comply anymore for such library.
We have then to discover the way for all the other lib.
Title: Re: Self-consistent installation on MAC
Post by: JStorm on October 31, 2019, 11:55:12 PM
You don't need to use a static x11-compilation, because you cannot run x11-software without the x11-server, which provides also the dynamic x11-libraries.

In order to use a static version of a library instead of the dynamic one, the linker needs the path to the library instead of "-L<library>". On Linux this can be done via:
Code: [Select]
             -Wl,--start-group \
                <path>/<library1>.a \
                <path>/<library2>.a \
                <path>/<library3>.a \
             -Wl,--end-group
But I don't know the OSX equivalent.