Giter Site home page Giter Site logo

aamaricci / scifortran Goto Github PK

View Code? Open in Web Editor NEW
155.0 18.0 40.0 81.62 MB

A library of fortran modules and routines for scientific calculations (*in a way* just like scipy for python)

License: GNU Lesser General Public License v3.0

Fortran 99.30% Shell 0.02% Makefile 0.05% CMake 0.28% TeX 0.33% C 0.02%
scientific fortran cmake scipy lapack blas minpack quadpack fftpack arpack

scifortran's Introduction

scifortran's People

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  avatar  avatar  avatar  avatar  avatar

Watchers

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

scifortran's Issues

A problem in making the GAUSS_QUADRATURE.f90.o

The cmake process is successful:

-- The Fortran compiler identification is Intel 17.0.5.20170817
-- Check for working Fortran compiler: /public/software_purley/mpi/intelmpi/2017.4.239/intel64/bin/mpiifort
-- Check for working Fortran compiler: /public/software_purley/mpi/intelmpi/2017.4.239/intel64/bin/mpiifort -- works
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Checking whether /public/software_purley/mpi/intelmpi/2017.4.239/intel64/bin/mpiifort supports Fortran 90
-- Checking whether /public/software_purley/mpi/intelmpi/2017.4.239/intel64/bin/mpiifort supports Fortran 90 -- yes
-- OS: Linux 3.10.0-693.el7.x86_64
-- BUILD_TYPE=RELEASE
-- Found MPI_Fortran: /public/software_purley/mpi/intelmpi/2017.4.239/intel64/bin/mpiifort (found version "3.1")
-- Found MPI: TRUE (found version "3.1")
-- Set Fortran compiler FC to /public/software_purley/mpi/intelmpi/2017.4.239/intel64/bin/mpiifort, ID=Intel
/public/software_purley/compiler/intel/intel-compiler-2017.5.239/mkl/tools/mkl_link_tool: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
-- MKL found at: /public/software_purley/compiler/intel/intel-compiler-2017.5.239/mkl
-- MKL supports Scalapack+Blacs
-- Fortran Compiler id = Intel
-- Fortran Compiler ver. = 17.0.5.20170817
-- Fortran Compiler options = -fpp -O3 -ftz
-- Testing P-ARPACK patch: zdotc.patch
-- Patch applied: zdotc.patch
-- SF compilation lines: -L${libdir} -lscifor -L/public/software_purley/compiler/intel/intel-compiler-2017.5.239/mkl/lib/intel64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lmkl_scalapack_lp64 -lmkl_blacs_intelmpi_lp64 -L/usr/lib64 -lpthread -lm -ldl
-- Module file: scifor/user_prefix/intel/
-- Library version:
-- Library will be installed in: /public/home/gengl/A_LIB/SciFortran/scifor/intel/

TO CONCLUDE INSTALLATION <<
Compile with:
$ gmake
Install with:
$ gmake install

Uninstall with:
$ gmake uninstall

But the make process return an error, could someone tell me the reason? Thanks!

Scanning dependencies of target SF_PARSE_INPUTLIB
[ 1%] Building Fortran object src/SF_PARSE_INPUT/CMakeFiles/SF_PARSE_INPUTLIB.dir/LIST_INPUT.f90.o
[ 1%] Building Fortran object src/SF_PARSE_INPUT/CMakeFiles/SF_PARSE_INPUTLIB.dir/SF_PARSE_INPUT.f90.o
[ 1%] Built target SF_PARSE_INPUTLIB
Scanning dependencies of target SF_INITLIB
[ 2%] Building Fortran object src/SF_INIT/CMakeFiles/SF_INITLIB.dir/SF_ARRAYS.f90.o
[ 2%] Building Fortran object src/SF_INIT/CMakeFiles/SF_INITLIB.dir/SF_COLORS.f90.o
[ 2%] Building Fortran object src/SF_INIT/CMakeFiles/SF_INITLIB.dir/SF_CONSTANTS.f90.o
[ 3%] Building Fortran object src/SF_INIT/CMakeFiles/SF_INITLIB.dir/SF_FONTS.f90.o
[ 3%] Building Fortran object src/SF_INIT/CMakeFiles/SF_INITLIB.dir/SF_MISC.f90.o
[ 3%] Building Fortran object src/SF_INIT/CMakeFiles/SF_INITLIB.dir/SF_PAULI.f90.o
[ 4%] Building Fortran object src/SF_INIT/CMakeFiles/SF_INITLIB.dir/SF_TIMER.f90.o
[ 4%] Built target SF_INITLIB
Scanning dependencies of target SF_MPILIB
[ 4%] Building Fortran object src/SF_MPI/CMakeFiles/SF_MPILIB.dir/SF_BLACS.f90.o
[ 5%] Building Fortran object src/SF_MPI/CMakeFiles/SF_MPILIB.dir/SF_MPI.f90.o
[ 5%] Built target SF_MPILIB
Scanning dependencies of target SF_IOTOOLSLIB
[ 5%] Building Fortran object src/SF_IOTOOLS/CMakeFiles/SF_IOTOOLSLIB.dir/IOFILE.f90.o
[ 6%] Building Fortran object src/SF_IOTOOLS/CMakeFiles/SF_IOTOOLSLIB.dir/IOPLOT.f90.o
[ 6%] Building Fortran object src/SF_IOTOOLS/CMakeFiles/SF_IOTOOLSLIB.dir/IOREAD.f90.o
[ 7%] Building Fortran object src/SF_IOTOOLS/CMakeFiles/SF_IOTOOLSLIB.dir/SF_IOTOOLS.f90.o
[ 7%] Built target SF_IOTOOLSLIB
Scanning dependencies of target SF_DERIVATELIB
[ 8%] Building Fortran object src/SF_DERIVATE/CMakeFiles/SF_DERIVATELIB.dir/SF_DERIVATE.f90.o
[ 8%] Built target SF_DERIVATELIB
Scanning dependencies of target SF_INTEGRATELIB
[ 8%] Building Fortran object src/SF_INTEGRATE/CMakeFiles/SF_INTEGRATELIB.dir/GAUSS_QUADRATURE.f90.o
/public/home/gengl/A_LIB/package/SciFortran-master/src/SF_INTEGRATE/GAUSS_QUADRATURE.f90(33): error #8541: Not yet implemented: type containing ALLOCATABLE field of same type. Use POINTER instead. [INTEGRATION_TYPE]
type(integration_type),dimension(:),allocatable :: ivec
----------^
compilation aborted for /public/home/gengl/A_LIB/package/SciFortran-master/src/SF_INTEGRATE/GAUSS_QUADRATURE.f90 (code 1)
make[2]: *** [src/SF_INTEGRATE/CMakeFiles/SF_INTEGRATELIB.dir/GAUSS_QUADRATURE.f90.o] Error 1
make[1]: *** [src/SF_INTEGRATE/CMakeFiles/SF_INTEGRATELIB.dir/all] Error 2
make: *** [all] Error 2

Error applying patch zdotc.patch

Using WSL, I get the following error when running cmake ..

pwd
/mnt/c/fortran/public_domain/github/SciFortran/build
cmake ..
-- OS: Linux 5.10.43.3-microsoft-standard-WSL2
-- BUILD_TYPE=RELEASE
-- Fortran Compiler id   = GNU
-- Fortran Compiler ver. = 9.3.0
-- Fortran Compiler options = -cpp -ffree-line-length-none -fPIC -w  -Wno-argument-mismatch -O3   -funroll-loops
-- Set Fortran compiler FC to /usr/bin/mpif90, ID=GNU
-- Git SHA1: 8c2a7fe1aa1d7e7a935996e36ceb7bb81f6ff4fc
-- Git branch: master
-- Git tag: 4.7.3-1-g8c2a7fe
-- BLAS/LAPACK found at: /usr/lib/x86_64-linux-gnu/libopenblas.so /usr/lib/x86_64-linux-gnu/libopenblas.so;/usr/lib/x86_64-linux-gnu/libopenblas.so
-- Finding SCALAPACK
-- Testing P-ARPACK patch: zdotc.patch
-- Patch not applied. Applying: zdotc.patch
CMake Error at src/arpack/CMakeLists.txt:215 (MESSAGE):
  Error applying patch zdotc.patch


-- Configuring incomplete, errors occurred!
See also "/mnt/c/fortran/public_domain/github/SciFortran/build/CMakeFiles/CMakeOutput.log".
See also "/mnt/c/fortran/public_domain/github/SciFortran/build/CMakeFiles/CMakeError.log".

A few questions about SciFortran and it's packaging

On trying linux packaging of SciFortran a few questions can be interesting to maintainers (+ user repos). I'm trying to summurize some of them.

  • Third-party libraries (arpack, fftpack, minipack, quadpack): are modified versions of them are used (except cmake-files)? Is it possible to unbundle it and use upstream system installed package? Is arpack-ng (instead of arpack) is used really?

  • Names and directories structure convention: as I could see the installation directory structure currently aimed to install into user (non-system) environment, isn't? The current CMakeLists.txt and additional .sh scripts look to be aimed for this purpose.
    As example the recommended path where pkg-config searches packages .pc files is /usr/lib/pkgconfig/ or /usr/share/pkgconfig/ and library path /usr/lib/ (the /usr/lib64/ paths could be used instead of /usr/lib/ in some distributives of amd64/x86_64 arch - but it's easy to patch in place on packaging). Modules could be placed into /usr/include/scifor.
    Under actively enchancement process of CMakeLists.txt it's easily currently in my case (for gentoo) to skip cmake install phase and force to direct installation of .so library, .pc file and modules to approriate ststem directories.

  • Release circle: could it be less often, with accumulation of several fixes and features? Many places of scifor project store version number and it's frozen at 4.7.3 - it will be easier to change it once on separate "release commit" etc.

  • Documentation, examples, tests: the documentation writing is very time-consuming process. The examples are easier to create (but still require time) and could be used for tests later. The support of scifor users with examples could be helpful and is welcome :)
    The examples could be even made on the base of scipy documentation. The good starting point is creation of structured list of implemented procedures and functions.

What should I do with this cmake error?

-- The Fortran compiler identification is Intel 14.0.2.20140120
-- Check for working Fortran compiler: /opt/intel/composer_xe_2013_sp1.2.144/bin/intel64/ifort
-- Check for working Fortran compiler: /opt/intel/composer_xe_2013_sp1.2.144/bin/intel64/ifort -- works
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Checking whether /opt/intel/composer_xe_2013_sp1.2.144/bin/intel64/ifort supports Fortran 90
-- Checking whether /opt/intel/composer_xe_2013_sp1.2.144/bin/intel64/ifort supports Fortran 90 -- yes
-- OS: Linux 5.4.0-125-generic
-- BUILD_TYPE=RELEASE
-- Found MPI_Fortran: /home/user01/anaconda3/envs/triqs_env/lib/libmpifort.so (found version "4.0")
-- Found MPI: TRUE (found version "4.0")
-- Set Fortran compiler FC to /home/user01/anaconda3/envs/triqs_env/bin/mpif90, ID=Intel
-- MKL found at: /opt/intel/composer_xe_2013_sp1.2.144/mkl
-- MKL supports Scalapack+Blacs
-- Fortran Compiler id = Intel
-- Fortran Compiler ver. = 14.0.2.20140120
-- Fortran Compiler options = -fpp -O3 -ftz
-- Testing P-ARPACK patch: zdotc.patch
-- Patch applied: zdotc.patch
CMake Error at cmake/BuildPkgConfigFile.cmake:6 (LIST):
LIST sub-command REMOVE_DUPLICATES requires list to be present.
Call Stack (most recent call first):
CMakeLists.txt:292 (BUILD_PKCONFIG)

-- Version file: /home/user01/ncainstall/SciFortran-master/build/etc/modules/scifor/intel/.version
-- Module file: scifor/intel/
-- Library version:
-- Library will be installed in: /home/user01/opt/scifor/intel/

TO CONCLUDE INSTALLATION <<
Compile with:
$ make
Install with:
$ make install

Uninstall with:

We should better define the min versions of `CMake` and `ninja`

Getting ninja into HPC environments means either to deal with manual binary download (or build) or to rely on nonsudo solutions.

From their official list I think we could choose among these options:

E.g. on Ulysses, as far as I know, we have only pip out of the box, but it bundles a slightly outdated version of Ninja, which will not work for SciFortran. Here what happens:

$ cmake -GNinja ..
CMake Error at CMakeLists.txt:5 (PROJECT):
  The Ninja generator does not support Fortran using Ninja version

    1.10.2.git.kitware.jobserver-1

  due to lack of required features.  Kitware has implemented the required
  features but as of this version of CMake they have not been integrated to
  upstream ninja.  Pending integration, Kitware maintains a branch at:

    https://github.com/Kitware/ninja/tree/features-for-fortran#readme

  with the required features.  One may build ninja from that branch to get
  support for Fortran.

I managed to easily try the latest brewed version (1.11.1) on my laptop and everything works fine. But HomeBrew is quite of an hassle to get on Ulysses (and elsewhere I suspect) since it complains about a too old version of curl (and who knows what else downstream...).

Summarizing for now we know that:

CMake Version / Ninja Version Does work?
v3.15.4 / v1.10.2 โŒ
vx.yy.z / v1.11.0 โ”
v3.24.2 / v1.11.1 ๐ŸŸข

Ninja version 1.11.0 apparently is shipped by both Conda and Spack, which even has a separate package aimed at supporting fortran, so we could try one of those to determine the minimum required version for Ninja to work here. In the end we should edit the README to redirect to a fine-tuned subset of eligible Ninja versions.

undefined reference to `integrate_quad_func_'

Hello,
I met one problem when I tested the functionality of scifor.
The code snippet is shown below.

 program test
  Use scifor
  Implicit None
  
  real(8) :: Integral

  Call quad_func(sin2, 0.0d0, pi, Integral)
  
  Write (*,*) Integral

! ------------------------------- !  
Contains
  Function sin2(x)
    Real(8) :: sin2
	Real(8) :: x
	
	sin2 = sin(x)**2
  End Function
end Program test

After I input directives gfortran test_integrate.f95 -I/home/wangy/opt/scifor/gnu/4.6.31/include -L/home/wangy/opt/scifor/gnu/4.6.31/lib -lscifor /usr/lib64/liblapack.so /usr/lib64/libblas.so ,
it returned me an error information which is shown below.

/tmp/ccbOEfEL.o: In function `MAIN__':
test_integrate.f95:(.text+0x8c): undefined reference to `integrate_quad_func_'
collect2: error: ld returned 1 exit status

How to solve this probelm?

compilation not working on ubuntu 20.04.2

Hi, I am having troubls compiling the SciFor library. It works with version 4.7.5 but not from 4.7.6 onwards. The compilation error I get after invoking make is:

/home/severino/Desktop/Codes/QcmPLab/SciFortran/src/SCIFOR.f90:2:7:
2 | USE SF_ARRAYS
| 1
Fatal Error: Cannot open module file โ€˜sf_arrays.modโ€™ for reading at (1): No such file or directory
compilation terminated.
make[2]: *** [src/CMakeFiles/SCIFORLIB.dir/build.make:63: src/CMakeFiles/SCIFORLIB.dir/SCIFOR.f90.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1012: src/CMakeFiles/SCIFORLIB.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

I noticed that after invoking cmake I have a modified src/SCIFOR_VERSION.f90 file. I don't know if this is expected behaviour.

Attached are the CMakeCache.txt and CMakeOutput.log files.
CMakeCache.txt
CMakeOutput.log

UPDATE: I have the same issue with the DMFTTools library, version 2.3.3 works, version 2.3.4 not

Best Sever

Windows 10 Installation

Is there any document that can share the way to use the library in the Windows 10 platform? Should I have to copy the library to the library folder? Thanks in advance.

Issues about ```cmake ..```

Hi aamaricci,

The information returned after that I input cmake .. is shown below

 CMake Deprecation Warning at CMakeLists.txt:4 (CMAKE_MINIMUM_REQUIRED):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- The Fortran compiler identification is GNU 6.3.1
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: /usr/bin/f95 - skipped
-- Checking whether /usr/bin/f95 supports Fortran 90
-- Checking whether /usr/bin/f95 supports Fortran 90 - yes
-- OS: Linux 4.11.12-100.fc24.x86_64
-- BUILD_TYPE=RELEASE
-- Fortran Compiler id = GNU
-- Could NOT find MPI_Fortran (missing: MPI_Fortran_LIB_NAMES MPI_Fortran_F77_HEADER_DIR MPI_Fortran_MODULE_DIR MPI_Fortran_WORKS) 
CMake Error at /usr/local/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:218 (message):
  Could NOT find MPI (missing: MPI_Fortran_FOUND)

      Reason given by package: MPI component 'C' was requested, but language C is not enabled.  MPI component 'CXX' was requested, but language CXX is not enabled.  

Call Stack (most recent call first):
  /usr/local/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:577 (_FPHSA_FAILURE_MESSAGE)
  /usr/local/share/cmake-3.19/Modules/FindMPI.cmake:1721 (find_package_handle_standard_args)
  CMakeLists.txt:52 (FIND_PACKAGE)


-- Configuring incomplete, errors occurred!
See also "/home/wangy/downloads/scifor/build/CMakeFiles/CMakeOutput.log".
See also "/home/wangy/downloads/scifor/build/CMakeFiles/CMakeError.log".

Does it mean that the installation fail?

We state that MPI is optional but `-DUSE_MPI=false` fails

If we force plain gfortran (instead of mpif90) as:

$ export FC=gfortran

The build fails even if we explicitly request for not including mpi:

$ cmake -DUSE_MPI=false ..
click to see output
-- The Fortran compiler identification is GNU 12.2.0
-- Check for working Fortran compiler: /home/linuxbrew/.linuxbrew/bin/gfortran
-- Check for working Fortran compiler: /home/linuxbrew/.linuxbrew/bin/gfortran  -- works
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Checking whether /home/linuxbrew/.linuxbrew/bin/gfortran supports Fortran 90
-- Checking whether /home/linuxbrew/.linuxbrew/bin/gfortran supports Fortran 90 -- yes
-- OS: Linux 5.15.0-46-generic
-- BUILD_TYPE=RELEASE
-- MKL found at: /opt/intel/compilers_and_libraries_2020.4.304/linux/mkl
-- MKL supports Scalapack+Blacs
-- Fortran Compiler id   = GNU
-- Fortran Compiler ver. = 12.2.0
-- Fortran Compiler options = -cpp -ffree-line-length-none -fPIC -w  -fallow-argument-mismatch -O3   -funroll-loops
-- Found Git: /usr/bin/git (found version "2.25.1") 
-- Git SHA1: 4f49e7d81a3067c84dcaf8ee6bf9b768e7665a3e
-- Git branch: master
-- Git tag: 4.9.6
-- Testing P-ARPACK patch: zdotc.patch
-- Patch applied: zdotc.patch
-- SF compilation lines: -L${libdir} -lscifor -L/opt/intel/compilers_and_libraries_2020.4.304/linux/mkl/lib/intel64 -lmkl_gf_lp64 -lmkl_sequential -lmkl_core -lmkl_scalapack_lp64 -lmkl_blacs_intelmpi_lp64 -L/usr/lib/x86_64-linux-gnu -lpthread -lm -ldl
-- Version file: /home/gbellomia/Dropbox/SISSA/QcmPlab/SciFortran/buildNinja/etc/modules/scifor/gnu/.version
-- Module file: scifor/gnu/4.9.6
-- Library version: 4.9.6
-- Library will be installed in: /home/gbellomia/opt/scifor/gnu/4.9.6
-- 
>> TO CONCLUDE INSTALLATION <<
Compile with:
$ make
Install with:
$ make install

Uninstall with:
$ make uninstall

-- Configuring done
-- Generating done
-- Build files have been written to: /home/gbellomia/Dropbox/SISSA/QcmPlab/SciFortran/build
$ make
click to see output
Scanning dependencies of target SF_PARSE_INPUTLIB
[  0%] Building Fortran object src/SF_PARSE_INPUT/CMakeFiles/SF_PARSE_INPUTLIB.dir/LIST_INPUT.f90.o
[  1%] Building Fortran object src/SF_PARSE_INPUT/CMakeFiles/SF_PARSE_INPUTLIB.dir/SF_PARSE_INPUT.f90.o
[  1%] Built target SF_PARSE_INPUTLIB
Scanning dependencies of target SF_INITLIB
[  2%] Building Fortran object src/SF_INIT/CMakeFiles/SF_INITLIB.dir/SF_ARRAYS.f90.o
[  2%] Building Fortran object src/SF_INIT/CMakeFiles/SF_INITLIB.dir/SF_COLORS.f90.o
[  3%] Building Fortran object src/SF_INIT/CMakeFiles/SF_INITLIB.dir/SF_CONSTANTS.f90.o
[  3%] Building Fortran object src/SF_INIT/CMakeFiles/SF_INITLIB.dir/SF_FONTS.f90.o
[  3%] Building Fortran object src/SF_INIT/CMakeFiles/SF_INITLIB.dir/SF_MISC.f90.o
[  4%] Building Fortran object src/SF_INIT/CMakeFiles/SF_INITLIB.dir/SF_PAULI.f90.o
[  4%] Building Fortran object src/SF_INIT/CMakeFiles/SF_INITLIB.dir/SF_TIMER.f90.o
[  4%] Built target SF_INITLIB
Scanning dependencies of target SF_MPILIB
[  4%] Building Fortran object src/SF_MPI/CMakeFiles/SF_MPILIB.dir/SF_BLACS.f90.o
[  5%] Building Fortran object src/SF_MPI/CMakeFiles/SF_MPILIB.dir/SF_MPI.f90.o
[  5%] Built target SF_MPILIB
Scanning dependencies of target SF_IOTOOLSLIB
[  5%] Building Fortran object src/SF_IOTOOLS/CMakeFiles/SF_IOTOOLSLIB.dir/IOFILE.f90.o
[  5%] Building Fortran object src/SF_IOTOOLS/CMakeFiles/SF_IOTOOLSLIB.dir/IOPLOT.f90.o
[  6%] Building Fortran object src/SF_IOTOOLS/CMakeFiles/SF_IOTOOLSLIB.dir/IOREAD.f90.o
[  6%] Building Fortran object src/SF_IOTOOLS/CMakeFiles/SF_IOTOOLSLIB.dir/SF_IOTOOLS.f90.o
[  6%] Built target SF_IOTOOLSLIB
Scanning dependencies of target SF_DERIVATELIB
[  7%] Building Fortran object src/SF_DERIVATE/CMakeFiles/SF_DERIVATELIB.dir/SF_DERIVATE.f90.o
[  7%] Built target SF_DERIVATELIB
Scanning dependencies of target SF_INTEGRATELIB
[  8%] Building Fortran object src/SF_INTEGRATE/CMakeFiles/SF_INTEGRATELIB.dir/GAUSS_QUADRATURE.f90.o
[  8%] Building Fortran object src/SF_INTEGRATE/CMakeFiles/SF_INTEGRATELIB.dir/SF_INTEGRATE.f90.o
[  8%] Built target SF_INTEGRATELIB
Scanning dependencies of target SF_INTERPOLATELIB
[  9%] Building Fortran object src/SF_INTERPOLATE/CMakeFiles/SF_INTERPOLATELIB.dir/SF_INTERPOLATE.f90.o
[  9%] Built target SF_INTERPOLATELIB
Scanning dependencies of target SF_LINALGLIB
[ 10%] Building Fortran object src/SF_LINALG/CMakeFiles/SF_LINALGLIB.dir/SF_LINALG.f90.o
linalg_blacs_aux.f90:3:0:

Fatal Error: Cannot open included file 'mpif.h'
compilation terminated.
make[2]: *** [src/SF_LINALG/CMakeFiles/SF_LINALGLIB.dir/build.make:63: src/SF_LINALG/CMakeFiles/SF_LINALGLIB.dir/SF_LINALG.f90.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:823: src/SF_LINALG/CMakeFiles/SF_LINALGLIB.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

Where I want to highlight the actual fortran error:

linalg_blacs_aux.f90:3:0:

Fatal Error: Cannot open included file 'mpif.h'
compilation terminated.

The very same error is encountered by ninja (I first discovered it here, but then cross-checked with make)

$ cmake -DUSE_MPI=false -GNinja ..
[...]
$ ninja
[417/475] Building Fortran object src/SF_LINALG/CMakeFiles/SF_LINALGLIB.dir/SF_LINALG.f90.o
FAILED: src/SF_LINALG/CMakeFiles/SF_LINALGLIB.dir/SF_LINALG.f90.o include/sf_linalg.mod 
/home/linuxbrew/.linuxbrew/bin/gfortran  -I../src/SF_LINALG  -Iinclude -cpp -ffree-line-length-none -fPIC -w  -fallow-argument-mismatch -O3   -funroll-loops -Jinclude   -fpreprocessed -c src/SF_LINALG/CMakeFiles/SF_LINALGLIB.dir/SF_LINALG.f90-pp.f90 -o src/SF_LINALG/CMakeFiles/SF_LINALGLIB.dir/SF_LINALG.f90.o
linalg_blacs_aux.f90:3:0:

Fatal Error: Cannot open included file 'mpif.h'
compilation terminated.
[426/475] Building Fortran object src/SF_INTERPOLATE/CMakeFiles/SF_INTERPOLATELIB.dir/SF_INTERPOLATE.f90.o
ninja: build stopped: subcommand failed.

So, having it with both, I guess it is not a build-system (dependency-related) error.


Could it come from commit d9c6758, where the incriminate source file has moved from a USE MPI statement to include mpif.h? As previously discussed in 71b8aea this is crucial to avoid version mismatches but indeed it requires the mpif90 wrapper, to provide its own version of the mpif.h header. Well, I'm not actually sure it would have worked with a use statement neither: what happens to the MPI module if the compiler is not mpi-aware?

I imagine that PARPACK does not raise an issue since we do not request to compile it with the -DUSE_MPI=false option, but for sure we need to compile linalg_blacs_aux.f90 and there MPI is explicitly requested:
https://github.com/QcmPlab/SciFortran/blob/4f49e7d81a3067c84dcaf8ee6bf9b768e7665a3e/src/SF_LINALG/linalg_blacs_aux.f90#L2-L3

I actually believe that all the work needed to carefully disentangle the MPI and non-MPI features (and somehow document what you can actually use with a non-MPI install...) would not really be rewarded by any notable benefit. [See later comments, it's easier than what I expected]

Documentation

Hi Adriano,

I follow your progress with interest, I think this project has great potential. However, the lack of documentation limits me (and maybe others) to digg deeper. I am counscious that writing documentation is a time-consuming effort, but it has not less relevance of the code itself (IMHO). Have you a plan to add documentation in the near future (or it is already here and I am so blind to have missed it)?

Thank you very much for sharing your work.

Stefano

Another issue with failed to compile with ```mpif90 $(pkg-config --cflags --libs scifor) test.f95```

Firstly, I installed mpi. And I follow the make post-install instructions completely.
Secondly, I write one tested code for testing the interpolation functionality of scifor.

Module ParameterPack
    Implicit None
	Real(8), Parameter :: Pi=3.1415926535897932384626d0
    Integer, Parameter :: Nt = 1025
    Real(8), Save :: Array(2, 1:Nt)
End Module ParameterPack

! ------------------------------------------------------------------------------

! -----------------------------------------------------------------------------!
Module FunPack
   Use ParameterPack
   Use Scifor
   Implicit None
! ------------------------------------------------------------------!
!     (1) Function Fun(x)                                           !
! ------------------------------------------------------------------!
Contains
! -----------------------------------------------------------------------------!
  Function Fun(x)
     Real(8) :: Fun
     Real(8), Intent(in) :: x
     Integer, Save :: Iswitch = 0
     Real(8) :: yout
	 Real(8), Dimension(Nt) :: xin, yin
! ----------------------------------------------------------------------------!
     xin = Array(1,:)
	 yin = Array(2,:)
     Call cubic_spline(xin, yin, x, yout)
     Fun = yout
     Return
  End Function Fun
! -----------------------------------------------------------------------------
End Module FunPack

! -----------------------------------------------------------------------------!
Program InterPolate
   Use ParameterPack
   Use Scifor
   Use FunPack
   Implicit None
   Integer :: loop, i
   Real(8) :: dx, x, y
   Real(8), Dimension(1:Nt) :: line_gas
   Real :: ttime
! -----------------------------------------------------------------------------
   
   Open(11, file="line_gas.dat")
   Do i = 1, Nt
     Read(11,*) line_gas(i)
   End Do
! -----------------------------------------------------------------------------
   dx = 75.0d0/(Nt-1)
   Do loop = 1, Nt
     x = dx*(loop-1)
     Array(1, loop) = x
     Array(2, loop) = line_gas(loop)
   End Do
! -----------------------------------------------------------------------------
   Open(10, file="dt_sci_gas.dat")
   Do loop = 0, 75000
      x = 0.001d0*loop
      y = Fun(x)
      Write(10, *) x, y
   EndDo
   Close(10)
! -----------------------------------------------------------------------------
   Call CPU_time(ttime)
   Write(*,*) "-----------------------------------------------------------"
   Write(*,*) "ttime=:", ttime
! ------------------------------------------------------------------
End Program InterPolate

After I input
$ mpif90 $(pkg-config --cflags --libs scifor) test_cubic_spline.f95
It returned an error to me as follows.

/tmp/ccBaLEme.o: In function `__funpack_MOD_fun':
test_cubic_spline.f95:(.text+0xd8): undefined reference to `__sf_interpolate_MOD_d_cub_interp_s'
collect2: error: ld returned 1 exit status

However, it works when I compile this code by gfortran test_cubic_spline.f95 -I/home/wangy/opt/scifor/gnu/4.6.31/include -L/home/wangy/opt/scifor/gnu/4.6.31/lib -lscifor.

Issues about FFT

Hello,

I want to analyze the spectrum of a 1D spatial function dens(x) by computing the Fourier Transform of it.
And I find that there are many interfaces for FFT, such as rfft_1d_forward, cfft_1d_forward and cfft_1d_backward.
What are the differences between them? What are the outputs?
Could you introduce them to me briefly?
Thank you!

Segfault when using system-provided lapack

Using the lapack version provided by the system (Manjaro 22.0.2 with openblas 0.3.21-1) CDMFT calculations (for various drivers) crash with a segmentation fault during the diagonalization of the impurity Hamiltonian. Compiling SciFortran with -DWITH_BLAS_LAPACK everything works fine.

gdb gives the following backtrace:

Thread 1 "cdn_ssh" received signal SIGSEGV, Segmentation fault.
0x00007ffff6df50b2 in zgemv_n_HASWELL () from /usr/lib/libopenblas.so.3

#0 0x00007ffff6df50b2 in zgemv_n_HASWELL () from /usr/lib/libopenblas.so.3
#1 0x00007ffff66b550c in zgemv_ () from /usr/lib/libopenblas.so.3
#2 0x00007ffff7e5f199 in zlatrd_ () from /usr/lib/liblapack.so.3
#3 0x00007ffff7ddc9d0 in zhetrd_ () from /usr/lib/liblapack.so.3
#4 0x00007ffff7dd36ac in zheevd_ () from /usr/lib/liblapack.so.3
#5 0x0000555555b58775 in __sf_linalg_MOD_zeigh_simple ()
#6 0x00005555555c5f9e in ed_diag::ed_diag_d ()

log.txt
log_err.txt

Incompatibility of mentioned Licenses

The LICENSE.md file refers the "GNU Lesser General Public License v3.0" (LGPL-3.0) while README.md refers the "GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version" (GPL3+).

It slightly confuses.

Please update LICENSE.md or README.md with proper license.

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.