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

Add basic ingredients for CONDA/cl.exe build for Windows. #78

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

willend
Copy link
Contributor

@willend willend commented Feb 28, 2024

This PR includes

  • Minimal edits to src/mcpl/mcpl.c for missing windows unistd/getopt
  • A public domain (?) implementation of unistd.h in src/mcpl (was taken from https://stackoverflow.com/a/826027/1202830 - author gives no explicit license there)
  • CMAKE infrastructure to ensure the CONDA include path is explicitly set for cl.exe to pick up
  • In util/ I have put a .bat snippet to enable python from the surrounding conda env being run on the bin/mcpl-config python script
  • zlib is successfully picked up from CONDA via the above include-workaround

Once this is in place, we should be ready to build a Windows package with enough features for a functional McStas release on Windows / conda via a build.bat with something like

cmake -DCMAKE_INSTALL_PREFIX=%PREFIX%  ^
-S %SRCDIR% -G "NMake Makefiles"  ^
-DBUILD_SHARED_LIBS=ON -DMCPL_DISABLE_CXX=ON ^
-DMCPL_NOTOUCH_CMAKE_BUILD_TYPE=ON  ^
-DMCPL_ENABLE_RPATHMOD=OFF  ^
-DCMAKE_INSTALL_LIBDIR=lib - ^
DCMAKE_BUILD_TYPE=Release ^
-DMCPL_ENABLE_EXAMPLES=OFF  ^
-DMCPL_ENABLE_PYTHON=OFF  ^
-DMCPL_ENABLE_ZLIB=USEPREINSTALLED  ^
-DMCPL_CONDA_WINDOWS=ON  ^
-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON  ^
%CMAKE_ARGS%

cmake --build . --target install --config Release

(- Hinges on conda dependencies getopt-win32, zlib etc.)

@willend willend requested a review from tkittel February 28, 2024 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant