coretran icon indicating copy to clipboard operation
coretran copied to clipboard

Build with gfortran 9.3

Open mdpiper opened this issue 3 years ago • 10 comments

With gfortran 9.3, building coretran fails on Linux and macOS.

Here's a sample traceback on macOS:

[ 50%] Building Fortran object CMakeFiles/coretran.dir/sorting/m_select.f90.o
[ 51%] Building Fortran object CMakeFiles/coretran.dir/maths/m_maths.f90.o
[ 52%] Building Fortran object CMakeFiles/coretran.dir/maths/sm_maths_d1D.f90.o
[ 54%] Building Fortran object CMakeFiles/coretran.dir/maths/sm_maths_i1D.f90.o
/Users/mpiper/projects/coretran/src/maths/sm_maths_i1D.f90:1:18:

    1 | submodule (m_maths) sm_maths_i1D
      |                  1
......
    4 | use m_allocate, only: allocate
      |                              2
Error: Symbol ‘allocate’ at (1) conflicts with the symbol at (2)
/Users/mpiper/projects/coretran/src/maths/sm_maths_i1D.f90:1:18:

    1 | submodule (m_maths) sm_maths_i1D
      |                  1
......
    5 | use m_deallocate, only: deallocate
      |                                  2
Error: Symbol ‘deallocate’ at (1) conflicts with the symbol at (2)
/Users/mpiper/projects/coretran/src/maths/sm_maths_i1D.f90:1:18:

    1 | submodule (m_maths) sm_maths_i1D
      |                  1
......
    6 | use m_errors, only:eMsg
      |                       2
Error: Symbol ‘emsg’ at (1) conflicts with the symbol at (2)
/Users/mpiper/projects/coretran/src/maths/sm_maths_i1D.f90:1:18:

    1 | submodule (m_maths) sm_maths_i1D
      |                  1
......
    7 | use m_sort, only: argsort
      |                         2
Error: Symbol ‘argsort’ at (1) conflicts with the symbol at (2)
/Users/mpiper/projects/coretran/src/maths/sm_maths_i1D.f90:1:18:

    1 | submodule (m_maths) sm_maths_i1D
      |                  1
......
    8 | use m_select, only: argSelect
      |                             2
Error: Symbol ‘argselect’ at (1) conflicts with the symbol at (2)
/Users/mpiper/projects/coretran/src/maths/sm_maths_i1D.f90:1:18:

    1 | submodule (m_maths) sm_maths_i1D
      |                  1
......
    9 | use m_array1D, only: arange
      |                           2
Error: Symbol ‘arange’ at (1) conflicts with the symbol at (2)

mdpiper avatar Oct 09 '20 20:10 mdpiper

I'm kinda booked up right now, so I haven't put any time into looking for a solution. I can try in the next few weeks, though.

For more info, see https://github.com/conda-forge/coretran-feedstock/pull/1.

mdpiper avatar Oct 09 '20 20:10 mdpiper

Okay thanks for the heads up, I’ll take a look at 9.3 and see what I can do

leonfoks avatar Oct 09 '20 22:10 leonfoks

I just compiled successfully on my Mac using gfortran 10. However I have cmake handle the flags etc. required on my Mac. Any chance you aren't using the same options at compile time?

e.g. these are the flags for me.

-Wl,-rpath,PATH-TO/coretran/lib PATH-TO/coretran/lib/libcoretran.dylib -std=f2008ts -cpp -ffree-line-length-none -fall-intrinsics -fno-underscoring -DNDEBUG -O3 -funroll-all-loops -finline-functions

leonfoks avatar Feb 08 '21 19:02 leonfoks

Actually I just ran into this....

Its because I re-import the deallocate and allocate functions.... So i just need to remove those from the submodules. Looks like gfortran 9+ has this limitation which is nice.

leonfoks avatar Feb 08 '21 19:02 leonfoks

Cool--thank you for looking into this, Leon.

If you do make these changes, would you consider incrementing the version on coretran (e.g., to 1.0.1)? The conda-forge bot will pick up on the new version and attempt to rebuild the package.

mdpiper avatar Feb 10 '21 16:02 mdpiper

No problem. I made the changes already and I’ll update the version number as soon as I can!

leonfoks avatar Feb 10 '21 17:02 leonfoks

Also! Once this is working again, could you please add some info to the readme about installation via conda? I have no idea whose really using coretran but it would be great if users had that flexibility!!

leonfoks avatar Feb 10 '21 17:02 leonfoks

Absolutely! I'd be happy to do so. I'll send you a PR.

mdpiper avatar Feb 10 '21 17:02 mdpiper

Okay, new release done, 1.0.1!

leonfoks avatar Feb 11 '21 03:02 leonfoks

Excellent! Thank you for doing this, Leon. The conda-forge bot successfully rebuilt coretran with gfortran 7 and 9.

(I still owe you a few sentences on installing coretran through conda.)

mdpiper avatar Feb 12 '21 21:02 mdpiper