Hello everyone,

I would like to share some of my thoughts and seek some opinions on coding
for const char **ompd_dll_locations.

After reviewing the documentation
<https://www.openmp.org/spec-html/5.0/openmpsu192.html>, looking over LLVM
approach
<https://github.com/OpenMPToolsInterface/LLVM-openmp/blob/3b6c06e354ef1e59da22778a9033d87ed0e3b19d/runtime/src/ompd-specific.cpp#L69-L83>
as a reference, looking around in GCC code base, and searching around for
similar cases and their solutions, I have just a few more questions before
finally putting down some unit tests and code.

- This post
<https://unix.stackexchange.com/questions/19633/which-header-defines-the-macro-that-specifies-the-machine-architecture>seems
to use compiler macro to rely on the compiler to suggest architecture,
including 32bit and 64bit. I found some macro in gcc/config/i386/i386.h
that seems relevant. Is this an acceptable approach? If yes, which header
should I use? If not, should I then compare byte size of int and decide
from there?

- I did some digging around to find conventional library location.  One of
the issue, however, is that my Linux x86 64bit machine is currently down
for repair. I checked in my FreeBSD x86 64bit machine, which suggested
/usr/lib for 64bit library and /usr/lib32 for 32bit library, and my
raspberry pi Linux 64bit ARM, which suggested /usr/lib/aarch64-linux-gnu
for 64bit library. At the moment, I assumed I would keep the scope small
and stay with x86 machine's 32bit and 64bit machines, but I wasn't sure
what would be the best path to put in that would accommodate all machines.
I haven't even looked into Windows, although I assume it's likely
C:\Program Files\system and C:\Program Files\system32. Should I simply put
all possible path into the array per arch?
(LLVM currently simply puts { "ompd.so", NULL }, but I am assuming this was
just a placeholder.)

- There doesn't seem to be any dedicated function to assign values to the
variable. I would like to create a header file to declare some additional
functions, such as one that would assign the value. Is this acceptable and,
if so, where would be the best place to put such header file?

I would appreciate any suggestions.

Cheers and stay safe,

Tony Sim

Reply via email to