[SciPy-Dev] Many Problems Building w/ MKL 11, ifort, icc; scipy.test() Fails w/ Undefined Symbols

Xavier Barthelemy xabart@gmail....
Thu Aug 29 02:03:55 CDT 2013


mkl_rt are working well for me,
here are my options:

site.cfg:


[mkl]
#Vversion=composer_xe_2011_sp1.7.256
#Vversion=composer_xe_2011_sp1.8.273
#Vversion=composer_xe_2011_sp1.9.293
#Vversion=composer_xe_2011_sp1.10.319
#Vversion=composer_xe_2011_sp1.11.339
#Vversion=composer_xe_2013.1.117
Vversion=composer_xe_2013.3.163

library_dirs =
 /opt/intel/%(Vversion)s/mkl/lib/intel64:/opt/intel/%(Vversion)s/compiler/lib/intel64
include_dirs =
 /opt/intel/%(Vversion)s/mkl/include:/opt/intel/%(Vversion)s/mkl/include/intel64/lp64
lapack_libs =  mkl_blas95_lp64, mkl_lapack95_lp64
mkl_libs =   mkl_rt

in numpy/distutils/intelccompiler.py:



class IntelCCompiler(UnixCCompiler):
    """ A modified Intel compiler compatible with an gcc built Python."""
    compiler_type = 'intel'
    cc_exe = 'icc'
    cc_args = 'fPIC'

    def __init__ (self, verbose=0, dry_run=0, force=0):
        UnixCCompiler.__init__ (self, verbose,dry_run, force)
        self.cc_exe = 'icc -fPIC'
        compiler = self.cc_exe
        self.set_executables(compiler=compiler,
                             compiler_so=compiler,
                             compiler_cxx=compiler,
                             linker_exe=compiler,
                             linker_so=compiler + ' -shared')

class IntelItaniumCCompiler(IntelCCompiler):
    compiler_type = 'intele'

    # On Itanium, the Intel Compiler used to be called ecc, let's search for
    # it (now it's also icc, so ecc is last in the search).
    for cc_exe in map(find_executable,['icc','ecc']):
        if cc_exe:
            break

class IntelEM64TCCompiler(UnixCCompiler):
    """ A modified Intel x86_64 compiler compatible with a 64bit gcc built
Python.
    """
    Vversion='composer_xe_2011_sp1.9.293'
    Vversion='composer_xe_2011_sp1.10.319'
    Vversion='composer_xe_2011_sp1.11.339'
    Vversion='composer_xe_2013.1.117'
    Vversion='composer_xe_2013.3.163'
    LDir='-L/opt/intel/'+Vversion+'/mkl/lib/intel64
'+'-L/opt/intel/'+Vversion+'/compiler/lib/intel64 '
    IDir='-I/opt/intel/'+Vversion+'/mkl/include/intel64/lp64
'+'-I/opt/intel/'+Vversion+'/mkl/include '
    compiler_type = 'intelem'
    cc_exe = 'icc -m64 -O3 -g -fPIC -fp-model strict -fomit-frame-pointer
-openmp -xHost -lpthread '+IDir+LDir
    cc_args = '-m64 -O3 -g -fPIC -fp-model strict -fomit-frame-pointer
-openmp -xHost -lpthread '+IDir+LDir
    def __init__ (self, verbose=0, dry_run=0, force=0):
        UnixCCompiler.__init__ (self, verbose,dry_run, force)
        Vversion='composer_xe_2011_sp1.9.293'
        Vversion='composer_xe_2011_sp1.10.319'
        Vversion='composer_xe_2011_sp1.11.339'
        Vversion='composer_xe_2013.1.117'
        Vversion='composer_xe_2013.3.163'
        LDir='-L/opt/intel/'+Vversion+'/mkl/lib/intel64
'+'-L/opt/intel/'+Vversion+'/compiler/lib/intel64 '
        IDir='-I/opt/intel/'+Vversion+'/mkl/include/intel64/lp64
'+'-I/opt/intel/'+Vversion+'/mkl/include '
        self.cc_exe = 'icc -m64 -O3 -g -fPIC -fp-model strict
-fomit-frame-pointer -openmp -xHost -lpthread '+IDir+LDir
        compiler = self.cc_exe
        self.set_executables(compiler=compiler,
                             compiler_so=compiler,
                             compiler_cxx=compiler,
                             linker_exe=compiler,
                             linker_so=compiler + ' -shared')


and  in  numpy/distutils/fcompiler/intel.py:

    def get_flags_opt(self):
        return ['-xhost -m64 -openmp -fp-model strict']


My script to compile everything is:
python setup.py config --compiler=intelem --fcompiler=intelem config_fc
--fcompiler=intelem build_clib --compiler=intelem --fcompiler=intelem
build_ext --compiler=intelem --fcompiler=intelem install
--prefix=/opt/Python/Numpy-1.7.1-intel


I hope it helps

Xavier


2013/8/29 Will Buckner <wbuckner@beatsmusic.com>

>
> Thanks, but, I had already added them to ld.so.conf.d/ and ran ldconfig. I
> eventually got it to run without LD_RUN_PATH somehow by removing everything
> in build/ (had previously been running python setup.py clean) and finally
> got everything to work fairly sanely with:
>
> [mkl]
> library_dirs = /opt/intel/mkl/lib/intel64:/opt/intel/lib/intel64
> include_dirs = /opt/intel/mkl/include:/opt/intel/include
> mkl_libs =  mkl_def, mkl_intel_lp64, mkl_intel_thread, mkl_core, mkl_mc,
> iomp5
> lapack_libs =
>
> > Also, isn't libmkl_mc specific to the mic architecture? I don't think
> it's necessary to explicitly link against it. Instead, libiomp5, libimf and
> libirc are libraries I often find are required.
>
> So I know nothing about the MKL stack, or BLAS for that matter. Intel docs
> say "Kernel library for processors based on the Intel(R) Core(TM)
> microarchitecture". My CPUs are "Intel(R) Xeon(R) CPU E7- 4860  @
> 2.27GHz". Also keep in mind, this is MKL 11 and a lot has changed since
> 9x, apparently, and it seems most everyone writing docs on MKL w/
> SciPy/NumPy is using older MKL. What I really want to figure out is how to
> get "mkl_rt" working properly.
>
> Should I have something in lapack_libs?
>
> Thanks!
>
> On Thu, Aug 22, 2013 at 3:40 PM, Alex Leach <beamesleach@gmail.com> wrote:
>
>> Looks to me like you need to update your system's ldconfig files. Without
>> an -rpath / -R linker flag, the lib. directories will need to be known by
>> the dynamic linker during run time, as well as during compile-time linking
>> (which appears to complete successfully).
>>
>> This is accomplished by creating a file in /etc/ldconfig.d/ and putting
>> each of Intel's lib directories on a separate line. Finally, run ldconfig
>> as root.
>>
>> Also, isn't libmkl_mc specific to the mic architecture? I don't think
>> it's necessary to explicitly link against it. Instead, libiomp5, libimf and
>> libirc are libraries I often find are required.
>>
>> KR, and good luck!
>> Alex
>>
>> _______________________________________________
>> SciPy-Dev mailing list
>> SciPy-Dev@scipy.org
>> http://mail.scipy.org/mailman/listinfo/scipy-dev
>>
>>
>
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-dev
>
>


-- 
 « Quand le gouvernement viole les droits du peuple, l'insurrection est,
pour le peuple et pour chaque portion du peuple, le plus sacré des droits
et le plus indispensable des devoirs »

Déclaration des droits de l'homme et du citoyen, article 35, 1793
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-dev/attachments/20130829/8c9919cd/attachment.html 


More information about the SciPy-Dev mailing list