-Bstatic finally working !

Finally, upon playing with linking command it’s working !

Here is the hand-make modified linking command, which comes from cmake setting:

/mnt/apps/pgi/linux86-64/13.10/bin/pgf90 -g -Bstatic  CMakeFiles/example.dir/example.F90.o  -o ../bin/example  /usr/lib64/libm.a libstrcmp.a -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.a -Wl,--end-group -Wl,--start-group /mnt/apps/intel/composer_xe_2013_sp1.1.106/mkl/lib/intel64/libmkl_intel_lp64.a /mnt/apps/intel/composer_xe_2013_sp1.1.106/mkl/lib/intel64/libmkl_pgi_thread.a /mnt/apps/intel/composer_xe_2013_sp1.1.106/mkl/lib/intel64/libmkl_core.a /usr/lib64/libpthread.a /usr/lib64/libm.a /usr/lib64/libdl.a -Wl,--end-group /home/milias/Work/qch/software/software_projects/autocmake_devel/autocmake_miroi/test/fc_lapack/build_static_pgf90_mkl_6/libc.a

here is the compilation, linking and code execution:

milias@login.grid.umb.sk:~/Work/qch/software/software_projects/autocmake_devel/autocmake_miroi/test/fc_lapack/build_static_pgf90_pgcc_mkl/.make clean 
milias@login.grid.umb.sk:~/Work/qch/software/software_projects/autocmake_devel/autocmake_miroi/test/fc_lapack/build_static_pgf90_pgcc_mkl/.m 
[ 50%] Building C object src/CMakeFiles/strcmp.dir/strcmp.c.o
Linking C static library libstrcmp.a
[ 50%] Built target strcmp
[100%] Building Fortran object src/CMakeFiles/example.dir/example.F90.o
make[2]: Warning: File `src/libstrcmp.a' has modification time 25 s in the future
Linking Fortran executable ../bin/example
/mnt/apps/intel/composer_xe_2013_sp1.1.106/mkl/lib/intel64/libmkl_core.a(mkl_aa_fw_load_orsl_lite_lib.o): In function `mkl_aa_fw_load_orsl_lite_lib':
../../../../serv/offload/framework/core/mkl_aa_fw_load_orsl_lite_lib.c:(.text+0xbe): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib64/libpthread.a(libpthread.o): In function `sem_open':
(.text+0x774d): warning: the use of `mktemp' is dangerous, better use `mkstemp'
make[2]: warning:  Clock skew detected.  Your build may be incomplete.
[100%] Built target example
milias@login.grid.umb.sk:~/Work/qch/software/software_projects/autocmake_devel/autocmake_miroi/test/fc_lapack/build_static_pgf90_pgcc_mkl/.ldd bin/example 
        not a dynamic executable
milias@login.grid.umb.sk:~/Work/qch/software/software_projects/autocmake_devel/autocmake_miroi/test/fc_lapack/build_static_pgf90_pgcc_mkl/.bin/example 
 dgesv test ok
milias@login.grid.umb.sk:~/Work/qch/software/software_projects/autocmake_devel/autocmake_miroi/test/fc_lapack/build_static_pgf90_pgcc_mkl/.

All this stuff of getting proper static executable pgf90+MKL I have to translate into working CMake commands. Wish me good luck, guys !

Miro

Thanks for the update Miroi. Though the warning indicates that you may have further issues.

warning: Using ‘dlopen’ in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/lib64/libpthread.a(libpthread.o): In function `sem_open’: