hpparvi / PyTransit

Fast and easy exoplanet transit light curve modelling.
GNU General Public License v2.0
99 stars 23 forks source link

installation error on ubuntu and windows #30

Closed hippke closed 5 years ago

hippke commented 5 years ago

Cannot install PyTransit with Python3 pip using conda (fresh env). Tried Ubuntu 18.04 and Windows 10. The error is

   gfortran:f90: src/gimenez.f90
    src/gimenez.f90:35:2:

     #ifndef CHUNK_SIZE
      1
    Warning: Illegal preprocessor directive
    src/gimenez.f90:36:2:

     #define CHUNK_SIZE 128
      1
    Warning: Illegal preprocessor directive
    src/gimenez.f90:37:2:

     #endif
      1
    Warning: Illegal preprocessor directive
    src/gimenez.f90:271:33:

         real(8), dimension(CHUNK_SIZE, npol) :: d
                                     1
    Error: Symbol ‘chunk_size’ at (1) has no IMPLICIT type
    src/gimenez.f90:35:2:

     #ifndef CHUNK_SIZE
      1
    Warning: Illegal preprocessor directive
    src/gimenez.f90:36:2:

     #define CHUNK_SIZE 128
      1
    Warning: Illegal preprocessor directive
    src/gimenez.f90:37:2:

     #endif
      1
    Warning: Illegal preprocessor directive
    src/gimenez.f90:271:33:

         real(8), dimension(CHUNK_SIZE, npol) :: d
                                     1
    Error: Symbol ‘chunk_size’ at (1) has no IMPLICIT type
    error: Command "/usr/local/gcc-7.1/bin/gfortran -Wall -g -fno-second-underscore -fPIC -O3 -funroll-loops -DDCHUNK_SIZE=128 -Ibuild/src.linux-x86_64-3.7/build/src.linux-x86_64-3.7/pytransit -I/home/michael/miniconda3/envs/hpk_env/lib/python3.7/site-packages/numpy/core/include -I/home/michael/miniconda3/envs/hpk_env/include/python3.7m -c -c src/gimenez.f90 -o build/temp.linux-x86_64-3.7/src/gimenez.o -Jbuild/temp.linux-x86_64-3.7/pytransit -Ibuild/temp.linux-x86_64-3.7/pytransit" failed with exit status 1

    ----------------------------------------
hpparvi commented 5 years ago

Hi Michael,

Sorry, you'll need to manually include -cpp into f90flags when building PyTransit v1. I'm using

python setup.py config_fc --fcompiler=gnu95 --opt="-Ofast" --f90flags="-cpp -fopenmp -march=native" build
python setup.py install

with Linux and

python setup.py config_fc --fcompiler=gnu95 --opt="-Ofast" --f90flags="-cpp -fopenmp -march=native -mno-avx" build
python setup.py install

with Mac.

However, I'm preparing a new major version of PyTransit (v2) that gets rid of all the fortran code in favour of numba and OpenCL. The new version of the Gimenez model isn't working yet, but rest of the models should be ok.

Cheers, Hannu