No subject


Thu Oct 27 09:13:38 EDT 2011


it is usually a problem in passing the values of the netcdf variable to 
genmake2. What follows is what I do to track down this problem by looking 
at genmake.log (will appear after you run genmake2): create a file 
(genmake_tnc.F) like the one shown in genmake.log in the netcdf section 
(towards the end), and try to compile it with the command line(s) that you 
can also find in genmake.log. In my previous example that would be (don't 
use this, but the corresponding lines in your own genmake.log):
1. this one creates genmake_tnc.f
cat genmake_tnc.F |  cpp -traditional -P -DWORDLENGTH=4 -DALLOW_USE_MPI 
-DALWAYS_USE_MPI -DHAVE_SYSTEM -DHAVE_FDATE -DHAVE_ETIME -DHAVE_CLOC 
-DHAVE_SETRLSTK -DHAVE_SIGREG -DHAVE_STAT 
-I/uv/soft/netcdf/3.6.3-intel/include -I/opt/sgi/mpt/mpt-2.05/include
2. this one compiles
ifort  -W0 -WB -convert big_endian -assume byterecl -fPIC -O3 -align -c 
genmake_tnc.f
3. this one links the libraries to create the executable
ifort  -W0 -WB -convert big_endian -assume byterecl -fPIC -O3 -align -o 
genmake_tnc genmake_tnc.o -L/uv/soft/netcdf/3.6.3-intel/lib/ -lmpi 
-lnetcdf
Then you'll have to tinker with the flags etc, until this works "offline", 
and then you can add the appropriate lines in the build option file 
(INCLUDES="$INCLUDES -I/uv/soft/netcdf/3.6.3-intel/include", LIBS="$LIBS 
-L/uv/soft/netcdf/3.6.3-intel/lib").

M.


On Jul 30, 2012, at 7:30 PM, Patti M Sheaffer wrote:

>  Specifically, what is an "inverted comma?" 
> 
> I've noticed some issues with library linking with the -lnetcdf call to 
> gcc this way and am very curious for the fix!  The best I've been able 
> to do is to specifically name the library in the call.  I've built 
several 
>  of these codes and always have the same problem with netcdf. 


_______________________________________________
MITgcm-support mailing list
MITgcm-support at mitgcm.org
http://mitgcm.org/mailman/listinfo/mitgcm-support


--=_alternative 000A128988257A51_=
Content-Type: text/html; charset="US-ASCII"

<tt><font size=2>I'm sorry I wasn't clearer - and I probably made a mistake
with my quotations. &nbsp;I'll have to think about your comments, but they
are very helpful - thank you! &nbsp;</font></tt>
<br>
<br><tt><font size=2>I just today discovered the actual problem to which
I was referring (it may not be relevant to MITgcm): &nbsp;When you build
NetCDF and install it to its own directory on several of the Linux x64
distros, it creates /yournetcdfinstallpath/bin, /yournetcdfinstallpath/include,
and /yournetcdfinstallpath/lib64. &nbsp;But often the build script gcc
command line call to include the library (say, in MITgcm) is:</font></tt>
<br>
<br><tt><font size=2>-L/yournetcdfinstallpath/lib -lnetcdf</font></tt>
<br>
<br><tt><font size=2>Note that it's not going to look in /yournetcdfinstallpath/lib64
- so it fails to find the library it needs and doesn't always tell you.
&nbsp;Most buildscripts I've seen for most linux apps that get supplied
as buildable source (rather than binares) encounter this sort of dependency
issue. &nbsp;It's been around at least a decade (I used to build an x64
bacula contrib for an OpenSuSE repo). &nbsp;I would think that script-building
tools would by now check or create the options for both lib and a lib64
directories for all required libs - but I'm a total klutz with build scripts
so who am I to criticize? &nbsp; ;^)</font></tt>
<br>
<br><tt><font size=2>Happy, Happy, Happy :-)</font></tt>
<br>
<p><font size=3>Patricia</font>
<p>
<br>
<br>
<br>
<br><font size=1 color=#5f5f5f face="sans-serif">From: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">Martin Losch &lt;Martin.Losch at awi.de&gt;</font>
<br><font size=1 color=#5f5f5f face="sans-serif">To: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">mitgcm-support at mitgcm.org,
</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Date: &nbsp; &nbsp; &nbsp;
&nbsp;</font><font size=1 face="sans-serif">07/31/2012 05:25 AM</font>
<br><font size=1 color=#5f5f5f face="sans-serif">Subject: &nbsp; &nbsp;
&nbsp; &nbsp;</font><font size=1 face="sans-serif">Re: [MITgcm-support]
Build with nectdf</font>
<br>
<hr noshade>
<br>
<br>
<br><tt><font size=2>Patti,<br>
<br>
the build_options-files for genmake2 use bash-syntax. In bash, this &quot;$NETCDF_ROOT&quot;
is different from '$NETCDF_ROOT' (the former expands NETCDF_ROOT, the latter
doesn't); there are many resources online, that explain this in more detail.
As a general rule I always use double quotes with bash, unless I want to
pass variable names rather than their content.<br>
<br>


More information about the MITgcm-support mailing list