Closed aeantipov closed 12 years ago
Try to do the following and let me know what you get (I turned off any open mp lib and did not link against mkl_gnu_thread which I think is not necessary):
cmake -DBLAS_LIBRARY=-lmkl_core -DLAPACK_LIBRARY="-lmkl_intel_lp64;-lmkl_sequential;-lpthread" -DCBLAS_INCLUDE_DIR=/usr/local/intel/composerxe/2011.7.256/mkl/include -DLAPACK_LINKER_FLAGS=-L/usr/local/intel/composerxe/2011.7.256/mkl/lib/intel64 -DBOOST_SOURCE_DIR=path_to_boost_sources path_to_triqs_sources
This time it's much better. At first I got bunch of errors, which told something like 'undefined reference to `gm_crc'. Adding -lgm to LAPACK_LIBRARY fixed it and the compilation got to the building of Wien2k module, at which it failed. I used this short shell script for configuration:
CXX="g++" CC="gcc" cmake \ -DBLAS_LIBRARY=-lmkl_core -DLAPACK_LIBRARY="-lgm;-lmkl_intel_lp64;-lmkl_sequential;-lpthread" \ -DCBLAS_INCLUDE_DIR=/usr/local/intel/composerxe/2011.7.256/mkl/include \ -DLAPACK_LINKER_FLAGS=-L/usr/local/intel/composerxe/2011.7.256/mkl/lib/intel64 \ -DBOOST_SOURCE_DIR=/home/antipov/code/boost_svn \ -DMPIEXEC:FILEPATH=/usr/local/mpich/gnu/bin/mpiexec \ -DMPI_COMPILER:FILEPATH=/usr/local/mpich/gnu/bin/mpic++ \ -DMPI_LIBRARY:FILEPATH=/usr/local/mpich/gnu/lib/libmpich.a \ -DMPI_INCLUDE_PATH:STRING=/usr/local/mpich/gnu/include \ -DCMAKE_INSTALL_PREFIX=/home/antipov/_local \ /home/antipov/code/triqs
The result is:
[ 39%] Built target boost_for_triqs [ 45%] Built target mpi Linking CXX shared library libtriqs.so [ 48%] Built target triqs Linking CXX executable a_x_ty_nopy [ 48%] Built target a_x_ty_nopy Scanning dependencies of target array_cache_nopy [ 48%] Building CXX object triqs/arrays/test/C++/CMakeFiles/array_cache_nopy.dir/array_cache.cpp.o Linking CXX executable array_cache_nopy [ 48%] Built target array_cache_nopy ........ Linking Fortran executable dmftproj [ 95%] Built target dmftproj Scanning dependencies of target triqs_Wien2k [ 95%] Generating vertex.so See /home/antipov/Downloads/triqs_build3/pytriqs/Wien2k/F90/f2pyBuild.log for logs make[2]: *** [pytriqs/Wien2k/F90/vertex.so] Error 1 make[1]: *** [pytriqs/Wien2k/F90/CMakeFiles/triqs_Wien2k.dir/all] Error 2 make: *** [all] Error 2
f2pyBuild.log:
running build running config_cc unifing config_cc, config, build_clib, build_ext, build commands --compiler options running config_fc unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options running build_src build_src building extension "vertex" sources creating /tmp/tmpcFezih creating /tmp/tmpcFezih/src.linux-x86_64-2.6 f2py options: [] f2py: vertex.pyf Reading fortran codes... Reading file 'vertex.pyf' (format:free) Post-processing... Block: vertex Block: u4ind Post-processing (stage 2)... Building modules... Building module "vertex"... Constructing wrapper function "u4ind"... u_out = u4ind(rcl,tm,[l,n]) Wrote C/API module "vertex" to file "/tmp/tmpcFezih/src.linux-x86_64-2.6/vertexmodule.c" adding '/tmp/tmpcFezih/src.linux-x86_64-2.6/fortranobject.c' to sources. adding '/tmp/tmpcFezih/src.linux-x86_64-2.6' to include_dirs. copying /usr/lib64/python2.6/site-packages/numpy/f2py/src/fortranobject.c -> /tmp/tmpcFezih/src.linux-x86_64-2.6 copying /usr/lib64/python2.6/site-packages/numpy/f2py/src/fortranobject.h -> /tmp/tmpcFezih/src.linux-x86_64-2.6 build_src: building npy-pkg config files running build_ext customize UnixCCompiler customize UnixCCompiler using build_ext customize GnuFCompiler Could not locate executable g77 Could not locate executable f77 customize IntelFCompiler Found executable /usr/bin/gfortran Found executable /usr/local/bin/ifort customize LaheyFCompiler Could not locate executable lf95 lahey: no Fortran 77 compiler found lahey: no Fortran 77 compiler found customize PGroupFCompiler Found executable /usr/local/pgi/linux86-64/11.9/bin/pgf77 Found executable /usr/local/pgi/linux86-64/11.9/bin/pgf90 customize PGroupFCompiler customize PGroupFCompiler using build_ext building 'vertex' extension compiling C sources C compiler: gcc -pthread -fno-strict-aliasing -DNDEBUG -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -fPIC creating /tmp/tmpcFezih/tmp creating /tmp/tmpcFezih/tmp/tmpcFezih creating /tmp/tmpcFezih/tmp/tmpcFezih/src.linux-x86_64-2.6 compile options: '-I/tmp/tmpcFezih/src.linux-x86_64-2.6 -I/usr/lib64/python2.6/site-packages/numpy/core/include -I/usr/include/python2.6 -c' gcc: /tmp/tmpcFezih/src.linux-x86_64-2.6/fortranobject.c gcc: /tmp/tmpcFezih/src.linux-x86_64-2.6/vertexmodule.c compiling Fortran sources Fortran f77 compiler: /usr/local/pgi/linux86-64/11.9/bin/pgf77 -fpic -Minform=inform -Mnosecond_underscore -fast Fortran f90 compiler: /usr/bin/gfortran -fpic -Minform=inform -Mnosecond_underscore -fast Fortran fix compiler: /usr/bin/gfortran -Mfixed -fpic -Minform=inform -Mnosecond_underscore -fast compile options: '-I/tmp/tmpcFezih/src.linux-x86_64-2.6 -I/usr/lib64/python2.6/site-packages/numpy/core/include -I/usr/include/python2.6 -c' gfortran:f90: vertex.f90 Warning: Using -Mis deprecated, use -J instead Warning: Using -M is deprecated, use -J instead f951: error: unrecognized command line option "-fast" Fatal Error: gfortran: Only one -J option allowed Warning: Using -M is deprecated, use -J instead Warning: Using -M is deprecated, use -J instead f951: error: unrecognized command line option "-fast" Fatal Error: gfortran: Only one -J option allowed error: Command "/usr/bin/gfortran -fpic -Minform=inform -Mnosecond_underscore -fast -I/tmp/tmpcFezih/src.linux-x86_64-2.6 -I/usr/lib64/python2.6/site-packages/numpy/core/include -I/usr/include/python2.6 -c -c vertex.f90 -o /tmp/tmpcFezih/vertex.o" failed with exit status 1
gfortran has version 4.5
There might be an issue with the fortran compiler used in f2py. You use gnu compilers, but mkl libraries. I got similar errors with plain f2py, when specifiying only the fortran exectuable to be 'ifort', for instance, and not the vendor to be 'intel'. That resulted in strange linking behavior and errors. I don't know, how to fix this easily in cmake, though.
Thanks, Markus. That is right - somehow instead of using gfortran whilst building f2py the configuration script found pgi compiler in my path and invoked it as a f77 compiler, which was wrong. As soon as I changed my PATH variable to avoid it, everything finally compiled smoothly. Once again, thanks everyone for helping with this!
Hi, everyone. I still try to get TRIQS installed to a machine with MKL. The mpi compiler is GNU mpic++, g++ and gcc are used as CXX and CC. From the FindBLAS.Cmake I got that TRIQS actually looks for an "mkl" string in LAPACKLIBS and if it exists, replaces cblas with mkl_cblas etc. After some playing I got string "You are using mkl" during configuration and finally everything went smooth and I got no errors or warnings during generating CMakeCache. Here are the lines, that I have put in ccmake (CMakeCache.txt is attached):
CmakeCache - http://gist.github.com/1363901
The problem occurs during linking CXX executable a_x_ty_nopy. The log is in the bottom. To me it looks like there are some dependencies on pthreads and openmp (libgomp) for GNU case. There were some more mistakes with linking but they have passed after I included more libraries in LAPACK_LIBS. So this suggests that some additional flags should be passed when linking. I tried to pass "-fopenmp -lpthread" in CMAKE_MODULE_LINKER_FLAGS but it didn't help.
Thanks for the support!
Build log: