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

Check system installation of sundials #533

Closed
sn248 opened this issue Jun 26, 2024 · 5 comments
Closed

Check system installation of sundials #533

sn248 opened this issue Jun 26, 2024 · 5 comments
Labels

Comments

@sn248
Copy link

sn248 commented Jun 26, 2024

Hi

I am trying to update the R interface to Sundials (sn248/sundialr). R package rules dictate that I first check for system installation of sundials before using the bundled-up version.

I was not able to find any information regarding pkg-config for sundials.

Could you suggest how to check if sundials is installed on user's machine?

Thanks

@sn248 sn248 added the triage label Jun 26, 2024
@balos1 balos1 changed the title <title> Check system installation of sundials Check system installation of sundials Jun 26, 2024
@balos1
Copy link
Member

balos1 commented Jun 26, 2024

I was not able to find any information regarding pkg-config for sundials.

We do not provide a pkg-config file at this time (see #242).

Could you suggest how to check if sundials is installed on user's machine?

CMake's find_package command is the supported way. Not sure if this possible for you to use in the context of R.

@sn248
Copy link
Author

sn248 commented Jun 26, 2024

Thank you for the quick response. I used the following to know that SUNDIALS exists.

sudo cmake --find-package -DNAME=SUNDIALS -DCOMPILER_ID=GNU -DLANGUAGE=C -DMODE=EXIST

which gives

SUNDIALS found

But I am not able to get the location of header files and static libraries (in /usr/local/include and /usr/local/lib respectively), when I use the following commands.

sudo cmake --find-package -DNAME=SUNDIALS -DCOMPILER_ID=GNU -DLANGUAGE=C -DMODE=COMPILE

sudo cmake --find-package -DNAME=SUNDIALS -DCOMPILER_ID=GNU -DLANGUAGE=C -DMODE=LINK

In addition, I would also like to check that the installed version is 7.0.0 or higher.

Any suggestion would be very helpful. Thanks!

@balos1
Copy link
Member

balos1 commented Jun 27, 2024

Sorry, I meant that the supported way is to use the find_package command from a CMakeLists.txt. According to the output of cmake --help though, the --find-package command line option is deprecated (I have never used it either, so I am unsure if it can do what youre asking).

From a CMakeLists.txt you would do

find_package(SUNDIALS)

Then the SUNDIALS::<component> targets would give you the link libraries and include paths. See this part of the docs.

Otherwise, you may need to write some custom script to look for sundials and then parse the SUNDIALSConfig.cmake / SUNDIALSTargets.cmake files to get the includes and link libraries. We have noted that a pkg-config file is a requested feature and hope to add it at some point in the future (we would also happily take a community contribution that does it).

@balos1 balos1 added question and removed triage labels Jun 27, 2024
@sn248
Copy link
Author

sn248 commented Jun 27, 2024

Thanks again! This is helpful although I am not sure how to use a CMakelist.txt within R package to compile using system installation.

Perhaps, I will wait till we get a pkg-config, until then use the current approach of bundling the Sundials source with the package.

@balos1
Copy link
Member

balos1 commented Jul 1, 2024

OK. I will close this now as a duplicate request for a pkg-config file.

@balos1 balos1 closed this as completed Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants