Skip to content

Complaints about recursive rules #126

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

Closed
arjenmarkus opened this issue Jul 18, 2020 · 6 comments
Closed

Complaints about recursive rules #126

arjenmarkus opened this issue Jul 18, 2020 · 6 comments
Labels
packaging Related to porting or packaging a project to fpm

Comments

@arjenmarkus
Copy link
Member

I tried to use fpm on a somewhat more complex collection of Fortran modules and their test programs. They are all part of my Flibs project (http://flibs.sf.net). I copied the source files for the modules to a directory src and the sources for the test programs to test/xxx (well, for two test programs, to get started). Then I set up a fpm.toml file. All have been attached.

fpm gave me an error message:

Build system error - recursion detected:
Key type: FilesQ
Key value: build/gfortran_debug/computing/combinations.o build/gfortran_debug/computing/combinations.mod
Rules may not be recursive

As all the modules are standalone I am not sure what went wrong. Also, I noticed that with my first attempt it complained about a different (!) module than when I redirected the output.

It may be that the problem has already been solved - my version of fpm is one month old.
test-fpm-flibs.zip

@everythingfunctional
Copy link
Member

Some of the source files contain a program at the end which uses the module. This use statement signals to the fpm build system that the module depends on itself. Thus, the recursive rule error message.

Basic fix, remove the example programs from the end of the module source files.

@arjenmarkus
Copy link
Member Author

arjenmarkus commented Jul 21, 2020 via email

@arjenmarkus
Copy link
Member Author

Yes, two of the source files contained a test program (I should have a look at those :)). But when I removed them and tried again, I ran into another issue: a presumed relation between the names of the module and the source file that contains it. I will report it as a separate issue.

@milancurcic
Copy link
Member

Especially because this (module + program in a source file) is valid, fpm needs to be able to detect this and print a helpful message to the user.

@arjenmarkus
Copy link
Member Author

arjenmarkus commented Jul 21, 2020 via email

@LKedward
Copy link
Member

I'll close this as fpm now supports having programs and modules in the same file and has removed any required relationship between file path and module name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packaging Related to porting or packaging a project to fpm
Projects
None yet
Development

No branches or pull requests

5 participants