Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

[DOC] Update ubuntu install instructions from source #14534

Merged
merged 4 commits into from
Apr 24, 2019

Conversation

larroy
Copy link
Contributor

@larroy larroy commented Mar 26, 2019

Description

This PR updates ubuntu install instructions by using CMake and adding steps needed to update CMake on ubuntu 18.04 otherwise developers get nontrivial error messages.

@aaronmarkham

Checklist

Essentials

Please feel free to remove inapplicable items for your PR.

  • The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to the relevant JIRA issue created (except PRs with tiny changes)
  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage:
  • Unit tests are added for small changes to verify correctness (e.g. adding a new operator)
  • Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore)
  • Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL)
  • Code is well-documented:
  • For user-facing API changes, API doc string has been updated.
  • For new C++ functions in header files, their functionalities and arguments are documented.
  • For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable
  • Check the API doc at http:https://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
  • To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

@larroy larroy requested a review from szha as a code owner March 26, 2019 19:55
@larroy larroy changed the title Update ubuntu install instructions from source [DOC] Update ubuntu install instructions from source Mar 26, 2019
@abhinavs95
Copy link
Contributor

@mxnet-label-bot add [Doc, Installation, pr-awaiting-review]

@marcoabreu marcoabreu added Doc Installation pr-awaiting-review PR is waiting for code review labels Mar 26, 2019
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
..
ninja
Copy link
Member

Choose a reason for hiding this comment

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

-DUSE_MKLDNN will be turned on by default in this cmake line? Seems we need change the description in the next section and document the default behavior somewhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

MKL install requires additional steps in Ubuntu that are not part of the installation, so it's disabled. by -DUSE_MKL_IF_AVAILABLE=OFF even if any other MKL variables are on.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@TaoLv happy if you can help with MKL and CMake: #14670

Copy link
Contributor Author

Choose a reason for hiding this comment

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


```bash
export LD_LIBRARY_PATH=$PWD/lib
export LD_LIBRARY_PATH=`realpath build`
export MXNET_LIBRARY_PATH=`realpath build/libmxnet.so`
Copy link
Member

Choose a reason for hiding this comment

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

When will this env variable be used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

MXNET_LIBRARY_PATH when loading the library from python.

Copy link
Contributor

Choose a reason for hiding this comment

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

But why do we need this? It seems to work fine without having to set this env variable earlier.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was there in the instructions already. I agree is not necessary.

Copy link
Contributor

Choose a reason for hiding this comment

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

It was there in the instructions already. I agree is not necessary.
I could not find it in the instructions before this PR. If not necessary, can we not add it to the doc?

Copy link
Contributor Author

@larroy larroy Apr 15, 2019

Choose a reason for hiding this comment

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

Sure. I'm indifferent. While it can help debugging we can remove to keep the instructions lean. As you can see in the patch it was there already.

Copy link
Contributor

@aaronmarkham aaronmarkham left a comment

Choose a reason for hiding this comment

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

Some minor suggestions.

docs/install/ubuntu_setup.md Outdated Show resolved Hide resolved
```

**For Ubuntu 18.04 and CUDA builds you need to update CMake**
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the implication for older Ubuntu OS? Is there a version >= that must be met?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For older versions the distribution's provided CMake is working.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should we clarify that in the doc?

Copy link
Contributor

Choose a reason for hiding this comment

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

No, I guess it is fine if there is no action required.

sudo apt remove --purge --auto-remove cmake

# Update CMAKE for correct cuda autotedetection: https://github.com/clab/dynet/issues/1457
version=3.14
Copy link
Contributor

Choose a reason for hiding this comment

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

Putting in version number in the docs makes them go stale pretty fast. Is there a way to consolidate versions in a file so it can be managed there instead of sprinkled throughout code blocks in the docs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this is fine. This is the minimum version that works with ubuntu 18.04 I think is ok to put it there, and people can update it. If you put an indirect reference becomes more messy to maintain.

echo "USE_BLAS = openblas" >> ./config.mk
make -j $(nproc)
```

Copy link
Contributor

Choose a reason for hiding this comment

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

Should put something here instead of having two code blocks back to back... some description...

@piyushghai
Copy link
Contributor

@larroy Is this PR good to merge now ?

cmake -GNinja \
-DUSE_CUDA=OFF \
-DUSE_MKL_IF_AVAILABLE=OFF \
-DCMAKE_CUDA_COMPILER_LAUNCHER=ccache \
Copy link
Contributor

@apeforest apeforest Apr 9, 2019

Choose a reason for hiding this comment

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

I am not an expert in cmake but is ccache a de facto build option for cmake build system? Can we leave this option to user?

Copy link
Contributor Author

@larroy larroy Apr 11, 2019

Choose a reason for hiding this comment

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

needs to be enabled explicitly with this flag, is not default. I think we should enable it in our instructions to speed up development process. Otherwise it becomes an obscure trick.

@larroy
Copy link
Contributor Author

larroy commented Apr 11, 2019

@piyushghai up to reviewers to approve or follow up on the changes / made additional requests. @apeforest @aaronmarkham

Copy link
Contributor

@aaronmarkham aaronmarkham left a comment

Choose a reason for hiding this comment

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

I'm ok with the current changes here.

Copy link
Contributor

@apeforest apeforest left a comment

Choose a reason for hiding this comment

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

Looks fine to me. Just one small comment added. Thanks!

@aaronmarkham
Copy link
Contributor

Restarted CI (Julia test failed for some reason... let's see if gets though this time...)

@larroy
Copy link
Contributor Author

larroy commented Apr 24, 2019

@aaronmarkham @apeforest are we good to merge?

@aaronmarkham aaronmarkham merged commit 014ca13 into apache:master Apr 24, 2019
haohuanw pushed a commit to haohuanw/incubator-mxnet that referenced this pull request Jun 23, 2019
* Update ubuntu install instructions from source

* Update docs/install/ubuntu_setup.md

Co-Authored-By: larroy <[email protected]>

* Address CR comments

* Address CR comments
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Doc Installation pr-awaiting-review PR is waiting for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants