dev-cafe / autocmake

CMake plugin composer.
http://autocmake.org
BSD 3-Clause "New" or "Revised" License
42 stars 18 forks source link

More output from cmake #44

Closed miroi closed 9 years ago

miroi commented 9 years ago

Hi,

would it be possible to have more output from autocmake (through verbose flag) ? I am used to the DIRAC cmake output, containing compiler flags, compiler versions, extra libraries...

milias@login.grid.umb.sk:~/Work/qch/software/software_projects/autocmake_devel/autocmake/test/fc_blas/.python setup.py --fc=gfortran --blas=auto
FC=gfortran cmake -DEXTRA_FCFLAGS="''" -DENABLE_64BIT_INTEGERS=False -DENABLE_BLAS=auto -DENABLE_LAPACK=auto -DMKL_FLAG=off -DMATH_LIB_SEARCH_ORDER="MKL;ESSL;ATLAS;ACML;SYSTEM_NATIVE" -DBLAS_LANG=Fortran -DLAPACK_LANG=Fortran -DCMAKE_BUILD_TYPE=release -G "Unix Makefiles" None /home/milias/Work/qch/software/software_projects/autocmake_devel/autocmake/test/fc_blas

-- The C compiler identification is GNU 4.4.7
-- The CXX compiler identification is GNU 4.4.7
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- The Fortran compiler identification is GNU
-- Check for working Fortran compiler: /usr/bin/gfortran
-- Check for working Fortran compiler: /usr/bin/gfortran  -- works
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Checking whether /usr/bin/gfortran supports Fortran 90
-- Checking whether /usr/bin/gfortran supports Fortran 90 -- yes
-- BLAS will be searched for based on MKLROOT=/mnt/apps/intel/composer_xe_2013_sp1.1.106/mkl
-- Searching for BLAS using search order MKL;ESSL;ATLAS;ACML;SYSTEM_NATIVE
-- Found BLAS: MKL (-Wl,--start-group;/mnt/apps/intel/composer_xe_2013_sp1.1.106/mkl/lib/intel64/libmkl_gf_lp64.so;/mnt/apps/intel/composer_xe_2013_sp1.1.106/mkl/lib/intel64/libmkl_gnu_thread.so;/mnt/apps/intel/composer_xe_2013_sp1.1.106/mkl/lib/intel64/libmkl_core.so;/usr/lib64/libpthread.so;/usr/lib64/libm.so;-fopenmp;-Wl,--end-group)
-- LAPACK will be searched for based on MKLROOT=/mnt/apps/intel/composer_xe_2013_sp1.1.106/mkl
-- Searching for LAPACK using search order MKL;ESSL;ATLAS;ACML;SYSTEM_NATIVE
-- Found LAPACK: MKL (-Wl,--start-group;/mnt/apps/intel/composer_xe_2013_sp1.1.106/mkl/lib/intel64/libmkl_lapack95_lp64.a;/mnt/apps/intel/composer_xe_2013_sp1.1.106/mkl/lib/intel64/libmkl_gf_lp64.so;-fopenmp;-Wl,--end-group)
-- Configuring done
-- Generating done
-- Build files have been written to: /home/milias/Work/qch/software/software_projects/autocmake_devel/autocmake/test/fc_blas/build

   configure step is done
   now you need to compile the sources:
   $ cd build
   $ make
milias@login.grid.umb.sk:~/Work/qch/software/software_projects/autocmake_devel/autocmake/test/fc_blas/.
bast commented 9 years ago

It is definitely possible. But the question is probably whether this should be provided by default and this I don't know yet. Everything that is on by default has to work for "all" possible projects. I suggest you start coding a module that does that and if it turns out general enough we include it in the standard set of modules.

bast commented 9 years ago

http://autocmake.readthedocs.org/en/latest/developers/faq.html#autocmake-does-not-do-feature-x-i-really-need-feature-x-and-a-setup-py-flag-x

miroi commented 9 years ago

I tried to emulate config_info output based on git_info output, but plenty of variables are undefined in the simplest test case (I modified fc).

So I leaving this issue. Probably good printout can be in done in own cmake module.

milias@login.grid.umb.sk:~/Work/qch/software/software_projects/autocmake_devel/autocmake_miroi/test/fc/build-20
15-08-03-19-48-21/.m
[ 25%] Generating config_info.h
-- Who compiled             : 
-- Host                     : 
-- Who compiled             : 
-- Host                     : 
-- System name              : 
-- System                   : 
-- CMake version            : 2.8.12.2
-- CMake generator          : 
-- Python version           : 
-- Processor                : 
-- Fortran compiler         : 
-- Fortran compiler version :  
-- Fortran compiler flags   :   
-- C compiler               : 
-- C compiler version       :  
-- C compiler flags         :   
-- CMAKE_ARGC=4
-- CMAKE_ARGV0=/usr/bin/cmake
-- CMAKE_ARGV1=-D_target_dir=/home/milias/Work/qch/software/software_projects/autocmake_devel/autocmake_miroi/test/fc/build-2015-08-03-19-48-21
-- CMAKE_ARGV2=-P
-- CMAKE_ARGV3=config_info_sub.cmake
-- CMAKE_BINARY_DIR=/home/milias/Work/qch/software/software_projects/autocmake_devel/autocmake_miroi/modules/config_info
-- CMAKE_COMMAND=/usr/bin/cmake
-- CMAKE_CPACK_COMMAND=/usr/bin/cpack
-- CMAKE_CTEST_COMMAND=/usr/bin/ctest
-- CMAKE_CURRENT_BINARY_DIR=/home/milias/Work/qch/software/software_projects/autocmake_devel/autocmake_miroi/modules/config_info
-- CMAKE_CURRENT_LIST_DIR=/home/milias/Work/qch/software/software_projects/autocmake_devel/autocmake_miroi/modules/config_info
-- CMAKE_CURRENT_LIST_FILE=/home/milias/Work/qch/software/software_projects/autocmake_devel/autocmake_miroi/modules/config_info/config_info_sub.cmake
-- CMAKE_CURRENT_SOURCE_DIR=/home/milias/Work/qch/software/software_projects/autocmake_devel/autocmake_miroi/modules/config_info
-- CMAKE_EDIT_COMMAND=/usr/bin/ccmake
-- CMAKE_FILES_DIRECTORY=/CMakeFiles
-- CMAKE_HOST_UNIX=1
-- CMAKE_MAJOR_VERSION=2
-- CMAKE_MINOR_VERSION=8
-- CMAKE_PATCH_VERSION=12
-- CMAKE_ROOT=/usr/share/cmake-2.8
-- CMAKE_SCRIPT_MODE_FILE=/home/milias/Work/qch/software/software_projects/autocmake_devel/autocmake_miroi/modules/config_info/config_info_sub.cmake
-- CMAKE_SOURCE_DIR=/home/milias/Work/qch/software/software_projects/autocmake_devel/autocmake_miroi/modules/config_info
-- CMAKE_TWEAK_VERSION=2
-- CMAKE_VERSION=2.8.12.2
-- UNIX=1
-- _target_dir=/home/milias/Work/qch/software/software_projects/autocmake_devel/autocmake_miroi/test/fc/build-2015-08-03-19-48-21
[ 25%] Built target config_info
[ 50%] Generating git_info.h
-- Found Git: /usr/bin/git (found version "1.7.1") 
[ 50%] Built target git_info
[ 75%] Building Fortran object src/CMakeFiles/example.dir/module.f90.o
make[2]: Warning: File `src/CMakeFiles/example.dir/module.f90.o.provides.build' has modification time 25 s in the future
[100%] Building Fortran object src/CMakeFiles/example.dir/example.f90.o
Warning: /home/milias/Work/qch/software/software_projects/autocmake_devel/autocmake_miroi/test/fc/src/example.f90:5: Illegal preprocessor directive
Warning: /home/milias/Work/qch/software/software_projects/autocmake_devel/autocmake_miroi/test/fc/src/example.f90:6: Illegal preprocessor directive
Linking Fortran executable ../bin/example
make[2]: warning:  Clock skew detected.  Your build may be incomplete.
[100%] Built target example
bast commented 9 years ago

A warning about dealing with build info using header files. Sounds like a perfect idea and I have tried it myself but this will most probably fail on Fortran due to the line limit. This needs extra care and extra scripts that chop or truncate strings. Alternatively it requires Fortran calling C which includes the header file.