9494
9595 # Decide whether to use distutils or meson backend
9696 npMaj ,npMin ,npPatch = np .__version__ .split ('.' )
97- npVersion = float (npMaj + '.' + npMin )
9897
9998 def buildLib (fileName ,libName ):
10099 t2 = os .stat ('fortranLib/' + fileName ).st_mtime
@@ -104,23 +103,23 @@ def buildLib(fileName,libName):
104103 else : # in case the file does not exist t2 is set to t1
105104 t1 = t2
106105 if len (sos ) < 1 or t2 > t1 :
107- print ("Please wait: building %s..." % libName )
108- if npVersion < 1.26 :
106+
107+ if int (npMin ) <= 26 :
108+ print ("Please wait: building %s using distutils..." % libName )
109109 return_code = sp .call (['{}' .format (f2pycmd ),
110110 '--fcompiler={}' .format (fcompiler ),
111- '--compiler={}' .format (ccompiler ),
112111 '--opt={}' .format (f90options ),
113112 '-c' , '-m' ,
114113 '%s' % libName ,
115- 'fortranLib/%s' % fileName ,
116- "--backend" , "distutils" ], stderr = sp .PIPE , stdout = sp .PIPE )
114+ 'fortranLib/%s' % fileName ], stderr = sp .PIPE , stdout = sp .PIPE )
117115 else :
118116 try :
119117 import ninja
120118 except ImportError :
121119 print ("Building libraries with meson backend requires ninja to be installed" )
122120 print ('Please install it using "pip install ninja"' )
123121
122+ print ("Please wait: building %s using meson..." % libName )
124123 my_env = os .environ .copy ()
125124 my_env ["FFLAGS" ]= f90options
126125 return_code = sp .call (['{}' .format (f2pycmd ),
0 commit comments