space-physics / iri2016

International Reference Ionosphere 2016 from Python and Matlab
http://irimodel.org/
MIT License
67 stars 34 forks source link

build is running cmake at every time step #31

Open petermao opened 2 years ago

petermao commented 2 years ago

after e545b56fda15bf6f41d5d5418a61b11f8ec335cc, build is running cmake at every time step, slowing things down considerably, rather than only on the first running of iri2016.IRI(.)

I am seeing one iteration of this output at every time step:

-- Configuring done
-- Generating done
-- Build files have been written to: <path-to...>/lib/python/site-packages/iri2016-1.11.1-py3.7.egg/iri2016/build
Scanning dependencies of target iri2016
[ 63%] Built target iri2016
Scanning dependencies of target iri2016_driver
Scanning dependencies of target test_iri2016
[100%] Built target iri2016_driver
[100%] Built target test_iri2016

Should this line be reinstated? https://github.com/space-physics/iri2016/blob/ca66b2c79d2aaa0010678008e829e0750b234def/src/iri2016/build.py#L8

petermao commented 2 years ago

My solution above is not totally satisfactory, either. If I tweak iri2016_driver.f90 and do a pip install . --user from the top level of the iri2016 package, most of the code updates in the install location, but the old compiled iri2016_driver remains.

In order to run the new code, I run (in python)

import iri2016 as iri
iri.build.build()

and then everything is as expected.

Can the "build on run" logic be modified to rerun build if the compiled iri2016_driver is older than the source files?