In both Matlab and GNU Octave, functions like error and warning by default print messages to stderr in non-interactive sessions, for easier capture to uncluttered log files.
To print to stderr in general, use
fprintf(2, 'Hello text')
Verify these are printing to stderr by appending to the end of the command line command: 2>err.log
Fortran languages standards keep long backward compatibility.
Fortran 2018 finally deprecated Fortran 1958 fixed width format.
In general across languages, compiler vendors take years to add the full language feature set.
Automatically determining if a particular compiler supports a needed modern Fortran feature is straightforward with CMake (and Meson).
This CMake example is for
error stop.
Unlike C++, we do not typically need to enable modern Fortran features with specific compiler flags.
Modern Fortran features are typically enabled by default.
include(CheckSourceCompiles)set(CMAKE_TRY_COMPILE_TARGET_TYPESTATIC_LIBRARY)# save link time, only compile is needed
check_source_compiles(Fortran"program test
error stop
end"f08errorstop)if(f08errorstop)...
endif()
Assumes: Windows laptop connecting to a remote Windows PC with
OpenSSH server and client
built into Windows.
Remote PC IP
Remote PC SSH port
Remote PC RDP port
1.2.3.4
22 (open TCP firewall)
3389 (blocked by remote PC firewall)
Setup: on the Windows laptop, create script file sshrdp.bat:
start /b ssh -L 3391:localhost:3389 %1@echo off
REM enough time to enter passwordtimeout /nobreak 10
mstsc /v:localhost:3391
Usage: from that directory, type sshrdp myhostname to connect RDP over SSH to myhostname computer that’s setup in your ~/.ssh/config file or via the IP address or hostname directly.
sshrdp.bat:
makes the SSH connection (you’ll be prompted for SSH password, or use a public key file)
makes the RDP connection over the SSH tunnel (where you will be prompted for the Windows password).
Fortran has a long legacy of preprocessing systems, reaching back at least to the 1970s when C was not yet widely known.
I would argue that modern Fortran ≥ 2008 has eliminated most preprocessors use cases.
It’s usually much cleaner and quicker (build/runtime) to use Fortran submodule to switch functionality such as
MKL vs. Atlas vs. Netlib Lapack
using CMake, for example.
Numerous Python preprocessors have arisen (and sunk) along with the usual C/C++-based preprocessors.
The only thing we use preprocessors for is very simple single-line statements, where adding a submodule would be significantly more cumbersome than a one-liner preprocessor statement.
Historically, very elaborate Fortran preprocessors were developed such that they nearly became a language unto themselves.
A few quick start tips for using
EZNEC
antenna design software for yagi antennas.
This is assuming a yagi antenna for 440 MHz band.
Ground: start with “free space”. If the antenna model is too close to the ground, the simulation can be unrealistic. Once satisfied in free space, consider real ground (non-free space)
Number of segments: suggest 5 per wire, with free EZNEC license
Number of yagi elements: 3..5 elements are possible with free EZNEC at 440 MHz.
CMake by default searches for shared libs before static libs.
Sometimes a project needs to specifically link external or internal static libs, even if shared libs are present.
A simple cross-platform way to do this is to set
CMAKE_FIND_LIBRARY_SUFFIXES
before any find_library() or find_package():
set(CMAKE_FIND_LIBRARY_SUFFIXES.a.lib)
This takes advantage of de facto static library extensions for macOS, Windows and Linux, using CMake system variables.
The default values for CMAKE_FIND_LIBRARY_SUFFIXES are set by (depending on platform and compiler) CMake