我將帶您一步步創建自己的HDF5包
確保您使用的是最新版本的暢達的:
(root) [[email protected] hdf5]# conda update conda
安裝軟件包暢達,建立
(root) [[email protected] hdf5]# conda install -y conda-build
下載存在於默認頻道中的套餐食譜的官方存儲庫
(root) [[email protected] tmp]# wget -qO- https://github.com/ContinuumIO/anaconda-recipes/archive/4.3.0.tar.gz | tar -xvz
(root) [[email protected] tmp]# cd anaconda-recipes-4.3.0/hdf5/
(root) [[email protected] hdf5]# ls
bld.bat build.sh meta.yaml
編輯文件build.sh來添加自定義的編譯器標誌
(root) [[email protected] hdf5]# vi build.sh
如果編譯器標誌需要一些更多的依賴關係,然後將它們添加在meta.yml文件要求部分的構建款。另外,更新網址爲https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8.17/src/hdf5-1.8.17.tar.gz。由於這是舊版本,因此URL已更改。
(root) [[email protected] hdf5]# vi meta.yaml
開始構建包的時間。(您可能需要使用系統軟件包管理器安裝GCC)
(root) [[email protected] hdf5]# conda build .
如果一切進展順利,該包將被建成,你會看到一個輸出類似:
# If you want to upload package(s) to anaconda.org later, type:
anaconda upload /conda/conda-bld/linux-64/hdf5-1.8.17-1.tar.bz2
# To have conda build upload to anaconda.org automatically, use
# $ conda config --set anaconda_upload yes
anaconda_upload is not set. Not uploading wheels: []
####################################################################################
Source and build intermediates have been left in /conda/conda-bld.
There are currently 2 accumulated.
To remove them, you can run the ```conda build purge``` command
安裝anaconda-客戶端包
(root) [[email protected] hdf5]# conda install -y anaconda-client
訪問https://anaconda.org/並在那裏創建一個帳戶。然後上傳您剛剛創建的頻道包裝:
(root) [[email protected] hdf5]# anaconda upload /conda/conda-bld/linux-64/hdf5-1.8.17-1.tar.bz2
Using Anaconda API: https://api.anaconda.org
The action you are performing requires authentication, please sign in:
Using Anaconda API: https://api.anaconda.org
Username: nehaljwani
nehaljwani's Password:
login successful
Using Anaconda API: https://api.anaconda.org
detecting package type ...
conda
extracting package attributes for upload ...
done
Uploading file nehaljwani/hdf5/1.8.17/linux-64/hdf5-1.8.17-1.tar.bz2 ...
uploaded 2003 of 2003Kb: 100.00% ETA: 0.0 minutes
Upload(s) Complete
Package located at:
https://anaconda.org/nehaljwani/hdf5
現在,下一次你可以用你的渠道下載並從通道安裝包現在
(root) [[email protected] ~]# conda install -c nehaljwani hdf5
Fetching package metadata ...........
Solving package specifications: .
Package plan for installation in environment /conda:
The following NEW packages will be INSTALLED:
hdf5: 1.8.17-1 nehaljwani
,如果你想建立h5py,程序幾乎相同,但您必須確保在構建此軟件包時,hdf5軟件包將從您的頻道中獲取。爲此,請確保您的頻道具有最高優先級。現在
(root) [[email protected] ~]# conda config --prepend channels nehaljwani
,因爲你還需要進行細微的修改,您可以創建一個補丁,並通過創建一個文件中的補丁和補丁加入它在生成過程中應用它在meta.yml文件子節,就像一個在這裏:https://github.com/ContinuumIO/anaconda-recipes/blob/master/h5py/meta.yaml
有關如何構建包更多信息,請訪問:https://conda.io/docs/build_tutorials/pkgs2.html#
感謝您抽出時間來寫這個。我能夠讓一切工作。 – user2886057