0
我編譯了源代碼並在LDFLAGS中包含了適當的庫文件。然而,因爲我想運行二進制文件,它說缺少一個特定的libX.a。如果我將庫的路徑添加到LD_LIBRARY_PATH,一切都會好的。將庫文件添加到二進制文件
是否有任何方法永久性地將該文件包含在二進制文件中以消除LD_LIBRARY_PATH步驟?
LDFLAGS=-L/export/apps/computer/scalapack -L/export/apps/computer/OpenBLAS-0.2.18
BLAS_LIBS=-lopenblas
SCALAPACK_LIBS=-lscalapack
COMP_LIBS=dc_lapack.a liblapack.a libblas.a
LIBS=$(SCALAPACK_LIBS) $(BLAS_LIBS)
ldd
命令的輸出,顯示
# ./siesta
./siesta: error while loading shared libraries: libopenblas.so.0: cannot open shared object file: No such file or directory
# ldd siesta
libopenblas.so.0 => not found
...
然而,
# ls ../../../computer/OpenBLAS-0.2.18/libopenblas* -l
lrwxrwxrwx 1 root root 33 Jul 27 11:58 ../../../computer/OpenBLAS-0.2.18/libopenblas.a -> libopenblas_piledriverp-r0.2.18.a
-rw-r--r-- 1 root root 28091912 Jul 27 11:59 ../../../computer/OpenBLAS-0.2.18/libopenblas_piledriverp-r0.2.18.a
-rwxr-xr-x 1 root root 14912094 Jul 27 12:00 ../../../computer/OpenBLAS-0.2.18/libopenblas_piledriverp-r0.2.18.so
lrwxrwxrwx 1 root root 34 Jul 27 12:00 ../../../computer/OpenBLAS-0.2.18/libopenblas.so -> libopenblas_piledriverp-r0.2.18.so
lrwxrwxrwx 1 root root 34 Jul 27 12:00 ../../../computer/OpenBLAS-0.2.18/libopenblas.so.0 -> libopenblas_piledriverp-r0.2.18.so
任何想法?
你能不能說說第一種方法 – mahmood
在Makefile或代替-lopenblas用-static取代-shared解釋寫ŧ他完全路徑到openblas靜態庫到對象fileslist – arved