メインコンテンツに移動

VTK

VTKは,流体力学や弾性力学などで用いられるスカラー・ベクトル・テンソル等のフィールド・データを,バイナリーファイルよりも高圧縮で保存するライブラリーです.VTKで保存したデータは,可視化ソフトParaViewでグラフ表示することが可能です.

パッケージの利用方法

まずlibPNGをインストールしておきます.あーもちろん,CMakeとかBoostも必要だと思うけど.ここのVTK-新しげをダウンロードして使います.これはMacOS用のVTKライブラリ, M1チップ対応universalバージョンです.

XCodeで使うやり方は、BOOSTと類似しているので省略

ライブラリーを使って,何をするかは,こちらを参照

ライブラリーで作成したデータをどうするかは,こちらを参照

配布パッケージ作成方法(8.2.0)臺灣積體電路製造股份有限公司

X86ビルド

X86ターミナルで実行する.

cd x86_64
tar zxf ../VTK-8.2.0.tar.bz2
cd VTK-8.2.0/
export CXX=clang++; export CC=clang;
mkdir build
cd build
cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=/usr/local/ -DBOOST_ROOT:PATHNAME=/usr/local/ -DCMAKE_VERBOSE_MAKEFILE=OFF -DVTK_USE_SYSTEM_PNG=ON ..
make
lipo -info lib/*dylib
Non-fat file: lib/libvtkChartsCore-8.2.1.dylib is architecture: x86_64
Non-fat file: lib/libvtkChartsCore-8.2.dylib is architecture: x86_64
.
.
.
Non-fat file: lib/libvtkzlib-8.2.1.dylib is architecture: x86_64
Non-fat file: lib/libvtkzlib-8.2.dylib is architecture: x86_64

ARM64ビルド

ARM64ターミナルで実行する

cd arm64
tar zxf ../VTK-8.2.0.tar.bz2
cd VTK-8.2.0/
export CXX=clang++; export CC=clang;
mkdir build
cd build
cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=/usr/local/ -DBOOST_ROOT:PATHNAME=/usr/local/ -DCMAKE_VERBOSE_MAKEFILE=OFF -DVTK_USE_SYSTEM_PNG=ON ..
make
lipo -info lib/*dylib
Non-fat file: lib/libvtkChartsCore-8.2.1.dylib is architecture: arm64
Non-fat file: lib/libvtkChartsCore-8.2.dylib is architecture: arm64
Non-fat file: lib/libvtkCommonColor-8.2.1.dylib is architecture: arm64
.
.
.
Non-fat file: lib/libvtkzlib-8.2.1.dylib is architecture: arm64
Non-fat file: lib/libvtkzlib-8.2.dylib is architecture: arm64
fswatch -x /usr/local/ > files.log &
sudo make install

豚ビルド

豚リンゴを使う.

mkdir ../universal
fatty_apple.sh . ../../../x86_64/VTK-8.2.0/build ../universal lib/*dylib
sudo cp ../universal/lib/libvtk* /usr/local/lib/
kill %1
fswatch_analyze.sh -c _binary files.log
pkgbuild --identifier VTK --root _binary VTK-8.2.0-osx11.2.pkg

いいのかな?

lipo -info /usr/local/lib/libvtk*dylib
Architectures in the fat file: /usr/local/lib/libvtkChartsCore-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkChartsCore-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkCommonColor-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkCommonColor-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkCommonComputationalGeometry-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkCommonComputationalGeometry-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkCommonCore-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkCommonCore-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkCommonDataModel-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkCommonDataModel-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkCommonExecutionModel-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkCommonExecutionModel-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkCommonMath-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkCommonMath-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkCommonMisc-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkCommonMisc-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkCommonSystem-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkCommonSystem-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkCommonTransforms-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkCommonTransforms-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkDICOMParser-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkDICOMParser-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkDomainsChemistry-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkDomainsChemistry-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkDomainsChemistryOpenGL2-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkDomainsChemistryOpenGL2-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkFiltersAMR-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkFiltersAMR-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkFiltersCore-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkFiltersCore-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkFiltersExtraction-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkFiltersExtraction-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkFiltersFlowPaths-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkFiltersFlowPaths-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkFiltersGeneral-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkFiltersGeneral-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkFiltersGeneric-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkFiltersGeneric-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkFiltersGeometry-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkFiltersGeometry-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkFiltersHybrid-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkFiltersHybrid-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkFiltersHyperTree-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkFiltersHyperTree-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkFiltersImaging-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkFiltersImaging-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkFiltersModeling-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkFiltersModeling-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkFiltersParallel-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkFiltersParallel-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkFiltersParallelImaging-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkFiltersParallelImaging-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkFiltersPoints-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkFiltersPoints-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkFiltersProgrammable-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkFiltersProgrammable-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkFiltersSMP-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkFiltersSMP-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkFiltersSelection-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkFiltersSelection-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkFiltersSources-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkFiltersSources-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkFiltersStatistics-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkFiltersStatistics-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkFiltersTexture-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkFiltersTexture-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkFiltersTopology-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkFiltersTopology-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkFiltersVerdict-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkFiltersVerdict-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkGeovisCore-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkGeovisCore-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOAMR-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOAMR-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOAsynchronous-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOAsynchronous-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOCityGML-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOCityGML-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOCore-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOCore-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOEnSight-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOEnSight-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOExodus-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOExodus-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOExport-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOExport-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOExportOpenGL2-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOExportOpenGL2-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOExportPDF-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOExportPDF-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOGeometry-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOGeometry-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOImage-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOImage-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOImport-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOImport-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOInfovis-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOInfovis-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOLSDyna-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOLSDyna-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOLegacy-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOLegacy-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOMINC-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOMINC-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOMovie-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOMovie-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIONetCDF-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIONetCDF-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOPLY-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOPLY-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOParallel-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOParallel-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOParallelXML-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOParallelXML-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOSQL-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOSQL-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOSegY-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOSegY-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOTecplotTable-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOTecplotTable-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOVeraOut-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOVeraOut-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOVideo-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOVideo-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOXML-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOXML-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOXMLParser-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkIOXMLParser-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkImagingColor-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkImagingColor-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkImagingCore-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkImagingCore-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkImagingFourier-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkImagingFourier-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkImagingGeneral-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkImagingGeneral-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkImagingHybrid-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkImagingHybrid-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkImagingMath-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkImagingMath-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkImagingMorphological-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkImagingMorphological-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkImagingSources-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkImagingSources-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkImagingStatistics-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkImagingStatistics-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkImagingStencil-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkImagingStencil-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkInfovisCore-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkInfovisCore-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkInfovisLayout-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkInfovisLayout-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkInteractionImage-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkInteractionImage-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkInteractionStyle-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkInteractionStyle-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkInteractionWidgets-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkInteractionWidgets-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkNetCDF-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkNetCDF-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkParallelCore-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkParallelCore-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkRenderingAnnotation-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkRenderingAnnotation-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkRenderingContext2D-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkRenderingContext2D-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkRenderingContextOpenGL2-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkRenderingContextOpenGL2-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkRenderingCore-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkRenderingCore-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkRenderingFreeType-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkRenderingFreeType-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkRenderingGL2PSOpenGL2-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkRenderingGL2PSOpenGL2-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkRenderingImage-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkRenderingImage-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkRenderingLOD-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkRenderingLOD-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkRenderingLabel-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkRenderingLabel-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkRenderingOpenGL2-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkRenderingOpenGL2-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkRenderingVolume-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkRenderingVolume-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkRenderingVolumeOpenGL2-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkRenderingVolumeOpenGL2-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkViewsContext2D-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkViewsContext2D-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkViewsCore-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkViewsCore-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkViewsInfovis-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkViewsInfovis-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkdoubleconversion-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkdoubleconversion-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkexodusII-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkexodusII-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkexpat-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkexpat-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkfreetype-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkfreetype-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkgl2ps-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkgl2ps-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkglew-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkglew-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkhdf5-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkhdf5-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkhdf5_hl-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkhdf5_hl-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkjpeg-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkjpeg-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkjsoncpp-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkjsoncpp-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtklibharu-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtklibharu-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtklibxml2-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtklibxml2-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtklz4-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtklz4-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtklzma-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtklzma-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkmetaio-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkmetaio-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkogg-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkogg-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkproj-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkproj-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkpugixml-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkpugixml-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtksqlite-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtksqlite-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtksys-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtksys-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtktheora-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtktheora-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtktiff-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtktiff-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkverdict-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkverdict-8.2.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkzlib-8.2.1.dylib are: x86_64 arm64
Architectures in the fat file: /usr/local/lib/libvtkzlib-8.2.dylib are: x86_64 arm64

いいんじゃね?

配布パッケージ作成方法(8.2.0)じたばた編

 

X86ビルド

X86ターミナルで実行する.

cd x86_64
tar zxf ../VTK-8.2.0.tar.bz2
cd VTK-8.2.0/
export CXX=clang++; export CC=clang;
mkdir build
cd build
cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=/usr/local/ -DBOOST_ROOT:PATHNAME=/usr/local/ -DCMAKE_VERBOSE_MAKEFILE=ON ..
make
lipo -info lib/*dylib
Non-fat file: lib/libvtkChartsCore-8.2.1.dylib is architecture: x86_64
Non-fat file: lib/libvtkChartsCore-8.2.dylib is architecture: x86_64
.
.
.
Non-fat file: lib/libvtkzlib-8.2.1.dylib is architecture: x86_64
Non-fat file: lib/libvtkzlib-8.2.dylib is architecture: x86_64

ARM64ビルド

ARM64ターミナルで実行する

cd arm64
tar zxf ../VTK-8.2.0.tar.bz2
cd VTK-8.2.0/
export CXX=clang++; export CC=clang;
mkdir build
cd build
cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=/usr/local/ -DBOOST_ROOT:PATHNAME=/usr/local/ -DCMAKE_VERBOSE_MAKEFILE=ON ..
make
[ 52%] Linking C shared library ../../../lib/libvtkpng-8.2.dylib
cd /Users/sugimoto/Documents/Source/Free/arm64/VTK-8.2.0/build/ThirdParty/png/vtkpng && /Applications/CMake.app/Contents/bin/cmake -E cmake_link_script CMakeFiles/vtkpng.dir/link.txt --verbose=1
/Library/Developer/CommandLineTools/usr/bin/clang -w -w -g -arch arm64 -isysroot
/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk -dynamiclib -Wl,-headerpad_max_install_names
-compatibility_version 1.0.0 -current_version 1.0.0 -o ../../../lib/libvtkpng-8.2.1.dylib
-install_name @rpath/libvtkpng-8.2.1.dylib CMakeFiles/vtkpng.dir/png.c.o CMakeFiles/vtkpng.dir/pngerror.c.o
CMakeFiles/vtkpng.dir/pngget.c.o CMakeFiles/vtkpng.dir/pngmem.c.o CMakeFiles/vtkpng.dir/pngpread.c.o
CMakeFiles/vtkpng.dir/pngread.c.o CMakeFiles/vtkpng.dir/pngrio.c.o CMakeFiles/vtkpng.dir/pngrtran.c.o
CMakeFiles/vtkpng.dir/pngrutil.c.o CMakeFiles/vtkpng.dir/pngset.c.o CMakeFiles/vtkpng.dir/pngtrans.c.o
CMakeFiles/vtkpng.dir/pngwio.c.o CMakeFiles/vtkpng.dir/pngwrite.c.o CMakeFiles/vtkpng.dir/pngwtran.c.o
CMakeFiles/vtkpng.dir/pngwutil.c.o  -Wl,-rpath,/Users/sugimoto/Documents/Source/Free/arm64/VTK-8.2.0/build/lib
../../../lib/libvtkzlib-8.2.1.dylib -lm
Undefined symbols for architecture arm64:"_png_init_filter_functions_neon", referenced from:
 _png_init_filter_functions in pngrutil.c.o

だとさ.なにこれ?ではこれでどうだ

cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=/usr/local/ -DBOOST_ROOT:PATHNAME=/usr/local/ -DCMAKE_VERBOSE_MAKEFILE=OFF -DVTK_USE_SYSTEM_LIBRARIES=ON -D EIGEN3_INCLUDE_DIR=/usr/local/include ..

こんどは

  Could NOT find Freetype (missing: FREETYPE_LIBRARY FREETYPE_INCLUDE_DIRS)

てゆうかこいつ,見つからなかったら同梱のを使うとかの知恵はないのか.

で, 調べてみると, そもそも_png_init_filter_functions_neonというののneonってのは,

  • ARMにおけるマシン語命令

なのだそうだ.で,libpngの該当部分を読むと,「GCCは4.4くらいまで壊れてたけど今は大丈夫」「clangの連中は,いったいサポートする気があるのか?」といった感じで書いてある.

clangでビルドするからNEONでこけるのではないか.ううん,それではだめだなあ.いろいろ見ているうちに,面白いものを見つけた.VTK_USE_SYSTEM_PNG 変数である.

ARM64ターミナルで実行する

cd arm64
tar zxf ../VTK-8.2.0.tar.bz2
cd VTK-8.2.0/
export CXX=clang++; export CC=clang;
mkdir build
cd build
cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=/usr/local/ -DBOOST_ROOT:PATHNAME=/usr/local/ -DCMAKE_VERBOSE_MAKEFILE=OFF -DVTK_USE_SYSTEM_PNG=ON ..
make

配布パッケージ作成方法(9.0.1)臺灣積體電路製造股份有限公司

 

どうもVTK8をM1でビルドするのが大変なので,9.0.1で試してみる.

ARM64ビルド

ARM64ターミナルで実行する

cd arm64
tar zxf ../VTK-9.0.1.tar.bz2
cd VTK-9.0.1/
export CXX=clang++; export CC=clang;
mkdir build
cd build
cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=/usr/local/ -DBOOST_ROOT:PATHNAME=/usr/local/ -DCMAKE_VERBOSE_MAKEFILE=OFF ..
make
[ 64%] Building C object ThirdParty/hdf5/vtkhdf5/src/CMakeFiles/vtkhdf5_src.dir/H5Fsuper.c.o
VTK-9.0.1/ThirdParty/hdf5/vtkhdf5/src/H5Fsuper.c:1397:16: error: implicit declaration of function 'vtkhdf5_H5O__fsinfo_set_version' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
            if(H5O__fsinfo_set_version(f, &fsinfo) < 0)
           ^
VTK-9.0.1/ThirdParty/hdf5/vtkhdf5/src/vtk_hdf5_mangle.h:1882:33: note: expanded from macro
  'H5O__fsinfo_set_version'
#define H5O__fsinfo_set_version vtkhdf5_H5O__fsinfo_set_version

ますます変なエラーだな・・・これはそのうち治ると言う話なのだが・・・

まだ使えないな.

 

配布パッケージ作成方法(7.1.1)

いうまでもないが BOOSTとCMAKEの後です

tar zxf VTK-7.1.1.tar.gz
cd VTK-7.1.1
export CXX=clang++; export CC=clang;
cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_INSTALL_PREFIX=/usr/local/ -DBOOST_ROOT:PATHNAME=/usr/local/ -DCMAKE_VERBOSE_MAKEFILE=ON .
make
fswatch -x /usr/local > files.log &
sudo make install
kill %1
fswatch_analyze.sh -c _binary files.logpkgbuild --identifier VTK --root _binary VTK-7.1.1-osx10.12.pkg