Skip to content

/usr/local/lib64 instead of /usr/local/lib #501

Open
@dmantione

Description

Hello,

SIMAVR currently installs its library files always in /usr/local/lib. In most Linux systems this means that 64 bit libraries are installed in a directory intended for 32 bit libraries.

Now this stuff is not so easy, because there is no perfect way to just ask the Linux system wether lib64 or lib should be used, it is a policy imposed by the Linux distribution. Or... actually there is: rpm --eval %{_lib} In order to allow distribution independent rpms to install on any Linux system, rpm knows the right answer. Debian users won't like this, but it even works on a Debian system.

I have coded the following patch, it is just a suggestion and in no way I'm suggesting that this is the best way to do it. Feel free to comment.

  • "make SYSTEMLIBDIR=xxx" will enforce /usr/local/xxx
  • If that has not been set, rpm --eval %{_lib} is executed
  • If that doesn't result in a value:
    ** If "uname -m" returns x86_64 it uses /usr/local/lib64
    ** Otherwise, use /usr/local/lib

In other words, rpm is called because it is the most reliable method I know, but if rpm is not available, it still tries to do something sensible. User can always easily override.

I would prefer to use LIBDIR rather than SYSTEMLIBDIR, but there already is a LIBDIR variable used by the makefile system.

simavr_lib64.patch.txt

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