What value puts Jam in its builtin variable $(OS) on QNX Neutrino hosts? - qnx

I have to configure my compilation depending on build hosts. Windows and Linux are easy and I have access to the build hosts to test it myself anyway.
What I have so far completely failed to find are the values of $(OS) and, just to check my expectations, $(OSPLAT). I assume OSPLAT to be X86 on x86 machines, similar to other QNX supported SDP packages
If anyone has access to a QNX/Neutrino system with installed QNX SDP, the Jam script below can produce the result:
Echo $(OS) $(OSPLAT) ;

I had a look at Jam source and it seems that depending on the platform version it is either QNX or QNXNTO. See jam.h for more details and OSPLAT values.

Related

How do I install luac.cross on a Mac?

NodeMCU documentation states
NodeMCU firmware build now automatically generates a luac.cross image
as standard in the firmware root directory; this can be used to
compile and to syntax-check Lua source on the Development machine for
execution under NodeMCU Lua on the ESP8266.
Where do I get luac.cross from and how do I install it?
Do I build NodeMCU firmware from source on Mac and is luac.cross created as part of that process? I have been using the cloud service to create custom firmware. Is luac.cross available via cloud build?
Straight lua code has overwhelmed the MakerFocus NodeMCU board resulting runtime panic with out of memory issue. Hoping compiled code will reduce RAM needs.
Where do I get luac.cross from and how do I install it?
You gave the answer in the quote from the documentation you posted. Specifically this
NodeMCU firmware build now automatically generates a luac.cross image...
So, if you build the NodeMCU manually on your platform the build process will also create a lua.cross for your platform. That's the reason you cannot download or install lua.cross - it has to fit your platform i.e. OS et.al.
The logical next question would then be: how do I manually build NodeMCU on macOS?
I don't know the answer to that as I build with the Docker image (from yours truly) on macOS. Running the Docker build creates a luac.cross in the firmware root directory. However, as macOS is just the host OS for Docker in this setup luac.cross is for Linux rather than native for macOS. To use it you would start the Docker container again and run bash in it to get a shell to execute the Lua cross compilation: docker run --rm -ti -vpwd:/opt/nodemcu-firmware marcelstoer/nodemcu-build bash.
Straight lua code has overwhelmed the MakerFocus NodeMCU board resulting runtime panic with out of memory issue. Hoping compiled code will reduce RAM needs.
I hate to disillusion you, but if I had to bet I would expect that savings won't be significant enough to yield the expected results. As you already started reading documentation I'd like to point you to the relevant FAQ: How is NodeMCU Lua different to standard Lua? and Techniques for Reducing RAM
And maybe using LFS will be your life saver.
In case you want to use this tool regardless of the platform - you can use my API to build it:
curl -d #yourscript.lua -X POST https://nodemcu-luacross-run-64l7ehzjta-uc.a.run.app/compile > output.luac

Can aws-sdk-cpp be built for QNX?

The goal is to upload to Amazon S3 from QNX software.
Is it possible to target QNX as the build for the aws-sdk-cpp?
Initial attempts seem to default to Windows.
We don't know, but you should try. Since QNX is unix like system, most probably it's okay to build on QNX. But make sure you have openssl/curl/cmake stuff installed.

Bazel repository rule- Can I access something like Java's "os.arch"?

I need to write a Bazel repository rule which downloads mysql binaries according to the required version, to the operating system and the architecture.
I'll get the required version from the user, the operating system from repository_os.name but I'm not sure how I can access the architecture?
The current non-hermetic code uses os.arch as a good enough heuristic (yes I know it's not precise).
There is no way to access the architecture, except asking for uname -m using repository_ctx.execute. You can also make it work on Windows by executing a different command depending on repository_ctx.os.name (which is the same as os.name from the JVM so if it contains win you can execute the Windows command). If you think this is needed, please file a feature request on https://github.com/bazelbuild/bazel/issues/new
The host platform's CPU architecture and operating system name are accessible via repository_ctx.os. The attribute is a repository_os struct with arch and name.

Good alternative to environment modules for windows?

In the past I have used environment modules extensively in Unix based systems. The tool proved very usefull since we had many different projects each of them using a potentially different set of tools.
I am now however stuck with a windows machine and need to make the most of it. Does anybody know of a good alternative to environment modules for windows? I am basically looking for a tool that let's me manipulate the PATH (or $env:PATH in windows powershell) environment variable without having to touch it directly.
You can install environment modules on windows as well. The instructions are in the repository https://github.com/cea-hpc/modules/blob/master/INSTALL-win.txt
Basically you have to install active state tcl and copy the source files.
I use this and it works quite well.

Installation of Z3 on a posix system without python?

Is it possible to get Z3 running on a system providing posix API without having python installed?
I have seen the new version 4.3 uses python already in the build-process (scripts/mk_make.py).
Whats about older versions like 4.1? Is it imaginable to get it to run on posix without python?
Is Python not available in your system?
Python was always used to automatically generate some parts of the Z3 code base. In the first source code release, we have included the automatically generated code. Actually, at that time, we were using a combination of python + sed + awk + grep to generate these parts of the code. Another problem with the first release is that the build system for Windows (+ Visual Studio) was completely different from the build system for the other platforms. The Makefiles for Linux and OSX were derived from Visual Studio Project files. Some users also started to report problems with the build system for Linux and OSX. So, to reduce these problems and have a uniform build system, we decided to use python (and python only) to:
Automatically generate code (for bindings for different languages, API logging support, etc)
Check the system for requirements
Generate the Makefiles
And any other form of automation
Python is very attractive for us because it works in most systems (even non posix compliant ones). We can easily write portable scripts. Moreover, after we made the switch, we can compile Z3 in more platforms. We successfully compiled it on Windows, Linux (Mint, Ubuntu, Suse, etc), OSX, Cygwin, and FreeBSD.
In the "unstable" (aka working-in-progress) branch, we don't even require autoconf anymore, we use python to do all system specific configuration. To build Z3, we just need: python, C++ compiler (Visual Studio C++, g++ or clang++), ar (on non-windows platform), make (or nmake). This is very small set of requirements. Python is available in most platforms by default.
That being said, is it possible to remove the python requirement? Yes, it is, but it would have to replace python with something else. Something, that would allows us to perform all tasks described above. Take a look in the directory scripts at http://z3.codeplex.com/SourceControl/changeset/view/0c1f2a82818a,
we would have to port all these automation scripts to something that can be used on all platforms we support.

Resources