rocm_smi_lib icon indicating copy to clipboard operation
rocm_smi_lib copied to clipboard

Can you create a flat directory structure on install?

Open haampie opened this issue 3 years ago • 4 comments

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

haampie avatar Jun 10 '21 08:06 haampie

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.

musicinmybrain avatar Jul 12 '21 15:07 musicinmybrain

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.

Mystro256 avatar Dec 17 '21 02:12 Mystro256

[AMD Official Use Only]

Under share we need something like:

Share -->doc -->-->.[pdf,md,txt] -->html-->-->.html -->info-->-->.info -->man -->man1-->.1 -->man5-->.5 -->-->

Thanks, -Tony

From: Jeremy Newton @.> Sent: Thursday, December 16, 2021 9:07 PM To: RadeonOpenCompute/rocm_smi_lib @.> Cc: Subscribed @.***> Subject: Re: [RadeonOpenCompute/rocm_smi_lib] Can you create a flat directory structure on install? (#84)

[CAUTION: External Email]

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.htmlhttps://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcmake.org%2Fcmake%2Fhelp%2Flatest%2Fmodule%2FGNUInstallDirs.html&data=04%7C01%7CTony.Tye%40amd.com%7Ca7a475bf62f14677c7ae08d9c101e3bd%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637753036166650343%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=pQLLjxNyCH%2B7BjX5g7HFSRmh5HGyn868Wl2AGeuUIVA%3D&reserved=0

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.

Reply to this email directly, view it on GitHubhttps://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FRadeonOpenCompute%2Frocm_smi_lib%2Fissues%2F84%23issuecomment-996375659&data=04%7C01%7CTony.Tye%40amd.com%7Ca7a475bf62f14677c7ae08d9c101e3bd%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637753036166650343%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=rFgk9dhu6zR5eVAcOn8iKUfpj0wL6ON3QGNcSlZB0Zs%3D&reserved=0, or unsubscribehttps://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FABJ2DYLQDFYTF5EHRBAYVM3URKLLVANCNFSM46NSWFZQ&data=04%7C01%7CTony.Tye%40amd.com%7Ca7a475bf62f14677c7ae08d9c101e3bd%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637753036166650343%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=ihkHsn%2BVkRhinMhunCz3FZkfy5Y93Yo%2B9N2BLRQxzGQ%3D&reserved=0. Triage notifications on the go with GitHub Mobile for iOShttps://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapps.apple.com%2Fapp%2Fapple-store%2Fid1477376905%3Fct%3Dnotification-email%26mt%3D8%26pt%3D524675&data=04%7C01%7CTony.Tye%40amd.com%7Ca7a475bf62f14677c7ae08d9c101e3bd%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637753036166650343%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=jwd1Vpo%2Biapydw73jghfsKUdvKemXXk3w1U%2FUZzh3Tc%3D&reserved=0 or Androidhttps://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.github.android%26referrer%3Dutm_campaign%253Dnotification-email%2526utm_medium%253Demail%2526utm_source%253Dgithub&data=04%7C01%7CTony.Tye%40amd.com%7Ca7a475bf62f14677c7ae08d9c101e3bd%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637753036166650343%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=hY%2BWBeUadFmZ7o7eOe8B88ehx%2B3wZhhJPBt1Q5hSeGc%3D&reserved=0. You are receiving this because you are subscribed to this thread.Message ID: @.@.>>

t-tye avatar Dec 17 '21 02:12 t-tye

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!

Maxzor avatar Jan 30 '22 03:01 Maxzor

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.

dmitrii-galantsev avatar Dec 12 '23 21:12 dmitrii-galantsev