SCOREC / core

parallel finite element unstructured meshes
Other
179 stars 63 forks source link

Set bob install dir to CMAKE_INSTALL_LIBDIR #451

Closed bobpaw closed 1 week ago

bobpaw commented 2 weeks ago

Set bob install dir to CMAKE_INSTALL_LIBDIR

bobpaw commented 2 weeks ago

Looks good. Thank you.

What is the issue with relinking and $ORIGIN? Is that for capstone?

Yes. Capstone builds SCOREC/core and provides the shared libraries with capstone. That capstone library can be linked again to SCOREC (which will be especially necessary if the plugin is provided by default), but the issue I was having was that ld would find the shared libraries (ma.so, mds.so, gmi.so) in the capstone folder instead of the ones I had installed and built (with cmake --install). Using the build tree was easy, but trying to use the install tree was having this lib64 issue due to relinking.

I see a handful of locations in bob.cmake where lib is used explicitly. I'm guessing those should also be changed.

I believe those are only CMake targets. I don't know the convention, but the Capstone package includes those in lib.

cwsmith commented 2 weeks ago

Thank you. I think I get the gist of the capstone problem.

It looks like the Professional CMake book (19th edition) suggests having a consistent directory for the libraries, \<packageName>Config.cmake, and target files.

The install destination of that file (\<packageName>Config.cmake) should use the variables defined by the GNUInstallDirs, which simplifies customization by Linux distributions and other packaging systems. [pg 541]

I didn't find a direct quote for the target files, but all the examples I could find (see pg 524) use the GNUInstallDirs variables.

I can help with these modifications and testing if needed.

bobpaw commented 1 week ago

Ok, that makes sense. I will update the remaining lib to be CMAKE_INSTALL_LIBDIR. I will also update bin per the same guideline.

cwsmith commented 1 week ago

Thank you. I'm going to add a CI test to check that downstream packages can use our cmake package successfully.

cwsmith commented 1 week ago

@bobpaw Can you rebase on develop? It now has a CI test for a user build using the installed cmake config file?

https://github.com/SCOREC/core/blob/88a39f6c4db82e82595c47cfc7fdfb56cbf3fec0/.github/workflows/cmake.yml#L48-L56

cwsmith commented 1 week ago

Thank you. The new test ran without issues.

https://github.com/SCOREC/core/actions/runs/10755354998/job/29826921049?pr=451#step:7:1