#2772: Issues link against Kadath thorns and Intel MKL due to link ordering
Reporter:tootle
Status:new
Milestone:
Version:
Type:bug
Priority:major
Component:EinsteinToolkit thorn

A recurring issue that keeps coming up with the KadathThorn/Importer is centered around linking when using intel MKL.  It is worth noting that this is not restricted to the ETK, but I had not been able to reproduce the error myself until now.

The problem is resolved if I specify all of the dependencies of Kadath in a specific order in the final build command that outputs the cactus executable. e.g, adding the following directly after -lkadath:

-lgsl -lgslcblas -lfftw3 -L${MKLROOT}/lib/ -Wl,--start-group -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lmkl_blacs_intelmpi_lp64 -Wl,--end-group -lgomp -lpthread -lmkl_scalapack_lp64 -lm -ldl

results in a working executable on the local HPC in Idaho. Excluding this link order or adding it somewhere else in the command other than directly after -lkadath will result in an executable that yields undefined behavior. Note: the undefined behavior leads to a crash during ID import from all known cases (in and out of the ETK) where this problem has come up.

Solution:

  1. Ability to specify a controlled link order in the options.cfg file (LDFLAGS does not work)
  2. Ability to specify a controlled link order during the build script of KadathThorn

‌

--
Ticket URL: https://bitbucket.org/einsteintoolkit/tickets/issues/2772/issues-link-against-kadath-thorns-and