adda
adda copied to clipboard
Further improvement of makefiles
There are a few ideas:
1) It would be nice to have compilation goals like 'install' and 'dist'. So
that it would look more standard from a GNU-point of view.
2) It is not clear whether makefiles will work if executed from a different
directory. Should be tested.
3) Inclusion of dependencies causes make to scan some makefiles twice,
including variable processing (e.g. in mpi/Makefile). It is logical to separate
this two processes completely.
Original issue reported on code.google.com by yurkin
on 6 Sep 2010 at 6:20
It is also a good idea to change values of internal variables to lowercase to
distinguish them from those, which are designed to be specified from outside
(command line or environment).
Original comment by yurkin
on 8 Sep 2010 at 11:32
Original comment by yurkin
on 10 Jun 2011 at 2:04
- Added labels: Usability
A related idea is to use configure scripts as was discussed in #81
Another related idea is to create packages for ADDA (automatically compiled), for which GitHub has recently added internal support.
A related (potential) idea is to use CMake instead of configure
- not sure what is better.
Use of CMake is a must for conveniently using other toolchains on Windows, like Intel Compiler on top of Visual Studio. If we do it ourselves, we need to:
- change some compilation options (i.e.
-QMD
and-Qstd=c99
instead of-MD
and-std=c99
, respectively) - use
.obj
extension instead of.o
for object files - rework specification of paths to libraries (e.g.
LIB
environmental variable instead of-L...
flags) or give full path to libraries together with their names. - specify full library file name (
*.lib
) instead of-l...
flags - if compiling Fortran sources, the calling names of corresponding functions from in C files need to be changed from
function_
toFUNCTION
(this can be made by macros) or usingISO_C_BINDING
inside Fortran sources.
I have managed to perform such simulation in the simplest seq
mode using a special batch file src/iw_compile.bat, but it would be hard to enable this inside the current Makefile
keeping compatibility with all existing modes.
Still, I do not see any immediate value in supporting this toolchain on Windows.
Here are minimalistic examples of CMake files to compile ADDA (seq
and ocl
modes) with static linking of Fortran libraries, contributed by Michel Gross. While they are definitely simpler than basic makefiles, it is still not clear, whether CMake can (and how easy) incorporate all the complexity (and various modes) of current ADDA makefiles.
cmakelists_fortran.txt CMakeLists_ocl.txt CMakeLists_adda.txt