Giter VIP home page Giter VIP logo

leonfoks / coretran Goto Github PK

View Code? Open in Web Editor NEW
96.0 9.0 12.0 5.04 MB

An easy to follow library to make Fortran easier in general with wrapped interfaces, sorting routines, kD-Trees, and other algorithms to handle scientific data and concepts. The library contains core fortran routines and object-oriented classes.

License: BSD 3-Clause "New" or "Revised" License

CMake 1.82% Fortran 97.40% C 0.77%
fortran fortran-routines sorting-algorithms kdtrees ford modern object-oriented scientific-computing

coretran's Introduction

Coretran

An easy to follow library to make Fortran easier in general with wrapped interfaces, sorting routines, kD-Trees, and other algorithms to handle scientific data and concepts. The library contains core fortran routines and object-oriented classes.

Why coretran?

I used Fortran extensively during my PhD to solve very large systems of equations with application to the inversion of geophysical data for 3D subsurface physical property models. I developed algorithms that utilized random point clouds in space, structured rectilinear, triangular, and voronoi meshes, and the unstructured versions of these. Fortran has relatively little modern and freely available source code, compared to other languages, which have easy to use libraries that perform these types of operations.

I struggled as a beginner coming in to Fortran because the basic functions that handle numbers were not readily available. It was frustrating that I had to write (and then duplicate) my own error checking when allocating memory or opening a file. What also frustrated me was when I had to write the same function/subroutine multiple times for different input types like integers or real numbers.

I wonder, how many people have written their own function as basic as computing a mean of some numbers?

This was initially the driving motivation for me to develop this library. The simple fact that Fortran does not have these basic functions readily available, and that any user starting from scratch would have to write their own. I humbly hope that this library will help to alleviate this issue, by providing functions/subroutines with complexities that range from the most basic to the more advanced, but all in pure Fortran. The effect is hopefully similar to a Python user who has immediate access to amazing packages such as numpy and scipy.

The code comes with a complete set of source code documentation that is easily generated into html pages. These docs also contain working examples on how to run each function and subroutine within the library. Also included in the docs are the references to papers or online material that I used.

This library is written using modern Fortran standards with modules, sub modules, and object oriented derived types.

The code can be compiled easily across platforms using CMake.

Compiler Support

Compiler Compiler Compiler Compiler Compiler Compiler


Main features | Documentation | Compiling | An example of coretran


Main features

All functions and subroutines are interfaces, they work no matter the input type whether it real, or integer etc. where it makes sense.

Getting Ready for Compiling and Creating the Documentation

There are three aspects that we need to address

  1. Installing a Fortran compiler to create the libraries
  2. Installing the software build tool that compiles the codes in the correct order, so you don't have to!
  3. Install Python and the software to generate the source code documentation locally (optional! You could just go here)

Installing the GNU fortran compiler

To compile my library, I have been using gfortran version 6.3.0 because of the use of submodules and other 2008 standards. I you want to use Intel's fortran compiler you will need ifort version 17+

* Linux

If you work in Linux you should be well versed in installing packages on your system. At the time of writing this I am running on Ubuntu 16.04 LTS.

* Mac

On a Mac, I use Brew to manage my libraries/programs. So type "brew install gcc" and you should be golden.

* Windows

Windows is a little trickier but it is still easy! The easiest way I have found is to use MinGW. There is a good tutorial on installing mingw here. I will summarize below.

Go to MinGW - Downloads, and click on "Mingw-builds" in the table to redirect to sourceforge. This will download the installer.

When you run the installer, choose the following

  • Version: 6.3.0 (minimum) you may choose higher
  • Architecture: x86_64
  • Threads: posix
  • Exception: sjlj
  • Build revision: The highest number

You should change the Destination Folder so that the path does not contain any spaces.

Add an environment variable called "MinGW_Home" and point it to the bin directory in your chosen destination folder. e.g. "C:\programs\mingw-w64\x86_64-6.3.0-posix-sjlj-rt_v5-rev1\mingw64\bin"

I don't require MSYS to build my library so you can stop here if you like. I do however suggest making an alias to the MinGW32-make executable, this is optional, so later in these instructions simply replace "make" with "mingw32-make" if you choose not to do this.

Go to the bin directory in your installation folder, on my system it is "C:\programs\mingw-w64\x86_64-6.3.0-posix-sjlj-rt_v5-rev1\mingw64\bin" and create a file called "make.bat"

Edit the file with a text editor and add the following single line "mingw32-make %*" This allows you to use the command "make" on windows which we will need later to build to library.

Compilation

The library can be compiled with any custom approach you choose, however to make life easier, I have included instructions on how to use cmake to generate makefiles. Cmake allows you to easily build the same source code on Windows, OSX, and Linux with no changes. I always found make files cumbersome on Windows so Cmake made my life very easy. The portability of Cmake to multiple architectures was the driving reason for me choosing it, plus Cmake can handle the newer, more modern, aspects of Fortran 2003, 2008+, and handles source code dependencies very well.

Installing Cmake

The installation of cmake should be quite easy. Similar to the section above on installing gfortran.

On a Mac, I simply use brew again.

On windows, you should be able to download the installation binary from their website.

Compiling the coretran library

To compile the coretran library, navigate to the root directory and create a new folder "build".

Change directory to build and type

cmake [-D options] [-G option] ../src

There are a number of extra options you can pass through to this cmake command. Each option follows a -D flag.

  • -D
    • -DCMAKE_BUILD_TYPE=

      • DEBUG will add all debugging flags, tracebacks, and array bound checking. This is great for development.
      • RELEASE will turn of the less efficient checks, and will compile with higher levels of optimization. This is great for production runs once everything is debugged.
    • -DCMAKE_Fortran_COMPILER=

      • If cmake does not use the compiler you need, you can specify the path to the compiler you want. I had some issues on OSX with the intel compiler and gfortran both installed. Using -G "Unix Makefiles" would always detect the intel compiler. To force cmake to use gfortran, I used -DCMAKE_Fortran_COMPILER=/usr/local/Cellar/gcc/6.2.0/bin/gfortran (Remember I used brew to install gfortran, and that the version number might change!)
      • Even if you type "which gfortran" and it shows the correct one, cmake may still detect a lower version system level gcc/gfortran. If you encounter build errors such as "unclassifiable statement", cmake is probably using too old a version of gfortran. In this case, explicitly specify the gfortran to use with this option.
    • -DBUILD_SHARED_LIBS=

      • ON this is the default option and will build shared libraries.
      • OFF this will build static libraries.
    • -DCMAKE_INSTALL_PREFIX=

      • This allows you to specify an install directory after you compile the library. e.g. -DCMAKE_INSTALL_PREFIX=/path/to/dir will put all compiled modules in an include folder, and compiled libraries in a lib folder. Additionally, the lib folder will contain a folder called "cmake" that contains a cmake config file for coretran. If you append the lib/cmake folder to an environment variable called "CMAKE_LIBRARY_PATH" you will be able to use "find_package(coretran REQUIRED CONFIG)" in your own cmake project to make linking to coretran very easy.

Cmake can generate makefiles for a multitude of different compilers. The -G option allows you to specify which compiler you wish to generate a makefile for.

  • -G

    If you type

     cmake -h
    

    You will see not only the man pages for cmake, but also a list of generators e.g.

     Generators
    
     The following generators are available on this platform:
     Unix Makefiles                  = Generates standard UNIX makefiles.
     Ninja                           = Generates build.ninja files.
     Xcode                           = Generate Xcode project files.
     CodeBlocks - Ninja              = Generates CodeBlocks project files.
     CodeBlocks - Unix Makefiles     = Generates CodeBlocks project files.
     CodeLite - Ninja                = Generates CodeLite project files.
     CodeLite - Unix Makefiles       = Generates CodeLite project files.
     Sublime Text 2 - Ninja          = Generates Sublime Text 2 project files.
     Sublime Text 2 - Unix Makefiles = Generates Sublime Text 2 project files.
     Kate - Ninja                    = Generates Kate project files.
     Kate - Unix Makefiles           = Generates Kate project files.
     Eclipse CDT4 - Ninja            = Generates Eclipse CDT 4.0 project files.
     Eclipse CDT4 - Unix Makefiles   = Generates Eclipse CDT 4.0 project files.
     KDevelop3                       = Generates KDevelop 3 project files.
     KDevelop3 - Unix Makefiles      = Generates KDevelop 3 project files.
    

    On Windows, you should also see a generator for "MinGW Makefiles"

    So choose which one you want.

    On OSX and Linux I have always used "Unix Makefiles".

    On Windows, I have used "MinGW Makefiles" or "NMake Makefile" for gfortran or intel respectively.

    So the -G option might be " -G "Unix Makefiles" "

Finally, to compile the library, type

make

or on Windows,

mingw32-make

if you did not follow this step.

If you want to "install" coretran to the directory specified using the -DCMAKE_INSTALL_PREFIX option (see above), type

make install

Testing Coretran and running the scaling code

The makefile will automatically generate two programs, a "unit tester" and a scalability test. These programs will be located in the bin folder within the coretran repository.

To run the test program type (assuming you are still in the build folder)

../bin/coretranTest N 1

where N is a number > 15. N defines the size of arrays to use in the tests. Over 1e8 your might have slow tests...

To run the scalability program type

../bin/coretranScale

This will perform some timing tests on the sorting algorithms, selection, KDtree generation, etc. This lets you get a feel for how quickly coretran will perform these algorithms. These algorithms are not the best in the world by any means, but hopefully they are readable and usable!

How to use coretran in your library or program

Once the coretran library is compiled, you can easily use it in your own program.

  • Using your own make files or compile.bat scripts

    When you compile your Fortran codes to object files, simply use -I/ path/to/coretran/include. When you link your objects, use -L/path/ to/coretran/lib and -lcoretran.

  • Using cmake to build your own project

    If you use cmake, and you used "make install" to install coretran, you can append the path "install-path/lib/cmake" to an environment variable called "CMAKE_LIBRARY_PATH". You can then use "find_package(coretran REQUIRED CONFIG)" to easily find coretran, followed by "target_link_libraries(${PROJECT_NAME} coretran)"

Documentation

Any good software library should come with documentation. In this library, I have extensive source code comments that you should be able to follow. The source code comments also contain snippets of code that show how to use the functions I have written. In addition to this, the source code comments can be used to automatically generate html pages. These pages are fully searchable and very nicely organized. This is where Ford comes in.

The html documentation for the source code be created locally using the ford Fortran Documentation Tool. If you don't want to create it locally you can simply see it here.

You can install Ford like any other Python module using "pip install ford".

Installing and Setting up Python

I have so far found the Anaconda Distribution of Python to be the most friendly cross platform distribution. Go ahead and install Anaconda on your system, if you are on Windows, allow the installer to modify your environment variables (so you don't have to later). Ford uses python version 3+ so be sure to get the correct installer.

Ford can also generate a dependency graph of the fortran modules by using Graphviz, you will need to install Graphviz separately.

  • Windows Graphviz Installation

    I downloaded the .msi files from the Graphviz website, I then had to add the following path to my environment variables "C:\Program Files (x86)\Graphviz2.38\bin" so that Ford can use the executable. (Locate the folder where you installed Graphviz, if it is different to my path, add that to your environment variables instead).

  • OSX Graphviz Installation

    To manage my programs I use Homebrew. To install Graphviz, I simply used "brew install Graphviz"

Generating the docs

Once Ford and perhaps Graphviz are installed, simply navigate to the root coretran folder in a terminal/command prompt and type "ford Docs.md". This will generate html pages under the docs folder.

Go to Top

An example of coretran

Here is a small example of how this library makes Fortran easier to use (especially for a beginner), and how it can clean up your code. While this example is not extensive it should give you an idea.

Fortran code to allocate an array, create some numbers, and compute their mean.

program theMean_test
use, intrinsic :: iso_fortran_env, only: real64, int32
implicit none
real(real64), allocatable :: a(:)
real(real64) :: theMean
! Some parameters to handle everything
integer(int32) :: i, istat, N
N=1000

! Allocate a and check for errors
allocate(a(N), stat=istat)
if (istat /= 0) then
  stop "Could not allocate a"
endif

! Create numbers from 1 to N
a = [(real(i,kind=real64), i=1,N)]

! Compute the mean
theMean = sum(a)/real(N,kind=real64)

! Deallocate memory
deallocate(a, stat=istat)
if (istat /= 0) then
  stop "Could not deallocate a"
endif
end program

The same code using coretran

program theMean
use variableKind, only: r64,i32
use m_allocate, only: allocate
use m_deallocate, only: deallocate
use m_array1D, only: arange
use m_maths only: mean
implicit none
real(r64), allocatable :: a(:)
real(r64) :: theMean
integer(i32) :: N
N=1000

! Allocate a and check for errors
call allocate(a,N)

! Create numbers from 1 to N
call arange(a, 1.0_r64, 1000.0_r64)

! Compute the mean
theMean = mean(a)

! Deallocate memory
call deallocate(a)
end program

coretran's People

Contributors

anjohan avatar leonfoks avatar pnorton-usgs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

coretran's Issues

compile failed on GNU Fortran (GCC) 7.3.1 (Red Hat 7.3.1-5)

Compile failed as follows:

rmcd@localhost build]$ make
[ 1%] Building Fortran object CMakeFiles/coretran.dir/core/m_variableKind.f90.o
[ 2%] Building Fortran object CMakeFiles/coretran.dir/core/m_errors.f90.o
[ 4%] Building Fortran object CMakeFiles/coretran.dir/core/m_unitTester.f90.o
[ 5%] Building Fortran object CMakeFiles/coretran.dir/core/m_allocate.f90.o
/home/rmcd/git/coretran/src/core/m_allocate.f90:44.4:

module subroutine allocate_r1D(this, n)
1

Error: Unclassifiable statement at (1)
/home/rmcd/git/coretran/src/core/m_allocate.f90:47.11:

  real(r32), allocatable, intent(inout) :: this(:) 
       1

Error: Parameter 'r32' at (1) has not been declared or is a variable, which does not reduce to a constant expression
/home/rmcd/git/coretran/src/core/m_allocate.f90:49.14:

  integer(i32), intent(in) :: n 
          1

Error: Parameter 'i32' at (1) has not been declared or is a variable, which does not reduce to a constant expression
/home/rmcd/git/coretran/src/core/m_allocate.f90:51.7:

end subroutine
   1

Error: Expecting END INTERFACE statement at (1)

line too long in prng_class.f90

There is a line that is too long in prng_class.f90:

c:\fortran\public_domain\coretran>gfortran -c prng_class.f90
prng_class.f90:167:132:

generic, public :: rngExponential => rngExponential_d1_Prng_, rngExponential_d1D_Prng_, rngExponential_d2D_Prng_, rngExponential_d3D_Prng_
1
Error: Line truncated at (1) [-Werror=line-truncation]
prng_class.f90:167:38:

generic, public :: rngExponential => rngExponential_d1_Prng_, rngExponential_d1D_Prng_, rngExponential_d2D_Prng_, rngExponential_d3D_Prng_
1
Error: Undefined specific binding 'rngexponential_d' as target of GENERIC 'rngexponential' at (1)
f951.exe: some warnings being treated as errors

Issues about the module "m_random"

Hi,

I found three possible issues when I tested "coretran" with some simple programs.

  1. Outputs of rngInteger are constants
    For testing the functionalities of rngInteger, I write the code as shown below.
       Program main
          ! Import modules
          Use variableKind, only: r64,i32
          Use m_allocate, only: allocate
          Use m_deallocate, only: deallocate
          Use m_random, only: rngInteger, rngNormal, rngUniform
    
          Implicit None
    
         ! Data dictionary: declare parameters
         Integer(i32), allocatable :: a(:)
         Integer(i32) :: N, I
    
         N = 10
    
         ! Allocate memory
         call allocate(a, N)
    
         call rngInteger(a, 1, 10)
    
         Do i = 1, N
             Write (*,*) a(i)
         End Do
    
        ! Deallocate memory
        call deallocate(a)
    
    End Program
    

And the results of this code are as shown in the figure below. Obviously, the outputs are not random numbers.
SharedScreenshot

  1. The second program is used to test the functionalities of rngNormal. And the code is shown below.
Program main
  ! Import modules
  Use variableKind, only: r64,i32
  Use m_allocate, only: allocate
  Use m_deallocate, only: deallocate
  Use m_random, only: rngInteger, rngNormal, rngUniform
  use m_array1D, only: arange
  use m_maths, only: mean, std
  
  Implicit None
  
  ! Data dictionary: declare parameters
  Real(r64), allocatable :: a(:)
  Integer(i32) :: N, i
  
  N = 10
  
  ! Allocate memory
  call allocate(a, N)
  
  call rngNormal(a)
  
  Do i = 1, N
    Write (*,*) a(i)
  End Do
  
  ! Deallocate memory
  call deallocate(a)

End Program

However, this program output nothing! To be exact, It seemed trapped in an endless cycle because my machine keeps running until I killed this program.

  1. The third example illustrates the issue about rngUniform. The code is shown below.
Program main
  ! Import modules
  Use variableKind, only: r64,i32
  Use m_allocate, only: allocate
  Use m_deallocate, only: deallocate
  Use m_random, only: rngInteger, rngNormal, rngUniform
  use m_array1D, only: arange
  use m_maths, only: mean, std
  
  Implicit None
  
  ! Data dictionary: declare parameters
  Real(r64), allocatable :: a(:)
  Integer(i32) :: N, i
  
  N = 10
  
  ! Allocate memory
  call allocate(a, N)
  
  call rngUniform(a)
  
  Do i = 1, N
    Write (*,*) a(i)
  End Do
  
  ! Deallocate memory
  call deallocate(a)


End Program

And the output of this program is shown in the figure below. I don't understand why this error appears.
SharedScreenshot_1

Mean example is too verbose

I understand the advantage of demonstrating the power of coretran on a very simple example, however the native Fortran code for the mean example is unnecessarily verbose and misrepresents the level of verbosity of Fortran. The following can make it much more succinct:

  • No need to explicitly allocate - use automatic allocation on assignment.
  • No need to explicitly deallocate at the end of the program - let the array get cleaned-up by the compiler.
  • No need to explicitly re-cast integer to real - let the compiler do the type coercion.

The equivalent and correct example:

program theMean_program
use, intrinsic :: iso_fortran_env, only: real64, int32
implicit none
real(real64), allocatable :: a(:)
real(real64) :: theMean
integer(int32) :: i, istat, N
N=1000

! Create numbers from 1 to N
a = [(real(i,kind=real64), i=1,N)]

! Compute the mean
theMean = sum(a)/N

end program

Unable to compile with ifortran

I've tried compiling with all the versions of intels ifortran compiler which I have available on my system:

ifortran 16.0
sm_maths_d1D.f90
error 6834: Array speicifications must be given for result name, not function

ifortran 17.0, 18.3, 19.0
Errors in the make step with sm_geometry.f90 - A separate interface body must have been declared in the program unit or an ancestor of the program unit for the separate module procedure

Build with shared libs off - fails with coretranTest

Building cortran with shared libs off fails with coretranTest. Build succeds with coretran but fails with the test as below. Build with sharedlibs on succeeds. Not sure if this is a cmake issue or not. Any help would be appreciated.

[ 91%] Building Fortran object CMakeFiles/coretran.dir/time/ProgressBar_Class.f90.o
[ 92%] Linking Fortran static library /home/rmcd/git/coretran/lib/libcoretran.a
[ 92%] Built target coretran
[ 94%] Linking Fortran executable /home/rmcd/git/coretran/bin/coretranTest
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: cannot find -lm
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: cannot find -lm
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: cannot find -ldl
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: cannot find -lm
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: cannot find -lpthread
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: cannot find -lc
collect2: error: ld returned 1 exit status
make[2]: *** [/home/rmcd/git/coretran/bin/coretranTest] Error 1
make[1]: *** [tests/CMakeFiles/coretranTest.dir/all] Error 2
make: *** [all] Error 2

ProgressBar seems nonfunctional

In module ProgressBar_Class, public :: set is commented out, as well as the subsequent lines.
As a result, the sample code provided at the head of ProgressBar_Class.f90 fails on the line call P%set(N, time = .false.) because "set’ at (1) is not a member of the ‘progressbar’ structure".

Is there a modification to the sample code envisioned, or is this dead code?

Uncommenting the codes leads to compile errors: set_i1_progressbar’ and ‘set_id1_progressbar’ for GENERIC ‘set’ at (1) are ambiguous and set_i1_progressbar’ must be a module procedure or an external procedure with an explicit interface at (1) etc.

dynamicArrays folder missing CMakeLists.txt

The CMakeLists.txt file appears to be missing from dynamicArrays folder. I created the file with the content below, and it compiled. Please advise if this is not the correct content.

target_sources(${libName}
PUBLIC
"${CMAKE_CURRENT_LIST_DIR}/m_dynamicArray.f90"
"${CMAKE_CURRENT_LIST_DIR}/m_fixedArray.f90"
"${CMAKE_CURRENT_LIST_DIR}/sm_dDynamicArray.f90"
"${CMAKE_CURRENT_LIST_DIR}/sm_iDynamicArray.f90"
"${CMAKE_CURRENT_LIST_DIR}/sm_idDynamicArray.f90"
"${CMAKE_CURRENT_LIST_DIR}/sm_rDynamicArray.f90"
)

Random number generator is not thread safe nor has cycle skipping capabilities

Common problem with random number generators is their inability to generate independent generators on each thread, across nodes and then cycle skip. Most people simply use independent generators on each thread, each with a different seed.

A better way is to generate each with the same seed, and cycle skip according to the rank of the thread.

  • Find a Fortran xorshiftXXX based prng. Found public domain, need to check.
  • Modify to make more sense and better OOP
  • Incorporate into the random module

Add a release

This is a request to git tag a release of coretran.

cannot compile sm_rngChiSq.f90

c:\fortran\public_domain\coretran>gfortran -c --verbose sm_rngChiSq.f90
Built by Equation Solution http://www.Equation.com.
Using built-in specs.
COLLECT_GCC=gfortran
Target: x86_64-w64-mingw32
Configured with: ../gcc-8-20180408-mingw/configure --host=x86_64-w64-mingw32 --build=x86_64-unknown-linux-gnu --target=x86_64-w64-mingw32 --prefix=/home/gfortran/gcc-home/binary/mingw32/native/x86_64/gcc/8-20180408 --with-sysroot=/home/gfortran/gcc-home/binary/mingw32/cross/x86_64/gcc/8-20171217 --with-gcc --with-gnu-ld --with-gnu-as --with-ld64=no --with-gmp=/home/gfortran/gcc-home/binary/mingw32/native/x86_64/gmp --with-mpfr=/home/gfortran/gcc-home/binary/mingw32/native/x86_64/mpfr --with-mpc=/home/gfortran/gcc-home/binary/mingw32/native/x86_64/mpc --with-cloog=/home/gfortran/gcc-home/binary/mingw32/native/x86_64/cloog --with-diagnostics-color=auto --enable-cloog-backend=isl --enable-targets=i686-w64-mingw32,x86_64-w64-mingw32 --enable-lto --enable-languages=c,c++,fortran --enable-threads=win32 --enable-static --enable-shared=lto-plugin --enable-plugins --enable-ld=yes --enable-libquadmath --enable-libquadmath-support --enable-libgomp --disable-checking --disable-nls --disable-tls --disable-win32-registry
Thread model: win32
gcc version 8.0.1 20180408 (experimental) (GCC)
COLLECT_GCC_OPTIONS='-c' '-v' '-mtune=generic' '-march=x86-64'
c:/equation/bin/../libexec/gcc/x86_64-w64-mingw32/8.0.1/f951.exe sm_rngChiSq.f90 -quiet -dumpbase sm_rngChiSq.f90 -mtune=generic -march=x86-64 -auxbase sm_rngChiSq -version -fintrinsic-modules-path c:/equation/bin/../lib/gcc/x86_64-w64-mingw32/8.0.1/finclude -o C:\Users\vivek\AppData\Local\Temp\ccEor6Qq.s
GNU Fortran (GCC) version 8.0.1 20180408 (experimental) (x86_64-w64-mingw32)
compiled by GNU C version 8.0.0 20171217 (experimental), GMP version 6.1.2, MPFR version 3.1.4, MPC version 1.0.3, isl version none
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU Fortran2008 (GCC) version 8.0.1 20180408 (experimental) (x86_64-w64-mingw32)
compiled by GNU C version 8.0.0 20171217 (experimental), GMP version 6.1.2, MPFR version 3.1.4, MPC version 1.0.3, isl version none
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
sm_rngChiSq.f90:19:18:

module procedure rngChisq_d1!(this,ndf,first)
1
Error: MODULE PROCEDURE at (1) must be in a generic module interface
sm_rngChiSq.f90:26:43:

call rngGamma(this,half*dble(ndf), first)
1
Error: Unexpected CALL statement in CONTAINS section at (1)
sm_rngChiSq.f90:27:19:

this = two * this
1
Error: Unexpected assignment statement in CONTAINS section at (1)
sm_rngChiSq.f90:28:5:

end procedure
1
Error: Expecting END SUBMODULE statement at (1)
sm_rngChiSq.f90:31:18:

module procedure rngChisq_d1D!(this,ndf,first)
1
Error: MODULE PROCEDURE at (1) must be in a generic module interface
sm_rngChiSq.f90:36:16:

integer :: i,N
1
Error: Unexpected data declaration statement in CONTAINS section at (1)
sm_rngChiSq.f90:37:14:

N=size(this)
1
Error: Unexpected assignment statement in CONTAINS section at (1)
sm_rngChiSq.f90:38:34:

call rngChisq(this(1),ndf,first)
1
Error: Unexpected CALL statement in CONTAINS section at (1)
sm_rngChiSq.f90:39:10:

do i=2,N
1
Error: Unexpected DO statement in CONTAINS section at (1)
sm_rngChiSq.f90:40:38:

 call rngChisq(this(i),ndf,.false.)
                                  1

Error: Unexpected CALL statement in CONTAINS section at (1)
sm_rngChiSq.f90:41:5:

end do
1
Error: Expecting END SUBMODULE statement at (1)
sm_rngChiSq.f90:42:5:

end procedure
1
Error: Expecting END SUBMODULE statement at (1)

Failed to compile the library in Linux with gfortran version using gfortran version 6.3.1

Hello, @leonfoks

Following your instructions, I typed cmake ../src in the command line, and everything is OK. Then I typed make to compile the library. However, it failed and returned to me error information as follows.

[ 81%] Building Fortran object CMakeFiles/coretran.dir/spatial/m_KdTree.f90.o
[ 83%] Building Fortran object CMakeFiles/coretran.dir/spatial/m_geometry.f90.o
[ 84%] Building Fortran object CMakeFiles/coretran.dir/spatial/sm_KdTreeBranch_class.f90.o
[ 86%] Building Fortran object CMakeFiles/coretran.dir/spatial/sm_KdTreeSearch_class.f90.o
/home/wangy/downloads/coretran/src/spatial/sm_KdTreeSearch_class.f90:1135:0:

   module procedure rangeSearch_KD!(search, tree, D, lowerBound, upperBound) result(iPoints)
 
internal compiler error: in gfc_get_symbol_decl, at fortran/trans-decl.c:1419
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
CMakeFiles/coretran.dir/build.make:731: recipe for target 'CMakeFiles/coretran.dir/spatial/sm_KdTreeSearch_class.f90.o' failed
make[2]: *** [CMakeFiles/coretran.dir/spatial/sm_KdTreeSearch_class.f90.o] Error 1
CMakeFiles/Makefile2:116: recipe for target 'CMakeFiles/coretran.dir/all' failed
make[1]: *** [CMakeFiles/coretran.dir/all] Error 2
Makefile:148: recipe for target 'all' failed
make: *** [all] Error 2

Could you help me address this issue?

Does `dDynamicArray` allow us to remove multiple elements at the same time?

Hi, @leonfoks

I'm testing the functionalities of idDynamicArray_Class. And I know that I can remove one element of an array by using idDynamicArray%remove(index), where index is an integer.

What I want to know is that whether dDynamicArray allows us to remove multiple elements at the same time.
For example, I have an array called array_a = (/ 12, 36, 48, 24, 6, 8 /), and I want to delete array_a(1), array_a(4) and array_a(5). Is there any way to achieve this goal?

Mean example is broken

There are typos and illegal names in the native Fortran version of the mean which do not allow it to compile.

Below is the correct code:

program theMean_program
use, intrinsic :: iso_fortran_env, only: real64, int32
implicit none
real(real64), allocatable :: a(:)
real(real64) :: theMean
! Some parameters to handle everything
integer(int32) :: i, istat, N
N=1000

! Allocate a and check for errors
allocate(a(N), stat=istat)
if (istat /= 0) then
  stop "Could not allocate a"
endif

! Create numbers from 1 to N
a = [(real(i,kind=real64), i=1,N)]

! Compute the mean
theMean = sum(a)/real(N,kind=real64)

! Deallocate memory
deallocate(a, stat=istat)
if (istat /= 0) then
  stop "Could not deallocate a"
endif
end program

(I did not test the coretran variant)

line too long in Stopwatch_Class.f90

c:\fortran\public_domain\coretran>gfortran -c Stopwatch_Class.f90
Stopwatch_Class.f90:219:132:

 res = trim(str(this%StopTime_(5)))//':'//trim(str(this%StopTime_(6)))//':'//trim(str(this%StopTime_(7)))//'.'//trim(str(this%StopTime_(8)))
                                                                                                                                1

Error: Line truncated at (1) [-Werror=line-truncation]
Stopwatch_Class.f90:219:132:

 res = trim(str(this%StopTime_(5)))//':'//trim(str(this%StopTime_(6)))//':'//trim(str(this%StopTime_(7)))//'.'//trim(str(this%StopTime_(8)))
                                                                                                                                1

Error: 'sto' at (1) is not a member of the 'stopwatch' structure
f951.exe: some warnings being treated as errors

lines too long in m_tests.f90

I am using GNU Fortran (GCC) 8.0.1 20180408 (experimental) on Windows 10.

c:\fortran\public_domain\coretran>gfortran -c m_tests.f90
m_tests.f90:424:132:

call test%test(all(da%i%values(1:3) == [30, 20, 10]) .and. all(da%v%values(1:3) == [30.d0, 20.d0, 10.d0]), 'dArgDynamicArray%prepend')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:424:110:

call test%test(all(da%i%values(1:3) == [30, 20, 10]) .and. all(da%v%values(1:3) == [30.d0, 20.d0, 10.d0]), 'dArgDynamicArray%prepend')
1
Error: Unterminated character constant beginning at (1)
m_tests.f90:426:132:

call test%test(all(da%i%values(1:4) == [30, 20, 10, 40]) .and. all(da%v%values(1:4) == [30.d0, 20.d0, 10.d0, 40.d0]), 'dArgDynamicArray%append')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:426:121:

call test%test(all(da%i%values(1:4) == [30, 20, 10, 40]) .and. all(da%v%values(1:4) == [30.d0, 20.d0, 10.d0, 40.d0]), 'dArgDynamicArray%append')
1
Error: Unterminated character constant beginning at (1)
m_tests.f90:428:132:

call test%test(all(da%i%values(1:3) == [30, 10, 40]) .and. all(da%v%values(1:3) == [30.d0, 10.d0, 40.d0]), 'dArgDynamicArray%remove')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:428:110:

call test%test(all(da%i%values(1:3) == [30, 10, 40]) .and. all(da%v%values(1:3) == [30.d0, 10.d0, 40.d0]), 'dArgDynamicArray%remove')
1
Error: Unterminated character constant beginning at (1)
m_tests.f90:443:132:

call test%test(all(da%i%values(1:3)==[3, 1, 2]) .and. all(da%v%values(1:3)==[10.d0, 20.d0, 30.d0]), 'dArgDynamicArray%insertSorted')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:443:103:

call test%test(all(da%i%values(1:3)==[3, 1, 2]) .and. all(da%v%values(1:3)==[10.d0, 20.d0, 30.d0]), 'dArgDynamicArray%insertSorted')
1
Error: Unterminated character constant beginning at (1)
m_tests.f90:449:132:

call test%test(all(da%i%values(1:3)==[3, 1, 2]) .and. all(da%v%values(1:3)==[10.d0, 20.d0, 30.d0]), 'dArgDynamicArray%insertSortedUnique')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:449:103:

call test%test(all(da%i%values(1:3)==[3, 1, 2]) .and. all(da%v%values(1:3)==[10.d0, 20.d0, 30.d0]), 'dArgDynamicArray%insertSortedUnique')
1
Error: Unterminated character constant beginning at (1)
m_tests.f90:451:132:

call test%test(all(da%i%values(1:4)==[3, 4, 1, 2]) .and. all(da%v%values(1:4)==[10.d0, 15.d0, 20.d0, 30.d0]), 'dArgDynamicArray%insertSortedUnique')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:451:113:

call test%test(all(da%i%values(1:4)==[3, 4, 1, 2]) .and. all(da%v%values(1:4)==[10.d0, 15.d0, 20.d0, 30.d0]), 'dArgDynamicArray%insertSortedUnique')
1
Error: Unterminated character constant beginning at (1)
m_tests.f90:459:132:

call test%test(all(da%i%values(1:3)==[3, 1, 2]) .and. all(da%v%values(1:3)==[10.d0, 20.d0, 30.d0]), 'dArgDynamicArray%insertSorted')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:459:103:

call test%test(all(da%i%values(1:3)==[3, 1, 2]) .and. all(da%v%values(1:3)==[10.d0, 20.d0, 30.d0]), 'dArgDynamicArray%insertSorted')
1
Error: Unterminated character constant beginning at (1)
m_tests.f90:465:132:

call test%test(all(da%i%values(1:3)==[3, 1, 2]) .and. all(da%v%values(1:3)==[10.d0, 20.d0, 30.d0]), 'dArgDynamicArray%insertSortedUnique')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:465:103:

call test%test(all(da%i%values(1:3)==[3, 1, 2]) .and. all(da%v%values(1:3)==[10.d0, 20.d0, 30.d0]), 'dArgDynamicArray%insertSortedUnique')
1
Error: Unterminated character constant beginning at (1)
m_tests.f90:467:132:

call test%test(all(da%i%values(1:3)==[3, 4, 1]) .and. all(da%v%values(1:3)==[10.d0, 15.d0, 20.d0]), 'dArgDynamicArray%insertSortedUnique')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:467:103:

call test%test(all(da%i%values(1:3)==[3, 4, 1]) .and. all(da%v%values(1:3)==[10.d0, 15.d0, 20.d0]), 'dArgDynamicArray%insertSortedUnique')
1
Error: Unterminated character constant beginning at (1)
m_tests.f90:497:132:

call test%test(all(ida%i%values(1:4) == [30, 20, 10, 40]) .and. all(ida%v%values(1:4) == [30, 20, 10, 40]), 'iArgDynamicArray%append')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:497:111:

call test%test(all(ida%i%values(1:4) == [30, 20, 10, 40]) .and. all(ida%v%values(1:4) == [30, 20, 10, 40]), 'iArgDynamicArray%append')
1
Error: Unterminated character constant beginning at (1)
m_tests.f90:520:132:

call test%test(all(ida%i%values(1:3)==[3, 1, 2]) .and. all(ida%v%values(1:3)==[10, 20, 30]), 'iArgDynamicArray%insertSortedUnique')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:520:132:

call test%test(all(ida%i%values(1:3)==[3, 1, 2]) .and. all(ida%v%values(1:3)==[10, 20, 30]), 'iArgDynamicArray%insertSortedUnique')
1
Error: Syntax error in argument list at (1)
m_tests.f90:522:132:

call test%test(all(ida%i%values(1:4)==[3, 4, 1, 2]) .and. all(ida%v%values(1:4)==[10, 15, 20, 30]), 'iArgDynamicArray%insertSortedUnique')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:522:103:

call test%test(all(ida%i%values(1:4)==[3, 4, 1, 2]) .and. all(ida%v%values(1:4)==[10, 15, 20, 30]), 'iArgDynamicArray%insertSortedUnique')
1
Error: Unterminated character constant beginning at (1)
m_tests.f90:536:132:

call test%test(all(ida%i%values(1:3)==[3, 1, 2]) .and. all(ida%v%values(1:3)==[10, 20, 30]), 'iArgDynamicArray%insertSortedUnique')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:536:132:

call test%test(all(ida%i%values(1:3)==[3, 1, 2]) .and. all(ida%v%values(1:3)==[10, 20, 30]), 'iArgDynamicArray%insertSortedUnique')
1
Error: Syntax error in argument list at (1)
m_tests.f90:538:132:

call test%test(all(ida%i%values(1:3)==[3, 4, 1]) .and. all(ida%v%values(1:3)==[10, 15, 20]), 'iArgDynamicArray%insertSortedUnique')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:538:132:

call test%test(all(ida%i%values(1:3)==[3, 4, 1]) .and. all(ida%v%values(1:3)==[10, 15, 20]), 'iArgDynamicArray%insertSortedUnique')
1
Error: Syntax error in argument list at (1)
m_tests.f90:564:132:

call test%test(all(idda%i%values(1:2) == [20_i64, 10_i64]) .and. all(idda%v%values(1:2) == [20_i64, 10_i64]), 'idArgDynamicArray%insert')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:564:113:

call test%test(all(idda%i%values(1:2) == [20_i64, 10_i64]) .and. all(idda%v%values(1:2) == [20_i64, 10_i64]), 'idArgDynamicArray%insert')
1
Error: Unterminated character constant beginning at (1)
m_tests.f90:566:132:

call test%test(all(idda%i%values(1:3) == [30_i64, 20_i64, 10_i64]) .and. all(idda%v%values(1:3) == [30_i64, 20_i64, 10_i64]), 'idArgDynamicArray%prepend')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:566:129:

call test%test(all(idda%i%values(1:3) == [30_i64, 20_i64, 10_i64]) .and. all(idda%v%values(1:3) == [30_i64, 20_i64, 10_i64]), 'idArgDynamicArray%prepend')
1
Error: Unterminated character constant beginning at (1)
m_tests.f90:568:132:

call test%test(all(idda%i%values(1:4) == [30_i64, 20_i64, 10_i64, 40_i64]) .and. all(idda%v%values(1:4) == [30_i64, 20_i64, 10_i64, 40_i64]), 'idArgDynamicArray%append')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:568:132:

call test%test(all(idda%i%values(1:4) == [30_i64, 20_i64, 10_i64, 40_i64]) .and. all(idda%v%values(1:4) == [30_i64, 20_i64, 10_i64, 40_i64]), 'idArgDynamicArray%append')
1
Error: Syntax error in array constructor at (1)
m_tests.f90:570:132:

call test%test(all(idda%i%values(1:3) == [30_i64, 10_i64, 40_i64]) .and. all(idda%v%values(1:3) == [30_i64, 10_i64, 40_i64]), 'idArgDynamicArray%remove')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:570:129:

call test%test(all(idda%i%values(1:3) == [30_i64, 10_i64, 40_i64]) .and. all(idda%v%values(1:3) == [30_i64, 10_i64, 40_i64]), 'idArgDynamicArray%remove')
1
Error: Unterminated character constant beginning at (1)
m_tests.f90:585:132:

call test%test(all(idda%i%values(1:3)==[3, 1, 2]) .and. all(idda%v%values(1:3)==[10_i64, 20_i64, 30_i64]), 'idArgDynamicArray%insertSorted')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:585:110:

call test%test(all(idda%i%values(1:3)==[3, 1, 2]) .and. all(idda%v%values(1:3)==[10_i64, 20_i64, 30_i64]), 'idArgDynamicArray%insertSorted')
1
Error: Unterminated character constant beginning at (1)
m_tests.f90:591:132:

call test%test(all(idda%i%values(1:3)==[3, 1, 2]) .and. all(idda%v%values(1:3)==[10_i64, 20_i64, 30_i64]), 'idArgDynamicArray%insertSortedUnique')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:591:110:

call test%test(all(idda%i%values(1:3)==[3, 1, 2]) .and. all(idda%v%values(1:3)==[10_i64, 20_i64, 30_i64]), 'idArgDynamicArray%insertSortedUnique')
1
Error: Unterminated character constant beginning at (1)
m_tests.f90:593:132:

call test%test(all(idda%i%values(1:4)==[3, 4, 1, 2]) .and. all(idda%v%values(1:4)==[10_i64, 15_i64, 20_i64, 30_i64]), 'idArgDynamicArray%insertSortedUnique')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:593:121:

call test%test(all(idda%i%values(1:4)==[3, 4, 1, 2]) .and. all(idda%v%values(1:4)==[10_i64, 15_i64, 20_i64, 30_i64]), 'idArgDynamicArray%insertSortedUnique')
1
Error: Unterminated character constant beginning at (1)
m_tests.f90:601:132:

call test%test(all(idda%i%values(1:3)==[3, 1, 2]) .and. all(idda%v%values(1:3)==[10_i64, 20_i64, 30_i64]), 'idArgDynamicArray%insertSorted')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:601:110:

call test%test(all(idda%i%values(1:3)==[3, 1, 2]) .and. all(idda%v%values(1:3)==[10_i64, 20_i64, 30_i64]), 'idArgDynamicArray%insertSorted')
1
Error: Unterminated character constant beginning at (1)
m_tests.f90:607:132:

call test%test(all(idda%i%values(1:3)==[3, 1, 2]) .and. all(idda%v%values(1:3)==[10_i64, 20_i64, 30_i64]), 'idArgDynamicArray%insertSortedUnique')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:607:110:

call test%test(all(idda%i%values(1:3)==[3, 1, 2]) .and. all(idda%v%values(1:3)==[10_i64, 20_i64, 30_i64]), 'idArgDynamicArray%insertSortedUnique')
1
Error: Unterminated character constant beginning at (1)
m_tests.f90:609:132:

call test%test(all(idda%i%values(1:3)==[3, 4, 1]) .and. all(idda%v%values(1:3)==[10_i64, 15_i64, 20_i64]), 'idArgDynamicArray%insertSortedUnique')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:609:110:

call test%test(all(idda%i%values(1:3)==[3, 4, 1]) .and. all(idda%v%values(1:3)==[10_i64, 15_i64, 20_i64]), 'idArgDynamicArray%insertSortedUnique')
1
Error: Unterminated character constant beginning at (1)
m_tests.f90:637:132:

call test%test(all(rda%i%values(1:3) == [30, 20, 10]) .and. all(rda%v%values(1:3) == [30.0, 20.0, 10.0]), 'rArgDynamicArray%prepend')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:637:109:

call test%test(all(rda%i%values(1:3) == [30, 20, 10]) .and. all(rda%v%values(1:3) == [30.0, 20.0, 10.0]), 'rArgDynamicArray%prepend')
1
Error: Unterminated character constant beginning at (1)
m_tests.f90:639:132:

call test%test(all(rda%i%values(1:4) == [30, 20, 10, 40]) .and. all(rda%v%values(1:4) == [30.0, 20.0, 10.0, 40.0]), 'rArgDynamicArray%append')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:639:119:

call test%test(all(rda%i%values(1:4) == [30, 20, 10, 40]) .and. all(rda%v%values(1:4) == [30.0, 20.0, 10.0, 40.0]), 'rArgDynamicArray%append')
1
Error: Unterminated character constant beginning at (1)
m_tests.f90:641:132:

call test%test(all(rda%i%values(1:3) == [30, 10, 40]) .and. all(rda%v%values(1:3) == [30.0, 10.0, 40.0]), 'rArgDynamicArray%remove')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:641:109:

call test%test(all(rda%i%values(1:3) == [30, 10, 40]) .and. all(rda%v%values(1:3) == [30.0, 10.0, 40.0]), 'rArgDynamicArray%remove')
1
Error: Unterminated character constant beginning at (1)
m_tests.f90:656:132:

call test%test(all(rda%i%values(1:3)==[3, 1, 2]) .and. all(rda%v%values(1:3)==[10.0, 20.0, 30.0]), 'rArgDynamicArray%insertSorted')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:656:132:

call test%test(all(rda%i%values(1:3)==[3, 1, 2]) .and. all(rda%v%values(1:3)==[10.0, 20.0, 30.0]), 'rArgDynamicArray%insertSorted')
1
Error: Syntax error in argument list at (1)
m_tests.f90:662:132:

call test%test(all(rda%i%values(1:3)==[3, 1, 2]) .and. all(rda%v%values(1:3)==[10.0, 20.0, 30.0]), 'rArgDynamicArray%insertSortedUnique')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:662:102:

call test%test(all(rda%i%values(1:3)==[3, 1, 2]) .and. all(rda%v%values(1:3)==[10.0, 20.0, 30.0]), 'rArgDynamicArray%insertSortedUnique')
1
Error: Unterminated character constant beginning at (1)
m_tests.f90:664:132:

call test%test(all(rda%i%values(1:4)==[3, 4, 1, 2]) .and. all(rda%v%values(1:4)==[10.0, 15.0, 20.0, 30.0]), 'rArgDynamicArray%insertSortedUnique')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:664:111:

call test%test(all(rda%i%values(1:4)==[3, 4, 1, 2]) .and. all(rda%v%values(1:4)==[10.0, 15.0, 20.0, 30.0]), 'rArgDynamicArray%insertSortedUnique')
1
Error: Unterminated character constant beginning at (1)
m_tests.f90:672:132:

call test%test(all(rda%i%values(1:3)==[3, 1, 2]) .and. all(rda%v%values(1:3)==[10.0, 20.0, 30.0]), 'rArgDynamicArray%insertSorted')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:672:132:

call test%test(all(rda%i%values(1:3)==[3, 1, 2]) .and. all(rda%v%values(1:3)==[10.0, 20.0, 30.0]), 'rArgDynamicArray%insertSorted')
1
Error: Syntax error in argument list at (1)
m_tests.f90:678:132:

call test%test(all(rda%i%values(1:3)==[3, 1, 2]) .and. all(rda%v%values(1:3)==[10.0, 20.0, 30.0]), 'rArgDynamicArray%insertSortedUnique')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:678:102:

call test%test(all(rda%i%values(1:3)==[3, 1, 2]) .and. all(rda%v%values(1:3)==[10.0, 20.0, 30.0]), 'rArgDynamicArray%insertSortedUnique')
1
Error: Unterminated character constant beginning at (1)
m_tests.f90:680:132:

call test%test(all(rda%i%values(1:3)==[3, 4, 1]) .and. all(rda%v%values(1:3)==[10.0, 15.0, 20.0]), 'rArgDynamicArray%insertSortedUnique')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:680:102:

call test%test(all(rda%i%values(1:3)==[3, 4, 1]) .and. all(rda%v%values(1:3)==[10.0, 15.0, 20.0]), 'rArgDynamicArray%insertSortedUnique')
1
Error: Unterminated character constant beginning at (1)
m_tests.f90:1039:132:

call test%test(all(da%i%values == ia1D(1:10)) .and. all(abs(da%v%values - sqrt(c1D(ia1D(1:10)))) <= 1.d-15), '2D - KdTreeSearch%kNearest, k nearest')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:1039:112:

call test%test(all(da%i%values == ia1D(1:10)) .and. all(abs(da%v%values - sqrt(c1D(ia1D(1:10)))) <= 1.d-15), '2D - KdTreeSearch%kNearest, k nearest')
1
Error: Unterminated character constant beginning at (1)
m_tests.f90:1048:132:

call test%test(all(da%i%values == ia1D(1:15)) .and. all(abs(da%v%values - (c1D(1:15))) <= 1.d-15), '2D - KdTreeSearch%kNearest, radius search')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:1048:102:

call test%test(all(da%i%values == ia1D(1:15)) .and. all(abs(da%v%values - (c1D(1:15))) <= 1.d-15), '2D - KdTreeSearch%kNearest, radius search')
1
Error: Unterminated character constant beginning at (1)
m_tests.f90:1052:132:

call test%test(all(da%i%values == ia1D(1:10)) .and. all(abs(da%v%values - (c1D(1:10))) <= 1.d-15), '2D - KdTreeSearch%kNearest, k radius search')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:1052:102:

call test%test(all(da%i%values == ia1D(1:10)) .and. all(abs(da%v%values - (c1D(1:10))) <= 1.d-15), '2D - KdTreeSearch%kNearest, k radius search')
1
Error: Unterminated character constant beginning at (1)
m_tests.f90:1093:132:

call test%test(all(da%i%values == ia1D(1:10)) .and. all(abs(da%v%values - sqrt(d1D(ia1D(1:10)))) <= 1.d-15), '3D - KdTreeSearch%kNearest')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:1093:112:

call test%test(all(da%i%values == ia1D(1:10)) .and. all(abs(da%v%values - sqrt(d1D(ia1D(1:10)))) <= 1.d-15), '3D - KdTreeSearch%kNearest')
1
Error: Unterminated character constant beginning at (1)
m_tests.f90:1101:132:

call test%test(all(da%i%values == ia1D(1:15)) .and. all(abs(da%v%values - (d1D(1:15))) <= 1.d-15), '3D - KdTreeSearch%kNearest, radius search')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:1101:102:

call test%test(all(da%i%values == ia1D(1:15)) .and. all(abs(da%v%values - (d1D(1:15))) <= 1.d-15), '3D - KdTreeSearch%kNearest, radius search')
1
Error: Unterminated character constant beginning at (1)
m_tests.f90:1105:132:

call test%test(all(da%i%values == ia1D(1:10)) .and. all(abs(da%v%values - (d1D(1:10))) <= 1.d-15), '3D - KdTreeSearch%kNearest, k radius search')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:1105:102:

call test%test(all(da%i%values == ia1D(1:10)) .and. all(abs(da%v%values - (d1D(1:10))) <= 1.d-15), '3D - KdTreeSearch%kNearest, k radius search')
1
Error: Unterminated character constant beginning at (1)
m_tests.f90:1149:132:

call test%test(all(da%i%values == ia1D(1:10)) .and. all(abs(da%v%values - sqrt(c1D(ia1D(1:10)))) <= 1.d-15), 'KD - KdTreeSearch%kNearest')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:1149:112:

call test%test(all(da%i%values == ia1D(1:10)) .and. all(abs(da%v%values - sqrt(c1D(ia1D(1:10)))) <= 1.d-15), 'KD - KdTreeSearch%kNearest')
1
Error: Unterminated character constant beginning at (1)
m_tests.f90:1159:132:

call test%test(all(da%i%values == ia1D(1:15)) .and. all(abs(da%v%values - (d1D(1:15))) <= 1.d-15), 'KD - KdTreeSearch%kNearest, radius search')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:1159:102:

call test%test(all(da%i%values == ia1D(1:15)) .and. all(abs(da%v%values - (d1D(1:15))) <= 1.d-15), 'KD - KdTreeSearch%kNearest, radius search')
1
Error: Unterminated character constant beginning at (1)
m_tests.f90:1163:132:

call test%test(all(da%i%values == ia1D(1:10)) .and. all(abs(da%v%values - (d1D(1:10))) <= 1.d-15), 'KD - KdTreeSearch%kNearest, k radius search')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:1163:102:

call test%test(all(da%i%values == ia1D(1:10)) .and. all(abs(da%v%values - (d1D(1:10))) <= 1.d-15), 'KD - KdTreeSearch%kNearest, k radius search')
1
Error: Unterminated character constant beginning at (1)
m_tests.f90:1535:132:

call test%test(all(shape(a3D) == [20,20,20]) .and. all(a3D(1:10,1:10,1:10) == 3.d0) .and. all(a3D(11:20,11:20,11:20) == 0.d0),'reallocate_d3D')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:1535:129:

call test%test(all(shape(a3D) == [20,20,20]) .and. all(a3D(1:10,1:10,1:10) == 3.d0) .and. all(a3D(11:20,11:20,11:20) == 0.d0),'reallocate_d3D')
1
Error: Unterminated character constant beginning at (1)
m_tests.f90:1550:132:

call test%test(all(shape(ia3D) == [20,20,20]) .and. all(ia3d(1:10,1:10,1:10) == 3) .and. all(ia3D(11:20,11:20,11:20) == 0),'reallocate_i3D')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:1550:126:

call test%test(all(shape(ia3D) == [20,20,20]) .and. all(ia3d(1:10,1:10,1:10) == 3) .and. all(ia3D(11:20,11:20,11:20) == 0),'reallocate_i3D')
1
Error: Unterminated character constant beginning at (1)
m_tests.f90:1565:132:

call test%test(all(shape(iad3D) == [20,20,20]) .and. all(iad3d(1:10,1:10,1:10) == 3) .and. all(iad3D(11:20,11:20,11:20) == 0),'reallocate_id3D')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:1565:130:

call test%test(all(shape(iad3D) == [20,20,20]) .and. all(iad3d(1:10,1:10,1:10) == 3) .and. all(iad3D(11:20,11:20,11:20) == 0),'reallocate_id3D')
1
Error: Unterminated character constant beginning at (1)
m_tests.f90:1575:132:

call test%test(all(shape(z2D) == [20,20]) .and. all(z2D(1:10,1:10) == (2.d0, 0.d0)) .and. all(z2D(11:20,11:20) == (0.d0, 0.d0)),'reallocate_c2D')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:1575:131:

call test%test(all(shape(z2D) == [20,20]) .and. all(z2D(1:10,1:10) == (2.d0, 0.d0)) .and. all(z2D(11:20,11:20) == (0.d0, 0.d0)),'reallocate_c2D')
1
Error: Unterminated character constant beginning at (1)
m_tests.f90:1580:132:

call test%test(all(shape(z3D) == [20,20,20]) .and. all(z3D(1:10,1:10,1:10) == (3.d0, 0.d0)) .and. all(z3D(11:20,11:20,11:20) == (0.d0, 0.d0)),'reallocate_c3D')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:1580:132:

call test%test(all(shape(z3D) == [20,20,20]) .and. all(z3D(1:10,1:10,1:10) == (3.d0, 0.d0)) .and. all(z3D(11:20,11:20,11:20) == (0.d0, 0.d0)),'reallocate_c3D')
1
Error: Expected a right parenthesis in expression at (1)
m_tests.f90:1590:132:

call test%test(all(shape(zz2D) == [20,20]) .and. all(zz2D(1:10,1:10) == (2.d0, 0.d0)) .and. all(zz2D(11:20,11:20) == (0.d0, 0.d0)),'reallocate_z2D')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:1590:132:

call test%test(all(shape(zz2D) == [20,20]) .and. all(zz2D(1:10,1:10) == (2.d0, 0.d0)) .and. all(zz2D(11:20,11:20) == (0.d0, 0.d0)),'reallocate_z2D')
1
Error: Syntax error in argument list at (1)
m_tests.f90:1595:132:

call test%test(all(shape(zz3D) == [20,20,20]) .and. all(zz3D(1:10,1:10,1:10) == (3.d0, 0.d0)) .and. all(zz3D(11:20,11:20,11:20) == (0.d0, 0.d0)),'reallocate_z3D')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:1595:132:

call test%test(all(shape(zz3D) == [20,20,20]) .and. all(zz3D(1:10,1:10,1:10) == (3.d0, 0.d0)) .and. all(zz3D(11:20,11:20,11:20) == (0.d0, 0.d0)),'reallocate_z3D')
1
Error: Syntax error in expression at (1)
m_tests.f90:1605:132:

call test%test(all(shape(la2D) == [20,20]) .and. all(la2D(1:10,1:10) .eqv. .true.) .and. all(la2D(11:20,11:20) .eqv. .false.),'reallocate_l2D')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:1605:129:

call test%test(all(shape(la2D) == [20,20]) .and. all(la2D(1:10,1:10) .eqv. .true.) .and. all(la2D(11:20,11:20) .eqv. .false.),'reallocate_l2D')
1
Error: Unterminated character constant beginning at (1)
m_tests.f90:1610:132:

call test%test(all(shape(la3D) == [20,20,20]) .and. all(la3D(1:10,1:10,1:10) .eqv. .true.) .and. all(la3D(11:20,11:20,11:20) .eqv. .false.),'reallocate_l3D')
1
Error: Line truncated at (1) [-Werror=line-truncation]
m_tests.f90:1610:132:

call test%test(all(shape(la3D) == [20,20,20]) .and. all(la3D(1:10,1:10,1:10) .eqv. .true.) .and. all(la3D(11:20,11:20,11:20) .eqv. .false.),'reallocate_l3D')
1
Error: Syntax error in expression at (1)
f951.exe: some warnings being treated as errors

Build with gfortran 9.3

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.