-
Notifications
You must be signed in to change notification settings - Fork 48
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
Cmake configuration fails when pfunit is **not** in toplevel CMakeLists.txt #483
Comments
@jfdev001 First, I really don't think this is the issue, but at least for pFUnit, we never specify the MPI wrapper as the Fortran compiler. In CMake the That said, I think I might understand the issue. Let me ponder on it. |
@jfdev001 Well, as we can't really test this easily without help from you, I decided to make a branch with some changes in CMake to see if it helps or not. Can you try the branch |
@mathomp4 I tried it with your branch corresponding to the commit 72f9f47 at https://github.com/jfdev001/minimal-fetch-content-pfunit/tree/use-bugfix-mathomp4 and this unfortunately did not fix the problem :( |
@jfdev001 Well, my branch is just our develop...bugfix/mathomp4/483-project-driver Let me try grabbing your repo and building myself. |
@jfdev001 This might take more than a day. I'm seeing...weird stuff putting in prints. I might even need to consult people like @ZedThree who I believe added our first But I am seeing even more fundamental weirdness. Like I set a variable and try to print it on the next line...and the print is empty. |
That said, I am beginning to think that |
@jfdev001 Can you try the Note: I am still doing internal testing myself, but hopefully it's good on our end too. |
The toy example (jfdev001/minimal-fetch-content-pfunit/fixed) works as expected. I don't really have a particularly complete codebase to use to test your fix since I really just wanted to have a sort generic fortran cmake project, but a "slightly" more complete example I provide here ( jfdev001/hello-sparse-blas and build with One thing that is a bit odd though, when calling
all of the pfunit tests get built even when the intention is to just test my tests (labeled "myproject"). Is this intended behavior?
|
"intended" may not be the right word here. But we did do some non-canonical things with tests in our formative CMake years when we did not quite understand how things work. On our end, we build and install these layers separately and do not combine them into a single project. Thus don't really see that problem. With a bit of work, I think I can point you to the bits that cause the above behavior. If you find a fix, I'm happy to accept so long as it does not interfere with our other uses. |
I could look into this so I would appreciate you pointing me in the right direction. I could open a separate issue for this. |
I suspect that it is related to this bit of code in the topmost CMakeLists.txt:
|
I would like to use pFUnit in my project and download it using
FetchContent
inextern/pFunit/CMakeLists.txt
. My project structure is as follows:when attempting
cmake -S . -B build -DCMAKE_Fortran_COMPILER=mpif90
,pFUnit
does not configure correctly (i'm new to cmake, my issue could be a more basic misunderstanding) and throws the error preceded by some debugging information fromvariable_watch(PFUNIT_DRIVER)
:It's odd to me that
PFUNIT_DRIVER
is correctly read and set in one file, but is an empty string in the other. Any suggestions for resolving this error?Below are the contents of the files in my broken example, but for convenience, you can also pull my code from jfdev001/minimal-fetch-content-pfunit and reproduce a working (yet not ideally structured) and broken example as needed.
A working example can be compiled by placing the pfunit fetch content in the toplevel
CMakeLists.txt
and structuring the project as shown below, but for organizational purposes, it seems like it would be a better practice to put such dependencies in a separate folder (see e.g., fortran-lang/fftpack, jchristopherson/dynamics).The text was updated successfully, but these errors were encountered: