Closed jchodera closed 9 years ago
Is there a way to force a static compile of sqm
on osx
?
Hm. Static linking may not be possible. I wonder if we have to distribute gfortran
as well?
Any thoughts on this, @swails? This is still an issue.
This is weird, since this line is supposed to allow it to be built as statically as possible: https://github.com/omnia-md/conda-recipes/blob/master/ambermini/build.sh#L10
I see the note about requiring a "patched" version of gfortran
, though:
# See https://github.com/omnia-md/conda-recipes/pull/134
# https://github.com/omnia-md/conda-recipes/issues/132
# This may require a patched version of gfortran to properly produce staticly linked binaries on osx
if [[ "$OSTYPE" == "darwin"* ]]; then
export CUSTOMBUILDFLAGS="-static-libgfortran /usr/local/gfortran/lib/libquadmath.a -static-libgcc -lgfortran"
fi
It depends on which distribution of gfortran you have installed on the build machine, I think.
Working on fixing this.
Using this, I can get a static-y build on my laptop:
export CUSTOMBUILDFLAGS="-dynamiclib -lgfortran -static-libgfortran `locate libquadmath.a | tail -n 1` -static-libgcc"
But I don't have anything at /usr/local/gfortran/lib/libquadmath.a
, my copy of libquadmath.a is at /usr/local/Cellar/gcc/4.9.2_1/lib/gcc/4.9/libquadmath.a
, so presumably this is from homebrew.
But it still looks like it's not linked statically to libquadmath:
$ otool -L bin/sqm
bin/sqm:
sqm (compatibility version 0.0.0, current version 0.0.0)
/usr/local/lib/gcc/4.9/libquadmath.0.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
Hrm. That does seem to be the case, even on the test version I just compiled:
[LSKI1497:~/code/omnia/conda-recipes.jchodera] choderaj% otool -L ~/anaconda/bin/sqm
/Users/choderaj/anaconda/bin/sqm:
/opt/local/lib/libgcc/libquadmath.0.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
What if we distribute libquadmath.0.dylib
along with this?
Maybe I wrote that comment about a "hacked copy" of gfortran. Note the comment about removing libquadmath.0.dylib
Try, for giggles, backing up /opt/local/lib/libgcc/libquadmath.0.dylib
to somewhere safe, removing it from that location, and recompiling?
These options all require hacking a local installation of MacPorts or homebrew gcc
on the build machine, which I'd like to avoid doing since every time we migrate it to a new machine (which I'm about to do) we have to do a lot of site-specific prep work.
I've got another working alternative here: https://github.com/omnia-md/conda-recipes/pull/305
Any chance you can test? This uses the anaconda gcc
package that seems to have been created for solving exactly this problem. (It drops gfortran
on the path, but not gcc
.)
Believed resolved by omnia-md/conda-recipes#305
I'm having trouble running the
osx
ambermini package: