Really cool but obscure command line

I found this site and just love it. It lists out a lot of obscure commands that can be used on Unix systems, like ledger, a terminal based accounting package! What?!? Check it out!

A little collection of cool unix terminal/console/curses tools Just a list of 20 (now 28) tools for the command line. Some are little-known, some are just too useful to miss, some are pure obscure — I hope you find something useful that you weren’t aware of yet! Use your operating system’s package manager to install most of them.

Error: identifier “cout” is undefined

I ran across the following issue when trying to compile my AztecOO source code outside of Trilinous.

example/AztecOO/adapt_main.cpp(94): error: identifier "cout" is undefined
cout << comm << endl;
^
example/AztecOO/adapt_main.cpp(94): error: identifier "endl" is undefined
cout << comm << endl;
^
example/AztecOO/adapt_main.cpp(96): error: identifier "cerr" is undefined
if(argc != 2) cerr << "error: enter name of data file on command line" << endl;

Fix
The compiler doesn’t recognize that these methods come from the standard library. Therefore, I must tell it with the following commands:

using std::cout;
using std::endl;
using std::cerr;

Credit goes to http://stackoverflow.com/questions/13208547/the-includeiostream-exists-but-i-get-an-error-identifier-cout-is-undefine.

AztecOO catastrophic error: cannot open source file “Epetra_Map.h”

A while back I was trying to compile the AztecOO library outside of Trilinous. See this early post for more details. In doing so, I received the following error:

catastrophic error: cannot open source file "Epetra_Map.h"

Solution
Aztec requires quite a few of the additional tilinous header files. I copied a couple addition src directories from trilinous to my Aztec src folder. The list below shows everything I copied into source. I recommend you keep your AztecOO src directory organized and make folders for the external libraries. Also make sure to have correctly included directories with –I in the compile statement to ensure that the compiler looks into the Aztec src directory for the correct files.

Directories I copied:
trilinos-11.10.1-Source/packages/epetra/src
trilinos-11.10.1-Source/packages/teuchos/core/src
trilinos-11.10.1-Source/packages/teuchos/comm/src
trilinos-11.10.1-Source/packages/teuchos/parameterlist /src
trilinos-11.10.1-Source/packages/epetraext/src

Files
trilinos-11.10.1-Source/packages/triutils/src/Trilinos_Util.h
trilinos-11.10.1-Source/packages/triutils/src/Trilinos_Util_ReadMatrixMarket2Epetra.h
trilinos-11.10.1-Source/packages/epetraext/src/inout/EpetraExt_OperatorOut.h
trilinos-11.10.1-Source/packages/epetraext/src/EpetraExt_ConfigDefs.h

I also copied the additional files from the build version of trilinous (these files are generated upon ‘make’ in Trilinous).

trilinos.build/packages/epetra/src/Epetra_config.h
trilinos.build/packages/epetra/src/Epetra_DLLExportMacro.h
trilinos.build>/packages/teuchos/core/src/Teuchos_config.h
trilinos.build/Trilinos_version.h
trilinos.build/packages/triutils/src/Triutils_config.h
trilinos.build/packages/teuchos/core/src/Teuchos_config.h

I also had to remove some directories
aztecoo/example

Catastrophic error: cannot open source file

A while back I was trying to compile the AztecOO library outside of Trilinous. See this early post for more details. In doing so, I received the following error:

catastrophic error: cannot open source file "az_aztec.h"

Solution
This was a simple oversight on my part. To fix this, I added –I./src to the compile statement to make sure it looked in the Aztec src directory for header files, etc. Same goes for anyone experiencing a similar error.

AztecOO: error: identifier “sswap_” is undefined

Error
I’ve been trying to compile the AztecOO library outside of Trilinous. In doing so, I pulled the package Aztec source code from the Trilinous source code and opted to write my own Makefile to then compile it. My Makefile included the same settings reported in the Trilinous Makefile.export.AztecOO file.

To prepare this build, I needed to fetch the AztecOO_config.h file from a built version of Trilinous and place it in the source directory of the Aztec directory I was compiling (this file is generated upon ‘make’ in Trilinous). With that in place, I had the files I needed to compile Aztec, however, I ran into the following error.

error: identifier "sswap_" is undefined

Solution
SWAP_F77 is a defined module that points to the F77_BLAS_MANGLE module at the top of az_c_util.c. This second module is defined in AztecOO_config.h. All this module does, is add a “_” to the end of the name provided in the parameters and defines it with the provided value. This works when you are using the Fortran Blas library, but I am using the C version. To fix this, I edited all F77 functions in the AztecOO_config.h file to just return “name” instead of “name ## _”.

I also added this include statement to the file that errors src/az_c_util.c which required that I add –I to the compile statement in order for the compiler to find the right header files.

#include "mkl_blas.h"

Compiling ParaView v4.1.0 CMake Error: The following variables are used in this project…

Error

I received the following error while configuring ParaView v4.1.0 with ccmake from source.

CMake Error: The following variables are used in this project, 
but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly 
in the CMake files:
GLUT_Xi_LIBRARY (ADVANCED)
     linked by target "icetTests_mpi" in directory 
     ...ParaView-v4.1.0/ThirdParty/IceT/vtkicet/tests
GLUT_Xmu_LIBRARY (ADVANCED)
     linked by target "icetTests_mpi" in directory 
     ...ParaView-v4.1.0/ThirdParty/IceT/vtkicet/tests

ParaView Compile Error

Solution

To fix this, I set the GLIT_Xi_Library and GLUT_Xmu_LIBRARY variables to the correct libXi and libXmu shared libraries.

ParaView Compile Error

Compiling Mesa 7.9.1 Error: brw_program.c:39:20: error: talloc.h: No such file or directory

Error

I received the following error while configuring mesa version 7.9.1 from its source code (running ./configure).

Error: “brw_program.c:39:20: error: talloc.h: No such file or directory”

Mesa compile error
Solution

To solve this issue, I added a statement to the ./configure line that added talloc’s include directory into the CPPFLAGS.

CPPFLAGS="-I<PATH TO TALLOC INCLUDE DIRECTORY>" ./configure

Make sure to keep the “-I” before the path with no spaces between them. I had talloc installed in a unique location, with a different prefix than the norm. Mesa wasn’t looking in the right places for it. To provide mesa with the correct path, I added it into CPPFLAGS. These flags are used to define include directory paths for the compiler.

Compiling ParaView v4.1.0 Error: libXi.so undefined reference to `_XGetRequest’

Error

While compiling ParaView from the source files, I ran into the following error while running the ‘make’ command.

…libXi.so undefined reference to `_XGetRequest'
make[2]: *** [bin/icetTests_mpi] Error 1
[ThirdParty/IceT/vtkicet/tests/CMakeFiles/
icetTests_mpi.dir/all] Error2

Solution

In my case, the X11 libraries were installed separately and were located in custom directory locations that differed from the default. I fixed this error by checking and correcting the paths for my X11 libraries and include directories within the ccmake configuration menu. The error was then fixed during the next ‘make.’

Compiling ParaView v4.1.0 Error: couldn’t connect to server

Error

I received the following error while trying to compile ParaView from source.

http://www.vtk.org/files/ExternalData/MD5/
7dc839fb2825efa8c55e4275fee02a75 ("couldn't connect to server")

ParaView Compile Error

For some reason, the requested files could not be pulled from the server. You may have proxy issues or restricted internet access.

Solution

Manually download all MD5 files from http://www.vtk.org/files/ExternalData/MD5/ and place into your ExternalData/Objects/ within the build directory.