# fatal error: netcdf.inc jobcomp from \[Scarlett Martinez\]

**URL:** <https://forum.croco-ocean.org/t/fatal-error-netcdf-inc-jobcomp-from-scarlett-martinez/63>\
**Category:** compilation-installation\
**Tags:** compilation-installation\
**Created:** [February 5, 2019, 10:33am UTC](https://forum.croco-ocean.org/t/fatal-error-netcdf-inc-jobcomp-from-scarlett-martinez/63 "2019-02-05T10:33:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gcambon](https://forum.croco-ocean.org/user_avatar/forum.croco-ocean.org/gcambon/32/250_2.png) [@gcambon](https://forum.croco-ocean.org/u/gcambon)\
**Post date:** [February 5, 2019, 10:33am UTC](https://forum.croco-ocean.org/t/fatal-error-netcdf-inc-jobcomp-from-scarlett-martinez/63/1 "2019-02-05T10:33:25Z")

</div>

Hi everybody!  
I’m gong to start work with croco, I have two questons…

1. Is there a forum for croco or is this just like agrif?
2. when I compile croco with jobcomp I GET:

gfortran -c -O3 -fdefault-real-8 -fdefault-double-8 -mcmodel=medium wvlcty\_.f -o  
wvlcty.o  
cpp -traditional -DLinux -P -I -IROMSFILES/AGRIF\_INC checkdims.F | ./mpc \>  
checkdims\_.f  
checkdims.F:37:2: fatal error: netcdf.inc: No such file or directory

^  
compilation terminated.  
gfortran -c -O3 -fdefault-real-8 -fdefault-double-8 -mcmodel=medium checkdims\_.f  
-o checkdims.o  
f951: Error: Unexpected end of file in ‘checkdims\_.f’  
Makedefs:13: recipe for target ‘checkdims.o’ failed  
make: \*\*\* [checkdims.o] Error 1  
mv: cannot stat ‘croco’: No such file or directory

Could someone tell me what is causing this error? or how can I fix it?  
Many thanks in advance!

Marmo.

---

<div class="post-metadata">

**Author:** ![sjullien](https://forum.croco-ocean.org/user_avatar/forum.croco-ocean.org/sjullien/32/255_2.png) [@sjullien](https://forum.croco-ocean.org/u/sjullien)\
**Post date:** [February 6, 2019, 10:07am UTC](https://forum.croco-ocean.org/t/fatal-error-netcdf-inc-jobcomp-from-scarlett-martinez/63/2 "2019-02-06T10:07:32Z")

</div>

Check your netcdf library (NETCDFLIB) and include (NETCDFINC) paths in jobcomp

---

<div class="post-metadata">

**Author:** ![mariathdz](https://forum.croco-ocean.org/letter_avatar_proxy/v4/letter/m/7ba0ec/32.png) [@mariathdz](https://forum.croco-ocean.org/u/mariathdz)\
**Post date:** [March 4, 2020, 9:18pm UTC](https://forum.croco-ocean.org/t/fatal-error-netcdf-inc-jobcomp-from-scarlett-martinez/63/3 "2020-03-04T21:18:54Z")

</div>

Hello everybody!

I think I have the same error. I’m using a macOS Mojave (10.14.16). I downloaded the last version of CROCO and using:  
• a C compiler —\> g++7  
• a Fortran compiler —\> gfortran7  
• a Netcdf library netcdf-c-4.7.3 and netcdf-fortran-4.5.2  
• MPI libraries and compilers if running in parallel —\> OpenMPI

When I run jobcomp, first export:  
export NETCDFLIB=“-L/usr/local/netcdf-f/lib -lnetcdff -L/usr/local/netcdf-c/lib -lnetcdf -lnetcdf -lm”  
export NETCDFINC=“-I/usr/local/netcdf-f/include”  
export NF\_CONFIG=/usr/local/netcdf-f/bin/nf-config

Then:  
./jobcomp

but I obtained the next error:

OPERATING SYSTEM IS: Darwin  
./jobcomp: line 60: nf-config: command not found  
./jobcomp: line 61: nf-config: command not found  
file namelist\_pisces exists in Run directory  
Checking COMPILEAGRIF…  
Checking COMPILEMPI…  
Checking COMPILEXIOS…  
Checking COMPILEOASIS…  
Checking COMPILEOMP…  
cpp -traditional -DLinux -P -I -ICROCOFILES/AGRIF\_INC mpc.F \> mpc\_.f  
…  
and continued the compilation with some warnings, and finally:

Undefined symbols for architecture x86\_64:  
“_nf\_close_”, referenced from:  
_closecdf_ in closecdf.o  
_wrt\_his_ in wrt\_his.o  
_wrt\_rst_ in wrt\_rst.o  
_get\_initial_ in get\_initial.o  
“_nf\_create_”, referenced from:  
_def\_his_ in def\_his.o  
_def\_rst_ in def\_rst.o  
“_nf\_def\_dim_”, referenced from:  
_def\_his_ in def\_his.o  
_def\_rst_ in def\_rst.o  
“_nf\_def\_var_”, referenced from:  
_def\_grid\_3d_ in def\_grid\_3d.o  
_def\_his_ in def\_his.o  
_def\_rst_ in def\_rst.o  
“_nf\_enddef_”, referenced from:  
_def\_his_ in def\_his.o  
_def\_rst_ in def\_rst.o  
“_nf\_get\_att\_double_”, referenced from:  
_set\_cycle_ in set\_cycle.o  
“_nf\_get\_att\_text_”, referenced from:  
_get\_initial_ in get\_initial.o  
“_nf\_get\_var1\_double_”, referenced from:  
_set\_cycle_ in set\_cycle.o  
_get\_initial_ in get\_initial.o  
_get\_stflux_ in get\_stflux.o  
_get\_srflux_ in get\_srflux.o  
“_nf\_get\_vara\_double_”, referenced from:  
_nf\_fread_ in nf\_fread.o  
_nf\_fread\_x_ in nf\_fread\_x.o  
_nf\_fread\_y_ in nf\_fread\_y.o  
_nf\_read\_bry\_ns_ in nf\_read\_bry.o  
_nf\_read\_bry\_ew_ in nf\_read\_bry.o  
“_nf\_get\_vara\_int_”, referenced from:  
_get\_initial_ in get\_initial.o  
“_nf\_inq_”, referenced from:  
_checkdims_ in checkdims.o  
“_nf\_inq\_attname_”, referenced from:  
_set\_cycle_ in set\_cycle.o  
“_nf\_inq\_dim_”, referenced from:  
_checkdims_ in checkdims.o  
_set\_cycle_ in set\_cycle.o  
“_nf\_inq\_var_”, referenced from:  
_set\_cycle_ in set\_cycle.o  
“_nf\_inq\_varid_”, referenced from:  
_def\_his_ in def\_his.o  
_def\_rst_ in def\_rst.o  
_wrt\_grid_ in wrt\_grid.o  
_get\_initial_ in get\_initial.o  
_get\_stflux_ in get\_stflux.o  
_get\_srflux_ in get\_srflux.o  
“_nf\_inq\_varndims_”, referenced from:  
_get\_stflux_ in get\_stflux.o  
_get\_srflux_ in get\_srflux.o  
“_nf\_open_”, referenced from:  
_def\_his_ in def\_his.o  
_def\_rst_ in def\_rst.o  
_get\_initial_ in get\_initial.o  
_get\_stflux_ in get\_stflux.o  
_get\_srflux_ in get\_srflux.o  
“_nf\_put\_att\_double_”, referenced from:  
_put\_global\_atts_ in put\_global\_atts.o  
_def\_grid\_3d_ in def\_grid\_3d.o  
“_nf\_put\_att\_int_”, referenced from:  
_put\_global\_atts_ in put\_global\_atts.o  
“_nf\_put\_att\_text_”, referenced from:  
_put\_global\_atts_ in put\_global\_atts.o  
_nf\_add\_attribute_ in nf\_add\_attribute.o  
_def\_grid\_3d_ in def\_grid\_3d.o  
_def\_his_ in def\_his.o  
_def\_rst_ in def\_rst.o  
“_nf\_put\_var1\_double_”, referenced from:  
_wrt\_grid_ in wrt\_grid.o  
_wrt\_his_ in wrt\_his.o  
_wrt\_rst_ in wrt\_rst.o  
“_nf\_put\_var1\_text_”, referenced from:  
_wrt\_grid_ in wrt\_grid.o  
“_nf\_put\_var\_double_”, referenced from:  
_wrt\_grid_ in wrt\_grid.o  
“_nf\_put\_vara\_double_”, referenced from:  
_nf\_fwrite_ in nf\_fread.o  
_nf\_fwrite\_x_ in nf\_fread\_x.o  
_nf\_fwrite\_y_ in nf\_fread\_y.o  
“_nf\_put\_vara\_int_”, referenced from:  
_wrt\_his_ in wrt\_his.o  
_wrt\_rst_ in wrt\_rst.o  
“_nf\_set\_fill_”, referenced from:  
_def\_his_ in def\_his.o  
“_nf\_strerror_”, referenced from:  
_nf\_read\_bry\_ns_ in nf\_read\_bry.o  
_nf\_read\_bry\_ew_ in nf\_read\_bry.o  
“_nf\_sync_”, referenced from:  
_wrt\_his_ in wrt\_his.o  
_wrt\_rst_ in wrt\_rst.o  
ld: symbol(s) not found for architecture x86\_64  
collect2: error: ld returned 1 exit status  
gmake: \*\*\* [Makefile:173: croco] Error 1

Someone knows what is my problem? Pleases!

Thank you so much!

---

<div class="post-metadata">

**Author:** ![Rachid](https://forum.croco-ocean.org/user_avatar/forum.croco-ocean.org/rachid/32/296_2.png) [@Rachid](https://forum.croco-ocean.org/u/Rachid)\
**Post date:** [March 5, 2020, 2:04pm UTC](https://forum.croco-ocean.org/t/fatal-error-netcdf-inc-jobcomp-from-scarlett-martinez/63/4 "2020-03-05T14:04:38Z")

</div>

Hi  
You can try to edit jobcomp and hard-code the path for netcdf, replace around line 60 the lines

> NETCDFLIB=$(nf-config --flibs)
> 
> NETCDFINC=-I$(nf-config --includedir)

by something like

> NETCDFLIB=“-L/usr/local/netcdf-f/lib  
> -lnetcdff -L/usr/local/netcdf-c/lib -lnetcdf”
> 
> NETCDFINC=-I/usr/local/netcdf-f/include  
> -I/usr/local/netcdf-c/include"

Rachid

---

<div class="post-metadata">

**Author:** ![mariathdz](https://forum.croco-ocean.org/letter_avatar_proxy/v4/letter/m/7ba0ec/32.png) [@mariathdz](https://forum.croco-ocean.org/u/mariathdz)\
**Post date:** [March 5, 2020, 5:31pm UTC](https://forum.croco-ocean.org/t/fatal-error-netcdf-inc-jobcomp-from-scarlett-martinez/63/5 "2020-03-05T17:31:57Z")

</div>

Thank you so much Rachid. I forgot edit the jobcomp file directly.
