Preamble
This could potentially be an xy problem, so I'm open to suggestions that deviate from the original question if there's a better way to approach this.
Problem
I have a fairly large program that generates a lot of metrics, statistics, etc. One important calculation that I need is the ability to generate the output of a complex mathematical operation. The only tool that can generate this output is a third-party, vendor-supplied application. The vendor will gladly compile the application for my company for any OS/distory/architecture, but they cannot give us the source. As a result, our program must rely on the pre-compiled program being shipped as part of the same project, and the vendor program being launched via popen()
.
Due to installation mishaps and other issues, there are times that the popen()
call fails due to path issues, the file being moved, etc. These aren't things we can control, but nevertheless, the customer blames it on the devs.
Question
Is there some way, using a simple c plus make on linux program, to somehow embed the external application into our own application so that it can be popen()
'ed in a private memory mapping, so that the program is always available to our "main" application?
Ideally, we would just add the source for this program to our own code base and problem solved, but that's not available to us.