3
ßL]ˆ  ã               @   s  d dl mZmZmZ d dlZd dlmZmZ d dlmZ d dl	m
Z
mZmZ ddgZG dd„ deƒZejdkrˆd dlZG dd„ deƒZnd dlmZ G dd„ deƒZedk�r d dlmZ ejdƒ d dlmZ dejkrîeedd�jƒ ƒ needd�jƒ ƒ dS )é    )ÚdivisionÚabsolute_importÚprint_functionN)Ú	FCompilerÚdummy_fortran_file)Úplatform)ÚjoinÚdirnameÚnormpathÚPGroupFCompilerÚPGroupFlangCompilerc               @   sÆ   e Zd ZdZdZdZedkrRddgddgdd	dgddgd
gddgdgdœZdgZn.ddgdgdd	gdg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edkr²dd„ Zndd„ Zdd„ ZdS )r   ÚpgzPortland Group Fortran Compilerz1\s*pg(f77|f90|hpf|fortran) (?P<version>[\d.-]+).*Údarwinz<F77>z-VZ	pgfortranz-dynamiclibz-MfixedZlibtoolÚarz-crÚranlib)Úversion_cmdÚcompiler_f77Úcompiler_fixÚcompiler_f90Ú	linker_soÚarchiverr   Ú z-fpicz-module z-Ic             C   s   ddg}| j | S )Nz-Minform=informz-Mnosecond_underscore)Ú	pic_flags)ÚselfÚopt© r   ú?/tmp/pip-install-q_7g0qgj/Numpy/numpy/distutils/fcompiler/pg.pyÚ	get_flags-   s    zPGroupFCompiler.get_flagsc             C   s   dgS )Nz-fastr   )r   r   r   r   Úget_flags_opt1   s    zPGroupFCompiler.get_flags_optc             C   s   dgS )Nz-gr   )r   r   r   r   Úget_flags_debug4   s    zPGroupFCompiler.get_flags_debugc             C   s
   dddgS )Nz-dynamicz
-undefinedZdynamic_lookupr   )r   r   r   r   Úget_flags_linker_so8   s    z#PGroupFCompiler.get_flags_linker_soc             C   s   ddgS )Nz-sharedz-fpicr   )r   r   r   r   r    <   s    c             C   s   d| S )Nz-R%sr   )r   Údirr   r   r   Úruntime_library_dir_option?   s    z*PGroupFCompiler.runtime_library_dir_optionN)Ú__name__Ú
__module__Ú__qualname__Úcompiler_typeÚdescriptionÚversion_patternr   Úexecutablesr   Úmodule_dir_switchZmodule_include_switchr   r   r   r    r"   r   r   r   r   r      s:   


é   é   c               @   sœ   e Zd ZdZdZdZdZdgZddgdgdgdgdgedd	gdd
œZd	Z	dZ
dd„ Zejdd�dd„ ƒZdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ ZdS )r   Úflangz$Portland Group Fortran LLVM Compilerz/\s*(flang|clang) version (?P<version>[\d.-]+).*zlib.exez<F77>z	--versionNz/verbosez/OUT:)r   r   r   r   r   r   r   z-module c             C   s   t j| ƒ}|jdddgƒ |S )Nr-   ZflangrtiZompstub)r   Úget_librariesÚextend)r   r   r   r   r   r.   [   s    
z!PGroupFlangCompiler.get_librariesé€   )Úmaxsizec             C   s6   t j| ƒ}t| jd d ƒ}|jtt|ddƒƒƒ |S )z%List of compiler library directories.r   r   z..Úlib)r   Úget_library_dirsr	   r)   Úappendr
   r   )r   r   Z	flang_dirr   r   r   r3   `   s    
z$PGroupFlangCompiler.get_library_dirsc             C   s   g S )Nr   )r   r   r   r   r   i   s    zPGroupFlangCompiler.get_flagsc             C   s   g S )Nr   )r   r   r   r   Úget_flags_freel   s    z"PGroupFlangCompiler.get_flags_freec             C   s   dgS )Nz-gr   )r   r   r   r   r   o   s    z#PGroupFlangCompiler.get_flags_debugc             C   s   dgS )Nz-O3r   )r   r   r   r   r   r   s    z!PGroupFlangCompiler.get_flags_optc             C   s   g S )Nr   )r   r   r   r   Úget_flags_archu   s    z"PGroupFlangCompiler.get_flags_archc             C   s   t ‚d S )N)ÚNotImplementedError)r   r!   r   r   r   r"   x   s    z.PGroupFlangCompiler.runtime_library_dir_option)r#   r$   r%   r&   r'   r(   Zar_exeZpossible_executablesr)   Zlibrary_switchr*   r.   Ú	functoolsÚ	lru_cacher3   r   r5   r   r   r6   r"   r   r   r   r   r   F   s,   	)ÚCompilerNotFoundc               @   s   e Zd ZdZdZdd„ ZdS )r   r-   z$Portland Group Fortran LLVM Compilerc             C   s   t dƒ‚d S )Nz!Flang unsupported on Python < 3.5)r:   )r   r   r   r   Úget_versionƒ   s    zPGroupFlangCompiler.get_versionN)r#   r$   r%   r&   r'   r;   r   r   r   r   r      s   Ú__main__)Úlogé   )Úcustomized_fcompilerr-   )Úcompilerr   )r+   r,   )Ú
__future__r   r   r   ÚsysZnumpy.distutils.fcompilerr   r   r   Úos.pathr   r	   r
   Z	compilersr   Úversion_infor8   r   r:   r#   Ú	distutilsr=   Úset_verbosityZnumpy.distutilsr?   ÚargvÚprintr;   r   r   r   r   Ú<module>   s$   6
6


