Just checking assumptions here since you didn't provide a command line, but environment variables from your host aren't blindly passed to the simulated process in gem5. If you're using se.py, it looks like the --env option is what you want.
Gabe On Tue, Dec 12, 2017 at 12:14 PM, Sam Xi <[email protected]> wrote: > Hi all, > > I'm running into an issue with simulating a dynamic library in SE mode. My > binary has been compiled and linked with a library that is not installed in > one of the system default locations (/usr/lib, /usr/local/lib, > /usr/lib/x86_64-linux-gnu, > etc). I have the correct path added to LD_LIBRARY_PATH in my environment, > and I am able to run it locally. When I try to run it under gem5, gem5 > appears > to be ignoring my LD_LIBRARY_PATH, or at least some directories in the > path. I get the following errors: > > Global frequency set at 1000000000000 ticks per second > 0: system.cpu: Constructing CPU with id 0, socket id 0 > 0: system.remote_gdb.listener: listening for remote gdb #0 on port 7000 > **** REAL SIMULATION **** > info: Entering event queue @ 0. Starting simulation... > warn: x86 cpuid family 0x0000: unimplemented function 7 > warn: x86 cpuid family 0x0000: unimplemented function 7 > warn: ignoring syscall access(...) > 6674500: system.cpu: T0 : syscall mmap range is 0x7ffff7dd5000 - > 0x7ffff7dd6fff > warn: ignoring syscall access(...) > 7759000: system.cpu: T0 : syscall open: failed -> path:/etc/ld.so.preload > 10364000: system.cpu: T0 : syscall open: sim_fd[7], target_fd[3] -> > path:/etc/ld.so.cache > 10574500: system.cpu: T0 : syscall mmap range is 0x7ffff7db0000 - > 0x7ffff7dd4fff > warn: ignoring syscall access(...) > 13967000: system.cpu: T0 : syscall open: sim_fd[7], target_fd[3] -> > path:/usr/local/lib/libconfuse.so.2 > 15210500: system.cpu: T0 : syscall mmap range is 0x7ffff7ba3000 - > 0x7ffff7daffff > warn: ignoring syscall mprotect(...) > 15415500: system.cpu: T0 : syscall mmap range is 0x7ffff7dae000 - > 0x7ffff7daffff > warn: ignoring syscall access(...) > 19750500: system.cpu: T0 : syscall open: sim_fd[7], target_fd[3] -> > path:/lib/x86_64-linux-gnu/librt.so.1 > 20682000: system.cpu: T0 : syscall mmap range is 0x7ffff799b000 - > 0x7ffff7ba2fff > warn: ignoring syscall mprotect(...) > 20733000: system.cpu: T0 : syscall mmap range is 0x7ffff7ba1000 - > 0x7ffff7ba2fff > warn: ignoring syscall access(...) > 24809000: system.cpu: T0 : syscall open: failed -> > path:/lib/x86_64-linux-gnu/libmkldnn.so.0 > 25151500: system.cpu: T0 : syscall open: failed -> > path:/usr/lib/x86_64-linux-gnu/libmkldnn.so.0 > 25313000: system.cpu: T0 : syscall open: failed -> path:/lib/libmkldnn.so.0 > 25469000: system.cpu: T0 : syscall open: failed -> > path:/usr/lib/libmkldnn.so.0 > /work/samxi/test: error while loading shared libraries: libmkldnn.so.0: > cannot open shared object file: No such file or directory > > My LD_LIBRARY_PATH is: > */usr/local/mkl-dnn/lib*:/lib/x86_64-linux-gnu:/usr/local/lib. > The bolded directory is not attempted during the search for the library, as > shown in the latter lines of the log. As far as I can tell, all the > permissions for that directory have been set correctly, and the library is > indeed present there. > > If I link with -Wl,r-path=/usr/local/mkl-dnn/lib, however, gem5 > successfully > locates the dynamic library and everything is good. For now, this solution > will suffice, but not having to do this would be nice. > > I'm running on x86, simulating x86 too, on Ubuntu 16.04. > > Thanks, > Sam > -- > Thanks, > > Sam Xi > Harvard University > Computer Science, Ph.D. Candidate > http://www.samxi.org > _______________________________________________ > gem5-dev mailing list > [email protected] > http://m5sim.org/mailman/listinfo/gem5-dev _______________________________________________ gem5-dev mailing list [email protected] http://m5sim.org/mailman/listinfo/gem5-dev
