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

Create a TribitsFindJuliaInterp.cmake #489

Open
bkochuna opened this issue Jun 17, 2022 · 4 comments
Open

Create a TribitsFindJuliaInterp.cmake #489

bkochuna opened this issue Jun 17, 2022 · 4 comments

Comments

@bkochuna
Copy link
Contributor

Julia is similar to Python. It is a programming language that features an interpreter.
The base CMake releases typically include a FindPython, but do not include a FindJulia.cmake

This issue is about adding a feature to TriBITS to find a Julia installation in basically the same fashion as it finds a python installation/interpreter.

The propsed task would be to copy and modify ./cmake/tribits/core/package_arch/TribitsFindPythonInterp.cmake
to make a TribitsFindJuliaInterp.cmake.

This file would define two macros TRIBITS_FIND_JULIA and TRIBITS_FIND_JULIA_INTERP that would be direct analogs to the python macros.

@bartlettroscoe
Copy link
Member

bartlettroscoe commented Jun 17, 2022

Hello @bkochuna!

Just a few questions:

  1. Who is the customer?
  2. What is the use case for this? How does Julia get used in a TriBITS project? Would this be used in TriBITS Core in some way? (NOTE: TriBITS Core can use Python if available and that is why the TriBITS Core macro tribits_project() looks for Python by default.)
  3. Is there a way for a specific project to contain this module itself and call it without adding this to TriBITS proper?

I have been getting a lot of pressure to make TriBITS smaller and more focused. When many people look at TriBITS, they get scared off. So making it bigger and adding more features needs to be carefully weighed against the perceived added size and complexity.

@bkochuna
Copy link
Contributor Author

Hi Ross,

For now the customer is us. Futility/MPACT/VERA.

The use case is we have a module/package written in Julia that we access in Futility through a C API.

Happy to include this stuff in our own project, just figured it might be worthwhile to any TriBITS user as they could then pull in features in Julia like they could for Python.

@bkochuna
Copy link
Contributor Author

As a follow up, We can just treat Julia like a TPL very easily in this case, but I think that this sort of abuses the abstraction of what a TPL is.

@bartlettroscoe
Copy link
Member

bartlettroscoe commented Jun 17, 2022

As a follow up, We can just treat Julia like a TPL very easily in this case, but I think that this sort of abuses the abstraction of what a TPL is.

Yea, but it not that bad of an abuse of the TPL system. The MPI and Pthread TPLs are similar that they often don't provide libraries, per say. But if you consider TPLs to just be external packages (that may or may not provide libraries), then it is okay okay. Basically, the <tplName>::all_libs target (with new modern CMake TriBITS) would be empty in this case. If your users want to access the features of Julia in the generated JuliaConfig.cmake file, that would take a little more work (but TriBITS should have a general function soon to make that easy).

I see there is no standard CMake FindJulia.cmake module yet from looking at:

But it looks like people have written some:

I think Kitware is very hesitant to accept new find modules going forward unless there is a very strong case to do so.

Perhaps a good middle ground is to create a TriBITS/tribits/contrib/ directory and put things like this in there to be shared with other TriBITS projects?

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

No branches or pull requests

2 participants