[R-SIG-Mac] SHLIB_LDFLAGS with icc/ifort

Simon Urbanek simon.urbanek at r-project.org
Sun Aug 12 17:46:36 CEST 2007


Jan,

for gcc that supports it we are not using flat namespaces:
-dynamiclib -Wl,-macosx_version_min -Wl,10.3 -undefined  
dynamic_lookup -single_module -multiply_defined suppress

single module takes care of the common symbols, multiply defined is  
suppressed if not fatal and dynamic lookup is used for unresolved  
symbols.

We only fall back to the flat namespace if the compiler doesn't  
support the above, so my guess would be that icc doesn't - please  
look at the config.log and let me know what fails. We can provide  
separate flags for icc if necessary (I don't have icc anymore, so I  
can't test it :/).

As of Panther, unfortunately dynamic loading fails with the setup  
above (seems to be a bug in Panther) so we have to fall back to the  
old flat-space behavior as well. I didn't tweak the Panther config  
much, because I no longer have access to a Panther box.

Cheers,
Simon


On Aug 11, 2007, at 3:12 PM, Jan de Leeuw wrote:

> For compiling R I switched to icc/icpc/ifort 10.0.x on
> both Tiger and Leopard. This caused various multiply
> defined symbol errors (and even some cases where the
> linker could not find symbols in libreadline.dylib).
>
> So I changed "-flat_namespace --undefined suppress"
> in configure to "-twolevel_namespace -undefined dynamic_lookup"
> both for MH_DYLIB and MH_BUNDLE files. This solved the
> problems and did not introduce new ones, as far as I can see.
> It also solves the annoying multiply defined symbol error
> problems with add-on packages (even without using the -bundle_loader
> flag, it seems). This is because multiply defined symbols merely give
> warnings when linking libraries with two-level namespaces.
>
> Not sure if the same strategy works with gcc/gfortran, but the
> general idea of getting rid of flat namespaces seems
> useful, if only because it makes building on OS X more like
> building on other *nix systems and because package builds from
> source are less likely to fail.
>
> ==========================================================
> Jan de Leeuw, 11667 Steinhoff Rd, Frazier Park, CA 93225
> home 661-245-1725 skype 661-347-0667 global 254-381-4905
> .mac: jdeleeuw +++  aim: deleeuwjan +++ skype: j_deleeuw
> ==========================================================
>                  Many nights on the road
>         and not dead yet ---
>                 the end of autumn.       (Basho 1644-1694)
>
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>
>



More information about the R-SIG-Mac mailing list