Hi Phil,<div><br></div><div>Try to reduce the optimization flags, this helped me to get rid of the segmentation faults with earlier versions of ifort. Start with -O0 and if the error disappears, try -O2 which should be enough. Then also, if you use the arch file as you've posted it you should move the part<div><div><br></div><div>MKL = /usr/local/intel/composer_xe_2011_sp1.9.293/mkl </div><div>MKL_INC = $(MKL)/include/fftw </div><div>MKL_LIB = $(MKL)/lib/intel64 </div><div><br></div><div>INTEL_MKL_LIB=$(HOME)/cp2k/fftw3xf</div><div><br></div><div>to the top of the file. Otherwise -I$(MKL_INC) has nothing to include. With the new Intel compilers the FFTW is now contained in the MKL library directly and there is no need to build the wrapper:<br></div><div>http://software.intel.com/en-us/articles/build-cp2k-using-intel-fortran-compiler-professional-edition/<br></div><div><br></div><div>I hope this helps.</div><div><br></div><div>Regards,</div><div>Roger</div><div><br></div><br>On Monday, April 16, 2012 9:27:47 PM UTC+2, Phil Song wrote:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">Hi, all:
<br>
<br>I am trying to compile cp2k serial version with the newest intel
<br>fortran compiler (64 Compiler XE Version 12.1.3.293 Build 20120212).
<br>And I have used a config file (attached later) for compiling, where I
<br>have compiled the fftw3 that comes with the intel MKL library and put
<br>it on $(HOME)/cp2k/fftw3xf for linking (because I am not the
<br>administrator of the cluster). Both the compiling and linking went
<br>smoothly.
<br>
<br>However, when I tried to run one of the test example in the cp2k/tests/
<br>QS directory. The program crashed in the middle of the run after
<br>display "QUICKSTEP" with a segmentation fault (SIGSEGV). I have tried
<br>to open up a debugger to see what happened and I have found that the
<br>segmentation fault was originated from the following stack:
<br>
<br>==============================<wbr>==============================<wbr>===============
<br>#0 0x00007f575fcfb985 in mkl_blas_dgemm_mscale () in /usr/local/intel/
<br>composer_xe_2011_sp1.9.293/<wbr>mkl/lib/intel64/libmkl_mc3.so
<br>#1 0x00007f576245b9a5 in mkl_blas_dgemm_mscale () in /usr/local/intel/
<br>composer_xe_2011_sp1.9.293/<wbr>mkl/lib/intel64/libmkl_core.so
<br>#2 0x00007f575ffa5313 in mkl_blas_xdgemm () in /usr/local/intel/
<br>composer_xe_2011_sp1.9.293/<wbr>mkl/lib/intel64/libmkl_mc3.so
<br>#3 0x00007f576245d369 in mkl_blas_xdgemm () in /usr/local/intel/
<br>composer_xe_2011_sp1.9.293/<wbr>mkl/lib/intel64/libmkl_core.so
<br>#4 0x00007f5763485dff in mkl_blas_dgemm () in /usr/local/intel/
<br>composer_xe_2011_sp1.9.293/<wbr>mkl/lib/intel64/libmkl_<wbr>sequential.so
<br>#5 0x00007f5763bbf11b in dgemm () in /usr/local/intel/
<br>composer_xe_2011_sp1.9.293/<wbr>mkl/lib/intel64/libmkl_intel_<wbr>ilp64.so
<br>#6 0x0000000000ecdb8a in basis_set_types_mp_init_orb_<wbr>basis_set_ ()
<br>in /home/ysong/cp2k/cp2k-2.2/exe/<wbr>Linux-x86-64-intel/cp2k.sopt
<br>#7 0x0000000000eaf716 in atomic_kind_types_mp_init_<wbr>atomic_kind_set_
<br>() in /home/ysong/cp2k/cp2k-2.2/exe/<wbr>Linux-x86-64-intel/cp2k.sopt
<br>#8 0x0000000001629043 in qs_environment_mp_qs_init_<wbr>subsys_ () in /
<br>home/ysong/cp2k/cp2k-2.2/exe/<wbr>Linux-x86-64-intel/cp2k.sopt
<br>#9 0x000000000163023f in qs_environment_mp_qs_init_ () in /home/ysong/
<br>cp2k/cp2k-2.2/exe/Linux-x86-<wbr>64-intel/cp2k.sopt
<br>#10 0x000000000085b35c in qs_main_mp_quickstep_create_<wbr>force_env_ ()
<br>in /home/ysong/cp2k/cp2k-2.2/exe/<wbr>Linux-x86-64-intel/cp2k.sopt
<br>#11 0x0000000000465341 in f77_interface_mp_create_force_<wbr>env_ () in /
<br>home/ysong/cp2k/cp2k-2.2/exe/<wbr>Linux-x86-64-intel/cp2k.sopt
<br>#12 0x000000000040bc8a in cp2k_runs_mp_cp2k_run_ () in /home/ysong/
<br>cp2k/cp2k-2.2/exe/Linux-x86-<wbr>64-intel/cp2k.sopt
<br>#13 0x000000000040ae44 in cp2k_runs_mp_run_input_ () in /home/ysong/
<br>cp2k/cp2k-2.2/exe/Linux-x86-<wbr>64-intel/cp2k.sopt
<br>#14 0x0000000000407a06 in MAIN__ () in /home/ysong/cp2k/cp2k-2.2/exe/
<br>Linux-x86-64-intel/cp2k.sopt
<br>==============================<wbr>==============================<wbr>===============
<br>
<br>I was trying to further debug the cp2k source code to figure out where
<br>the problems came from. But it seemed that the parameters passed to
<br>basis_set_types_mp_init_orb_<wbr>basis_set seemed all right. Therefore, I
<br>am very confused. Could this be a problem with the newest MKL, which I
<br>think is unlikely? Or could this be a bug in the cp2k source? Or could
<br>I did not compile and link the program correctly?
<br>
<br>I have spent quite a long time look at this and still could not solve
<br>it. I hope someone can help me with this and any suggestion will be
<br>greatly appreciated.
<br>
<br>Thanks a lot!
<br>
<br>Best,
<br>Phil Song
<br>
<br>The machine that I have used to compile cp2k is equipped with a quad
<br>core i7 920.
<br>
<br>The config file Linux-x86-64-intel.sopt for compilation is attached as
<br>follow.
<br>
<br>==============================<wbr>==============================<wbr>===============
<br>CC = icc
<br>CPP =
<br>FC = ifort
<br>LD = ifort
<br>AR = xiar -r
<br>DFLAGS = -D__INTEL -D__FFTSG -D__FFTW3 -D__FFTMKL
<br>CPPFLAGS = -C -traditional $(DFLAGS) -I$(MKL_INC)
<br>FCFLAGS = $(DFLAGS) -I$(MKL_INC) -O3 -xHost -heap-arrays 64 -fpp -
<br>free
<br>FCFLAGS2 = $(DFLAGS) -I$(MKL_INC) -O1 -xHost -heap-arrays 64 -fpp -
<br>free
<br>LDFLAGS = $(FCFLAGS)
<br>
<br>MKL = /usr/local/intel/composer_xe_<wbr>2011_sp1.9.293/mkl
<br>MKL_INC = $(MKL)/include/fftw
<br>MKL_LIB = $(MKL)/lib/intel64
<br>
<br>INTEL_MKL_LIB=$(HOME)/cp2k/<wbr>fftw3xf
<br>
<br>LIBS = -L$(MKL_LIB) -L$(INTEL_MKL_LIB) \
<br> -lfftw3xf_intel \
<br> -lmkl_intel_ilp64 -lmkl_sequential -lmkl_core -lpthread -lm
<br>
<br>OBJECTS_ARCHITECTURE = machine_intel.o
<br>
<br>graphcon.o: graphcon.F
<br> $(FC) -c $(FCFLAGS2) $<
<br>
<br>qs_vxc_atom.o: qs_vxc_atom.F
<br> $(FC) -c $(FCFLAGS2) $<
<br>==============================<wbr>==============================<wbr>===============</blockquote></div></div>