https://www.dropbox.com/s/q78qjwseldjg48h/ex3-meson.tar.bz2
Hello Jussi,
The example under the link is a simplification of my failing case.
While first generating a meson project it works (builds, compiles and runs correctly). However, if you add an (unused) argument to the subroutine report_precision in the module m1 and try to recompile in a usual way
ninja -v
, then only the module m1 gets recompiled, but not module m2. This leads to a segmentation fault while running the program. I could not simplify the example further and still get segfaulting.
An example of modification of the subroutine report_precision is given by the subr report_precision_3 which also locates in the module m1.
The version of gfortran I have is 4.5...
Best regards, Peter
Send from phone. Please excuse my brevity.
The example under the link is a simplification of my failing case.
While first generating a meson project it works (builds, compiles and runs correctly). However, if you add an (unused) argument to the subroutine report_precision in the module m1 and try to recompile in a usual way
ninja -v
, then only the module m1 gets recompiled, but not module m2. This leads to a segmentation fault while running the program. I could not simplify the example further and still get segfaulting.
Hopefully it is ninja that has to be corrected.
Petr
Send from phone. Please excuse my brevity.
Hopefully it is ninja that has to be corrected.
I confirm that the problem is resolved. Namely, if I change the
arguments of a subroutine from a given module, then the all modules
which depend on this module will get rebuild. From the other hand, if
I just add a comment in the given module (which does not change
anything for object file), then only this module will get rebuild, but
not the other modules and project will get correctly linked. Thank
you! This is basically the effect I was looking for by using meson
instead of make utility.
I have a few comments though:
1. In the current version, there are a lot of 'echo' targets built.
Maybe they can be reduced unless they are not remnants of some
debugging process?
2. In present version the dependencies are caugth better than by using
make utility (as I mentioned already). However, I think the number of
rebuilds can be cut down further. Imagine a situation when there are
modules m1, m2, m3 and a subroutine s1 locates in the module m1 and it
is called in the module m2, but not called in the module m3, although
the module m1 us USEd in both modules m2 and m3. In this situation, if
the interface of the subroutine s1 got changes, then only module m2 is
necessary to rebuild, but module m3 may be left in peace. However (as
far as I understood) in the present version all three modules will get
rebuild. I will have to confirm that i) any rebuild of the module m3
is indeed not required and ii) in present version all three modules
will get rebuild.
What do you think?
3. In previous version of meson by default a debugging version of the
project has been generated, while in the present version of meson any
optimization flags got removed by default and the compiler's defaults
are -O2 option which is much slower than -O0 option which was
explicitly present in the previous version of meson (if I recall
correctly).
4. May I suggest for you to consider some features for build.meson
script by using which one would be able to specify enviroment
variables from inside of the build.meson script. This feature is
present in the Makefiles and in many other build systems. A way of
specifying enviroment variables from inside the build script would
save an additional scripting level for me.
5. If item 4 is not impossible then the include feature would make my
work with meson completely similar to what I do with Makefiles.
Namely, I could then to separate machine/compiler dependent
information and project-related information into different files.
I am trying to make with meson a build similar to Makefiles I am using now. Namely, I generate makefiles for several executables, dependencies are generated automatically as well. Only what I cannot generate automatically is so called architecture file in which the information about machine and libraries is concentrated. If there is a way to specify this information in a short convenient form explicitly and separately from the logics of the program itself (which modules depend on which other modules, the executables to build, etc) this would help me a lot. I also think this would be a prerequisite to use your build system on clusters (because normally it is more difficult to figure the working/optimal configuration of libraries/compilers on clusters)
the way you propose would resolve the task, also I perceive this as unsatisfactory because of too much scripting levels. I order to build with meson you would need to be aware of bash script, meson script, python script which generates list of source files (in my case) and ninja script. This proliferation makes bad feeling, but I can try that. Next I will experiment with intel fortran as I promised.
on my desktop I met following error with g95 compiler
g95: unrecognized option '-Jxyzedit.dir'
I almost got ifort working. There are two things that I could not do
FortranCompiler)
2. The option to put modules for ifort is -module path. However, if this option appears in quotes '-module path', then ifort could not recognize it
Hello Jussi,I tried to return the list as you suggested, but this lead to an error
I succeed to compile and run my project with g95, sunf90, gfortran and ifort compilers on my desktop. I think this is a milestone which is worth to commit. Could you introduce changes to environment.py according to attached file?
If I use gfortran or g95 compilers, then a non substantial change of a module leads to recompilation of this particular module and linking of the program. This is the behaviour we expect from meson. However, in case of sunf90 and ifort, the same non substantial change causes ninja to recompile all dependencies as it would do make utility. I admit I still do not understand how your smart detection strategy actually works. Maybe, because I do not understand it, I suggested something wrong for ifort and sun compilers?
I introduced 3 more Fortran compilers into environment.py (PGI, open64 and pathscale). I confirm that this works with my code on two machines. With this change I cover all compilers available to me now. There are abisoft and lahey compilers which are missing, but I do not have access to them currently.