HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.10/dist-packages/numpy/distutils/fcompiler/__pycache__/ibm.cpython-310.pyc
o

���g�
�@s�ddlZddlZddlZddlZddlmZddlmZddlm	Z	ddl
mZdgZGdd�de�Z
edkrMdd	lmZe�d
�eedd����dSdS)
�N)�	FCompiler)�find_executable)�make_temp_file)�log�IBMFCompilerc@sheZdZdZdZdZddgdgddgdgd	gd
dgdgd
�Zdd�Zdd�Zdd�Z	dd�Z
dd�ZdS)r�ibmzIBM XL Fortran Compilerzo(xlf\(1\)\s*|)IBM XL Fortran ((Advanced Edition |)Version |Enterprise Edition V|for AIX, V)(?P<version>[^\s*]*)z<F77>z	-qversion�xlf�xlf90z-qfixed�xlf95�arz-cr�ranlib)�version_cmd�compiler_f77�compiler_fix�compiler_f90�	linker_so�archiverrc
	stj|g|�Ri|��}|durNtj�d�rNtd�}td�}tj�|�rNtj�|�rNz
t	�
|ddg�}Wntt	jfy@Ynwt
�d|�}|rN|�d�}d�|durtj���rtt����}|���fd	d
�|D�}|rddlm}	|	|d�|_}|S)
N�aix�lslpprz-Lc�xlfcmpz xlfcmp:(?P<version>\d+([.]\d+)+)�versionz/etc/opt/ibmcmp/xlfc	s(g|]}tj�tj��|d��r|�qS)zxlf.cfg)�os�path�isfile�join)�.0�d��xlf_dir��H/usr/local/lib/python3.10/dist-packages/numpy/distutils/fcompiler/ibm.py�
<listcomp>5s(z,IBMFCompiler.get_version.<locals>.<listcomp>r)�LooseVersion)r�get_version�sys�platform�
startswithrrr�exists�
subprocess�check_output�OSError�CalledProcessError�re�search�group�isdir�sorted�listdir�reverse�distutils.versionr"r)
�self�args�kwdsrrr�o�m�lr"rrr r#s*�zIBMFCompiler.get_versioncC�dgS)Nz	-qextnamer�r4rrr �	get_flags;�zIBMFCompiler.get_flagscCr:)Nz-grr;rrr �get_flags_debug>r=zIBMFCompiler.get_flags_debugc
Cs�g}tjdkr
|�d�n|�d�|jddgd�}|durytj�d�r'd}nd	|}td
d�\}}t�d|�t|��)}t	�
d
�j}|D]}||�}	|	rY|�d|	�
d��qF|�|�qFWd�n1siwY|��|�d|�|S)N�darwinz/-Wl,-bundle,-flat_namespace,-undefined,suppressz-bsharedr�()�	ok_statusrz/etc/xlf.cfgz/etc/opt/ibmcmp/xlf/%s/xlf.cfgz_xlf.cfg)�suffixz	Creating z \s*crt\s*=\s*(?P<path>.*)/crt1.ozcrt = %s/bundle1.o
rz-F)r$r%�appendr#r&rr�info�openr,�compile�match�writer.�close)
r4�optr�xlf_cfg�fo�new_cfg�fi�
crt1_match�liner8rrr �get_flags_linker_soAs.


��z IBMFCompiler.get_flags_linker_socCr:)Nz-O3rr;rrr �
get_flags_opt[r=zIBMFCompiler.get_flags_optN)�__name__�
__module__�__qualname__�
compiler_type�description�version_pattern�executablesr#r<r>rQrRrrrr r
s"�
�__main__)�customized_fcompiler�r)�compiler)rr,r$r(�numpy.distutils.fcompilerr�numpy.distutils.exec_commandr�numpy.distutils.misc_utilr�	distutilsr�	compilersrrS�numpy.distutilsr[�
set_verbosity�printr#rrrr �<module>sQ
�