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

scotch: update & switch to cmake #22321

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

scotch: update & switch to cmake #22321

wants to merge 3 commits into from

Conversation

3rav
Copy link
Contributor

@3rav 3rav commented Oct 27, 2024

Draft:
#22063

@3rav 3rav marked this pull request as ready for review October 27, 2024 19:29
Comment on lines +109 to +110
provides=()
conflicts=()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The package with the new name should probably conflict, replace, and provide(?) the old name of this package.

@mmuetzel
Copy link
Collaborator

The package grokker indicates that the following package needs a rebuild:
mingw-w64-mumps

(Potentially, because one library seems to be split into three libraries now?)

@mmuetzel
Copy link
Collaborator

IIUC, the previous build rules manually created package config files for scotch and ptscotch. They are not created with the CMake build rules.
By the looks of it, mumps requires these .pc files.

Maybe, you could keep the part of the old build rules that created these files manually?

endif()

-add_library(scotcherr library_error.c)
+add_library(scotcherr STATIC library_error.c)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC, you'd like that the shared library also exports the symbols from this source file without having it be its own (shared) library.
If that is your goal here, it would probably be better to have scorcherr be an OBJECT library target instead.
Otherwise, users would need to link to the shared library and this static library.

@3rav
Copy link
Contributor Author

3rav commented Dec 16, 2024

Info from scotch about .pc
https://gitlab.inria.fr/scotch/scotch/-/issues/37#note_1103036

IIUC, the previous build rules manually created package config files for scotch and ptscotch. They are not created with the CMake build rules. By the looks of it, mumps requires these .pc files.

Maybe, you could keep the part of the old build rules that created these files manually?

@mmuetzel
Copy link
Collaborator

Info from scotch about .pc https://gitlab.inria.fr/scotch/scotch/-/issues/37#note_1103036

IIUC, the previous build rules manually created package config files for scotch and ptscotch. They are not created with the CMake build rules. By the looks of it, mumps requires these .pc files.
Maybe, you could keep the part of the old build rules that created these files manually?

Like I wrote, the previous build rules created the package config files manually. See this part of the package function before your changes:

  echo "
	prefix=${MINGW_PREFIX}
	libdir=\${prefix}/lib
	includedir=\${prefix}/include
	Name: scotch
	URL: ${url}
	Version: ${pkgver}
	Description: Serial graph partitioning and sparse matrix ordering package
	Cflags: -I\${includedir}
	Libs.private: -lscotcherr
	Libs: -L\${libdir} -lscotch
  " | sed '/^\s*$/d;s/^\s*//' > "${pkgdir}${MINGW_PREFIX}/lib/pkgconfig/scotch.pc"

  if [[ ${CARCH} != aarch64 ]]; then
    echo "
    prefix=${MINGW_PREFIX}
    libdir=\${prefix}/lib
    includedir=\${prefix}/include
    Name: ptscotch
    URL: ${url}
    Version: ${pkgver}
    Description: Parallel graph partitioning and sparse matrix ordering package
    Requires: scotch
    Requires.private: msmpi
    Cflags: -I\${includedir}
    Libs.private: -lptscotcherr
    Libs: -L\${libdir} -lptscotch
    " | sed '/^\s*$/d;s/^\s*//' > "${pkgdir}${MINGW_PREFIX}/lib/pkgconfig/ptscotch.pc"
fi

So, no surprise that upstream doesn't know about files that are only created by the MSYS2 packaging rules...

@3rav
Copy link
Contributor Author

3rav commented Dec 16, 2024

Ok, now I see that the files were created manually, is it also possible to do it this way for the cmake version?

@mmuetzel
Copy link
Collaborator

Ok, now I see that the files were created manually, is it also possible to do it this way for the cmake version?

I don't know why it wouldn't be possible.
You might need to check if all libraries are called the same and are located at the same directory as before though, and potentially update the corresponding lines in the .pc file generation.

@raedrizqie
Copy link
Contributor

Ok, now I see that the files were created manually, is it also possible to do it this way for the cmake version?

You need to provide *.pc.in file with every required data in it. Then just use cmake's configure_file function to substitue the data in *.pc.in and generate *.pc file from it.

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

Successfully merging this pull request may close these issues.

3 participants