Hi,
I am going to run my fortran code in a server and I need to write a makefile. Now in my fortran, I invoke the subroutine in IMSL.
So how do I write the makefile? or how to define the IMSL subroutine in makefile?
Confusion...I call 'source' any file you can read, ASCII text. To me that's source. You compile the 'source' code to get object files (assembly language, that is). You then compile the object files with the result an application or 'executable' file.
I prefer to use 'cygwin', a free F77 compiler that you can put onto a PC. Tried some fancier programs, better GUI, hated them, so I went back to the basics.
For instance, my makefile is
.f:
g77 $< -static -lm -o $*
I use the command 'make xxx.f' to compile xxx.f into an object and creates an executable at the same time, xxx.exe
So back to the original question--I am going to assume that this IMSL library is someplace you can look at the folder. The file names are *.f or *.o or what?
I don't have access to these source in the server. But I hear that the source is in default in some location/directory. And if we include these directory with the IMSL lib, we may run the IMSL with no problem. Otherwishe in my current case, the subroutine from IMSL lib is not recognized and said to be undefined.
Is it true?
There are two sources that seem to be referred to in this thread
1) The program source
2) The IMSL source
Assume the IMSL source is not available but the IMSL library and headers are.
Does the program source live on the Linux server or the Windows PC? If it lives on the Linux server, does the Linux server have access to the Windows PC's file system through Samba? If it doesn't, the files have to be ftp'd to the server.
Assuming the IMSL headers live in /opt/IMSL/include and the library lives in /opt/IMSL/lib and the library is called libIMSL.a or libIMSL.so the rule will look something like
.f.o:
g77 -c -I/opt/IMSL/include $<
This will create a .o from a .f. This rule appears first. Next comes the target. Say your program is aiamasal and the program source in main.f
-L tells it where to look for the library -l tells it the library name without the lib, .a or .so. This wil create the executable on Linux. You can run it on Linux but not on your Windows PC.