Q: I recently installed my first CentOS 7 Linux system and am having a hard time setting the clock correctly. I seem to be setting it correctly, but when I come back to the system a day or two later the time is not correct. It is usually a few minutes to an hour off.
Feb 23, 2015 Compiling Gromacs 5.0.4 on CentOS 6. Compiling Gromacs has never been easier using the cmake. There are a few assumptions. Compiling R-3.4.2 on CentOS 6 with GNU Basic Installing and Configuring of GPFS Cluster (Part 1) Compiling VASP-5.4.4 with Intel MPI-5.0.3.
A: If you clock is drifting that much in a short time it might be a symptom of another problem. But, maybe I can help with your initial question. Since the move to systemd setting the time and date is a little different on CentOS 7, Red Hat 7, or newer Fedora systems. Here we will show you the new timedatectl followed by the old trusty date command.
Using the timedatectl command.
Now that Red Hat Linux has moved to systemd, we have a new way to set the clock. the timedatectl command is very easy to use and an efficient way to set the time and date on your system.
NOTE: You must run the following command with root level permissions by either changing to root, or using sudo.
Displaying Current Time and Date using timedatectl
To display the current time and date settings just run the timedatectl command like so:
Example output:
To set the current time, use the timedatectl command with the set-time option:
To set the current date, use the timedatectl command with the set-time option using the date format (YEAR-MONTH-DAY) followed by the current time:
NOTE: If you do not include the current time when changing the date you clock will be set to 00:00:00.
Changing the Timezone with timedatectl
To change the timezone, you can use the timedatectl command with set-timezone option followed by the desired timezone:
For a list of acceptable time zones, use the list-timezones option:
If you know the name of your timezone you can use grep to easily find the exact syntax:
Or to list all the timezones in the Americas:
Enable NTP with timedatectl command
You can also enable or disable automatic clock synchronization using the remote NTP servers. I prefer this over setting the clock manually for many reasons. Enabling this should help keep your clock from drifting as described in the original question. To enable NTP clock syncronization, use set-ntp option with “yes” to enable or “no” to disable.
![Gromacs documentation Gromacs documentation](/uploads/1/2/5/6/125690611/366917423.png)
Read our tutorial on learning how to Configure and NTP server in Red Hat.
NOTE: Setting the set-ntp boolean to yes will enable chronyd or ntpd service, depending on which is installed on your system.
Using the date Command
We still have the option to use the old linux date command to set or show the current time and date.
Displaying Current Time and Date with the date command
To display the current time and date simply type date at the command line like so:
You can also use a custom format to display the time. This comes in very handy, especially when writing scripts. You can use control sequences to easily display the time or date in many formats or display only parts of the date (for example current month).
![Install gromacs ubuntu Install gromacs ubuntu](/uploads/1/2/5/6/125690611/530770874.png)
To display the current year in YYYY format:
To display the current month in MM format:
To display the current date in MM-DD-YYYY format:
To display just the current hour:
To display a list of control sequences you can use the following command or consult the man pages for date:
Setting Current Time and Date with the date Command
To set the current date use the --set option:
For example to set the current date to April 15, 2015:
To set the current time:
For example to set the clock to 1:14 PM:
To set both the time and date together:
Conclusion
The timedatctl command and date command have very similar functions. Both are capable of displaying and setting the current time and date. The timedatectl command has the added bonus of being able to sync via NTP.
If I missed anything let me know in the comments.
Introduction to building GROMACS¶
These instructions pertain to building GROMACS2019.4. You might also want to check the up-to-date installation instructions.
Quick and dirty installation¶
- Get the latest version of your C and C++ compilers.
- Check that you have CMake version 3.4.3 or later.
- Get and unpack the latest version of the GROMACS tarball.
- Make a separate build directory and change to it.
- Run
cmake
with the path to the source as an argument - Run
make
,makecheck
, andmakeinstall
- Source
GMXRC
to get access to GROMACS
Or, as a sequence of commands to execute:
This will download and build first the prerequisite FFT libraryfollowed by GROMACS. If you already have FFTW installed, you canremove that argument to
cmake
. Overall, this build of GROMACSwill be correct and reasonably fast on the machine upon whichcmake
ran. On another machine, it may not run, or may not runfast. If you want to get the maximum value for your hardware withGROMACS, you will have to read further. Sadly, the interactions ofhardware, libraries, and compilers are only going to continue to getmore complex.Quick and dirty cluster installation¶
On a cluster where users are expected to be running across multiplenodes using MPI, make one installation similar to the above, andanother using an MPI wrapper compiler and which is building onlymdrun, because that is the only component of GROMACS that usesMPI. The latter will install a single simulation engine binary,i.e.
mdrun_mpi
when the default suffix is used. Hence it is safeand common practice to install this into the same location wherethe non-MPI build is installed.Typical installation¶
As above, and with further details below, but you should considerusing the following CMake options with theappropriate value instead of
xxx
:-DCMAKE_C_COMPILER=xxx
equal to the name of the C99 Compiler you wish to use (or the environment variableCC
)-DCMAKE_CXX_COMPILER=xxx
equal to the name of the C++98 compiler you wish to use (or the environment variableCXX
)-DGMX_MPI=on
to build using MPI support (generally good to combine with building only mdrun)-DGMX_GPU=on
to build using nvcc to run using NVIDIA CUDA GPU acceleration or an OpenCL GPU-DGMX_USE_OPENCL=on
to build with OpenCL support enabled.GMX_GPU
must also be set.-DGMX_SIMD=xxx
to specify the level of SIMD support of the node on which GROMACS will run-DGMX_BUILD_MDRUN_ONLY=on
for building only mdrun, e.g. for compute cluster back-end nodes-DGMX_DOUBLE=on
to build GROMACS in double precision (slower, and not normally useful)-DCMAKE_PREFIX_PATH=xxx
to add a non-standard location for CMake to search for libraries, headers or programs-DCMAKE_INSTALL_PREFIX=xxx
to install GROMACS to a non-standard location (default/usr/local/gromacs
)-DBUILD_SHARED_LIBS=off
to turn off the building of shared libraries to help with static linking-DGMX_FFT_LIBRARY=xxx
to select whether to usefftw3
,mkl
orfftpack
libraries for FFT support-DCMAKE_BUILD_TYPE=Debug
to build GROMACS in debug mode
Building older versions¶
Installation instructions for old GROMACS versions can be found atthe GROMACS documentation page.