The .bashrc setting : export NCARG_ROOT=/usr/local/ncl-6.3.0 export PATH=usr/local/bin:$PATH When I run two commands for testing: [neginm@civ-1215x ~]$ ng4ex gsun01n -clean NCAR Graphics NCL Example This example was set up to display the output to an X11 window. Copying gsun01n.ncl Running NCL... Copyright (C) 1995-2015 - All Rights Reserved University Corporation for Atmospheric Research NCAR Command Language Version 6.3.0 The use of this software is governed by a License Agreement. See http://www.ncl.ucar.edu/ for more details. Finished running 'ncl < gsun01n'... [neginm@civ-1215x ~]$ ncargex cpex08 -clean NCAR Graphics Fortran Example Copying cpex08.f Copying cpexcc.f Compiling and linking... /usr/bin/gfortran -fPIC -fno-second-underscore -fno-range-check -fopenmp -O -o cpex08 cpexcc.f cpex08.f -L/usr/local/ncl-6.3.0/lib -L/usr/X11R6/lib64 -lncarg -lncarg_gks -lncarg_c -lX11 -lXext -lcairo -lfontconfig -lpixman-1 -lfreetype -lexpat -lpng -lz -lpthread -lXrender -lbz2 /usr/bin/ld: cannot find -lX11 collect2: ld returned 1 exit status The compile and link failed.