connorourke / crystal_torture

crystal_torture: A crystal structure analysis code, allowing site tortuosity to be calculated.
MIT License
7 stars 2 forks source link

Possible fix for compilation errors #2

Closed bjmorgan closed 5 years ago

bjmorgan commented 5 years ago

Installing with pip was giving the following error:

 compiling Fortran 90 module sources
    Fortran f77 compiler: /usr/bin/gfortran -Wall -g -ffixed-form -fno-second-underscore -fPIC -O3 -funroll-loops
    Fortran f90 compiler: /usr/bin/gfortran -Wall -g -fno-second-underscore -fPIC -O3 -funroll-loops
    Fortran fix compiler: /usr/bin/gfortran -Wall -g -ffixed-form -fno-second-underscore -Wall -g -fno-second-underscore -fPIC -O3 -funroll-loops
    creating build/temp.linux-x86_64-3.6/crystal_torture
    compile options: '-I/home/bjm42/.pyenv/versions/3.6.7/envs/crystal_torture/lib/python3.6/site-packages/numpy/core/include -c'
    extra options: '-Jbuild/temp.linux-x86_64-3.6 -Ibuild/temp.linux-x86_64-3.6'
    extra f90 options: '-fopenmp -lgomp -O3'
    gfortran:f90: ./crystal_torture/tort.f90
    gfortran: error: unrecognized command line option ‘-fopenmp -lgomp -O3’
    error: Command "/usr/bin/gfortran -Wall -g -fno-second-underscore -fPIC -O3 -funroll-loops -I/home/bjm42/.pyenv/versions/3.6.7/envs/crystal_torture/lib/python3.6/site-packages/numpy/core/include -c -c ./crystal_torture/tort.f90 -o build/temp.linux-x86_64-3.6/crystal_torture/tort.o -Jbuild/temp.linux-x86_64-3.6 -Ibuild/temp.linux-x86_64-3.6 -fopenmp -lgomp -O3" failed with exit status 1

This appears to be fixed by passing fortran compiler options as a list, rather than a single string, i.e.

[‘-fopenmp -lgomp -O3’]

becomes

['fopenmp', '-lgomp', '-O3']

check_f2py_compiler() now returns dict(list(str)) instead of dict(str), and these arguments are no longer wrapped in lists in setup_tort_ext().

This appears to fix the problem on:

coveralls commented 5 years ago

Pull Request Test Coverage Report for Build 112


Totals Coverage Status
Change from base Build 110: 0.0%
Covered Lines:
Relevant Lines: 0

💛 - Coveralls