Skip to content

Can not link the shared-object(.so) #2

@shenben

Description

@shenben

Every program can be properly compiled. However, when I run a program that uses pre-compiled linking with -.so files, I get the error "No such file or directory". Could you please offer a solution or any advice?

For example, in the directory ‘pmem_space_management’,when running the command "make run_memkind" on the bash shell, the errors shown below appear in the terminal.

time LD_PRELOAD=./memkind_dram.so ./memory_mode_test 1
time: cannot run LD_PRELOAD=./memkind_dram.so: No such file or directory
Command exited with non-zero status 127
0.00user 0.00system 0:00.00elapsed ?%CPU (0avgtext+0avgdata 964maxresident)k
0inputs+0outputs (0major+24minor)pagefaults 0swaps
make: *** [Makefile:17: run_memkind] Error 127

Another Example is shown in the below.

emc_admin@numasvr02:~/NvmEngine/pmem_program/wal_accel$ make run_acc
export AOFGUARD_DISABLE_SYNC=yes
export AOFGUARD_NVM_DIR=/mnt/pmem0
export AOFGUARD_NVM_SIZE_MB=512
export LD_LIBRARY_PATH=./lib
export AOFGUARD_FILENAME_PATTERN=.log
LD_PRELOAD=./lib/libaofguard_inject.so taskset -c 0 ./wal_acc 
./wal_acc: error while loading shared libraries: libaofguard_inject.so: cannot open shared object file: No such file or directory
make: *** [Makefile:32: run_acc] Error 127

Both of their XXX.so files are not found by the program. (I can ensure that -.so files are properly compiled and accessible, as shown below.)

$ find . -name libaofguard_inject.so
./lib/libaofguard_inject.so

I'm at a loss as to what caused this and how to fix it. I'd be grateful if you @guoanwu could provide me with any useful information!

By the way, my settings are as follows.

ndctl-71.1
pmdk-1.9.3
memkind-1.12.0
ubuntu  20.04
gcc 7.5.0
GNU Make 4.2.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions