Why is libcxa linked dynamically?

Why is libcxa linked dynamically?

If you do not specify the -static option, then according to the Intel documentation, libcxa will nevertheless be linked in dynamically.

This is a significnatly problem if I want to run binaries on another machine. In particular, it makes it much more difficult to run on our MOSIX cluster where Intel Fortran isn't installed (too much administrative hassle).

But adding -static links in everything statically including libc and libm. That is silly too.

In addition it makes it very hard to use ifc to compile MEX files for direct linking into MATLAB, where using -static is not going to work. I eventually hacked my mexopts.sh into doing this but it was a real pain as I had to guess what .a files to link in manually in what order. Oy vey.

In my opinion the right answer is to have three modes (as I believe NAG does).

1. Link all libraries, including Intel supplied libraries, dynamically.

2. Link dynamically ONLY those operating-system provided standard libraries which are universally available, i.e. libc and libm.

3. Link everything statically.

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

-static-libcxa: Link the libcxa library statically.

This will avoid linking libcxa dynamically.

I pulled this answer out of a previous forum post.

I believe this option was not in the initial 7 release, but added later.

Hope this helps.

Leave a Comment

Please sign in to add a comment. Not a member? Join today