[petsc-users] petsc-users Digest, Vol 200, Issue 3

kiran hegde kiranhegde75 at gmail.com
Sat Aug 2 22:56:07 CDT 2025


Hi,

Please find the attached configure.log file.
PETSC installation successfully completes with make check, without any
error.
But, when compiling fortan codes with   petsc  library+include in the
makefile i get this error.

Regards,
Kiran



On Sat, Aug 2, 2025 at 9:42 PM <petsc-users-request at mcs.anl.gov> wrote:

> Send petsc-users mailing list submissions to
>         petsc-users at mcs.anl.gov
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://lists.mcs.anl.gov/mailman/listinfo/petsc-users 
> or, via email, send a message with subject or body 'help' to
>         petsc-users-request at mcs.anl.gov
>
> You can reach the person managing the list at
>         petsc-users-owner at mcs.anl.gov
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of petsc-users digest..."
>
>
> Today's Topics:
>
>    1.  missing binary operator before token (kiran hegde)
>    2. Re:  missing binary operator before token (Satish Balay)
>    3. Re:  Error compiling with cuda (Satish Balay)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sat, 2 Aug 2025 20:51:59 +0530
> From: kiran hegde <kiranhegde75 at gmail.com>
> To: petsc-users at mcs.anl.gov
> Subject: [petsc-users] missing binary operator before token
> Message-ID:
>         <CANSMj-4Pwx4sGJ1He8Smzs8qy5B9DbKzFuZAN=
> 1jYciyLHRc_A at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hi ,
>
> I am compiling fortran code using petsc include & lib, but getting
> below error:
>
> 298 | #if PetscHasAttribute(format) &&
> !defined(PETSC_SKIP_ATTRIBUTE_FORMAT)
> Error: missing binary operator before token '('
>
> /home/kiranhegde/MyLinuxApplications/Installations/petsc/include/petscmacros.h:330:0:
>
>   330 | #if PetscHasAttribute(__cold__)
> Error: missing binary operator before token '('
>
> /home/kiranhegde/MyLinuxApplications/Installations/petsc/include/petscmacros.h:332:0:
>
>   332 | #elif PetscHasAttribute(cold) /* some implementations (old gcc) use
> no underscores */
> Error: missing binary operator before token '('
>
> /home/kiranhegde/MyLinuxApplications/Installations/petsc/include/petscmacros.h:355:0:
>
> 298 | #if PetscHasAttribute(format) &&
> !defined(PETSC_SKIP_ATTRIBUTE_FORMAT)
> Error: missing binary operator before token '('
>
> /home/kiranhegde/MyLinuxApplications/Installations/petsc/include/petscmacros.h:330:0:
>
>   330 | #if PetscHasAttribute(__cold__)
> Error: missing binary operator before token '('
>
> /home/kiranhegde/MyLinuxApplications/Installations/petsc/include/petscmacros.h:332:0:
>
>   332 | #elif PetscHasAttribute(cold) /* some implementations (old gcc) use
> no underscores */
> Error: missing binary operator before token '('
>
> /home/kiranhegde/MyLinuxApplications/Installations/petsc/include/petscmacros.h:355:0:
>
> Same errors repeat for many lines and header files
> I am using PETSC at 3.23.4 version with gcc at 15.1.0
>
>
>
> --
> Regards,
>
> Kiran Hegde
> Mobile:+91 9972600235
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20250802/21975a36/attachment-0001.html 
> >
>
> ------------------------------
>
> Message: 2
> Date: Sat, 2 Aug 2025 11:04:17 -0500 (CDT)
> From: Satish Balay <balay.anl at fastmail.org>
> To: kiran hegde <kiranhegde75 at gmail.com>
> Cc: petsc-users at mcs.anl.gov
> Subject: Re: [petsc-users] missing binary operator before token
> Message-ID: <b54479d9-1ffb-2a20-f3c1-f8ca6c3c7071 at fastmail.org>
> Content-Type: text/plain; charset=US-ASCII
>
> Do you get these errors with 'make check' on a petsc install - or when
> compiling a petsc fortran example (with the corresponding makefile)?
>
> Satish
>
> On Sat, 2 Aug 2025, kiran hegde wrote:
>
> > Hi ,
> >
> > I am compiling fortran code using petsc include & lib, but getting
> > below error:
> >
> > 298 | #if PetscHasAttribute(format) &&
> !defined(PETSC_SKIP_ATTRIBUTE_FORMAT)
> > Error: missing binary operator before token '('
> >
> /home/kiranhegde/MyLinuxApplications/Installations/petsc/include/petscmacros.h:330:0:
> >
> >   330 | #if PetscHasAttribute(__cold__)
> > Error: missing binary operator before token '('
> >
> /home/kiranhegde/MyLinuxApplications/Installations/petsc/include/petscmacros.h:332:0:
> >
> >   332 | #elif PetscHasAttribute(cold) /* some implementations (old gcc)
> use
> > no underscores */
> > Error: missing binary operator before token '('
> >
> /home/kiranhegde/MyLinuxApplications/Installations/petsc/include/petscmacros.h:355:0:
> >
> > 298 | #if PetscHasAttribute(format) &&
> !defined(PETSC_SKIP_ATTRIBUTE_FORMAT)
> > Error: missing binary operator before token '('
> >
> /home/kiranhegde/MyLinuxApplications/Installations/petsc/include/petscmacros.h:330:0:
> >
> >   330 | #if PetscHasAttribute(__cold__)
> > Error: missing binary operator before token '('
> >
> /home/kiranhegde/MyLinuxApplications/Installations/petsc/include/petscmacros.h:332:0:
> >
> >   332 | #elif PetscHasAttribute(cold) /* some implementations (old gcc)
> use
> > no underscores */
> > Error: missing binary operator before token '('
> >
> /home/kiranhegde/MyLinuxApplications/Installations/petsc/include/petscmacros.h:355:0:
> >
> > Same errors repeat for many lines and header files
> > I am using PETSC at 3.23.4 version with gcc at 15.1.0
> >
> >
> >
> >
>
>
>
> ------------------------------
>
> Message: 3
> Date: Sat, 2 Aug 2025 11:11:48 -0500 (CDT)
> From: Satish Balay <balay.anl at fastmail.org>
> To: Renato E Poli <rpoli at utexas.edu>
> Cc: petsc-users <petsc-users at mcs.anl.gov>
> Subject: Re: [petsc-users] Error compiling with cuda
> Message-ID: <e56d2656-8977-b14c-5e70-e7a270ffb046 at fastmail.org>
> Content-Type: text/plain; charset="utf-8"
>
> Please send configure.log
>
> presumably you are using a pre-installed mpi from hpc-sdk - that uses NV
> compilers. [and PETSc configure is defaulting to mpicc/mpif90 in PATH]
>
> If you do not have MPI with gcc/gfortran - you can do something like:
>
> ./configure --with-cuda=1 --with-cc=gcc --with-cxx=g++ --with-fc=gfortran
> --download-mpich [other options]
>
> When no options are specified - configure guesses - and picks up what it
> can find - and sometimes that might not be what you intend to use..
>
> Satish
>
> On Sat, 2 Aug 2025, Renato E Poli wrote:
>
> > It seems that the installer is the one choosing to use nvfortran instead
> of
> > gfortran.
> >
> > I am building a docker container (clean environment).
> > I simply install CUDA SDK from
> >
> https://urldefense.us/v3/__https://developer.download.nvidia.com/hpc-sdk/25.5/nvhpc_2025_255_Linux_x86_64_cuda_12.9.tar.gz__;!!G_uCfscf7eWS!cBTymZpXcpFZ7BHpCGxn0ooq_STD1f9CioiFgRypIYNWg9lpwnmLpddrWk0-J-wQoeTw9Ipu2FPm037mQg_C2w$
> > , set paths and call petsc configure.
> >
> > RUN cd petsc-3.23.5 &&\
> >     ./configure --prefix=/usr/local/petsc  --with-debugging=0  --with-mpi
> > --download-hdf5   --download-hypre  --with-blaslapack   --with-cuda && \
> >     make all && make install
> >
> > Do you see any reason for using the wrong compiler?
> >
> > Renato
> >
> > On Sat, Aug 2, 2025 at 12:28?AM Satish Balay <balay.anl at fastmail.org>
> wrote:
> >
> > > NVFORTRAN (based on flang-17) does not support some F2008 features that
> > > are required here (flang-19+ should work)
> > >
> > > Suggest using gfortran instead.
> > >
> > > Satish
> > >
> > > On Fri, 1 Aug 2025, Renato E Poli wrote:
> > >
> > > >  Hi,
> > > >
> > > > I see the error below when compiling with --with-cuda.
> > > >
> > > > Any suggestion?
> > > >
> > > >
> > > >          CC arch-linux-c-opt/obj/src/mat/impls/aij/seq/inode2.o
> > > >          CC
> arch-linux-c-opt/obj/src/mat/impls/aij/seq/aijperm/aijperm.o
> > > >          CC
> > > arch-linux-c-opt/obj/src/mat/impls/aij/seq/mattransposematmult.o
> > > >          CC arch-linux-c-opt/obj/src/mat/impls/aij/seq/matptap.o
> > > >          CC arch-linux-c-opt/obj/src/mat/impls/aij/seq/matrart.o
> > > >          FC arch-linux-c-opt/obj/src/sys/ftn-mod/petscsysmod.o
> > > > NVFORTRAN-S-0034-Syntax error at or near end of line
> > > >
> (/opt/src/petsc-3.23.5/arch-linux-c-opt/include/../ftn/sys/petscsys.h: 6)
> > > > NVFORTRAN-S-0034-Syntax error at or near end of line
> > > >
> (/opt/src/petsc-3.23.5/arch-linux-c-opt/include/../ftn/sys/petscsys.h:
> > > 18)
> > > > NVFORTRAN-S-0034-Syntax error at or near end of line
> > > >
> (/opt/src/petsc-3.23.5/arch-linux-c-opt/include/../ftn/sys/petscsys.h:
> > > 30)
> > > > NVFORTRAN-S-0034-Syntax error at or near end of line
> > > >
> (/opt/src/petsc-3.23.5/arch-linux-c-opt/include/../ftn/sys/petscsys.h:
> > > 42)
> > > > NVFORTRAN-S-0034-Syntax error at or near end of line
> > > >
> (/opt/src/petsc-3.23.5/arch-linux-c-opt/include/../ftn/sys/petscsys.h:
> > > 54)
> > > > NVFORTRAN-S-0034-Syntax error at or near end of line
> > > >
> (/opt/src/petsc-3.23.5/arch-linux-c-opt/include/../ftn/sys/petscsys.h:
> > > 65)
> > > > NVFORTRAN-S-0034-Syntax error at or near end of line
> > > >
> (/opt/src/petsc-3.23.5/arch-linux-c-opt/include/../ftn/sys/petscsys.h:
> > > 76)
> > > > NVFORTRAN-S-0034-Syntax error at or near end of line
> > > >
> (/opt/src/petsc-3.23.5/arch-linux-c-opt/include/../ftn/sys/petscsys.h:
> > > 88)
> > > > NVFORTRAN-S-0034-Syntax error at or near end of line
> > > >
> (/opt/src/petsc-3.23.5/arch-linux-c-opt/include/../ftn/sys/petscsys.h:
> > > 100)
> > > > NVFORTRAN-S-0034-Syntax error at or near end of line
> > > >
> (/opt/src/petsc-3.23.5/arch-linux-c-opt/include/../ftn/sys/petscsys.h:
> > > 112)
> > > > NVFORTRAN-S-0034-Syntax error at or near end of line
> > > >
> (/opt/src/petsc-3.23.5/arch-linux-c-opt/include/../ftn/sys/petscsys.h:
> > > 124)
> > > > NVFORTRAN-S-0034-Syntax error at or near end of line
> > > >
> (/opt/src/petsc-3.23.5/arch-linux-c-opt/include/../ftn/sys/petscsys.h:
> > > 136)
> > > > NVFORTRAN-S-0034-Syntax error at or near end of line
> > > >
> (/opt/src/petsc-3.23.5/arch-linux-c-opt/include/../ftn/sys/petscsys.h:
> > > 148)
> > > > NVFORTRAN-S-0034-Syntax error at or near end of line
> > > >
> (/opt/src/petsc-3.23.5/arch-linux-c-opt/include/../ftn/sys/petscsys.h:
> > > 160)
> > > > NVFORTRAN-S-0034-Syntax error at or near end of line
> > > >
> > >
> (/opt/src/petsc-3.23.5/arch-linux-c-opt/include/../ftn/sys/petscviewer.h: 6)
> > > > NVFORTRAN-S-0034-Syntax error at or near end of line
> > > >
> (/opt/src/petsc-3.23.5/arch-linux-c-opt/include/../ftn/sys/petscviewer.h:
> > > > 17)
> > > > NVFORTRAN-S-0034-Syntax error at or near end of line
> > > >
> > >
> (/opt/src/petsc-3.23.5/arch-linux-c-opt/include/../ftn/sys/petscoptions.h:
> > > > 6)
> > > > NVFORTRAN-S-0034-Syntax error at or near end of line
> > > >
> > >
> (/opt/src/petsc-3.23.5/arch-linux-c-opt/include/../ftn/sys/petscoptions.h:
> > > > 18)
> > > > NVFORTRAN-S-0034-Syntax error at or near end of line
> > > >
> > >
> (/opt/src/petsc-3.23.5/arch-linux-c-opt/include/../ftn/sys/petscoptions.h:
> > > > 30)
> > > > NVFORTRAN-S-0034-Syntax error at or near end of line
> > > >
> (/opt/src/petsc-3.23.5/arch-linux-c-opt/include/../ftn/sys/petsclog.h: 5)
> > > > NVFORTRAN-S-0034-Syntax error at or near end of line
> > > >
> (/opt/src/petsc-3.23.5/arch-linux-c-opt/include/../ftn/sys/petsclog.h:
> > > 17)
> > > > NVFORTRAN-S-0034-Syntax error at or near end of line
> > > >
> (/opt/src/petsc-3.23.5/arch-linux-c-opt/include/../ftn/sys/petsclog.h:
> > > 29)
> > > > NVFORTRAN-S-0034-Syntax error at or near end of line
> > > >
> > >
> (/opt/src/petsc-3.23.5/arch-linux-c-opt/include/../ftn/sys/petscdevice.h: 6)
> > > > NVFORTRAN-S-0034-Syntax error at or near end of line
> > > >
> (/opt/src/petsc-3.23.5/arch-linux-c-opt/include/../ftn/sys/petscdevice.h:
> > > > 17)
> > > >   0 inform,   0 warnings,  24 severes, 0 fatal for petscsysdef
> > > >
> > >
> > >
> >
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> petsc-users mailing list
> petsc-users at mcs.anl.gov
> https://lists.mcs.anl.gov/mailman/listinfo/petsc-users 
>
>
> ------------------------------
>
> End of petsc-users Digest, Vol 200, Issue 3
> *******************************************
>


-- 
Regards,

Kiran Hegde
Mobile:+91 9972600235
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20250803/60a0bd5f/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: configure.log
Type: text/x-log
Size: 2142665 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20250803/60a0bd5f/attachment-0001.bin>


More information about the petsc-users mailing list