3
­?d]Í  ã               @   s   d dl mZmZmZ d dlZd dlmZ d dlmZm	Z	 ddddd	d
gZ
dd„ ZG dd„ deƒZG dd„ deƒZG dd„ deƒZG dd
„ d
eƒZG dd„ deƒZG dd„ deƒZG dd	„ d	eƒZedkrüd dlmZ ejdƒ d dlmZ eedd�jƒ ƒ dS )é    )ÚdivisionÚabsolute_importÚprint_functionN)Úsimple_version_match)Ú	FCompilerÚdummy_fortran_fileÚIntelFCompilerÚIntelVisualFCompilerÚIntelItaniumFCompilerÚIntelItaniumVisualFCompilerÚIntelEM64VisualFCompilerÚIntelEM64TFCompilerc             C   s   t d| f d�S )Nz"Intel.*?Fortran.*?(?:%s).*?Version)Ústart)r   )Útype© r   ú@/tmp/pip-build-op5p2y5_/numpy/numpy/distutils/fcompiler/intel.pyÚintel_version_match   s    r   c               @   s   e Zd Zdd„ Zdd„ ZdS )ÚBaseIntelFCompilerc             C   s*   t ƒ }dddd|d d|d g| jd< d S )	Nz<F77>z-FIz-Vz-cz.fz-oz.oÚversion_cmd)r   Úexecutables)ÚselfÚfr   r   r   Úupdate_executables   s    z%BaseIntelFCompiler.update_executablesc             C   s   d|kst ‚d| S )Nú,z-Wl,-rpath=%s)ÚAssertionError)r   Údirr   r   r   Úruntime_library_dir_option   s    z-BaseIntelFCompiler.runtime_library_dir_optionN)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r   r      s   r   c               @   sŠ   e Zd ZdZdZdZedƒZddgZddddd	gdgdd
gddgddgdgdœZ	dgZ
dZdZdd„ Zdd„ Zdd„ Zdd„ Zdd„ ZdS )r   ÚintelÚifortz&Intel Fortran Compiler for 32-bit appsz32-bit|IA-32ZifcNz-72z-w90z-w95z-FIz<F90>z-sharedÚarz-crÚranlib)r   Úcompiler_f77Úcompiler_f90Úcompiler_fixÚ	linker_soÚarchiverr#   z-fPICz-module z-Ic             C   s   dgS )Nz-FRr   )r   r   r   r   Úget_flags_free7   s    zIntelFCompiler.get_flags_freec             C   s   dgS )Nz-fPICr   )r   r   r   r   Ú	get_flags:   s    zIntelFCompiler.get_flagsc             C   s(   | j ƒ }|r|dk rdnd}dj|ƒgS )NÚ15ÚopenmpÚqopenmpz-fp-model strict -O1 -{})Úget_versionÚformat)r   ÚvÚmpoptr   r   r   Úget_flags_opt=   s    zIntelFCompiler.get_flags_optc             C   s   g S )Nr   )r   r   r   r   Úget_flags_archB   s    zIntelFCompiler.get_flags_archc             C   sx   t j| ƒ}| jƒ }|r(|dkr(|jdƒ tjdkrty|jdƒ}|jdƒ W n tk
rb   d}Y nX ddg|||…< |S )Nz8.0z-nofor_mainÚdarwinz-sharedr   z-dynamiclibz-Wl,-undefined,dynamic_lookup)	r   Úget_flags_linker_sor.   ÚappendÚsysÚplatformÚindexÚremoveÚ
ValueError)r   Úoptr0   Úidxr   r   r   r5   E   s    




z"IntelFCompiler.get_flags_linker_so)r!   )r   r   r   Úcompiler_typeÚcompiler_aliasesÚdescriptionr   Úversion_matchÚpossible_executablesr   Z	pic_flagsÚmodule_dir_switchÚmodule_include_switchr)   r*   r2   r3   r5   r   r   r   r   r       s(   

c               @   sV   e Zd ZdZf ZdZedƒZdddgZdddd	d
gddgdgddgddgdgdœZ	dS )r
   Zintelez'Intel Fortran Compiler for Itanium appszItanium|IA-64r!   ÚefortÚefcNz-FIz-w90z-w95z<F90>z-sharedr"   z-crr#   )r   r$   r&   r%   r'   r(   r#   )
r   r   r   r>   r?   r@   r   rA   rB   r   r   r   r   r   r
   U   s   

c               @   sj   e Zd ZdZf ZdZedƒZdddgZdddgddgdgd	d
gddgdgdœZ	dd„ Z
dd„ Zdd„ ZdS )r   Zintelemz&Intel Fortran Compiler for 64-bit appsz)EM64T-based|Intel\(R\) 64|64|IA-64|64-bitr!   rE   rF   Nz-FIz<F90>z-sharedr"   z-crr#   )r   r$   r&   r%   r'   r(   r#   c             C   s   dgS )Nz-fPICr   )r   r   r   r   r*   |   s    zIntelEM64TFCompiler.get_flagsc             C   s(   | j ƒ }|r|dk rdnd}dj|ƒgS )Nr+   r,   r-   z-fp-model strict -O1 -{})r.   r/   )r   r0   r1   r   r   r   r2      s    z!IntelEM64TFCompiler.get_flags_optc             C   s   dgS )NÚ r   )r   r   r   r   r3   „   s    z"IntelEM64TFCompiler.get_flags_arch)r   r   r   r>   r?   r@   r   rA   rB   r   r*   r2   r3   r   r   r   r   r   i   s   

c               @   s–   e Zd ZdZdZedƒZdd„ ZdZddgZ	d	d	gd	gd	gd	ged
dgd	dœZ
dZdZdZdZdZdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zd	S )r	   Zintelvz-Intel Visual Fortran Compiler for 32-bit appsz32-bit|IA-32c             C   s(   t ƒ }ddd|d d|d g| jd< d S )Nz<F77>z/FIz/cz.fz/oz.or   )r   r   )r   r   r   r   r   r   �   s    z'IntelVisualFCompiler.update_executableszlib.exer!   ZiflNz/verbosez/OUT:)r   r$   r&   r%   r'   r(   r#   z/c z/Foz/module:z/Ic             C   s   dddddg}|S )Nz/nologoz/MDz/nbsz/names:lowercasez/assume:underscorer   )r   r<   r   r   r   r*   ¨   s    zIntelVisualFCompiler.get_flagsc             C   s   g S )Nr   )r   r   r   r   r)   ¬   s    z#IntelVisualFCompiler.get_flags_freec             C   s   ddgS )Nz/4Ybz/d2r   )r   r   r   r   Úget_flags_debug¯   s    z$IntelVisualFCompiler.get_flags_debugc             C   s   dgS )Nz/O1r   )r   r   r   r   r2   ²   s    z"IntelVisualFCompiler.get_flags_optc             C   s   ddgS )Nz
/arch:IA32z/QaxSSE3r   )r   r   r   r   r3   µ   s    z#IntelVisualFCompiler.get_flags_archc             C   s   t ‚d S )N)ÚNotImplementedError)r   r   r   r   r   r   ¸   s    z/IntelVisualFCompiler.runtime_library_dir_option)r   r   r   r>   r@   r   rA   r   Úar_exerB   r   Zcompile_switchZobject_switchZlibrary_switchrC   rD   r*   r)   rH   r2   r3   r   r   r   r   r   r	   ‹   s0   c               @   sX   e Zd ZdZdZedƒZdgZej	Z	dddddgddd	d
gdgddge	ddgddœZ
dS )r   Zintelevz.Intel Visual Fortran Compiler for Itanium appsZItaniumZeflNz-FIz-w90z-w95z-4L72z-wz<F90>z-sharedz/verbosez/OUT:)r   r$   r&   r%   r'   r(   r#   )r   r   r   r>   r@   r   rA   rB   r	   rJ   r   r   r   r   r   r   ¼   s   

c               @   s&   e Zd ZdZdZedd�Zdd„ ZdS )r   Zintelvemz-Intel Visual Fortran Compiler for 64-bit appszIntel\(R\).*?64,)r   c             C   s   dgS )NrG   r   )r   r   r   r   r3   Ö   s    z'IntelEM64VisualFCompiler.get_flags_archN)r   r   r   r>   r@   r   rA   r3   r   r   r   r   r   Ð   s   
Ú__main__)Úlogé   )Úcustomized_fcompilerr    )Úcompiler)Ú
__future__r   r   r   r7   Znumpy.distutils.ccompilerr   Znumpy.distutils.fcompilerr   r   Z	compilersr   r   r   r
   r   r	   r   r   r   Ú	distutilsrL   Úset_verbosityZnumpy.distutilsrN   Úprintr.   r   r   r   r   Ú<module>   s&   5"1

