-
Notifications
You must be signed in to change notification settings - Fork 226
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
conda-installed gfortran on OSX: builds fail at runtime #739
Comments
I'm seeing this issue too! |
Well, it's the same
.. alternatively you can post process the executable as follows:
You used to be able to use |
I'm closing this as it's just how these things work. If you have any suggestions for improving it feel free to reopen. The reason it works on Linux is (probably!) because on that OS, |
@mingwandroid - just out of curiosity, why does this not happen with the gcc compiler? |
Because on OS X, the standard C library is implemented in A default fortran standard library doesn't ship with the OS so we must provide one. Conda's dynamic libraries (on OS X and Linux) are always identified via relative paths so that our environments are trivially relocatable (that is a requirement for hardlinks to work, and is just nicer than the alternative). You can see the functions used to enforce this here: https://github.com/conda/conda-build/blob/master/conda_build/post.py#L264-L307 |
Thanks @mingwandroid for the info! I was able to implement a workaround for OSX in my package that depends on F2PY builds, using your |
I made a script to update the rpaths of the test executables, which were failing on Travis, using the MacOS `install_name_tool` command. See ContinuumIO/anaconda-issues#739 (comment).
I made a script to update the rpaths of the test executables, which were failing on Travis, using the MacOS `install_name_tool` command. See ContinuumIO/anaconda-issues#739 (comment).
Sorry for bring this up again.. but should the cross compilation tools add the rpath flag to LDFLAGS by default on osx in the activate script of gfortran? Currently the configure script of openmpi fails because gfortran won't produce a runnable executable for this error. |
Personally I do not think they should. If a recipe needs this stuff (RPATH, -L, -I) then it should add this stuff. However I've been voted down on this so will go along with the majority opinion and will accept such a change in a PR. |
The discussion of this issue is at conda-forge/conda-forge.github.io#460 (comment) You'd need to add code like https://github.com/AnacondaRecipes/aggregate/blob/master/clang/activate-clang.sh#L85-L95 and https://github.com/AnacondaRecipes/aggregate/blob/master/clang/activate-clang.sh#L110-L111 We're damned if we do, and we're damned if we don't. |
Sometimes 'pureness' shall give way for 'it just works'. Otherwise we'd just revert to the old days before anaconda ... The way anaconda builds a package is already sort of peculiar -- it has to scan the binaries and modify the files anyways. The rpath flag can be considered as part of the peculiarity -- I hope this eases some of the hard feelings. |
I find this is helpful, I have solve the problem http://wusun.name/blog/2018-04-27-conda-libgfortran-issue/ |
I distribute a Python package that includes f2py-compiled Fortran extensions. I want to use conda to package this (for my students and other users) as a self-contained environment including gfortran. But I'm having trouble getting anything to compile and run on Mac OSX 10.11 with the conda-installed version of gfortran.
A simple HelloWorld example fails at runtime:
This then becomes the default gfortran version:
I then compile and try to run a 'hello world' program:
The same test works without error on linux.
I've found several other reports of such library errors with conda and gfortran on OSX, e.g. #498, ReactionMechanismGenerator/PyDAS#8
It looks to me like the version of gfortran installed by conda is completely unusable.
The text was updated successfully, but these errors were encountered: