dev-cafe / autocmake

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

added new fc_lapack test #50

Closed miroi closed 9 years ago

miroi commented 9 years ago

Wished to have core autocmake-blas/lapack tests running with many compilers as prelude for developing autocmake-DIRAC/

bast commented 9 years ago
miroi commented 9 years ago

Fine, I am going to simplify the test. So I have to supply data manually for A,b and check roots manually also.

bast commented 9 years ago

How about just diagonalizing a 2x2 matrix. Then it is easy to provide everything manually. No random stuff needed then.

miroi commented 9 years ago

Hi,

I have solving linear equations from lapack (DGESV). Will find some 3x3 system.

miroi commented 9 years ago

Pffffffuh, all two tests are green. Nice :+1:

miroi commented 9 years ago

Hi, are there any reasons against this PR ? I would be glad to have it in master, to experiment with lapack static linking....

bast commented 9 years ago

Thanks Miro. Two more questions from my side: What CMake version are you using on the machine with PGI and is the -rdynamic hack needed also with the latest CMake version?

miroi commented 9 years ago

Hi, i) CMake version:

milias@login.grid.umb.sk:~/Work/qch/software/software_projects/autocmake_devel/autocmake_miroi/.cmake --version
cmake version 2.8.12.2

ii) Ad -rdynamic hack : this I don't know. The CMake adds a lot of stuff into linking command, and sometimes we have to purify it of offensive flags. I don't know how this is developing with CMake versions, simply we have to watch it.

bast commented 9 years ago

Can you please try it with latest CMake? Because perhaps we are trying to workaround a problem that has been solved.

miroi commented 9 years ago

Hi,

the latest CMake also includes offensive flag for pgf90:

milias@login.grid.umb.sk:~/Work/qch/software/software_projects/autocmake_devel/autocmake_miroi/test/fc_blas/.python setup.py --fc=pgf90 
FC=pgf90 cmake -DEXTRA_FCFLAGS="''" -DENABLE_STATIC_LINKING=False -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 -DEXPLICIT_LIBS=off -DCMAKE_BUILD_TYPE=release -G "Unix Makefiles" None /home/milias/Work/qch/software/software_projects/autocmake_devel/autocmake_miroi/test/fc_blas

CMake Warning:
  Manually-specified variables were not used by the project:

    EXPLICIT_LIBS

-- 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
-- Detecting C compile features
-- Detecting C compile features - 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
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The Fortran compiler identification is PGI 1.1
-- Check for working Fortran compiler: /mnt/apps/pgi/linux86-64/13.10/bin/pgf90
-- Check for working Fortran compiler: /mnt/apps/pgi/linux86-64/13.10/bin/pgf90  -- works
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Checking whether /mnt/apps/pgi/linux86-64/13.10/bin/pgf90 supports Fortran 90
-- Checking whether /mnt/apps/pgi/linux86-64/13.10/bin/pgf90 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_intel_lp64.so;/mnt/apps/intel/composer_xe_2013_sp1.1.106/mkl/lib/intel64/libmkl_pgi_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;-mp;-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_intel_lp64.so;-mp;-Wl,--end-group)
-- Configuring done
-- Generating done
-- Build files have been written to: /home/milias/Work/qch/software/software_projects/autocmake_devel/autocmake_miroi/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_miroi/test/fc_blas/.cd build
milias@login.grid.umb.sk:~/Work/qch/software/software_projects/autocmake_devel/autocmake_miroi/test/fc_blas/build/.m
make: Warning: File `Makefile' has modification time 18 s in the future
make[1]: Warning: File `CMakeFiles/Makefile2' has modification time 18 s in the future
make[2]: Warning: File `src/CMakeFiles/example.dir/flags.make' has modification time 18 s in the future
Scanning dependencies of target example
make[2]: warning:  Clock skew detected.  Your build may be incomplete.
make[2]: Warning: File `src/CMakeFiles/example.dir/flags.make' has modification time 18 s in the future
make[2]: warning:  Clock skew detected.  Your build may be incomplete.
make[2]: Warning: File `src/CMakeFiles/example.dir/flags.make' has modification time 18 s in the future
[ 50%] Building Fortran object src/CMakeFiles/example.dir/example.f90.o
[100%] Linking Fortran executable ../bin/example
pgf90-Error-Unknown switch: -rdynamic
make[2]: *** [bin/example] Error 1
make[1]: *** [src/CMakeFiles/example.dir/all] Error 2
make: *** [all] Error 2
milias@login.grid.umb.sk:~/Work/qch/software/software_projects/autocmake_devel/autocmake_miroi/test/fc_blas/build/.which cmake
/home/milias/bin/cmake/cmake-3.3.0-Linux-x86_64/bin/cmake
milias@login.grid.umb.sk:~/Work/qch/software/software_projects/autocmake_devel/autocmake_miroi/test/fc_blas/build/.cmake --version
cmake version 3.3.0

CMake suite maintained and supported by Kitware (kitware.com/cmake).
milias@login.grid.umb.sk:~/Work/qch/software/software_projects/autocmake_devel/autocmake_miroi/test/fc_blas/build/.

and here is the linking command with offensive flag:

/mnt/apps/pgi/linux86-64/13.10/bin/pgf90      -Mpreprocess -Kieee  -fast -O3 -Mipa=fast CMakeFiles/example.dir/example.f90.o  -o ../bin/example  -L/mnt/apps/intel/composer_xe_2013_sp1.1.106/mkl/lib/intel64 -rdynamic -Wl,--start-group -lmkl_intel_lp64 -lmkl_pgi_thread -lmkl_core -lpthread /usr/lib64/libm.so -mp -Wl,--end-group -Wl,--start-group /mnt/apps/intel/composer_xe_2013_sp1.1.106/mkl/lib/intel64/libmkl_lapack95_lp64.a -lmkl_intel_lp64 -mp -Wl,--end-group -lmkl_pgi_thread -lmkl_core -lpthread /usr/lib64/libm.so /mnt/apps/intel/composer_xe_2013_sp1.1.106/mkl/lib/intel64/libmkl_lapack95_lp64.a -Wl,-rpath,/mnt/apps/intel/composer_xe_2013_sp1.1.106/mkl/lib/intel64
bast commented 9 years ago

OK thanks for testing it. Then we probably need to have it in the test script.