0

I'm trying to update an arcane scientific F77 program to the modern world by making it easier to install w/ a .configure script. However, this has proved to be more difficult than advertised. The program I'm dragging kicking and screaming into the 21st century requires the SuperMongo plotting library, and I'm trying to figure out how to have Automake find the correct path for the necessary SuperMongo libraries (libplotsub.a, libdevices.a, and libutils.a) Rather than have you kind souls look at the guts of the code, I've created a skeleton github repository (https://github.com/Acetylene5/autoconf_testing).

The main program is test.f, and calls the junk.f file. Both files include the Stuff.com common block. The file junk.f calls two functions: one (dcopy) is from the LAPACK library, and the other (drawcurs) is from the SuperMongo program. The reason I did this is because this program I'm fast-forwarding out of the stone age uses both these libraries.

I found on the interwebs a LAPACK macro (ax_lapack.m4) which seems to find the LAPACK libraries on my system. I've attempted to copy this .m4 file to ax_supermongo.m4, and change the requisite names and directories. However, I am not an M4 expert, so I have no idea if this is doing what I want. I don't think it is, because if you look at the output of ./configure, it doesn't seem to find the sm_graphics file (the token supermongo routine used by ax_supermongo.m4 to the location of the SM libraries):

deen@aida44170:~/Code/FORTRAN/testing/autoconf/master> autoreconf -i
deen@aida44170:~/Code/FORTRAN/testing/autoconf/master> ./configure
configure: loading site script /usr/share/site/x86_64-unknown-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether the Fortran 77 compiler works... yes
checking for Fortran 77 compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU Fortran 77 compiler... no
checking whether /usr/local2/misc/iraf/iraf/unix/hlib/f77.sh accepts -g... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... none
checking for sgemm_... no
checking for ATL_xerbla in -latlas... no
checking for sgemm_ in -lblas... yes
checking for dgemm_ in -ldgemm... no
checking for sgemm_ in -lmkl... no
checking for sgemm_... (cached) no
checking for sgemm_ in -lcxml... no
checking for sgemm_ in -ldxml... no
checking for sgemm_ in -lscs... no
checking for sgemm_ in -lcomplib.sgimath... no
checking for sgemm_ in -lblas... (cached) yes
checking for sgemm_ in -lessl... no
checking for sgemm_ in -lblas... (cached) yes
checking build system type... x86_64-suse-linux-gnu
checking host system type... x86_64-suse-linux-gnu
checking how to get verbose linking output from /usr/local2/misc/iraf/iraf/unix/hlib/f77.sh... configure: WARNING: cannot determine how to obtain linking information from /usr/local2/misc/iraf/iraf/unix/hlib/f77.sh

checking for Fortran 77 libraries of /usr/local2/misc/iraf/iraf/unix/hlib/f77.sh... 
checking for dummy main to link with Fortran 77 libraries... none
checking for Fortran 77 name-mangling scheme... lower case, underscore, extra underscore
checking for cheev_... no
checking for cheev_ in -llapack... yes
checking for sm_graphics__... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: executing depfiles commands

On my system, the Supermongo libraries reside in: /usr/local/misc/sm/sm2_4_36/lib/

Any suggestions on how to get autoconf to look into this directory, or possibly use a command-line variable to pass the directory here?

Please let me know if you need any more information.

Casey

soylentdeen
  • 101
  • 7
  • If this is a Linux/HPUX-11/Solaris/AIX system, try setting the LD_LIBRARY_PATH to point to your library directory. Presumably it is a .so or .sl. It may already have values so just prepend to it. – cup Jul 31 '13 at 04:58
  • Always use tag [tag:fortran] and only add the version when necessary to distinguish that your question is specific. For example that you cannot use Fortran 2008 but only Fortran 90. – Vladimir F Героям слава Dec 17 '15 at 11:46

1 Answers1

0

autoconf does not try to find the libraries for you, but the configure script that it generates does. If you want that configure script to look in /usr/local/misc/sm/sm2_4_36/lib/, the mechanism you use will depend on your system, but it is very common to give an argument to the configure script of the form LDFLAGS=-L/usr/local/misc/sm/sm2_4_36/lib/. You will probably also have to add a similar -I clause to CPPFLAGS to find the header files.

William Pursell
  • 204,365
  • 48
  • 270
  • 300