Jupyternotebook add configuration process c ++ core support

First, the environment:
a virtual machine:
(1) System: centos7.5_1804 (64bit) version
(2) Software Environment: git, python3.5.3, Jupyter4.4.0
Second, download and install the script:
resources and installation instructions: https: // github .com / root-Project / Cling
(1) Download the installation script file mode:
wget https://raw.githubusercontent.com/root-project/cling/master/tools/packaging/cpt.py        
# abroad because the site, download this file is very slow, not recommended for this operation.
(2) cloning software repository ways:
(ccl353) [Python @ centos75 the Test] $ git clone https://github.com/root-project/cling.git       
# this way due to the use of mirror sites, very fast. After completion of the command, generates cling directory in the current directory.
Three, cmake installation:
(ccl353) [Python @ centos75 the Test] == $ PIP install cmake 3.11.4
#cmake Version 3.6.4 above, here designated version installed version 3.11.4, the latest version can also be installed without special Claim.
Fourth, the installation process:
. 1, the core C ++ code compilation process:
(ccl353) [Python @ centos75 Test] $ CD Cling / Tools / Packaging
(ccl353) [Python @ centos75 Packaging] $ ./cpt.py --check-requirements-dev-&& ./cpt.py --create the Debug --with the env-Workdir =. / Build-Cling /
# This process is long, including time and compilation time of downloading files of the compilation process, in hours, in the middle there are a few errors that need to be resolved:
(1) "c ++: internal compiler error: kill (the program cc1plus)" - insufficient memory to increase the cache memory or swap exchange.
(2) "collect2: error: ld to signal 9 [have been killed] to exit." - swap exchange cache shortage, increase exchange swap cache
(3) "CMake Error at tools / clang / tools / driver / cmake_install.cmake: 41 (File):
  File the INSTALL CAN not Copy File
  "/home/python/projects/test/cling/tools/packaging/cling-build/builddir/bin/clang-5.0"
  to "/ tmp / Cling-obj / bin / Clang -5.0. "" - less than the target disk space, increase the / tmp directory to mount the disk space.
(4) "make: *** [ install] Error. 1
subprocess.CalledProcessError: the Command '-j4 the install the make'
The end result:
...
[100%] Built target Cling
[100%] Running Regression Tests The Cling
lit.py: / Home / Python / Projects / Test / Cling / Tools / Packaging / Build-Cling / Cling-the src / Tools /cling/test/lit.cfg:261: Note: the using Cling: '/home/python/projects/test/cling/tools/packaging/cling-build/builddir/./bin/cling'
lit.py: / Home /python/projects/test/cling/tools/packaging/cling-build/cling-src/tools/cling/test/lit.cfg:272: Note: Running Tests from Build Tree
Testing Time: 423.23s
  the Expected the Passes: 121
  the Expected the Failures: 13 is
  Unsupported tests:. 9
[100%] Built-Cling target Check
# compiler is substantially complete, but not very good, 13 does not pass the test, but does not affect.
# In the / home / python / projects / test / cling / tools / packaging / cling-build / directory there is a new generation directory "cling-CentOS Linux-7.5.1804- x86_64-0.6 ~ dev-6238cda", should be compiled the c ++ core files directory
2, configure the environment variables, and test c ++ environment:
(1) adding the PATH variable:
(ccl353) [Python @ centos75 bin] $ vi /home/python/.bashrc
...
# the User specific aliases and Functions
the PATH the PATH = $ Export: / Home / Python / Projects / Test / Cling / Tools / Packaging / Build-Cling / "Cling-x86_64-0.6 the CentOS the Linux-7.5.1804-dev-6238cda ~" / bin   
(2) to enable the ambient variable:
(ccl353) [Python @ centos75 bin] $ Source /home/python/.bashrc
(. 3) test c ++ environment:
(ccl353) [Python @ centos75 bin] $ CD / Home / Python
[Python centos75 @ ~] $ Cling
Cling ****************** ******************
* Type C ++ code and Press the Enter to RUN IT *
Type .q to Exit * *
*******************************************
[Cling] $
# now this interface, suggesting that c ++ basic available!
3, c ++ at the core of the installation Jupyter environment (installation documentation at: /home/python/projects/test/cling/tools/Jupyter/README.md):
[Python @ centos75 ~] $ cd / Home / Python / the Projects / Test / Cling / Tools / Packaging / Build-Cling / Cling-the CentOS the Linux-7.5.1804-x86_64-0.6-6238cda ~ dev / Share / Cling / Jupyter / Kernel
(ccl353) [Python @ centos75 Kernel] $ LS
Cling-cpp11 cpp17 cling.ipynb-scripts Cling
Cling-cpp14 Cling-cpp1z clingkernel.py setup.py
(ccl353) [Python @ centos75 Kernel] -e $ PIP the install.
. 4, register C ++ 17 / C ++ 1z / C ++ 14 / C ++ 11 of kernelspec:
(ccl353) [Python @ centos75 Kernel] $ jupyter-kernelspec the install --user Cling-cpp17
[InstallKernelSpec] Installed kernelspec cling-cpp17 in /home/python/.local/share/jupyter/kernels/cling-cpp17
(ccl353) [python@centos75 kernel]$ jupyter-kernelspec install --user cling-cpp1z
[InstallKernelSpec] Installed kernelspec cling-cpp1z in /home/python/.local/share/jupyter/kernels/cling-cpp1z
(ccl353) [python@centos75 kernel]$ jupyter-kernelspec install --user cling-cpp14
[InstallKernelSpec] Installed kernelspec cling-cpp14 in /home/python/.local/share/jupyter/kernels/cling-cpp14
(ccl353) [python@centos75 kernel]$ jupyter-kernelspec install --user cling-cpp11
[InstallKernelSpec] Installed kernelspec cling-cpp11 in /home/python/.local/share/jupyter/kernels/cling-cpp11
(ccl353) [python@centos75 kernel]$
# At this point, run jupyter notebook --no-browser --ip = * --port = 8888, browser login notebook, click on the right part of the new interface, you can see the new c ++ core.
4, c ++ core Jupyter notebook of unstable operation of processing:
the Installation Completed Well, find c ++ core instability in the use of notebook process, observe the log information Jupyter notebook server found error "RuntimeError: Can not find / home / python / projects / test / cling / tools / packaging / cling-build / cling-CentOS Linux-7.5.1804-x86_64-0.6 ~ dev-6238cda / lib / libclingJupyter. {so, dylib, dll} ", the analysis should be missing documents libclingJupyter resulting in. Observation back compilation process, are missing in the generated file / tmp / cling-obj / lib directory during compilation, but not copied to the appropriate position. Treated as follows:
from the directory / tmp / cling-obj / lib libclingJupyter.so.5.0.0 copy files to compile the results lib directory, and files do two soft connection:
(ccl353) [Python @ centos75 Packaging] $ CP / tmp / cling-obj / lib / libclingJupyter.so.5.0.0 / home / python / projects / test / cling / tools / packaging / cling-build / "cling-CentOS Linux-7.5.1804-x86_64-0.6 ~ dev- 6238cda "/ lib
(ccl353) [Python @ centos75 lib] $ LN -s libclingJupyter.so.5.0.0 libclingJupyter.so.5
(ccl353) [Python @ centos75 lib] $ LN -s libclingJupyter.so.5 libclingJupyter.so
(ccl353) [ python @ centos75 lib] $ ll
total amount 1,144,268
drwxrwxr Python Python. 3 4096-X. 8 20:54 Clang dated 22 is
lrwxrwxrwx Python Python. 1 21:32 20 is libclingJupyter.so. 8 dated 22 is -> libclingJupyter.so.5
lrwxrwxrwx Python Python. 1 24 21:31 libclingJupyter.so.5. 8 dated 22 is -> libclingJupyter.so.5.0.0
-rwxr XR-X-Python Python 1,171,719,248. 8. 1 dated 22 21:08 libclingJupyter.so.5.0.0
# after the above treatment process, c ++ at the core of jupyter notebook has been stable operation.
5. Summary:
c ++ core support for the installation of the compilation process jupyter notebook exceeded my expectations, overall need to pay attention to several points:
(1) memory to be large (at least 4G, the actual use of the 6G)
(2) swap exchange cache To large (the actual use of 17G, 30G space for the swap set at compile time)
(3) / tmp directory space should be large (the actual use of 23G, the compilation process specially equipped with a 100G disk do mount / tmp disk)
(4) long compile times (the actual compilation is estimated at around 10 hours, the middle of the process involved in compiling also in the file downloaded from the internet, compiled code magnitude G capacity, so a long time)
(5) as well as part of the work done manually (eg: libclingJupyter.so.5.0.0 copying other documents)
6, attached:
tips :
(1) the compilation process, you can use free and open another terminal command df observe memory and disk usage, resource consumption aid observation of the compilation process.
(2) the original machine swap swap only 1.3G, can be added for swap space (use root) using the following commands:
[root @ Home centos75] dd IF # = / dev / ZERO of = / Home / BS = the swapfile 1M 30000 = COUNT
[root @ centos75 Home] # mkswap / Home / swapfile
[root @ centos75 Home] # swapon / Home / swapfile
[root @ centos75 Home] # swapon -s
file name type size used privileges
partition / dev / sda3 1362940 -1 0
/ Home / File 30,719,996 0 -2 the swapfile

Guess you like

Origin www.cnblogs.com/sfccl/p/11247048.html
Recommended