我正在尝试编译包含mkl
scalapack
和blacs
库的python软件包https://github.com/jrs65/scalapy。编译成功,但是当我尝试执行测试程序时,我得到:
英特尔MKL致命错误:无法加载符号MKLMPI_Get_wrappers
我试图使用mkl_link_tool
来获得链接线。
这就是distutils
背后的情况:
gcc -pthread -shared -L/scratch/apc/lukrazi/intel/intelpython3/lib -Wl,-rpath=/scratch/apc/lukrazi/intel/intelpython3/lib,--no-as-needed -z noexecstack -z relro -z now -fstack-protector build/temp.linux-x86_64-3.6/build/src.linux-x86_64-3.6/scalapy/lowlevel/redistmodule.o build/temp.linux-x86_64-3.6/build/src.linux-x86_64-3.6/build/src.linux-x86_64-3.6/scalapy/lowlevel/fortranobject.o -L/scratch/apc/lukrazi/intel/intelpython3/lib -lpython3.6m -o build/lib.linux-x86_64-3.6/scalapy/lowlevel/redist.cpython-36m-x86_64-linux-gnu.so -I/scratch/apc/lukrazi/intel/compilers_and_libraries_2018.1.148/linux/mpi/intel64/include -L/scratch/apc/lukrazi/intel/compilers_and_libraries_2018.1.148/linux/mpi/intel64/lib/release_mt -L/scratch/apc/lukrazi/intel/compilers_and_libraries_2018.1.148/linux/mpi/intel64/lib -Xlinker --enable-new-dtags -Xlinker -rpath -Xlinker /scratch/apc/lukrazi/intel/compilers_and_libraries_2018.1.148/linux/mpi/intel64/lib/release_mt -Xlinker -rpath -Xlinker /scratch/apc/lukrazi/intel/compilers_and_libraries_2018.1.148/linux/mpi/intel64/lib -Xlinker -rpath -Xlinker /opt/intel/mpi-rt/2107.0.0/intel64/lib/release_mt -Xlinker -rpath -Xlinker /opt/intel/mpi-rt/2017.0.0/intel64/lib -lmpifort -lmpi -lmpigi -ldl -lrt -lpthread -L/scratch/apc/lukrazi/intel/compilers_and_libraries_2018.1.148/linux/mkl/lib/intel64 -Wl,--no-as-needed -lmkl_scalapack_lp64 -lmkl_blacs_intelmpi_lp64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread -lm -ldl -fopenmp
我还尝试了与-Wl,-Bstatic -Wl,--start-group
和-Wl,--end-group -Wl,-Bdynamic
的静态链接:
gcc -pthread -shared -L/scratch/apc/lukrazi/intel/intelpython3/lib -Wl,-rpath=/scratch/apc/lukrazi/intel/intelpython3/lib,--no-as-needed -z noexecstack -z relro -z now -fstack-protector build/temp.linux-x86_64-3.6/build/src.linux-x86_64-3.6/scalapy/lowlevel/redistmodule.o build/temp.linux-x86_64-3.6/build/src.linux-x86_64-3.6/build/src.linux-x86_64-3.6/scalapy/lowlevel/fortranobject.o -L/scratch/apc/lukrazi/intel/intelpython3/lib -lpython3.6m -o build/lib.linux-x86_64-3.6/scalapy/lowlevel/redist.cpython-36m-x86_64-linux-gnu.so -I/scratch/apc/lukrazi/intel/compilers_and_libraries_2018.1.148/linux/mpi/intel64/include -L/scratch/apc/lukrazi/intel/compilers_and_libraries_2018.1.148/linux/mpi/intel64/lib/release_mt -L/scratch/apc/lukrazi/intel/compilers_and_libraries_2018.1.148/linux/mpi/intel64/lib -Xlinker --enable-new-dtags -Xlinker -rpath -Xlinker /scratch/apc/lukrazi/intel/compilers_and_libraries_2018.1.148/linux/mpi/intel64/lib/release_mt -Xlinker -rpath -Xlinker /scratch/apc/lukrazi/intel/compilers_and_libraries_2018.1.148/linux/mpi/intel64/lib -Xlinker -rpath -Xlinker /opt/intel/mpi-rt/2107.0.0/intel64/lib/release_mt -Xlinker -rpath -Xlinker /opt/intel/mpi-rt/2017.0.0/intel64/lib -lmpifort -lmpi -lmpigi -ldl -lrt -lpthread -Wl,-Bstatic -Wl,--start-group /scratch/apc/lukrazi/intel/compilers_and_libraries_2018.1.148/linux/mkl/lib/intel64/libmkl_scalapack_lp64.a /scratch/apc/lukrazi/intel/compilers_and_libraries_2018.1.148/linux/mkl/lib/intel64/libmkl_blacs_intelmpi_lp64.a /scratch/apc/lukrazi/intel/compilers_and_libraries_2018.1.148/linux/mkl/lib/intel64/libmkl_intel_lp64.a /scratch/apc/lukrazi/intel/compilers_and_libraries_2018.1.148/linux/mkl/lib/intel64/libmkl_intel_thread.a /scratch/apc/lukrazi/intel/compilers_and_libraries_2018.1.148/linux/mkl/lib/intel64/libmkl_core.a -Wl,--end-group -Wl,-Bdynamic -liomp5 -lpthread -lm -ldl -fopenmp
没有成功。可能是什么问题?
答案 0 :(得分:0)
您有两种选择:a)通过以下方式构建共享库
-ld -shared --whole-archive libmkl_blacs_openmpi_lp64.a -no-whole-archive -o libmkl_blacs_openmp_lp64.so
或b)通过添加链接到静态库
-Wl,-Bstatic -Wl,--start-group
和
-Wl,--end-group -Wl,-Bdynamic