PrincetonUniversity / EDIPIC-2D

GNU General Public License v3.0
34 stars 20 forks source link

Error during "make" #3

Closed thstjdgus9 closed 2 years ago

thstjdgus9 commented 2 years ago

When I use "make" for source code build, there comes an error with "intrinsic module". My Compiler version is as follows.

[root@localhost src]# gcc --version gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44)

Error output is as follows.

[root@localhost src]# make "Using gcc/gfortran compilers" mpif90 -O2 -ffree-line-length-none -I/home/son/petsc-3.14.6//include -c pic2d_ElectronWallCollisions.f90 pic2d_ElectronWallCollisions.f90:749.19:

use, intrinsic :: ieee_arithmetic 1 Fatal Error: Can't find an intrinsic module named 'ieee_arithmetic' at (1)

How can I resolve it?

stephethier commented 2 years ago

You need to use a newer version of gcc/gfortran. The ieee_arithmetic module is supported for gcc versions >= 5. See https://stackoverflow.com/questions/30747019/ieee-arithmetic-intrinsic-module-in-gfortran

thstjdgus9 commented 2 years ago

You need to use a newer version of gcc/gfortran. The ieee_arithmetic module is supported for gcc versions >= 5. See https://stackoverflow.com/questions/30747019/ieee-arithmetic-intrinsic-module-in-gfortran

Thanks for your reply. I updated my GNU version to 10.2.1, and then this error has solved! However, now I confronted new error because of the GNU version. Error output is as follows.

[root@localhost src]# make "Using gcc/gfortran compilers" mpif90 -O2 -ffree-line-length-none -I/home/son/petsc-3.14.6//include -c pic2d_ElectronWallCollisions.f90 pic2d_ElectronWallCollisions.f90:5:7:

5 |   USE ParallelOperationValues
  |       1

Fatal Error: Cannot read module file ‘paralleloperationvalues.mod’ opened at (1), because it was created by a different version of GNU Fortran compilation terminated.

Please help me to resolve it

stephethier commented 2 years ago

You need to remove the old module and object files that you compiled with gfortran-4.8.5. Simply do the following: make clean Followed by make

thstjdgus9 commented 2 years ago

You need to remove the old module and object files that you compiled with gfortran-4.8.5. Simply do the following: make clean Followed by make

Stephethier, thanks for your reply! Now, I encountered new error. When I executed make, error comes from pic2d_PETSc_Solver.o \ Error is as follows.

mpif90 -O2 -ffree-line-length-none -I/home/son/petsc-3.14.6/include -c pic2d_PETSc_Solver.F90 /home/son/petsc-3.14.6/include/petsc/finclude/petscsys.h:13:2:

if defined (PETSC_HAVE_MPIUNI)

1~~~~ Fatal Error: petscconf.h: No such file or directory compilation terminated.

Of course, I checked following directory and petscconf.h existence. Also the environmental variable was set as follows.

export PETSC_DIR = /home/son/petsc-3.14.6
export LD_LIBRARY_PATH=${PETSC_DIR}/lib:${LD_LIBRARY_PATH}

Can you give me an Idea to resolve it? Thanks

stephethier commented 2 years ago

It looks like you installed PETSc yourself, right? Have you done the last step, which is to do make install?

thstjdgus9 commented 2 years ago

It looks like you installed PETSc yourself, right? Have you done the last step, which is to do make install?

I double checked my PETSc installation. However above error still remains. I tried other methods such as re-installation, but still it doesn't work.

What could I try next?

Thanks for your help.

stephethier commented 2 years ago

I think that your PETSC_DIR variable points to the wrong directory. It should not point to the PETSc source distribution directory (/home/son/petsc-3.14.6) but to wherever you "installed" it. When you ran the PETSc config script, did you set the --prefix= parameter? The instructions at Installing PETSc say:

./configure --with-cc=mpicc --with-cxx=mpicxx --with-fc=mpif90 \
            COPTFLAGS='-O2' CXXOPTFLAGS='-O2' FOPTFLAGS='-O2' \
            --with-blaslapack-dir=$MKLROOT \
            --download-hypre \
            --prefix=PATH_TO_INSTALL_DIRECTORY  \
            PETSC_ARCH=INTEL_2019  \
            PETSC_DIR=${PWD}

make all
make install

The final make install will copy all the required files to PATH_TO_INSTALL_DIRECTORY and that's the directory that your PETSC_DIR variable needs to point to: export PETSC_DIR=PATH_TO_INSTALL_DIRECTORY

thstjdgus9 commented 2 years ago

Oh, finally my problem resolved. As you said, I set my PETSC_DR and prefix in source distribution directory so that it didn't work.

Now EDIPIC-2D example works on my computer.

Thanks for your great help!!