I have been experimenting with the feq-parse project by @fluidnumerics_joe and stumbled on some peculiarities. One of them is that the Visual Studio solution that I created via CMake fails to build in one go. The first time the compiler complains about four source files in the test directory whereas it is happy with all the others there. The complaint is that the module file for FEQparse is not found. But it is apparently found for all the others. After building a second time it works fine.
The problem is: all the options are equal for all the files in the test directory. I can find no reason whatsoever for that behaviour wrt the four files. I suspected first something regarding parallel builds and race conditions, but as the set of files about which the compiler complains is always the same, I very much doubt this is the cause.
Does anyone have any idea where to look for the problem (or rather the solution)?
Hm, my guess is that fpm does not see the dependency via the included files. Could be fixed by adding a use statement in test.f90. In the VS case I get a complaint for four source files and not for all the other ones. Each is compiled independently.
It’d be helpful to see any verbose output from FPM… however, from this output it looks like src/FEQParse.F90 is not compiled on the first go-around. If you run fpm install followed by fpm test, I suppose it would work ?
@vmagnin - I’ve added the use FEQParse statement to the top of test.f90 in the bugfix/issue-12 branch branch; this does cause fpm to build src/FEQParse.f90 before any of the tests in test/ .
@Arjen - what version of CMake are you working with ?
@Arjen - I’ve added a fix to the bugfix/issue-12 branch that forces a dependency of the ${TARGET}_fortran target on the feqparse-static target which will guarantee that everything in src/ is compiled before starting on building anything in test/
fpm would need to analyse the included files to determine that the main program depends on the FEQParse module indirectly via the contained subroutines.