0

I'm working on implementing a user subroutine for LS-DYNA in linux Red Hat 5.11. To implement the subroutine an executable object file needs to be complied that includes the subroutine fortran code. I have a makefile that needs to be executed to create the .o file.

The problem is that the makefile was written for the Intel Fortran compiler but I only have assess to GFortran. I've already switched the compiler directory but I'm unsure what the other compiler commands do and how to execute those in GFortran. Here's the makefile:

lsdyna: dyn21.o dyn21b.o couple2other_user.o 
    /usr/bin/gfortran -o lsdyna init_once.o init_keywrd.o dynm.o dyn21.o dyn21b.o couple2other_user.o adummy_graph.o orderByMetis.o    adummy_msc.o mscapi.o libdyna.a libbcsext4.a liblsda.a liblssecurity.a  liblcpack.a libspooles.a libcparse.a libmf2.a liblsm.a liblscrypt.a libresurf.a libsfg.a libmetis.a  libfemster_wrap.a libfemster_wrap2d.a libfemster_wrap1d.a libfemster.a libfemster2d.a libfemster1d.a libpfem.a libmetis.a libblas.a liblapack.a libfftw3.a libsprng.a intel64_101_libansysdp.a  libdyna.a libblas.a liblapack.a libmetis.a  -i-static -L/usr/X11R6/lib64 -lX11 -openmp  -lstdc++ -lrt -lstdc++ 
dyn21.o: dyn21.f nhisparm.inc 
    /usr/bin/gfortran -c -w95 -zero -assume byterecl,buffered_io,protect_parens -mP2OPT_hpo_dist_factor=21 -ftz -nopad -fpp2 -openmp -i8 -r8  -DINTEL -DAdd_ -xW -fp-model precise -O2 -I. dyn21.f
dyn21b.o: dyn21b.f nhisparm.inc 
    /usr/bin/gfortran -c -w95 -zero -assume byterecl,buffered_io,protect_parens -mP2OPT_hpo_dist_factor=21 -ftz -nopad -fpp2 -openmp -i8 -r8  -DINTEL -DAdd_ -xW -fp-model precise -O2 -I. dyn21b.f
couple2other_user.o: couple2other_user.f 
    /usr/bin/gfortran -c -w95 -zero -assume byterecl,buffered_io,protect_parens -mP2OPT_hpo_dist_factor=21 -ftz -nopad -fpp2 -openmp -i8 -r8  -DINTEL -DAdd_ -xW -fp-model precise -O2 -I. couple2other_user.f
nlandon
  • 17
  • 2
  • 1
    ? Why don't you compile with the 'Intel Fortran Compliler' ? ... It used to be free. ... – Knud Larsen Jun 30 '16 at 20:52
  • 3
    The Intel compiler is very well documented and the documentation is available online. GFortran is also documented, and its documentation available online. What's stopping you reading the documentation and translating each Intel option into its GFortran equivalent ? – High Performance Mark Jun 30 '16 at 22:09
  • 1
    Your `Makefile` should use variables, and you should be aware of GNU make rule database (use `make -p` to get it). You also should enable warnings in `gfortran` (probably with `-Wall`). At last, your Redhat5 is a very old system; you'll better upgrade it. And the whole question is off-topic, since a *fix-my-code* (your `Makefile`) request. Please spend more time reading GNU [make documentation](https://www.gnu.org/software/make/manual/html_node/index.html) and [gfortran documentation](https://gcc.gnu.org/onlinedocs/gfortran/) – Basile Starynkevitch Jul 03 '16 at 16:05
  • Is there an associated error that occurs during compilation that we could look at and may point us to any issues? Thx – tale852150 Jul 03 '16 at 16:09
  • You might adapt some existing `Makefile` example (like [this](http://stackoverflow.com/a/14180540/841108)...) to Fortran – Basile Starynkevitch Jul 03 '16 at 16:10
  • Use tag [tag:fortran] for all Fortran questions. – Vladimir F Героям слава Jul 04 '16 at 08:00
  • @KnudLarsen Intel Fortran has never been free for everyone and it was the misuse of the free version by people who were not entitled fot it that lead Intel to cancel that free program. – Vladimir F Героям слава Jul 04 '16 at 08:02
  • I usually have a line at the top that says something like F90 = ifort or F90 = gfortran and then the $(F90) where I am compiling. Basically make files are not written FOR a compiler, but written TO CALL a compiler... Do it once at the top, and it runs through find n dandy. – Holmz Oct 17 '16 at 13:10

0 Answers0