# Where is libnetcdf.a and libnetcdff.a in NetCDF?

**URL:** https://forum.cmascenter.org/t/where-is-libnetcdf-a-and-libnetcdff-a-in-netcdf/1979
**Category:** I/O API
**Tags:** admin, smoke
**Created:** [December 10, 2020, 9:44pm UTC](https://forum.cmascenter.org/t/where-is-libnetcdf-a-and-libnetcdff-a-in-netcdf/1979 "2020-12-10T21:44:23Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Iqbal](https://avatars.discourse-cdn.com/v4/letter/i/bc8723/32.png) [@Iqbal](https://forum.cmascenter.org/u/Iqbal)
#### Post date: [December 10, 2020, 9:44pm UTC](https://forum.cmascenter.org/t/where-is-libnetcdf-a-and-libnetcdff-a-in-netcdf/1979/1 "2020-12-10T21:44:23Z")

</div>

Hello,  
I am trying to finish the step-8 from here [Availability/Download of the BAMS/Models-3 I/O&nbsp;API](https://www.cmascenter.org/ioapi/documentation/all_versions/html/AVAIL.html#ncf4)  
of I/O API 3.2 installation. Also, step-8 in the readme file from I/O APIV3.2 (attached). The step-8 is related to NetCDF library.

I have installed netcdf-Fortran 4.2 and netcdf 4.3.3.1 for Linux Centos 7. When I use  
nc-config --libs and nf-config --libs, I get lnetcdf and lnetcdff.

But according to step-8 in the above link " Acquire and build the netCDF library, libnetcdf.a (and libnetcdff.a for netCDF-4.1 or later), for each configuration. The netCDF home page is [Unidata | NetCDF](https://www.unidata.ucar.edu/software/netcdf/) For each configuration,copy or link the resulting libnetcdf.a (and libnetcdff.a, if you’re building netCDF version 4.1 or later) to the appropriate object directory `$BASEDIR/${BIN}`"

And Step-8 from read me file "get Netcdf (for netcdf, get both netcdf-fortran and netcdf-c) and build “libnetcdf.a” ".

How can I built “libnetcdf.a” and “libnetcdff.a” and link/copy to the I/O API $BIN folder?

Thanks

 ![Screenshot from 2020-12-10 15-42-17](https://canada1.discourse-cdn.com/flex027/uploads/cmas/original/2X/7/77cb32ce345bc01d7219f84f1d87c8a3be749b84.png) [README.txt](https://forum.cmascenter.org/uploads/short-url/hoJ84yFrgEEwVTp672i6nv1gl6m.txt) (7.7 KB)

---

<div class="post-metadata">

### Author: ![cjcoats](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@cjcoats](https://forum.cmascenter.org/u/cjcoats)
#### Post date: [December 10, 2020, 10:21pm UTC](https://forum.cmascenter.org/t/where-is-libnetcdf-a-and-libnetcdff-a-in-netcdf/1979/2 "2020-12-10T22:21:31Z")

</div>

For each of these, go to its top level directory and do the command  
_find . -name '_.a’\*  
to find out where the netCDF build-system has stashed the library.

Sorry, that probably needs to go into the instructions…

---

<div class="post-metadata">

### Author: ![Iqbal](https://avatars.discourse-cdn.com/v4/letter/i/bc8723/32.png) [@Iqbal](https://forum.cmascenter.org/u/Iqbal)
#### Post date: [December 11, 2020, 3:19pm UTC](https://forum.cmascenter.org/t/where-is-libnetcdf-a-and-libnetcdff-a-in-netcdf/1979/3 "2020-12-11T15:19:18Z")

</div>

Thank you so much. I got this  
[root@adeq /]# find -name ‘libnetcdf.a’  
./home/IqbalHossan/Desktop/Build\_WRF/LIBRARIES/netcdf-4.1.3/liblib/.libs/libnetcdf.a  
./home/IqbalHossan/Desktop/Build\_WRF/LIBRARIES/netcdf/lib/libnetcdf.a  
./home/IqbalHossan/miniconda3/pkgs/libnetcdf-4.7.1-nompi\_h94020b1\_101/lib/libnetcdf.a  
./home/IqbalHossan/miniconda3/envs/ncl\_stable/lib/libnetcdf.a  
./root/Documents/softwares/netcdf-4.1.3/liblib/.libs/libnetcdf.a  
./root/Documents/softwares/netcdf/lib/libnetcdf.a  
[root@adeq /]# find -name ‘libnetcdff.a’  
./home/IqbalHossan/Desktop/Build\_WRF/LIBRARIES/netcdf-4.1.3/fortran/.libs/libnetcdff.a  
./home/IqbalHossan/Desktop/Build\_WRF/LIBRARIES/netcdf/lib/libnetcdff.a  
./home/IqbalHossan/miniconda3/pkgs/netcdf-fortran-4.4.5-h55403cb\_1003/lib/libnetcdff.a  
./home/IqbalHossan/miniconda3/envs/ncl\_stable/lib/libnetcdff.a  
./root/Documents/softwares/netcdf-4.1.3/fortran/.libs/libnetcdff.a  
./root/Documents/softwares/netcdf/lib/libnetcdff.a

---

<div class="post-metadata">

### Author: ![cjcoats](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@cjcoats](https://forum.cmascenter.org/u/cjcoats)
#### Post date: [December 11, 2020, 3:28pm UTC](https://forum.cmascenter.org/t/where-is-libnetcdf-a-and-libnetcdff-a-in-netcdf/1979/4 "2020-12-11T15:28:33Z")

</div>

Perhaps I wasn’t clear that “its top level directory” meant the top-level directory of that netCDF C or Fortran build…

(8) in the I/O API installation instructions says "Pick one of each, and copy it to the relevant _ioapi3-2/${BIN}_ directory. At a guess, you might pick  
_/root/Documents/softwares/netcdf/lib/libnetcdf.a_  
_/root/Documents/softwares/netcdf/lib/libnetcdff.a_

---

<div class="post-metadata">

### Author: ![Iqbal](https://avatars.discourse-cdn.com/v4/letter/i/bc8723/32.png) [@Iqbal](https://forum.cmascenter.org/u/Iqbal)
#### Post date: [December 11, 2020, 3:40pm UTC](https://forum.cmascenter.org/t/where-is-libnetcdf-a-and-libnetcdff-a-in-netcdf/1979/5 "2020-12-11T15:40:32Z")

</div>

Thank you so much.

I did that.
