############################################################ # Building 'tdgesv' and sample output on physics, a Sun 4 # Ultra-Enterprise running SunOS 5.6 ############################################################# physics% pwd; ls /export/ugrad/phys410/linsys/ex1 Makefile tdgesv.f physics% make f77 -O -c tdgesv.f tdgesv.f: MAIN tdgesv1: f77 -O -L/home5/choptuik/lib tdgesv.o -llapack -o tdgesv Undefined first referenced symbol in file dscal_ /usr/local/lib/liblapack.a(dgetf2.o) dswap_ /usr/local/lib/liblapack.a(dlaswp.o) dtrsm_ /usr/local/lib/liblapack.a(dgetrf.o) idamax_ /usr/local/lib/liblapack.a(dgetf2.o) dgemm_ /usr/local/lib/liblapack.a(dgetrf.o) dger_ /usr/local/lib/liblapack.a(dgetf2.o) ld: fatal: Symbol referencing errors. No output written to tdgesv make: [tdgesv] Error 1 (ignored) ############################################################ # OOPS ... those are references to BLAS routines! I haven't # defined the environment variable LIBBLAS which is used in the # Makefile. Best to add a line in ~/.cshrc.user. Arguably, # '-lblas' should just be in the Makefile. However, on SOME # systems, BLAS is effectively "built-in", and then explicit # reference to it can cause problems at load time. With the # current mechanism, we can easily deal with such a case # simply by leaving the environment variable undefined on # those systems. ############################################################ physics% vi ~/.cshrc.user INSERT ----> setenv LIBBLAS '-lblas' ############################################################ # "Activate" the changed .cshrc_user; among other things this # will set LIBBLAS properly. ############################################################ physics% source !$ source ~/.cshrc.user [47]physics{phys410} set prompt="physics% " physics% pwd; ls /export/ugrad/phys410/linsys/ex1 Makefile tdgesv.f tdgesv.o ############################################################ # This time the build works ... ############################################################ physics% make f77 -O -L/home5/choptuik/lib tdgesv.o -llapack -lblas -o tdgesv ############################################################ # ... and we get output consistent with the other systems. ############################################################ physics% tdgesv 5.4263644124316 -0.32577537681739 -0.40835080698946