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

remove hardcoded yaml-cpp path from CMakeLists.txt #5

Merged
merged 8 commits into from
Sep 7, 2023

Conversation

TomMelt
Copy link
Contributor

@TomMelt TomMelt commented Aug 31, 2023

CMakeLists.txt and examples/cpp/cart_pole/CMakeLists.txt contain hardcoded paths to yaml-cpp

These has been removed in favour of using env variables

  • YAML_LIBRARY
  • YAML_INCLUDE_DIRS

Fixes #6

CMakeLists.txt and examples/cpp/cart_pole/CMakeLists.txt contain
hardcoded paths to yaml-cpp

These has been removed in favour of using env variables

* YAML_LIBRARY
* YAML_INCLUDE_DIRS
@azrael417
Copy link
Collaborator

LGTM. Josh, any comments?

Copy link
Collaborator

@romerojosh romerojosh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on improving the build for non-Docker users @TomMelt!

Left a couple of comments/changes. Additionally, before we can merge, can you update the Dockerfile to include the definition of this new env var to the TorchFort build line, for example, something like:

RUN cd /torchfort && mkdir build && cd build && \
    cmake -DCMAKE_INSTALL_PREFIX=/opt/torchfort \
    -DNVHPC_CUDA_VERSION=11.8 \
    -DCMAKE_PREFIX_PATH="`python -c 'import torch;print(torch.utils.cmake_prefix_path)'`;/opt/nvidia/hpc_sdk/Linux_x86_64/23.5/cmake" \
    -DYAML_LIBRARY=/opt/yaml-cpp/lib \
    -DYAML_INCLUDE_DIRS=/opt/yaml-cpp/include \
    .. && \
    make -j install && \
    cd / && rm -rf torchfort

CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
examples/cpp/cart_pole/CMakeLists.txt Outdated Show resolved Hide resolved
examples/cpp/cart_pole/CMakeLists.txt Outdated Show resolved Hide resolved
TomMelt and others added 6 commits September 6, 2023 09:36
Co-authored-by: romerojosh <romero.josh@gmail.com>
Co-authored-by: romerojosh <romero.josh@gmail.com>
Co-authored-by: romerojosh <romero.josh@gmail.com>
Co-authored-by: romerojosh <romero.josh@gmail.com>
@TomMelt
Copy link
Contributor Author

TomMelt commented Sep 6, 2023

Thanks for working on improving the build for non-Docker users @TomMelt!

Left a couple of comments/changes. Additionally, before we can merge, can you update the Dockerfile to include the definition of this new env var to the TorchFort build line, for example, something like:

RUN cd /torchfort && mkdir build && cd build && \
    cmake -DCMAKE_INSTALL_PREFIX=/opt/torchfort \
    -DNVHPC_CUDA_VERSION=11.8 \
    -DCMAKE_PREFIX_PATH="`python -c 'import torch;print(torch.utils.cmake_prefix_path)'`;/opt/nvidia/hpc_sdk/Linux_x86_64/23.5/cmake" \
    -DYAML_LIBRARY=/opt/yaml-cpp/lib \
    -DYAML_INCLUDE_DIRS=/opt/yaml-cpp/include \
    .. && \
    make -j install && \
    cd / && rm -rf torchfort

Hi @romerojosh , I have update the Dockerfile to include the YAML_CPP_ROOT CMake variable. It should be sufficient.

https://github.com/TomMelt/TorchFort/blob/533768dc4ea475331e97fdbc9fa472fa2bfa6659/docker/Dockerfile#L52

(annoyingly I can't test the docker build easily without making a virtual machine because the docker script doesn't work on ubuntu zfs install due to issues with overlayFS and the ZFS filesystems)

Copy link
Collaborator

@romerojosh romerojosh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for the PR!

@romerojosh romerojosh merged commit 910481d into NVIDIA:master Sep 7, 2023
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.

cmake contains hardcoded paths for yaml-cpp library
3 participants