qmlcode / qml

QML: Quantum Machine Learning
MIT License
199 stars 85 forks source link

Problem with installing QML on MAC #32

Closed yghadar closed 7 years ago

yghadar commented 7 years ago

I have Mac with Sierra OS. I have installed BLAS, LAPACK as well as ASE and gnu compilers from macport. When I try python setup.py install I get: resetting extension 'farad_kernels' language from '/opt/local/bin/gfortran-mp-7' to 'f77'. resetting extension 'fcho_solve' language from '/opt/local/bin/gfortran-mp-7' to 'f77'. resetting extension 'fdistance' language from '/opt/local/bin/gfortran-mp-7' to 'f77'. resetting extension 'fkernels' language from '/opt/local/bin/gfortran-mp-7' to 'f77'. resetting extension 'frepresentations' language from '/opt/local/bin/gfortran-mp-7' to 'f77'. customize Gnu95FCompiler Could not locate executable gfortran Could not locate executable f95 customize NAGFCompiler customize AbsoftFCompiler Could not locate executable f90 Could not locate executable f77 customize IBMFCompiler Could not locate executable xlf90 Could not locate executable xlf customize IntelFCompiler Could not locate executable ifort Could not locate executable ifc customize GnuFCompiler Could not locate executable g77 customize G95FCompiler Could not locate executable g95 customize PGroupFCompiler Could not locate executable pgfortran don't know how to compile Fortran code on platform 'posix' warning: build_ext: f77_compiler=None is not available.

building 'farad_kernels' extension error: extension 'farad_kernels' has Fortran sources but no Fortran compiler found bash-3.2$

I have give the full path in setup.py for FORTRAN = "/opt/local/bin/gfortran-mp-7"

Please let me know what I need to do to resolve the issue.

andersx commented 7 years ago

The FORTRAN variable should be "f90" and is used to tell setuptools the fortran version - you should NOT change this variable in setup.py.

andersx commented 7 years ago

You should not change anything in setup.py. Please follow the instructions here: http://www.qmlcode.org/installation.html

Feel free to open another issue if the instructions do not work.

yghadar commented 7 years ago

Hi Anders, I have use export path to provide the path with my working gfortran directory. I have also tried installing qml without chaninging anything in setup.py. It still can't find my gfortran. It would be good if instruction could be provided for Mac users.

Thank you,

Yasaman Ghadar, PhD Postdoctoral Scholar Argonne National Laboratory

Leadership Computing FacilityEmail: ghadar@anl.gov ghadar@anl.gov Phone: 630-252-1398 <630-252-1398>

On Wed, Aug 30, 2017 at 1:02 PM, Anders Steen Christensen < notifications@github.com> wrote:

The FORTRAN variable should be "f90" and is used to tell setuptools the fortran version - you should NOT change this variable in setup.py.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/qmlcode/qml/issues/32#issuecomment-326071411, or mute the thread https://github.com/notifications/unsubscribe-auth/AYjqF0bZEdjP_4rr4RA6rnA2oNKoZ-Ywks5sdaOZgaJpZM4PGKiu .

andersx commented 7 years ago

Ok, are you able to install qml via pip (simply "pip install qml")? Or does that yield the same error?

yghadar commented 7 years ago

On Mac that results to the same error.

Yasaman Ghadar, PhD Postdoctoral Scholar Argonne National Laboratory

Leadership Computing FacilityEmail: ghadar@anl.gov ghadar@anl.gov Phone: 630-252-1398 <630-252-1398>

On Wed, Aug 30, 2017 at 2:18 PM, Anders Steen Christensen < notifications@github.com> wrote:

Ok, are you able to install qml via pip (simply "pip install qml")? Or does that yield the same error?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/qmlcode/qml/issues/32#issuecomment-326091700, or mute the thread https://github.com/notifications/unsubscribe-auth/AYjqFymvRUToBsdmMygXede-P3JwbPq0ks5sdbV0gaJpZM4PGKiu .

andersx commented 7 years ago

Could you post the output from the following command:

pip install git+https://github.com/qmlcode/qml@develop --user -U

yghadar commented 7 years ago

Please see the following: Thanks

pip install git+https://github.com/qmlcode/qml@develop --user -U

Collecting git+https://github.com/qmlcode/qml@develop

Cloning https://github.com/qmlcode/qml (to develop) to /private/var/folders/d2/n_zzmk5561927yl3r7w5zwkm0000gq/T/pip-GoZ2Nj-build

Installing collected packages: qml

Running setup.py install for qml ... error

Complete output from command /Users/yghadar/miniconda2/bin/python -u -c

"import setuptools, tokenize;file='/private/var/folders/d2/n_zzmk5561927yl3r7w5zwkm0000gq/T/pip-GoZ2Nj-build/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /var/folders/d2/n_zzmk5561927yl3r7w5zwkm0000gq/T/pip-Q1tsFy-record/install-record.txt --single-version-externally-managed --compile --user --prefix=:

MKL-discover: MKLROOT was not set

running install

running build

running config_cc

unifing config_cc, config, build_clib, build_ext, build commands

--compiler options

running config_fc

unifing config_fc, config, build_clib, build_ext, build commands

--fcompiler options

running build_src

build_src

building extension "farad_kernels" sources

f2py options: ['--quiet']

  adding

'build/src.macosx-10.7-x86_64-2.7/build/src.macosx-10.7-x86_64-2.7/fortranobject.c' to sources.

  adding

'build/src.macosx-10.7-x86_64-2.7/build/src.macosx-10.7-x86_64-2.7' to include_dirs.

  adding

'build/src.macosx-10.7-x86_64-2.7/farad_kernels-f2pywrappers.f' to sources.

  adding

'build/src.macosx-10.7-x86_64-2.7/farad_kernels-f2pywrappers2.f90' to sources.

building extension "fcho_solve" sources

f2py options: ['--quiet']

  adding

'build/src.macosx-10.7-x86_64-2.7/build/src.macosx-10.7-x86_64-2.7/fortranobject.c' to sources.

  adding

'build/src.macosx-10.7-x86_64-2.7/build/src.macosx-10.7-x86_64-2.7' to include_dirs.

  adding 'build/src.macosx-10.7-x86_64-2.7/fcho_solve-f2pywrappers.f'

to sources.

building extension "fdistance" sources

f2py options: ['--quiet']

  adding

'build/src.macosx-10.7-x86_64-2.7/build/src.macosx-10.7-x86_64-2.7/fortranobject.c' to sources.

  adding

'build/src.macosx-10.7-x86_64-2.7/build/src.macosx-10.7-x86_64-2.7' to include_dirs.

  adding 'build/src.macosx-10.7-x86_64-2.7/fdistance-f2pywrappers.f' to

sources.

building extension "fkernels" sources

f2py options: ['--quiet']

  adding

'build/src.macosx-10.7-x86_64-2.7/build/src.macosx-10.7-x86_64-2.7/fortranobject.c' to sources.

  adding

'build/src.macosx-10.7-x86_64-2.7/build/src.macosx-10.7-x86_64-2.7' to include_dirs.

  adding 'build/src.macosx-10.7-x86_64-2.7/fkernels-f2pywrappers.f' to

sources.

building extension "fslatm" sources

f2py options: ['--quiet']

  adding

'build/src.macosx-10.7-x86_64-2.7/build/src.macosx-10.7-x86_64-2.7/fortranobject.c' to sources.

  adding

'build/src.macosx-10.7-x86_64-2.7/build/src.macosx-10.7-x86_64-2.7' to include_dirs.

  adding 'build/src.macosx-10.7-x86_64-2.7/fslatm-f2pywrappers.f' to

sources.

  adding 'build/src.macosx-10.7-x86_64-2.7/fslatm-f2pywrappers2.f90' to

sources.

building extension "frepresentations" sources

f2py options: ['--quiet']

  adding

'build/src.macosx-10.7-x86_64-2.7/build/src.macosx-10.7-x86_64-2.7/fortranobject.c' to sources.

  adding

'build/src.macosx-10.7-x86_64-2.7/build/src.macosx-10.7-x86_64-2.7' to include_dirs.

  adding

'build/src.macosx-10.7-x86_64-2.7/frepresentations-f2pywrappers.f' to sources.

  adding

'build/src.macosx-10.7-x86_64-2.7/frepresentations-f2pywrappers2.f90' to sources.

build_src: building npy-pkg config files

running build_py

creating build/lib.macosx-10.7-x86_64-2.7

creating build/lib.macosx-10.7-x86_64-2.7/qml

copying qml/__init__.py -> build/lib.macosx-10.7-x86_64-2.7/qml

copying qml/arad.py -> build/lib.macosx-10.7-x86_64-2.7/qml

copying qml/compound.py -> build/lib.macosx-10.7-x86_64-2.7/qml

copying qml/data.py -> build/lib.macosx-10.7-x86_64-2.7/qml

copying qml/distance.py -> build/lib.macosx-10.7-x86_64-2.7/qml

copying qml/kernels.py -> build/lib.macosx-10.7-x86_64-2.7/qml

copying qml/math.py -> build/lib.macosx-10.7-x86_64-2.7/qml

copying qml/representations.py -> build/lib.macosx-10.7-x86_64-2.7/qml

copying qml/slatm.py -> build/lib.macosx-10.7-x86_64-2.7/qml

copying qml/wrappers.py -> build/lib.macosx-10.7-x86_64-2.7/qml

running build_ext

customize UnixCCompiler

customize UnixCCompiler using build_ext

customize Gnu95FCompiler

Could not locate executable gfortran

Could not locate executable f95

customize NAGFCompiler

customize AbsoftFCompiler

Could not locate executable f90

Could not locate executable f77

customize IBMFCompiler

Could not locate executable xlf90

Could not locate executable xlf

customize IntelFCompiler

Could not locate executable ifort

Could not locate executable ifc

customize GnuFCompiler

Could not locate executable g77

customize G95FCompiler

Could not locate executable g95

customize PGroupFCompiler

Could not locate executable pgfortran

don't know how to compile Fortran code on platform 'posix'

warning: build_ext: f77_compiler=None is not available.

warning: build_ext: f90_compiler=None is not available.

building 'farad_kernels' extension

error: extension 'farad_kernels' has Fortran sources but no Fortran

compiler found

----------------------------------------

Command "/Users/yghadar/miniconda2/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/d2/n_zzmk5561927yl3r7w5zwkm0000gq/T/pip-GoZ2Nj-build/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /var/folders/d2/n_zzmk5561927yl3r7w5zwkm0000gq/T/pip-Q1tsFy-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /private/var/folders/d2/n_zzmk5561927yl3r7w5zwkm0000gq/T/pip-GoZ2Nj-build/

Yasaman Ghadar, PhD Postdoctoral Scholar Argonne National Laboratory

Leadership Computing FacilityEmail: ghadar@anl.gov ghadar@anl.gov Phone: 630-252-1398 <630-252-1398>

On Wed, Aug 30, 2017 at 2:26 PM, Anders Steen Christensen < notifications@github.com> wrote:

Could you post the output from the following command:

pip install git+https://github.com/qmlcode/qml@develop --user -U

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/qmlcode/qml/issues/32#issuecomment-326093856, or mute the thread https://github.com/notifications/unsubscribe-auth/AYjqF60XUDE44uLTWoqXXdTpY0iCEamwks5sdbd6gaJpZM4PGKiu .

andersx commented 7 years ago

Looks like a problem with your f compiler - what happens if you write: which gfortran

Also try updating your gcc:

# Update brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

# Install GCC
brew install gcc
yghadar commented 7 years ago

Hi, I have installed gfortran from macports, I have also export path in my bashrc file but that does not seem to help.

work:~ yghadar$ which gfortran

work:~ yghadar$ which gfortran-mp-6

/opt/local/bin/gfortran-mp-6

Yasaman Ghadar, PhD Postdoctoral Scholar Argonne National Laboratory

Leadership Computing FacilityEmail: ghadar@anl.gov ghadar@anl.gov Phone: 630-252-1398 <630-252-1398>

On Thu, Aug 31, 2017 at 3:28 AM, Anders Steen Christensen < notifications@github.com> wrote:

Looks like a problem with your f compiler - what happens if you write: which fortran

Also try updating your gcc:

Update brew

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install GCC

brew install gcc

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/qmlcode/qml/issues/32#issuecomment-326227261, or mute the thread https://github.com/notifications/unsubscribe-auth/AYjqF27Z82ElxoKrDoAPFHw9wX0ysB9vks5sdm6igaJpZM4PGKiu .

andersx commented 7 years ago

I think I understand the root of your problem now. This seems to be a limitations in python's setuptools, that it only looks for execuatbles named gfortran, but it should be possible to install a package regardless.

Can you run the following command: python setup.py build --help-fcompiler

This should give you a list of all f-compilers can find. I assume the list will be empty.

yghadar commented 7 years ago

Yes, you are right. Here is the output generated from python setup.py build --help-fcompiler

$ python setup.py build --help-fcompiler

Fortran compilers found:

Compilers available for this platform, but not found:

--fcompiler=absoft Absoft Corp Fortran Compiler

--fcompiler=g95 G95 Fortran Compiler

--fcompiler=gnu GNU Fortran 77 compiler

--fcompiler=gnu95 GNU Fortran 95 compiler

--fcompiler=ibm IBM XL Fortran Compiler

--fcompiler=intel Intel Fortran Compiler for 32-bit apps

--fcompiler=nag NAGWare Fortran 95 Compiler

--fcompiler=pg Portland Group Fortran Compiler

Compilers not available on this platform:

--fcompiler=compaq Compaq Fortran Compiler

--fcompiler=hpux HP Fortran 90 Compiler

--fcompiler=intele Intel Fortran Compiler for Itanium apps

--fcompiler=intelem Intel Fortran Compiler for 64-bit apps

--fcompiler=intelev Intel Visual Fortran Compiler for Itanium apps

--fcompiler=intelv Intel Visual Fortran Compiler for 32-bit apps

--fcompiler=intelvem Intel Visual Fortran Compiler for 64-bit apps

--fcompiler=lahey Lahey/Fujitsu Fortran 95 Compiler

--fcompiler=mips MIPSpro Fortran Compiler

--fcompiler=none Fake Fortran compiler

--fcompiler=pathf95 PathScale Fortran Compiler

--fcompiler=sun Sun or Forte Fortran 95 Compiler

--fcompiler=vast Pacific-Sierra Research Fortran 90 Compiler

For compiler details, run 'config_fc --verbose' setup command.

Yasaman Ghadar, PhD Postdoctoral Scholar Argonne National Laboratory

Leadership Computing FacilityEmail: ghadar@anl.gov ghadar@anl.gov Phone: 630-252-1398 <630-252-1398>

On Thu, Aug 31, 2017 at 10:13 AM, Anders Steen Christensen < notifications@github.com> wrote:

I think I understand the root of your problem now. This seems to be a limitations in python's setuptools, that it only looks for execuatbles named gfortran, but it should be possible to install a package regardless.

Can you run the following command: python setup.py build --help-fcompiler

This should give you a list of all f-compilers can find. I assume the list will be empty.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/qmlcode/qml/issues/32#issuecomment-326327065, or mute the thread https://github.com/notifications/unsubscribe-auth/AYjqF1USXGhGX8FI8JmZSRwzY68DlkQjks5sds2LgaJpZM4PGKiu .

andersx commented 7 years ago

Looks like you need to set up a symlink to gcc and gfortran, there are instructions here: https://stackoverflow.com/questions/8361002/how-to-use-the-gcc-installed-in-macports/8372496#8372496

Once you setup the symlinks, I think setup.py should be able to find the right gfortran. Let me know how it goes!

yghadar commented 7 years ago

Hi, So it looks working but it is not here is the output of python install setup.py ( last lines)

byte-compiling /Users/yghadar/miniconda2/lib/python2.7/site-packages/qml/init.py to init.pyc

byte-compiling /Users/yghadar/miniconda2/lib/python2.7/site-packages/qml/arad.py to arad.pyc

byte-compiling /Users/yghadar/miniconda2/lib/python2.7/site-packages/qml/compound.py to compound.pyc

byte-compiling /Users/yghadar/miniconda2/lib/python2.7/site-packages/qml/data.py to data.pyc

byte-compiling /Users/yghadar/miniconda2/lib/python2.7/site-packages/qml/distance.py to distance.pyc

byte-compiling /Users/yghadar/miniconda2/lib/python2.7/site-packages/qml/kernels.py to kernels.pyc

byte-compiling /Users/yghadar/miniconda2/lib/python2.7/site-packages/qml/math.py to math.pyc

byte-compiling /Users/yghadar/miniconda2/lib/python2.7/site-packages/qml/representations.py to representations.pyc

byte-compiling /Users/yghadar/miniconda2/lib/python2.7/site-packages/qml/slatm.py to slatm.pyc

byte-compiling /Users/yghadar/miniconda2/lib/python2.7/site-packages/qml/wrappers.py to wrappers.pyc

running install_egg_info

Writing /Users/yghadar/miniconda2/lib/python2.7/site-packages/qml-0.3.1-py2.7.egg-info

running install_clib

customize UnixCCompiler

Here is the output of:

import qml

Traceback (most recent call last):

File "", line 1, in

File "qml/init.py", line 37, in

from .compound import Compound

File "qml/compound.py", line 30, in

from .representations import generate_coulomb_matrix

File "qml/representations.py", line 28, in

from .frepresentations import fgenerate_coulomb_matrix

ImportError: No module named frepresentations

Yasaman Ghadar, PhD Postdoctoral Scholar Argonne National Laboratory

Leadership Computing FacilityEmail: ghadar@anl.gov ghadar@anl.gov Phone: 630-252-1398 <630-252-1398>

On Thu, Aug 31, 2017 at 10:25 AM, Anders Steen Christensen < notifications@github.com> wrote:

Looks like you need to set up a symlink to gcc and gfortran, there are instructions here: https://stackoverflow.com/questions/8361002/how-to-use- the-gcc-installed-in-macports/8372496#8372496

Once you setup the symlinks, I think setup.py should be able to find the right gfortran. Let me know how it goes!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/qmlcode/qml/issues/32#issuecomment-326330715, or mute the thread https://github.com/notifications/unsubscribe-auth/AYjqFx-oGtj9NAJ1trvLq63Extmatl36ks5sdtBVgaJpZM4PGKiu .

andersx commented 7 years ago

Based on

File "qml/__init__.py", line 37, in <module>

it looks like you were probably in the source folder, which you cloned from github. In this case the qml/ folder only contains the source (it is not where setup.py places the compiled code), but this is the folder that python searches first.

Can you try from another folder?

yghadar commented 7 years ago

I removed the qml folder

ls

Miniconda2-latest-MacOSX-x86_64.sh conda lammps-16Feb16 lammps-31Mar17 packmol

then I run this command: pip install git+ https://github.com/qmlcode/qml@develop --user -U

This is what I get:

error: Command "gcc -fno-strict-aliasing -I/Users/yghadar/miniconda2/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Ibuild/src.macosx-10.7-x86_64-2.7/build/src.macosx-10.7-x86_64-2.7 -I/Users/yghadar/miniconda2/lib/python2.7/site-packages/numpy/core/include -I/Users/yghadar/miniconda2/include/python2.7 -c build/src.macosx-10.7-x86_64-2.7/farad_kernelsmodule.c -o build/temp.macosx-10.7-x86_64-2.7/build/src.macosx-10.7-x86_64-2.7/farad_kernelsmodule.o -MMD -MF build/temp.macosx-10.7-x86_64-2.7/build/src.macosx-10.7-x86_64-2.7/farad_kernelsmodule.o.d -O3 -m64 -march=native -fPIC" failed with exit status 1

----------------------------------------

Command "/Users/yghadar/miniconda2/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/d2/n_zzmk5561927yl3r7w5zwkm0000gq/T/pip-rCYaDb-build/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /var/folders/d2/n_zzmk5561927yl3r7w5zwkm0000gq/T/pip-qWGJyX-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /private/var/folders/d2/n_zzmk5561927yl3r7w5zwkm0000gq/T/pip-rCYaDb-build/

Yasaman Ghadar, PhD Postdoctoral Scholar Argonne National Laboratory

Leadership Computing FacilityEmail: ghadar@anl.gov ghadar@anl.gov Phone: 630-252-1398 <630-252-1398>

On Thu, Aug 31, 2017 at 11:52 AM, Anders Steen Christensen < notifications@github.com> wrote:

Based on

File "qml/init.py", line 37, in

it looks like you were probably in the source folder, which you cloned from github. In this case the qml/ folder only contains the source (it is not where setup.py places the compiled code), but this is the folder that python searches first.

Can you try from another folder?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/qmlcode/qml/issues/32#issuecomment-326356850, or mute the thread https://github.com/notifications/unsubscribe-auth/AYjqF2UoMn_5jNJ9af_V035p7QuFUeVsks5sduThgaJpZM4PGKiu .

andersx commented 7 years ago

Difficult to say what your problem is here. But it looks like a problem with your environments. Really difficult to say from my end - you could try installing gcc from homebrew maybe.