Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation is incomplete on how to build with zoslib #67

Open
MikeFultonDev opened this issue Jun 22, 2024 · 4 comments
Open

Documentation is incomplete on how to build with zoslib #67

MikeFultonDev opened this issue Jun 22, 2024 · 4 comments
Labels
documentation Improvements or additions to documentation

Comments

@MikeFultonDev
Copy link
Collaborator

I wasn't able to compile using the options specified for C. I haven't whittled it to the minimum but found that:

-fzos-le-char-mode=ascii -D_XOPEN_SOURCE=600 -D_ALL_SOURCE -D_OPEN_SYS_FILE_EXT=1 -D_AE_BIMODAL=1 -D_ENHANCED_ASCII_EXT=0xFFFFFFFF  -DZOSLIB_OVERRIDE_CLIB=1 -DZOSLIB_OVERRIDE_CLIB_GETENV=1

worked.
Without at least some of those additional options, the header files spit out numerous errors.

@IgorTodorovskiIBM fyi

@MikeFultonDev MikeFultonDev added the documentation Improvements or additions to documentation label Jun 22, 2024
@MikeFultonDev
Copy link
Collaborator Author

It also isn't clear how to link... I tried:

clang -L "${ZOSLIB_ROOT}/lib" -lzoslib $TC.o -o $TC

as well as the same with clang++ and both result in a bunch of unresolved refs to C++ functions. Presumably this is because my 'main' is C but it's pulling in C++ code from the archive but I'm not sure how to tell clang/clang++ what to do

@IgorTodorovskiIBM fyi

@MikeFultonDev
Copy link
Collaborator Author

First unresolved ref:

./build
 IEW2456E 9207 SYMBOL
          _ZNSt3__16_ASCII15basic_streambufIcNS0_11char_traitsIcEEE6xsputnEPKcl
          UNRESOLVED.  MEMBER COULD NOT BE INCLUDED FROM THE DESIGNATED CALL
          LIBRARY.
 IEW2456E 9207 SYMBOL
          _ZNSt3__16_ASCII15basic_streambufIcNS0_11char_traitsIcEEE5uflowEv
          UNRESOLVED.  MEMBER COULD NOT BE INCLUDED FROM THE DESIGNATED CALL
          LIBRARY.

@MikeFultonDev
Copy link
Collaborator Author

Found a solution after digging through z/os open tools. It appears I also need -lzoslib-supp (not sure if the celquopt.s.o is required).

clang++ -fzos-le-char-mode=ascii -L "${ZOSLIB_ROOT}/lib" "${ZOSLIB_ROOT}/lib/celquopt.s.o" -lzoslib-supp -lzoslib driver.o $TC.o -o $TC

@MikeFultonDev
Copy link
Collaborator Author

@IgorTodorovskiIBM and @perry-ca : Please confirm/deny the following:

  • the zoslib code is a C++ object (either .so or .a).
    • as such, the current clang++ 'bind' step doesn't pull in the required C++ code ,and so zoslib-supp is required.
  • the celquopt.so provides the necessary 'initialization code' for a C application to work correctly
  • The example should be changed to include the celquopt.s.o and the zoslib-supp archive if doing a static bind

If that's correct, I can take a crack at fixing the C part of the documentation in the readme.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant