Hi,
I am a member of the team of ASIR Seismic (https://asirseismic.com).Is the SAC distribution suitable for UBUNTU 22.04?
I have a problem compiling a program (main.f) using readbbf , setbbv and writebbf (see below)
Thanks for your help,
Rami Hofstetter
Program main.f:------
call readbbf ('bbfile',nerr)
call setbbv ('V1',v1,nerr)
call writebbf ('bbfile',nerr)
stopend
f77 -g -c -o main.o main.f
f77 -g -o ../../bin/perform main.o /usr/local/sac/lib/sacio.a
/usr/bin/ld: main.o: in function `MAIN__':
/home/asirrami/WFMODEL/sw/perform/main.f:105: undefined reference to `readbbf_'
/usr/bin/ld: /home/asirrami/WFMODEL/sw/perform/main.f:106: undefined reference to `setbbv_'
/usr/bin/ld: /home/asirrami/WFMODEL/sw/perform/main.f:107: undefined reference to `writebbf_'
collect2: error: ld returned 1 exit status
make: *** [Makefile:10: perform] Error 1
I am a member of the team of ASIR Seismic (https://asirseismic.com).Is the SAC distribution suitable for UBUNTU 22.04?
I have a problem compiling a program (main.f) using readbbf , setbbv and writebbf (see below)
Thanks for your help,
Rami Hofstetter
Program main.f:------
call readbbf ('bbfile',nerr)
call setbbv ('V1',v1,nerr)
call writebbf ('bbfile',nerr)
stopend
f77 -g -c -o main.o main.f
f77 -g -o ../../bin/perform main.o /usr/local/sac/lib/sacio.a
/usr/bin/ld: main.o: in function `MAIN__':
/home/asirrami/WFMODEL/sw/perform/main.f:105: undefined reference to `readbbf_'
/usr/bin/ld: /home/asirrami/WFMODEL/sw/perform/main.f:106: undefined reference to `setbbv_'
/usr/bin/ld: /home/asirrami/WFMODEL/sw/perform/main.f:107: undefined reference to `writebbf_'
collect2: error: ld returned 1 exit status
make: *** [Makefile:10: perform] Error 1
-
Dear Rami -
This is a workaround rather than a fix. (Whether there is a SAC problem, I don’t know.)
The only sensible use I know of for readbbf / writebbf is to communicate between the SAC command language and an external program. A much simpler and straightforward way to do this is by using the
$RUN prog > /tmp/macro.m
…
$ENDRUN
mechanism in a SAC macro to provide program input, and for the program to write a SAC macro file which gets read by SAC to get output from a program, e.g. write
value = 1.0
print *,’SETBB V1 ‘,value
print *,’Q’
end
in your f77 program with standard output directed to a SAC macro file that your own SAC macro expects to read (see above $RUN example). Then issue “m /tmp/macro.m” in your own SAC macro and you get the value of V1.
The readbbf / writebbf mechanism is not used very much (it actually is an old LLNL software package that predates SAC and got absorbed into it in the early ‘80s) and is possibly broken or even, silently, absent in newer releases of SAC.
On 29 Jul 2022, at 19:14, rami hofstetter (via IRIS) <sac-help-bounce<at>lists.ds.iris.edu> wrote:
George Helffrich
Hi,
I am a member of the team of ASIR Seismic (https://asirseismic.com).
Is the SAC distribution suitable for UBUNTU 22.04?
I have a problem compiling a program (main.f) using readbbf , setbbv and writebbf (see below)
Thanks for your help,
Rami Hofstetter
Program main.f:
------
call readbbf ('bbfile',nerr)
call setbbv ('V1',v1,nerr)
call writebbf ('bbfile',nerr)
stop
end
f77 -g -c -o main.o main.f
f77 -g -o ../../bin/perform main.o /usr/local/sac/lib/sacio.a
/usr/bin/ld: main.o: in function `MAIN__':
/home/asirrami/WFMODEL/sw/perform/main.f:105: undefined reference to `readbbf_'
/usr/bin/ld: /home/asirrami/WFMODEL/sw/perform/main.f:106: undefined reference to `setbbv_'
/usr/bin/ld: /home/asirrami/WFMODEL/sw/perform/main.f:107: undefined reference to `writebbf_'
collect2: error: ld returned 1 exit status
make: *** [Makefile:10: perform] Error 1
----------------------
SAC Help
Topic home: http://ds.iris.edu/message-center/topic/sac-help/ | Unsubscribe: sac-help-unsubscribe<at>lists.ds.iris.edu
Sent from the IRIS Message Center (http://ds.iris.edu/message-center/)
Update subscription preferences at http://ds.iris.edu/account/profile/
george<at>elsi.jp