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