How to run GhostScript on AS400 server - ghostscript

We have PDF files on the AS/400 and we need to convert them to PCL for printing . So for this we found Ghostscript for converting PDF file to PCL format , so we're looking for a way to run Ghostscript commands on the AS/400.
Have you please any idea how to do it , if no I am looking for another "free" method to do what we need.
Any help will be appreciated

Ghostscript doesn't accept PCL as input, you need Ghostpdl for that, and more specifically the pcl6 executable.
You can't 'run Ghostscript commands' you can run the executable with the PCL file as an input and suitable command line switches.
In order to do this you will need to compile Ghostscript for your target environment (AS/400 apparently). Ghostscript is written in standard C so you will need a C compiler, the build process is convoluted and requires running a number of executables in order to generate some platform specific files.
Your first task is going to be porting Ghostscript and its build process onto your target platform. I'm not aware of anyone having done this for AS/400 but we'd be interested to hear how you get on.

Related

How to add a kit to Qt Creator from the command line, or other programmatic manner? [duplicate]

SO!
Let's say I have a number of settings (GCC compiler 9.3.0 built from source, as the distribution I have to use has a very old one, along with environment setup) for a new Kit in QtCreator.
I have managed to setup an environment for compilation and execution of compiled binaries, and made a script to make it work (like qmake -nocache -recursive/make/sudo make install, direct execution of g++, and other stuff).
One thing that script can't do at the moment, is that it cannot create a kit for QtCreator with new compilers and environment being set as required, so after running a script, its user has to go through setting it up himself through GUI, which is bad, because this can cause misconfiguration.
This thing I'm trying to create is going to be used by around ~200 people in my company, so leaving readme.txt with instructions just doesn't go well enough for me - I don't want running around fixing missing "{" and "}" in Environment description in created Kits, and other stuff.
Are there ways to create Kits for QtCreator automatically from command line? Maybe, there's some files to edit?
I've looked into this one a few years back (I wanted to do something similar for registering Buildroot toolchains automatically in QtCreator), and I was unable to find an off the shelf solution. So i think there are 2 ways to implement this:
a) Implementing a command line utility the manipulate the ~/.config/QtProject/qtcreator/{toolchains,profiles}.xml files. Maybe by (re)using the existing C++ implementation within QtCreator, or just re-implement it ie. in Python. Back than I didn't start to work on this as there was no real business need.
b) Switching to qbs, as qbs has support for setting up toolchains from the command line ( see: https://doc.qt.io/qbs/cli-setup-toolchains.html)
If you decide to go with solution a), please let me know and maybe we can partner up to implement it.
Check out the command line sdktool bundled with QtCreator:
The SDK tool can be used to set up Qt versions, tool chains, devices
and kits in Qt Creator.
There still is a lot of knowledge about Qt Creator internals required
to use this tool!
I haven't tried it yet, but I did find the executable under Tools/QtCreator/libexec/qtcreator subdirectory of the Qt Creator installation directory. ./sdktool --help works for me under Linux.

How to install and use open source library on Windows?

I'd like to use open source library on Windows. (ex:Aquila, following http://aquila-dsp.org/articles/iteration-over-wave-file-data-revisited/) But I can't understand anything about "Build System"... Everyone just say like, "Unzip the tar, do configure, make, make file" at Linux, but I want to use them for Windows. There are some several questions.
i) Why do I have to "Install" for just source code? Why can't I use these header files by copying them to the working directory and throw #include ".\aquila\global.h" ??
ii) What are Configuration and Make/Make Install? I can't understand them. I just know that configuration open source with Windows need "CMake", and it is configuration tool... But what it actually does??
iii) Though I've done : cmake, mingw32-make, mingw32-make install... My compiler said "undefined references to ...". What this means and what should I do with them?
You don't need to install for sources. You do need to install for the libraries that get built from that source code and that your code is going to use.
configure is the standard name for the script that does build configuration for the software about to be built. The usual way it is run (and how you will see it mentioned) is ./configure.
make is a build management tool (as the tag here on SO will tell you). One of the most common mechanisms for building code on linux (etc.) is to use the autotools suite which uses the aforementioned configure script to generate build configuration information for use by generated makefiles which make then uses to build the software. make is also the way to run the default build target defined in a makefile (which is often the all target and which usually builds the appropriate library/binary/etc.).
make install is a specific, secondary, invocation of the make tool on the install target which (generally) installs the (in this case previously) built code into an appropriate location (in the autotools/configure universe the default location is generally under /usr/local).
cmake is, again as the SO tag says, a build system that generates configuration files for other build tools (make, VS, etc.). This allows the developers to create the build configuration once and build on multiple platforms/etc. (at least in theory).
If running cmake worked correctly then it should have generated the correct information for whatever target system you told it to use (make or VS or whatever). Assuming that was make that should have allowed mingw32-make to build the software correctly (assuming additionally that mingw32-make is not a distinct cmake target than make). If that is not working correctly then something is still missing from your system (and cmake probably should have caught that).
But to give any more detail you will need to give more detail about what errors you are actually getting and from what command.
(Oh, and on Windows, and especially if you plan on building your software with VS (or some other non-mingw32-make tool) the chances of you needing to run mingw32-make install are incredibly small).
For Windows use cmake or latest ninja.
The process is not simple or straight, but achievable. You need to write CMake configuration.
Building process is not simple and straight, that's why there exists language like Java(that's another thing though)
Rely on CMake build the library, and you will get the Open-Source library for Windows.
You can distribute this as library for Windows systems, distribute and integrate with your own software, include the Open Source library, in either cases, you would have to build it for Windows.
Writing CMake helps, it would be helpful to build for other platforms as well.
Now Question comes: Is there any other way except CMake for Windows Build
Would you love the flavor of writing directly Assembly?
If obviously answer is no, you would have to write CMake and generate sln for MSVC and other compilers.
Just fix some of the errors comes, read the FAQ, Documentation before building an Open Source library. And fix the errors as they lurk through.
It is like handling burning iron, but it pays if you're working on something meaningful. Most of the server libraries are Open Source(e.g. age old Apache httpd). So, think before what you're doing.
There are also not many useful Open Source libraries which you could use in your project, but it's the way to Use the Open Source libraries.

How to include Qt libraries with CMake inside a .app project on OSX?

I've created a Qt project using CMake as build system. I would like to include in the deployment phase, the necessary Qt frameworks
Qt3Support.framework/ QtNetwork.framework/ QtXml.framework/
QtCore.framework/ QtOpenGL.framework/
QtGui.framework/ QtSql.framework/
in order to be ready to distribute my program as standalone dmg.
This is usually done with macdeployqt command but it gives me a lot of errors like this:
ERROR: "strip: for architecture x86_64 object:
/Users/rs/build/myapp.app/Contents/Frameworks/QtXmlPatterns.framework/Versions/4/QtXmlPatterns
malformed object (unknown load command 5)
so I want to be able to do it directly in the deployment phase, is it possible?
I was using DeployQt4 and BundleUtilities for some time until I ran into a problem with it which wasn't easy to fix according to one of the authors.
I ended up writing a ruby script that does what BundleUtilities does barring that problem. My script has a limitation currently comparing to the BundleUtilities - it doesn't handle bundles with multiple executables. Writing the same functionality in cmake is beyond my degree of masochism (I managed to understand what BundleUtilities does and how but was appalled by the contraptions they had to use to organize data in memory).
The script itself is available here: https://github.com/artm/vision-ui-skeleton/blob/master/ruby/fixup/fixup.rb
It is used from cmake at the bottom of: https://github.com/artm/vision-ui-skeleton/blob/master/cmake/QArtmRelease.cmake
It works with ruby that comes with OSX 10.6.x and probably higher.

MATLAB Invalid MEX File

So I'm running software I downloaded for analyzing the position of fluorescent proteins in microscopy images. The software is called plusTipTracker, and it runs off MATLAB.
So the first function (detecting 'spots' in the images) works fine, but the second function ("track spots") fails. In particular, it seems to be an error with a MEX file:
??? Invalid MEX-file
'/Users/ethanbuchman/Documents/MATLAB/plusTipTracker_1pt1pt3_2012-07-07/software/createDistanceMatrix.mexmaci64':
dlopen(/Users/ethanbuchman/Documents/MATLAB/plusTipTracker_1pt1pt3_2012-07-07/software/createDistanceMatrix.mexmaci64,
1): no suitable image found. Did find:
/Users/ethanbuchman/Documents/MATLAB/plusTipTracker_1pt1pt3_2012-07-07/software/createDistanceMatrix.mexmaci64:
unknown required load command 0x80000022.
I can locate this file in the software folder i downloaded. There are actually multiple versions, each with a different extension (eg. .mexa64, .mexmaci, .mexmaci64, etc.). There's also a .dll file. While there are other mex files in the folder, each with multiple extensions, none of the others have an associated dll file. Not sure if that's relevant.
But I have no idea what to do about this.
Im on MacOSX 10.5.8 using Matlab R2010b.
Any insight would be greatly appreciated. Thanks.
From what I'm reading here, it seems like the MEX file was compiled for a different version of Mac OS. Can you recompile the MEX files and DLL on your own system?

how to design an IDE for GCC using Java?

I have already created a text editor using Netbeans in Java and I want to know to link the text editor with the GCC compiler in Linux Platform.
Try the Runtime 'exec' method to execute the program you want (gcc) with the parameters you want (the file names to compile). From there you get a process object that you can use to read the output streams from the executed program.

Resources