<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Sufang,<br>
<br>
Building SPECFEM3D is
slightly tricky. There are two programs: the mesher (xmeshfem3D) and
the solver (xspecfem3D). In order to build the solver, you need
"OUTPUT_FILES/values_from_mesher.h". But this header file is an output
file of the mesher! In other words, you need to do the
following:<br>
<br>
1) Build 'xmeshfem3D'.<br>
2) Run 'xmeshfem3D' with the desired parameters (see "DATA/Par_file").
This will produce "OUTPUT_FILES/values_from_mesher.h" as output.<br>
3) Build 'xspecfem3D'.<br>
4) Run 'xspecfem3D'.<br>
<br>
There is also a utility program called "xcreate_header_file" which will
simply generate "OUTPUT_FILES/values_from_mesher.h" from your parameter
file without doing anything else (it won't create a mesh). This is
useful if you are running on a cluster where the mesher and the solver
need to run as a single batch job, and you therefore need to build both
programs beforehand. So an alternative approach is:<br>
<br>
1) Build 'xcreate_header_file'.<br>
2) Run 'xcreate_header_file' with the desired parameters
("DATA/Par_file"). This will produce
"OUTPUT_FILES/values_from_mesher.h" as output.<br>
3) Build 'xmeshfem3D' and 'xspecfem3D'.<br>
4) Run 'xmeshfem3D' and 'xspecfem3D'.<br>
<br>
I'm not certain what is causing the linker error LNK1136 --
unfortunately I don't have Visual Fortran for Windows available to
test. It is possible that your Fortran compiler couldn't find
"OUTPUT_FILES/values_from_mesher.h" and
produced a corrupt ".obj" file, but this seems unlikely. <br>
<br>
I do have one theory. Looking at the 'Makefile', note that some of the
files are compiled with your regular Fortran compiler command, but
others -- such as specfem3D.f90 -- are compiled with 'mpif90'. So I
would make sure your settings for the Makefile variables 'F90' and
'MPIF90' are consistent. In particular, on Windows (as I recall) the
GNU compilers use a different object file format than the Intel and
Microsoft compilers, so an incompatibility could arise there. Of
course, if you aren't using 'Makefile', this doesn't apply to you.<br>
<br>
If you
continue to have trouble with LNK1136, send me the output of a full
rebuild, and "specfem3D.obj".<br>
<br>
--Leif Strand<br>
&nbsp; <a class="moz-txt-link-freetext" href="http://www.geodynamics.org/">http://www.geodynamics.org/</a><br>
<br>
<br>
Sufang Zhang wrote:
<blockquote cite="mid44CB0F21.00017C.30649@bj163app5.163.com"
 type="cite">
  <div>Dear cig-short,</div>
  <div>&nbsp;&nbsp; I am lucky to discover your website and have downloaded the
software "SPECFEM3D_BASIN_V1.2". When I debugged it in Visual Fortran,
there is an error like that "Linking...<br>
.\Debug\specfem3D.obj : fatal error LNK1136: invalid or corrupt file<br>
Error executing link.exe."</div>
  <div>&nbsp;And I have not found any files in the filefold "OUTPUT_FILES".</div>
  <div>&nbsp;</div>
  <div>&nbsp;&nbsp; Also, I think&nbsp;the problem may be&nbsp;the following code.&nbsp; </div>
  <div><br>
! standard include of the MPI library<br>
&nbsp; include 'mpif.h'</div>
  <div>&nbsp; </div>
  <div>! include values created by the mesher<br>
&nbsp; include "OUTPUT_FILES/values_from_mesher.h"</div>
  <div>&nbsp;</div>
  <div>&nbsp;Can you&nbsp;give me some advice to use the softwar?</div>
  <div>&nbsp; </div>
  <div>Best wishes!</div>
  <div>&nbsp;</div>
  <div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Zhang Sufang</div>
  <div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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