Skip to content

Commit

Permalink
Fix builds for ARPACK-NG, FFTW, ONNX Runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
saudet committed Nov 21, 2024
1 parent db3859e commit aa4b8ea
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
13 changes: 12 additions & 1 deletion arpack-ng/cppbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,18 @@ case $PLATFORM in
make -j $MAKEJ
make install-strip
;;
macosx-*)
macosx-arm64)
sed -i="" 's/install_name \\$rpath/install_name @rpath/g' configure m4/libtool.m4
export CC="$(compgen -cX '!gcc*')"
export CXX="$(compgen -cX '!g++*')"
export FC="$(compgen -cX '!gfortran*') -Wl,-rpath,@loader_path/"
export F77="$FC"
export FLIBS="-lgfortran"
./configure --prefix=$INSTALL_PATH --enable-icb --with-blas=openblas --with-lapack=openblas
make -j $MAKEJ
make install-strip
;;
macosx-x86_64)
sed -i="" 's/install_name \\$rpath/install_name @rpath/g' configure m4/libtool.m4
export CC="$(ls -1 /usr/local/bin/gcc-* | head -n 1)"
export CXX="$(ls -1 /usr/local/bin/g++-* | head -n 1)"
Expand Down
15 changes: 12 additions & 3 deletions fftw/cppbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,21 @@ case $PLATFORM in
make -j $MAKEJ V=0
make install-strip
;;
macosx-*)
macosx-arm64)
patch -Np1 < ../../../fftw-macosx.patch
./configure --prefix=$INSTALL_PATH --disable-fortran --enable-shared --enable-threads --with-combined-threads --enable-sse2
./configure --prefix=$INSTALL_PATH --disable-fortran --enable-shared --enable-threads --with-combined-threads
make -j $MAKEJ V=0
make install-strip
./configure --prefix=$INSTALL_PATH --disable-fortran --enable-shared --enable-threads --with-combined-threads --enable-sse2 --enable-float
./configure --prefix=$INSTALL_PATH --disable-fortran --enable-shared --enable-threads --with-combined-threads --enable-float
make -j $MAKEJ V=0
make install-strip
;;
macosx-x86_64)
patch -Np1 < ../../../fftw-macosx.patch
./configure --prefix=$INSTALL_PATH --disable-fortran --enable-shared --enable-threads --with-combined-threads --enable-sse2 --enable-avx
make -j $MAKEJ V=0
make install-strip
./configure --prefix=$INSTALL_PATH --disable-fortran --enable-shared --enable-threads --with-combined-threads --enable-sse2 --enable-avx --enable-float
make -j $MAKEJ V=0
make install-strip
;;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
// "onnxruntime/core/providers/rocm/rocm_provider_factory.h",
// "onnxruntime/core/providers/dml/dml_provider_factory.h",
},
exclude = {"CL/opencl.h", "CL/cl_version.h", "CL/cl_platform.h", "CL/cl.h"/*, "CL/cl_gl.h", "CL/cl_gl_ext.h", "CL/cl_ext.h"*/},
link = {"onnxruntime_providers_shared", "[email protected]"}
),
@Platform(
Expand Down Expand Up @@ -117,7 +118,8 @@ public class onnxruntime implements LoadEnabled, InfoMapper {
}

public void map(InfoMap infoMap) {
infoMap.put(new Info("ORTCHAR_T", "std::basic_string<ORTCHAR_T>",
infoMap.putFirst(new Info("opencl.h", "cl_version.h", "cl_platform.h", "cl.h"/*, "cl_gl.h", "cl_gl_ext.h", "cl_ext.h"*/).skip())
.put(new Info("ORTCHAR_T", "std::basic_string<ORTCHAR_T>",
"onnxruntime_float16::BFloat16Impl<BFloat16_t>",
"onnxruntime_float16::Float16Impl<Float16_t>").cppText("").cppTypes().cast().pointerTypes("Pointer"))
.put(new Info("ORT_EXPORT", "ORT_API_CALL", "ORT_FILE", "NO_EXCEPTION", "ORT_ALL_ARGS_NONNULL", "OrtCustomOpApi").cppTypes().annotations())
Expand Down

0 comments on commit aa4b8ea

Please sign in to comment.