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

gfortran linker - should probably default to "static" option for non-win32 #13

Open
ForsteriteFoe opened this issue May 4, 2017 · 3 comments

Comments

@ForsteriteFoe
Copy link

ForsteriteFoe commented May 4, 2017

The following code in pymake.py (starting at line 373):

    # syslibs
    syslibs = []
    if sys.platform != 'win32':
        syslibs.append('-lc')

Should probably default to:

    syslibs = []
    if sys.platform != 'win32':
        syslibs.append('-static')
        syslibs.append('-lc')

The difference is that without the -static option, the resulting executable does not bundle the "c library", rather it links to where it is installed on the system.

Without the static it means, that in order to run the executable, you have to install the gfortran development files. Which is fine, but adds a step that requires internet access if you are running a live USB version of Linux.

The difference in executable size between the linked (~2.5MB) and static (~5MB) is IMHO not worth it as a default.

@ForsteriteFoe
Copy link
Author

Oh yeah, forgot to mention, found out that currently the behavior of the linker with the -l library (-llibarary) and -static is not included in the gfortan documentation .

It is, however, posted in the gcc documentation https://gcc.gnu.org/onlinedocs/gcc/Link-Options.html#Link-Options

@langevin-usgs
Copy link
Collaborator

Thanks, we'll look into this. We've had problems doing static links with gfortran, so maybe this will clear it up for us. Appreciate the comment.

@ForsteriteFoe
Copy link
Author

You are welcome - figured this was the place to put this.

The other seemingly sparsely documented compiler issue that I ran into when compiling is that "list-defined output" means that the formatting is up to the compiler. The gfortran compiler puts all "list-defined output" on the same row, however the ifort compiler apparently puts a newline after every five elements. The result is that the .ftl files from MODFLOW runs are formatted significantly differently, however, this difference doesn't appear to be important for running MT3D-USGS.

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

2 participants