Closed cheginit closed 5 years ago
I have not seen this problem before. Can you try just compiling the "C" files in the src/hspf13 directory without python from the command line?
The log says in it "error." Can you successful compile the four c files into objects? gcc -c *.c?
I don't think you need to specify the compiler flags on linux. It should be pretty straightforward...python3 setup.py build then sudo python3 setup.py install. The other instructions are for windows. If this works for you, I will try to update the readme to clarify.
I tried it without the compiler flag as you mentioned but gives the following error:
....
No module named 'numpy.distutils.cygwinccompiler' in numpy.distutils; trying from distutils
....
I attached the log. I think use of this module is hardcoded so it cannot use a compiler based on the OS. noflag.log
I was looking at the setup.py and have a minor suggestion, line 145:
files = ['hspf13/{}'.format(f)
for f in os.listdir('hspf13')
if f[-1] == 'c' or f[-1] == 'f']
can be replaced by:
files = glob.glob('hspf13/*.[c,f]')
I just saw your gcc comment. Yes, I can successfully compile with gcc -c *.c
without any error.
Try:
python3 setup.py config --compiler=unix build --compiler=unix
It seems like to work with default gcc and gfortran compiler.
Also, including install
should be fine:
python3 setup.py config --compiler=unix build --compiler=unix install
It worked. Thanks. Also, I had to add a user flag to avoid "permission denied":
$> python3 setup.py config --compiler=unix build --compiler=unix install --user
Great to hear. I am going to go ahead and close this issue then. Thank you Kong, and I hope you both are getting some value from this effort!
If anyone is still trying to install pyhspf in their linux systems, you need to delete config file and then build using command python3 setup.py build. After building install pyhspf by $python3 setup.py install$
I tried to compile the code on Ubuntu 18.04 with python3 but get the following error:
I installed the prerequisites using apt and am not using Anaconda.