# How can I set up environment

**URL:** <https://forum.cmascenter.org/t/how-can-i-set-up-environment/2957>\
**Category:** CMAQ\
**Created:** [January 17, 2022, 4:02pm UTC](https://forum.cmascenter.org/t/how-can-i-set-up-environment/2957 "2022-01-17T16:02:36Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![kkkghs0828](https://avatars.discourse-cdn.com/v4/letter/k/ce7236/32.png) [@kkkghs0828](https://forum.cmascenter.org/u/kkkghs0828)\
**Post date:** [January 17, 2022, 4:02pm UTC](https://forum.cmascenter.org/t/how-can-i-set-up-environment/2957/1 "2022-01-17T16:02:36Z")

</div>

![setup](https://canada1.discourse-cdn.com/flex027/uploads/cmas/original/2X/b/b524a93478ac351bf7bdfbfad4f68dd9c211359a.jpeg)

---

<div class="post-metadata">

**Author:** ![lizadams](https://avatars.discourse-cdn.com/v4/letter/l/49beb7/32.png) [@lizadams](https://forum.cmascenter.org/u/lizadams)\
**Post date:** [January 18, 2022, 2:37pm UTC](https://forum.cmascenter.org/t/how-can-i-set-up-environment/2957/2 "2022-01-18T14:37:18Z")

</div>

Typically you can do a module load command to load the compiler available on your system. Otherwise, you can check to see if the compiler is installed in a default install path using the following command:

```auto
gcc --version

```

To check to see what modules are available use

```auto
module avail

```

---

<div class="post-metadata">

**Author:** ![kkkghs0828](https://avatars.discourse-cdn.com/v4/letter/k/ce7236/32.png) [@kkkghs0828](https://forum.cmascenter.org/u/kkkghs0828)\
**Post date:** [January 18, 2022, 6:38pm UTC](https://forum.cmascenter.org/t/how-can-i-set-up-environment/2957/3 "2022-01-18T18:38:34Z")

</div>

Of course I check it and I followed instruction…

---

<div class="post-metadata">

**Author:** ![lizadams](https://avatars.discourse-cdn.com/v4/letter/l/49beb7/32.png) [@lizadams](https://forum.cmascenter.org/u/lizadams)\
**Post date:** [January 18, 2022, 7:14pm UTC](https://forum.cmascenter.org/t/how-can-i-set-up-environment/2957/4 "2022-01-18T19:14:01Z")

</div>

Are you sure that you are using the csh shell to install the software?

I don’t see the error you are reporting in this issue.  
Can you include the commands that you have tried, the errors you were getting, and also point to the tutorial you are using.

Thank you.

---

<div class="post-metadata">

**Author:** ![kkkghs0828](https://avatars.discourse-cdn.com/v4/letter/k/ce7236/32.png) [@kkkghs0828](https://forum.cmascenter.org/u/kkkghs0828)\
**Post date:** [January 18, 2022, 7:29pm UTC](https://forum.cmascenter.org/t/how-can-i-set-up-environment/2957/5 "2022-01-18T19:29:12Z")

</div>

I am working in dogwood.unc

Here is my command  
module avail  
module load gcc/9.1.0  
module load openmpi\_4.0.1/gcc\_9.1.0  
kkkghs/LIBRARIES  
wget ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-c-4.7.0.tar.gz  
tar -xzvf netcdf-c-4.7.0.tar.gz  
cd netcdf-c-4.7.0  
mkdir …/netcdf-c-4.7.0-gcc9.1.0  
which gfortran  
which gcc  
which g++  
csh  
setenv FC gfortran  
setenv CC gcc  
setenv CXX g++  
sh  
./configure --prefix=$cwd/…/netcdf-c-4.7.0-gcc9.1.0 --disable-netcdf-4 --disable-dap  
make check install  
and I got a message like that Not Congratulations!

---

<div class="post-metadata">

**Author:** ![lizadams](https://avatars.discourse-cdn.com/v4/letter/l/49beb7/32.png) [@lizadams](https://forum.cmascenter.org/u/lizadams)\
**Post date:** [January 18, 2022, 7:34pm UTC](https://forum.cmascenter.org/t/how-can-i-set-up-environment/2957/6 "2022-01-18T19:34:57Z")

</div>

I don’t think that you are running in csh, so the `$cwd` or current working directory command is not being recognized.

Try the following

echo $cwd

If you don’t get any output, it means that it is undefined.  
so the install directory is being set to  
/…/netcdf-c-4.7.0-gcc9.1.0  
Which is not the path that you need.

Next run the csh command to go into the csh shell

```auto
csh

```

echo $cwd

To see what it is generating. It should give you the path to your current working directory.

Here is an example:  
when I am not in the csh shell, there is no value for $cwd

echo $cwd

lizadams@vcredadmins-MBP desktop % pwd  
/Users/lizadams/desktop

When I enter the csh shell  
lizadams@vcredadmins-MBP desktop % csh  
[vcredadmins-MacBook-Pro:~/desktop] lizadams% echo $cwd  
/Users/lizadams/desktop

It now shows the current working directory as /Users/lizadams/desktop

The prefix= command can be modified to specify a full path, or you can use the csh shell to rerun the following.

```auto
csh
./configure --prefix=$cwd/…/netcdf-c-4.7.0-gcc9.1.0 --disable-netcdf-4 --disable-dap
make check install

```

Liz

---

<div class="post-metadata">

**Author:** ![kkkghs0828](https://avatars.discourse-cdn.com/v4/letter/k/ce7236/32.png) [@kkkghs0828](https://forum.cmascenter.org/u/kkkghs0828)\
**Post date:** [January 18, 2022, 7:42pm UTC](https://forum.cmascenter.org/t/how-can-i-set-up-environment/2957/7 "2022-01-18T19:42:55Z")

</div>

I did csh  
echo $cwd  
I can see output with /nas/longleaf/home/kkkghs

---

<div class="post-metadata">

**Author:** ![kkkghs0828](https://avatars.discourse-cdn.com/v4/letter/k/ce7236/32.png) [@kkkghs0828](https://forum.cmascenter.org/u/kkkghs0828)\
**Post date:** [January 18, 2022, 7:46pm UTC](https://forum.cmascenter.org/t/how-can-i-set-up-environment/2957/8 "2022-01-18T19:46:29Z")

</div>

This is my env  
MANPATH=/nas/longleaf/apps-dogwood/lmod/lmod/share/man:::/opt/puppetlabs/puppet/share/man  
XDG\_SESSION\_ID=187616  
HOSTNAME=dogwood-login2  
TERM=xterm  
SHELL=/bin/bash  
HISTSIZE=1000  
MODULEPATH\_ROOT=/nas/longleaf/apps-dogwood/lmod/modulefiles  
SSH\_CLIENT=  
LMOD\_PKG=/nas/longleaf/apps-dogwood/lmod/lmod  
QTDIR=/usr/lib64/qt-3.3  
QTINC=/usr/lib64/qt-3.3/include  
LMOD\_VERSION=7.6  
SSH\_TTY=/dev/pts/13  
QT\_GRAPHICSSYSTEM\_CHECKED=1  
USER=kkkghs  
LMOD\_sys=Linux  
LS\_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:_.tar=01;31:_.tgz=01;31:_.arc=01;31:_.arj=01;31:_.taz=01;31:_.lha=01;31:_.l01;31:_.lzh=01;31:_.lzma=01;31:_.tlz=01;31:_.txz=01;31:_.tzo=01;31:_.t7z=01;31:_.zip=01;31:_.z=01;31:_.Z=01;31:_.dz=01;31:_.gz;31:_.lrz=01;31:_.lz=01;31:_.lzo=01;31:_.xz=01;31:_.bz2=01;31:_.bz=01;31:_.tbz=01;31:_.tbz2=01;31:_.tz=01;31:_.deb=01;31:_.rpm;31:_.jar=01;31:_.war=01;31:_.ear=01;31:_.sar=01;31:_.rar=01;31:_.alz=01;31:_.ace=01;31:_.zoo=01;31:_.cpio=01;31:_.7z=01;31:_.01;31:_.cab=01;31:_.jpg=01;35:_.jpeg=01;35:_.gif=01;35:_.bmp=01;35:_.pbm=01;35:_.pgm=01;35:_.ppm=01;35:_.tga=01;35:_.xbm=01;35xpm=01;35:_.tif=01;35:_.tiff=01;35:_.png=01;35:_.svg=01;35:_.svgz=01;35:_.mng=01;35:_.pcx=01;35:_.mov=01;35:_.mpg=01;35:_.mpeg;35:_.m2v=01;35:_.mkv=01;35:_.webm=01;35:_.ogm=01;35:_.mp4=01;35:_.m4v=01;35:_.mp4v=01;35:_.vob=01;35:_.qt=01;35:_.nuv=01;35:_v=01;35:_.asf=01;35:_.rm=01;35:_.rmvb=01;35:_.flc=01;35:_.avi=01;35:_.fli=01;35:_.flv=01;35:_.gl=01;35:_.dl=01;35:_.xcf=01;35:wd=01;35:_.yuv=01;35:_.cgm=01;35:_.emf=01;35:_.axv=01;35:_.anx=01;35:_.ogv=01;35:_.ogx=01;35:_.aac=01;36:_.au=01;36:_.flac=01;_.mid=01;36:_.midi=01;36:_.mka=01;36:_.mp3=01;36:_.mpc=01;36:_.ogg=01;36:_.ra=01;36:_.wav=01;36:_.axa=01;36:_.oga=01;36:_.spx=36:\*.xspf=01;36:  
MAIL=/var/spool/mail/kkkghs  
PATH=/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/ibutils/bin:/opt/puppetlabs/bin:/opt/puppetl/bin  
LMOD\_SETTARG\_CMD=:  
PWD=/nas/longleaf/home/kkkghs  
LANG=en\_US.UTF-8  
MODULEPATH=/nas/longleaf/apps-dogwood/lmod/modulefiles/Linux:/nas/longleaf/apps-dogwood/lmod/modulefiles/Core:/nas/longleaf/apdogwood/lmod/lmod/modulefiles/Core  
LMOD\_SYSTEM\_NAME=dogwood  
LMOD\_CMD=/nas/longleaf/apps-dogwood/lmod/lmod/libexec/lmod  
HISTCONTROL=ignoredups  
KRB5CCNAME=FILE:/tmp/krb5cc\_356405\_SxL3Sb  
SHLVL=2  
HOME=/nas/longleaf/home/kkkghs  
BASH\_ENV=/nas/longleaf/apps-dogwood/lmod/lmod/init/bash  
LOGNAME=kkkghs  
QTLIB=/usr/lib64/qt-3.3/lib  
CVS\_RSH=ssh  
SSH\_CONNECTION=  
MODULESHOME=/nas/longleaf/apps-dogwood/lmod/lmod  
OMP\_NUM\_THREADS=1  
LESSOPEN=||/usr/bin/lesspipe.sh %s  
LMOD\_FULL\_SETTARG\_SUPPORT=no  
XDG\_RUNTIME\_DIR=/run/user/356405  
DISPLAY=  
LMOD\_DIR=/nas/longleaf/apps-dogwood/lmod/lmod/libexec  
BASH\_FUNC\_module()=() { eval $(LMOD\_CMD bash "@") && eval ({LMOD\_SETTARG\_CMD:-:} -s sh)  
}  
BASH\_FUNC\_ml()=() { eval $(LMOD\_DIR/ml\_cmd "@")  
}  
\_=/usr/bin/csh  
HOSTTYPE=x86\_64-linux  
VENDOR=unknown  
OSTYPE=linux  
MACHTYPE=x86\_64  
GROUP=users  
HOST=dogwood-login2  
REMOTEHOST=darby.wireless-1x.unc.edu  
TARG\_TITLE\_BAR\_PAREN=

---

<div class="post-metadata">

**Author:** ![lizadams](https://avatars.discourse-cdn.com/v4/letter/l/49beb7/32.png) [@lizadams](https://forum.cmascenter.org/u/lizadams)\
**Post date:** [January 18, 2022, 7:56pm UTC](https://forum.cmascenter.org/t/how-can-i-set-up-environment/2957/9 "2022-01-18T19:56:02Z")

</div>

> [@kkkghs0828](#):
>
> Here is my command  
> module avail  
> module load gcc/9.1.0  
> module load openmpi\_4.0.1/gcc\_9.1.0  
> kkkghs/LIBRARIES  
> wget ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-c-4.7.0.tar.gz  
> tar -xzvf netcdf-c-4.7.0.tar.gz  
> cd netcdf-c-4.7.0  
> mkdir …/netcdf-c-4.7.0-gcc9.1.0  
> which gfortran  
> which gcc  
> which g++  
> csh  
> setenv FC gfortran  
> setenv CC gcc  
> setenv CXX g++  
> sh  
> ./configure --prefix=$cwd/…/netcdf-c-4.7.0-gcc9.1.0 --disable-netcdf-4 --disable-dap  
> make check install  
> and I got a message like that Not Congratulations!

In the commands, just before doing the configure step, you ran sh, rather than csh.

Here is my command  
module avail  
module load gcc/9.1.0  
module load openmpi\_4.0.1/gcc\_9.1.0  
kkkghs/LIBRARIES  
wget ftp://ftp.unidata.ucar.edu/pub/netcdf/netcdf-c-4.7.0.tar.gz  
tar -xzvf netcdf-c-4.7.0.tar.gz  
cd netcdf-c-4.7.0  
mkdir …/netcdf-c-4.7.0-gcc9.1.0  
which gfortran  
which gcc  
which g++  
csh  
setenv FC gfortran  
setenv CC gcc  
setenv CXX g++  
sh **\<\<\<\<. change this to csh**  
./configure --prefix=$cwd/…/netcdf-c-4.7.0-gcc9.1.0 --disable-netcdf-4 --disable-dap  
make check install

---

<div class="post-metadata">

**Author:** ![kkkghs0828](https://avatars.discourse-cdn.com/v4/letter/k/ce7236/32.png) [@kkkghs0828](https://forum.cmascenter.org/u/kkkghs0828)\
**Post date:** [January 18, 2022, 8:11pm UTC](https://forum.cmascenter.org/t/how-can-i-set-up-environment/2957/10 "2022-01-18T20:11:18Z")

</div>

![new](https://canada1.discourse-cdn.com/flex027/uploads/cmas/original/2X/1/14aa4dcc9ec8c360df5487b89d85020fb9a0f505.jpeg)

I can see this message after setenv  
I do not know why I cannot permit my account itself

---

<div class="post-metadata">

**Author:** ![lizadams](https://avatars.discourse-cdn.com/v4/letter/l/49beb7/32.png) [@lizadams](https://forum.cmascenter.org/u/lizadams)\
**Post date:** [January 18, 2022, 8:20pm UTC](https://forum.cmascenter.org/t/how-can-i-set-up-environment/2957/11 "2022-01-18T20:20:52Z")

</div>

The full set of commands need to be followed to ensure that you are trying to build the directory in the correct location.

I am assuming that this is the directory where you installed the netcdf-c tar file is here: /nas/longleaf/home/kkkghs/LIBRARIES

cd /nas/longleaf/home/kkkghs/LIBRARIES  
cd netcdf-c-4.7.0  
mkdir …/netcdf-c-4.7.0-gcc9.1.0  
which gfortran  
which gcc  
which g++  
csh  
setenv FC gfortran  
setenv CC gcc  
setenv CXX g++

### at this point you should be in the directory /nas/longleaf/home/kkkghs/LIBRARIES/netcdf-c-4.7.0

###Then you need to run  
./configure --prefix=$cwd/…/netcdf-c-4.7.0-gcc9.1.0 --disable-netcdf-4 --disable-dap  
###This will install the library under /nas/longleaf/home/kkkghs/LIBRARIES/netcdf-c-4.7.0-gcc9.1.0  
make check install

If the $cwd command is giving you and issue, please set the install directory using a full path.

./configure --prefix=/nas/longleaf/home/kkkghs/LIBRARIES/netcdf-c-4.7.0-gcc9.1.0 --disable-netcdf-4 --disable-dap

In general, I wouldn’t recommend installing these libraries under your home directory, especially if you are planning to share them with others.

---

<div class="post-metadata">

**Author:** ![kkkghs0828](https://avatars.discourse-cdn.com/v4/letter/k/ce7236/32.png) [@kkkghs0828](https://forum.cmascenter.org/u/kkkghs0828)\
**Post date:** [January 18, 2022, 9:49pm UTC](https://forum.cmascenter.org/t/how-can-i-set-up-environment/2957/12 "2022-01-18T21:49:50Z")

</div>

Of course, I was in the directory  
But it did not work… Permission denied  
Or not I even cannot start install

 ![neee](https://canada1.discourse-cdn.com/flex027/uploads/cmas/original/2X/f/fc8eb60053e43ee2d02ce8c70b2ec7c2dd4bd5d2.jpeg)

---

<div class="post-metadata">

**Author:** ![kkkghs0828](https://avatars.discourse-cdn.com/v4/letter/k/ce7236/32.png) [@kkkghs0828](https://forum.cmascenter.org/u/kkkghs0828)\
**Post date:** [January 18, 2022, 10:44pm UTC](https://forum.cmascenter.org/t/how-can-i-set-up-environment/2957/14 "2022-01-18T22:44:04Z")

</div>

I just joined now. When are you free?

---

<div class="post-metadata">

**Author:** ![kkkghs0828](https://avatars.discourse-cdn.com/v4/letter/k/ce7236/32.png) [@kkkghs0828](https://forum.cmascenter.org/u/kkkghs0828)\
**Post date:** [January 18, 2022, 11:08pm UTC](https://forum.cmascenter.org/t/how-can-i-set-up-environment/2957/15 "2022-01-18T23:08:17Z")

</div>

I am okay anytime today night and tomorrow morning !!

2022년 1월 18일 (화) 오후 5:25, Liz Adams via CMAS CENTER FORUM \<[cmas@discoursemail.com](mailto:cmas@discoursemail.com)\>님이 작성:

---

<div class="post-metadata">

**Author:** ![lizadams](https://avatars.discourse-cdn.com/v4/letter/l/49beb7/32.png) [@lizadams](https://forum.cmascenter.org/u/lizadams)\
**Post date:** [January 19, 2022, 1:26pm UTC](https://forum.cmascenter.org/t/how-can-i-set-up-environment/2957/16 "2022-01-19T13:26:38Z")

</div>

Let’s try meeting at 9 am 1/19/2022
