Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
53 Views

Syntax error due to '&' "when expecting one of: <IDENTIFIER>

Jump to solution

I have written a small parent/child program structure that makes use of ZeroMQ and OpenMP. Until recently I have used gfortran to compile the program but I am now moving to iFort. The code can be found here. However, when compiling using the following makefile (not currently in the repository):

FC=ifort -O2 -openmp
LIBS=libf77zmq.a -lzmq 

EXE=hwserver hwclient

.PHONY: default

default: $(EXE)

%: %.f f77_zmq.h libf77zmq.a
	$(FC) $*.f -o $@ $(LIBS) -ffree-form

clean:
	$(RM) -f -- $(EXE) *.ipc

I get plenty of errors regarding ampersands. gfortran complained some about them as well, but they only resulted in warnings. A snippet of the output looks as follows:

ifort -02 -openmp hwserver.f -o hwserver libf77zmq.a -lzmq
fortcom: Error: solve.i, line 324: Syntax error, found '&' when expecting one of: <IDENTIFIER>
        PARAMETER ( INTS_WORDS = 1, &
------------------------------------------------------^
fortcom: Error: solve.i, line 325: Syntax error, found '&' when expecting one of: <IDENTIFIER>
        &           REALS_WORDS = 2, &
------------------------------------------------------^

and so it goes on...

I have understood that this is likely caused by ZeroMQ making use of Fortran77 standards, but as aforementioned this turned out to not be a problem when I used gfortran. Fully aware that it might come down to me having to rewrite the ZMQ-bindings, I would like to hear from you first to see if there's another way.

 

Regards

0 Kudos

Accepted Solutions
Highlighted
53 Views

Add -free to your ifort command line.

That's our equivalent to the gfortran -ffree-form.

                     --Lorri

View solution in original post

0 Kudos
2 Replies
Highlighted
54 Views

Add -free to your ifort command line.

That's our equivalent to the gfortran -ffree-form.

                     --Lorri

View solution in original post

0 Kudos
Highlighted
Beginner
53 Views

Lorri Menard (Intel) wrote:

Add -free to your ifort command line.

That's our equivalent to the gfortran -ffree-form.

                     --Lorri

Thank you Lorri, this solved the ampersand problem! The compilation now exits with only warnings.

0 Kudos