WSL2
works with Nmap directly and is generally recommended instead of Cygwin.
For those who do need Cygwin, it’s possible to use Nmap from Cygwin, silently calling Windows Nmap.
Install by download nmap.
Install nmap “self-installer” .exe. When asked, also install Npcap.
Cygwin: add to ~/.bash_profile the following. Note the \ and \( are vital for Cygwin shell to interpret the command correctly.
Starting Nmap ( https://nmap.org )
Nmap scan report for 8.8.8.8
Host is up (0.0092s latency).
Not shown: 998 filtered ports
PORT STATE SERVICE
53/tcp open domain
443/tcp open https
Nmap done: 1 IP address (1 host up) scanned in 7.41 seconds
Troubleshooting:
errors about interface → try running Cygwin as Administrator (right click on Cygwin icon).
find interface names available to nmap
nmap --iflist
Notes:
to find servers with a particular port open on a subnet, try my
Python findssh
program that scans for servers without nmap.
If you don’t install Npcap when asked in the nmap installer, nmap does not work.
Nmap claims no host existed at a known working IP address.
Git over SSH can use
SSH-agent
to remember SSH keys for Linux and Windows.
For those not using Git over SSH but tiring of typing the Git password, on Windows the
Git Credential Manager
can fix that situation.
The install is small and quick, and to use Git Credential Manager, be sure via
git remote -v
that the connection is https:// and not ssh:// where appropriate.
Upon trying to git push or git pull, the Git Credential Manager will appear.
It works with 2-factor Authentication as well, storing in
Windows Credential Manager.
The keys can be deleted from Windows Credential Manager if needed, and / or the Personal Access Token automatically generated can be deleted from GitHub.
Git Credential Manager Core 2.x is the next generation OS-agnostic Git credential manager that also works on more than just GitHub (e.g. also works on Bitbucket).
At the moment, we experienced a
bug
that prevented using the next generation GCM.
Opening Paraview Python “pvpython” terminal is accomplished by:
Linux: pvpython should be on $PATH.
macOS: Look under /Applications/ParaView*.app/Contents/bin/pvpython
Windows: Look under Start Menu > ParaView > pvpython
Paraview’s Python interface scripts that use Render() create a vestigial feature that is frozen.
To make the plots interactive, use Interact() instead.
Python Paraview example:
fromparaview.simpleimport *
s = Sphere()
Show()
Interact()
CMake with the Ninja and Ninja Multi-Config generators virtually always work well together, including with Fortran projects.
To generate the dependency graph, CMake directs the Fortran compiler to
preprocess each Fortran code file
when using the Ninja generator.
In rare cases, some legacy Fortran large code files can generate unexpected and spurious syntax errors when using CMake + Ninja.
The workaround seems to be to use the GNU Make backend, we have found that works for the rare case this became an issue.
Android task switching swipe navigation can be switched to 3-button navigation.
Some workflows are much easier via the traditional 3-button navigation used by Android since Android 3.x / 4.x.
Also when wearing gloves, using 3-button navigation can work better.
Switch an Android device to traditional 3-button navigation (back, home, switch or triangle, circle square)
by going to Settings → System → Gestures → System navigation and select “3-button navigation”.
CMake is excellent for building very complex Fortran projects across operating systems and computing platforms from embedded systems to HPC.
Here are a few common Fortran CMake patterns.
For hand-written Makefile the order of libraries matters completely.
CMake attempts to determine the graph for library files, starting from the user specified order.
CMake will try a finite multiplicity to resolve the graph, but in tough cases of library interdependency library ordering may need to be influenced by
add_dependencies()
or even
object libraries.
“Undefined reference to” occurs at linking of main executable: be sure the library is actually linked to the user library with
cmake --build build -v
Fortran module include: be sure the *.mod file directory is included, particularly to the main executable by setting the target properties like:
CMake
Object Libraries
can be used to keep build directories less cluttered and speed up the build process.
The traditional workflow for Makefile was to create lots of object files (targets) with the relevant compile options, definitions and link flags.
Then the final executable or library targets would be linked from all the object files.
CMake
add_library()
defaults to creating static libraries.
The following stanza creates “libfoo.a” or similar:
add_library(foosrc.f90)
With numerous targets, there are a lot of “lib*.a” that may be cluttering the build directory.
Also, there is a finite time consumed in creating all those archive .a files from the object files.
For projects that use Visual Studio, using Object Libraries can help avoid
complications with exporting symbols for MSVC.
CMake object libraries: a cleaner option for most cases where the “lib*.a” artifact is not needed is to create CMake Object Libraries instead:
instead of having files under build/ like “libfoo.a, libbar.a” there will be only “baz.exe”.
The object files will be tucked away under build/CMakeFiles/foo/*.o and build/CMakeFiles/bar/*.o.
The generator expressions expand to all the object files of “foo” and “bar” like a legacy Makefile.
The INTERFACE
target properties
of object libraries propagate up to targets linking them as usual.
You may need to modify the PUBLIC / PRIVATE / INTERFACE of object libraries or add them to the “target_link_libraries()” of the top-level targets when going from static or shared libraries to object libraries.
Caveats: object libraries with duplicate symbols can cause conflicts that need to be manually resolved.
When linking non-object libraries, the linker typically just uses the first instance seen of a symbol.