Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can you create a flat directory structure on install? #84

Closed
haampie opened this issue Jun 10, 2021 · 5 comments
Closed

Can you create a flat directory structure on install? #84

haampie opened this issue Jun 10, 2021 · 5 comments

Comments

@haampie
Copy link

haampie commented Jun 10, 2021

Currently;

./
├── lib
│   ├── librocm_smi64.so -> ../rocm_smi/lib/librocm_smi64.so
│   └── librocm_smi64.so.1 -> ../rocm_smi/lib/librocm_smi64.so.1
├── oam
│   ├── include
│   │   └── oam
│   │       ├── amd_oam.h
│   │       └── oam_mapi.h
│   └── lib
└── rocm_smi
    ├── docs
    │   ├── README.md
    │   └── ROCm_SMI_Manual.pdf
    │       └── refman.pdf
    ├── include
    │   └── rocm_smi
    │       ├── kfd_ioctl.h
    │       └── rocm_smi.h
    └── lib
        ├── librocm_smi64.so -> librocm_smi64.so.1
        ├── librocm_smi64.so.1 -> librocm_smi64.so.1.0
        └── librocm_smi64.so.1.0

Can you just make it flat?

./
├── lib
│   ├── librocm_smi64.so -> librocm_smi64.so.1
│   ├── librocm_smi64.so.1 -> librocm_smi64.so.1.0
│   ├── librocm_smi64.so.1.0
│   ├── liboam.so -> liboam.so.1
│   ├── liboam.so.1 -> liboam.so.1.0
│   └── liboam.so.1.0
├── include
│   ├── rocm_smi
│   │   ├── kfd_ioctl.h
│   │   └── rocm_smi.h
│   └── oam
│       ├── amd_oam.h
│       └── oam_mapi.h
└── docs
    ├── README.md
    └── ROCm_SMI_Manual.pdf
        └── refman.pdf
@musicinmybrain
Copy link

Oh, this would be great. I keep wanting to package rocm_smi_lib for Fedora Linux, and this is exactly what I would have to do manually. It would be great if the install were “normal” to begin with, and I didn’t have to try to rearrange it without accidentally breaking anything.

@Mystro256
Copy link
Contributor

Mystro256 commented Dec 17, 2021

I think it would be best to follow the FHS and do:

├── lib
│ ├── librocm_smi64.so -> librocm_smi64.so.1
│ ├── librocm_smi64.so.1 -> librocm_smi64.so.1.0
│ ├── librocm_smi64.so.1.0
│ ├── liboam.so -> liboam.so.1
│ ├── liboam.so.1 -> liboam.so.1.0
│ └── liboam.so.1.0
├── include
│ ├── rocm_smi
│ │ ├── kfd_ioctl.h
│ │ └── rocm_smi.h
│ ├── oam
│ │ ├── amd_oam.h
│ │ └── oam_mapi.h
├── share
│ ├── rocm_smi (or oam where applicable)
│ │ ├── README.md
│ │ ├── ROCm_SMI_Manual.pdf
│ │ └── refman.pdf

CMake also has a library for this:
https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html

Where you include(GNUInstallDirs), then replace "lib" with ${CMAKE_INSTALL_LIBDIR}, replace "include" with ${CMAKE_INSTALL_INCLUDEDIR}, and replace "share" with ${CMAKE_INSTALL_DATADIR}.
This allows distros or users to customise how they want to install these files. Thunk already does this, which is fantastic in my eyes.

@t-tye
Copy link

t-tye commented Dec 17, 2021 via email

@Maxzor
Copy link

Maxzor commented Jan 30, 2022

I think it would be best to follow the FHS and do:
...
CMake also has a library for this: https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html

Where you include(GNUInstallDirs), then replace "lib" with ${CMAKE_INSTALL_LIBDIR}, replace "include" with ${CMAKE_INSTALL_INCLUDEDIR}, and replace "share" with ${CMAKE_INSTALL_DATADIR}. This allows distros or users to customise how they want to install these files. Thunk already does this, which is fantastic in my eyes.

Totally!

@dmitrii-galantsev
Copy link
Collaborator

We do this now! :)
Thank you for pushing for this. The previous design was ridiculous.
In fact all rocm things should follow a sane flat structure now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants