Repository: pytorch
Issue: Installing pytorch from source on labs.cognitiveclass.ai
Labels: triaged,module: POWER

There are free linux-ppc64le Jupyter notebook environments (similar to Googe Colab):
1) https://labs.cognitiveclass.ai/tools/jupyterlab/  (no GPU)
2) https://labs.cognitiveclass.ai/tools/jupyterlab-for-ibm-powerai/  (with GPU)

They have Terminal available, but without "apt-get" working.
I tried to install pytorch 1.x from the source, but failed.
I was using instructions from here: 
https://developer.ibm.com/tutorials/install-pytorch-on-power/
Unfortunately some of these instructions don't help, in particular 
`apt-get install gfortran`
doesn't work.

I tried 
`conda install -c anaconda gfortran_linux-ppc64le -y`
but it doesn't help too.

Any ideas?

```
[ 83%] Linking CXX executable ../bin/cuda_rng_test
[ 83%] Linking CXX executable ../bin/device_test
[ 83%] Linking CXX executable ../bin/conv_op_cache_cudnn_test
/usr/bin/ld: warning: libgfortran.so.4, needed by /opt/conda/envs/py3.6/lib/libopenblas.so.0, not found (try using -rpath or -rpath-link)
/opt/conda/envs/py3.6/lib/libopenblas.so.0: undefined reference to `_gfortran_concat_string@GFORTRAN_7'
/opt/conda/envs/py3.6/lib/libopenblas.so.0: undefined reference to `_gfortran_etime@GFORTRAN_7'
/opt/conda/envs/py3.6/lib/libopenblas.so.0: undefined reference to `_gfortran_compare_string@GFORTRAN_7'
collect2: error: ld returned 1 exit status
/usr/bin/ld: warning: libgfortran.so.4, needed by /opt/conda/envs/py3.6/lib/libopenblas.so.0, not found (try using -rpath or -rpath-link)
/opt/conda/envs/py3.6/lib/libopenblas.so.0: undefined reference to `_gfortran_concat_string@GFORTRAN_7'
/opt/conda/envs/py3.6/lib/libopenblas.so.0: undefined reference to `_gfortran_etime@GFORTRAN_7'
/opt/conda/envs/py3.6/lib/libopenblas.so.0: undefined reference to `_gfortran_compare_string@GFORTRAN_7'
collect2: error: ld returned 1 exit status
caffe2/CMakeFiles/device_test.dir/build.make:95: recipe for target 'bin/device_test' failed
make[2]: *** [bin/device_test] Error 1
CMakeFiles/Makefile2:2636: recipe for target 'caffe2/CMakeFiles/device_test.dir/all' failed
make[1]: *** [caffe2/CMakeFiles/device_test.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 83%] Building CXX object caffe2/CMakeFiles/caffe2_pybind11_state_gpu.dir/python/pybind_state_dlpack.cc.o
caffe2/CMakeFiles/cuda_rng_test.dir/build.make:97: recipe for target 'bin/cuda_rng_test' failed
make[2]: *** [bin/cuda_rng_test] Error 1
CMakeFiles/Makefile2:2384: recipe for target 'caffe2/CMakeFiles/cuda_rng_test.dir/all' failed
make[1]: *** [caffe2/CMakeFiles/cuda_rng_test.dir/all] Error 2
[ 83%] Building CXX object caffe2/CMakeFiles/caffe2_pybind11_state_gpu.dir/python/pybind_state_nomni.cc.o
[ 83%] Linking CXX executable ../bin/apply_test
[ 83%] Linking CXX executable ../bin/net_async_tracing_test
[ 83%] Linking CXX executable ../bin/cudnn_test
/usr/bin/ld: warning: libgfortran.so.4, needed by /opt/conda/envs/py3.6/lib/libopenblas.so.0, not found (try using -rpath or -rpath-link)
/opt/conda/envs/py3.6/lib/libopenblas.so.0: undefined reference to `_gfortran_concat_string@GFORTRAN_7'
/opt/conda/envs/py3.6/lib/libopenblas.so.0: undefined reference to `_gfortran_etime@GFORTRAN_7'
/opt/conda/envs/py3.6/lib/libopenblas.so.0: undefined reference to `_gfortran_compare_string@GFORTRAN_7'
collect2: error: ld returned 1 exit status
caffe2/CMakeFiles/conv_op_cache_cudnn_test.dir/build.make:97: recipe for target 'bin/conv_op_cache_cudnn_test' failed
make[2]: *** [bin/conv_op_cache_cudnn_test] Error 1
CMakeFiles/Makefile2:2132: recipe for target 'caffe2/CMakeFiles/conv_op_cache_cudnn_test.dir/all' failed
make[1]: *** [caffe2/CMakeFiles/conv_op_cache_cudnn_test.dir/all] Error 2
[ 83%] Building CXX object caffe2/CMakeFiles/caffe2_pybind11_state_gpu.dir/python/pybind_state_registry.cc.o
[ 83%] Linking CXX executable ../bin/conv_to_nnpack_transform_test
/usr/bin/ld: warning: libgfortran.so.4, needed by /opt/conda/envs/py3.6/lib/libopenblas.so.0, not found (try using -rpath or -rpath-link/)
usr//optbin//condald/:envs /warningpy3.6:/ liblibgfortran.so.4/,libopenblas.so.0 :needed  undefined reference to `_gfortran_concat_stringby@ /GFORTRAN_7opt/'conda
/envs//py3.6opt//libconda//libopenblas.so.0,envs /py3.6/lib/libopenblas.so.0: undefined referencenot  tofound  `(_gfortran_etimetry@ GFORTRAN_7using'
-/rpathopt /orconda/envs /-py3.6rpath/-liblink/)libopenblas.so.0
:/ optundefined/ condareference/ envsto/ py3.6`/lib_gfortran_compare_string/@libopenblas.so.0GFORTRAN_7:'
 undefined reference to `_gfortran_concat_string@GFORTRAN_7'

...

/opt/conda/envs/py3.6/lib/libopenblas.so.0: undefined reference to `_gfortran_etime@GFORTRAN_7'
/opt/conda/envs/py3.6/lib/libopenblas.so.0: undefined reference to `_gfortran_compare_string@GFORTRAN_7'
collect2: error: ld returned 1 exit status
caffe2/CMakeFiles/elementwise_op_gpu_test.dir/build.make:97: recipe for target 'bin/elementwise_op_gpu_test' failed
make[2]: *** [bin/elementwise_op_gpu_test] Error 1
CMakeFiles/Makefile2:2048: recipe for target 'caffe2/CMakeFiles/elementwise_op_gpu_test.dir/all' failed
make[1]: *** [caffe2/CMakeFiles/elementwise_op_gpu_test.dir/all] Error 2
[ 83%] Linking CXX executable ../bin/pattern_net_transform_test
cc1: warning: command line option ‘-fvisibility-inlines-hidden’ is valid for C++/ObjC++ but not for C
cc1: warning: command line option ‘-fvisibility-inlines-hidden’ is valid for C++/ObjC++ but not for C
[ 84%] Linking CXX executable ../bin/blob_gpu_test
/usr/bin/ld: warning: libgfortran.so.4, needed by /opt/conda/envs/py3.6/lib/libopenblas.so.0, not found (try using -rpath or -rpath-link)
/opt/conda/envs/py3.6/lib/libopenblas.so.0: undefined reference to `_gfortran_concat_string@GFORTRAN_7'
/opt/conda/envs/py3.6/lib/libopenblas.so.0: undefined reference to `_gfortran_etime@GFORTRAN_7'
/opt/conda/envs/py3.6/lib/libopenblas.so.0: undefined reference to `_gfortran_compare_string@GFORTRAN_7'
collect2: error: ld returned 1 exit status
caffe2/CMakeFiles/pattern_net_transform_test.dir/build.make:95: recipe for target 'bin/pattern_net_transform_test' failed
make[2]: *** [bin/pattern_net_transform_test] Error 1
CMakeFiles/Makefile2:2468: recipe for target 'caffe2/CMakeFiles/pattern_net_transform_test.dir/all' failed
make[1]: *** [caffe2/CMakeFiles/pattern_net_transform_test.dir/all] Error 2
cc1: warning: command line option ‘-fvisibility-inlines-hidden’ is valid for C++/ObjC++ but not for C
cc1: warning: command line option ‘-fvisibility-inlines-hidden’ is valid for C++/ObjC++ but not for C
/usr/bin/ld: warning: libgfortran.so.4, needed by /opt/conda/envs/py3.6/lib/libopenblas.so.0, not found (try using -rpath or -rpath-link)
/opt/conda/envs/py3.6/lib/libopenblas.so.0: undefined reference to `_gfortran_concat_string@GFORTRAN_7'
/opt/conda/envs/py3.6/lib/libopenblas.so.0: undefined reference to `_gfortran_etime@GFORTRAN_7'
/opt/conda/envs/py3.6/lib/libopenblas.so.0: undefined reference to `_gfortran_compare_string@GFORTRAN_7'
collect2: error: ld returned 1 exit status
caffe2/CMakeFiles/blob_gpu_test.dir/build.make:97: recipe for target 'bin/blob_gpu_test' failed
make[2]: *** [bin/blob_gpu_test] Error 1
CMakeFiles/Makefile2:2174: recipe for target 'caffe2/CMakeFiles/blob_gpu_test.dir/all' failed
make[1]: *** [caffe2/CMakeFiles/blob_gpu_test.dir/all] Error 2
[ 84%] Linking CXX executable ../bin/cuda_optional_test
/usr/bin/ld: warning: libgfortran.so.4, needed by /opt/conda/envs/py3.6/lib/libopenblas.so.0, not found (try using -rpath or -rpath-link)
/opt/conda/envs/py3.6/lib/libopenblas.so.0: undefined reference to `_gfortran_concat_string@GFORTRAN_7'
/opt/conda/envs/py3.6/lib/libopenblas.so.0: undefined reference to `_gfortran_etime@GFORTRAN_7'
/opt/conda/envs/py3.6/lib/libopenblas.so.0: undefined reference to `_gfortran_compare_string@GFORTRAN_7'
collect2: error: ld returned 1 exit status
caffe2/CMakeFiles/cuda_optional_test.dir/build.make:785: recipe for target 'bin/cuda_optional_test' failed
make[2]: *** [bin/cuda_optional_test] Error 1
CMakeFiles/Makefile2:2426: recipe for target 'caffe2/CMakeFiles/cuda_optional_test.dir/all' failed
make[1]: *** [caffe2/CMakeFiles/cuda_optional_test.dir/all] Error 2
[ 84%] Linking CXX executable ../bin/cuda_packedtensoraccessor_test
/usr/bin/ld: warning: libgfortran.so.4, needed by /opt/conda/envs/py3.6/lib/libopenblas.so.0, not found (try using -rpath or -rpath-link)
/opt/conda/envs/py3.6/lib/libopenblas.so.0: undefined reference to `_gfortran_concat_string@GFORTRAN_7'
/opt/conda/envs/py3.6/lib/libopenblas.so.0: undefined reference to `_gfortran_etime@GFORTRAN_7'
/opt/conda/envs/py3.6/lib/libopenblas.so.0: undefined reference to `_gfortran_compare_string@GFORTRAN_7'
collect2: error: ld returned 1 exit status
caffe2/CMakeFiles/cuda_packedtensoraccessor_test.dir/build.make:794: recipe for target 'bin/cuda_packedtensoraccessor_test' failed
make[2]: *** [bin/cuda_packedtensoraccessor_test] Error 1
CMakeFiles/Makefile2:2258: recipe for target 'caffe2/CMakeFiles/cuda_packedtensoraccessor_test.dir/all' 
failed
make[1]: *** [caffe2/CMakeFiles/cuda_packedtensoraccessor_test.dir/all] Error 2
[ 84%] Linking CXX shared module python/caffe2_pybind11_state_gpu.cpython-37m-powerpc64le-linux-gnu.so
[ 84%] Built target caffe2_pybind11_state_gpu
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Failed to run 'bash ../tools/build_pytorch_libs.sh --use-cuda --use-nnpack nccl caffe2 libshm c10d THD'

```