diff --git a/artoolkitplus/cppbuild.sh b/artoolkitplus/cppbuild.sh index 0bbba420b01..c809837198a 100755 --- a/artoolkitplus/cppbuild.sh +++ b/artoolkitplus/cppbuild.sh @@ -59,6 +59,11 @@ case $PLATFORM in make -j $MAKEJ make install ;; + linux-loongarch64) + CC="gcc -mabi=lp64" CXX="g++ -mabi=lp64" $CMAKE -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=.. . + make -j $MAKEJ + make install + ;; linux-ppc64le) MACHINE_TYPE=$( uname -m ) if [[ "$MACHINE_TYPE" =~ ppc64 ]]; then diff --git a/artoolkitplus/platform/pom.xml b/artoolkitplus/platform/pom.xml index 09a77ec6006..3a712613a51 100644 --- a/artoolkitplus/platform/pom.xml +++ b/artoolkitplus/platform/pom.xml @@ -78,6 +78,12 @@ ${project.version} ${javacpp.platform.linux-arm64} + + ${project.groupId} + ${javacpp.moduleId} + ${project.version} + ${javacpp.platform.linux-loongarch64} + ${project.groupId} ${javacpp.moduleId} @@ -114,7 +120,7 @@ - ${javacpp.moduleId}.jar ${javacpp.moduleId}-linux-x86.jar ${javacpp.moduleId}-linux-x86_64.jar ${javacpp.moduleId}-linux-armhf.jar ${javacpp.moduleId}-linux-arm64.jar ${javacpp.moduleId}-linux-ppc64le.jar ${javacpp.moduleId}-macosx-x86_64.jar ${javacpp.moduleId}-windows-x86.jar ${javacpp.moduleId}-windows-x86_64.jar + ${javacpp.moduleId}.jar ${javacpp.moduleId}-linux-x86.jar ${javacpp.moduleId}-linux-x86_64.jar ${javacpp.moduleId}-linux-armhf.jar ${javacpp.moduleId}-linux-arm64.jar ${javacpp.moduleId}-linux-loongarch64.jar ${javacpp.moduleId}-linux-ppc64le.jar ${javacpp.moduleId}-macosx-x86_64.jar ${javacpp.moduleId}-windows-x86.jar ${javacpp.moduleId}-windows-x86_64.jar @@ -167,6 +173,7 @@ requires static org.bytedeco.${javacpp.moduleId}.linux.x86_64; requires static org.bytedeco.${javacpp.moduleId}.linux.armhf; requires static org.bytedeco.${javacpp.moduleId}.linux.arm64; + requires static org.bytedeco.${javacpp.moduleId}.linux.loongarch64; requires static org.bytedeco.${javacpp.moduleId}.linux.ppc64le; requires static org.bytedeco.${javacpp.moduleId}.macosx.x86_64; requires static org.bytedeco.${javacpp.moduleId}.windows.x86; diff --git a/cpython/cppbuild.sh b/cpython/cppbuild.sh index ac7412f1ffb..0827b1bb58d 100755 --- a/cpython/cppbuild.sh +++ b/cpython/cppbuild.sh @@ -124,6 +124,16 @@ case $PLATFORM in make -j $MAKEJ make install ;; + linux-loongarch64) + cd ../$OPENSSL + ./Configure linux64-loongarch64 -fPIC no-shared --prefix=$INSTALL_PATH --libdir=lib + make -s -j $MAKEJ + make install_sw + cd ../Python-$CPYTHON_VERSION + CC="gcc -mabi=lp64" ./configure --prefix=$INSTALL_PATH --enable-shared --with-system-ffi --with-openssl=$INSTALL_PATH LDFLAGS='-s -Wl,-rpath,\$$ORIGIN/,-rpath,\$$ORIGIN/../,-rpath,\$$ORIGIN/../lib/' + make -j $MAKEJ + make install + ;; macosx-*) cd ../$OPENSSL ./Configure darwin64-x86_64-cc -fPIC no-shared --prefix=$INSTALL_PATH --libdir=lib diff --git a/cpython/platform/pom.xml b/cpython/platform/pom.xml index a736cea0cd5..2c00c5aabd1 100644 --- a/cpython/platform/pom.xml +++ b/cpython/platform/pom.xml @@ -90,7 +90,7 @@ - ${javacpp.moduleId}.jar ${javacpp.moduleId}-linux-armhf.jar ${javacpp.moduleId}-linux-arm64.jar ${javacpp.moduleId}-linux-ppc64le.jar ${javacpp.moduleId}-linux-x86.jar ${javacpp.moduleId}-linux-x86_64.jar ${javacpp.moduleId}-macosx-x86_64.jar ${javacpp.moduleId}-windows-x86.jar ${javacpp.moduleId}-windows-x86_64.jar + ${javacpp.moduleId}.jar ${javacpp.moduleId}-linux-armhf.jar ${javacpp.moduleId}-linux-arm64.jar ${javacpp.moduleId}-linux-ppc64le.jar ${javacpp.moduleId}-linux-x86.jar ${javacpp.moduleId}-linux-x86_64.jar ${javacpp.moduleId}-linux-loongarch64.jar ${javacpp.moduleId}-macosx-x86_64.jar ${javacpp.moduleId}-windows-x86.jar ${javacpp.moduleId}-windows-x86_64.jar diff --git a/cpython/src/main/java/org/bytedeco/cpython/presets/python.java b/cpython/src/main/java/org/bytedeco/cpython/presets/python.java index 717523eaa16..b24219331d5 100644 --- a/cpython/src/main/java/org/bytedeco/cpython/presets/python.java +++ b/cpython/src/main/java/org/bytedeco/cpython/presets/python.java @@ -200,6 +200,7 @@ @Platform(value = "linux", preloadpath = {"/usr/lib/", "/usr/lib32/", "/usr/lib64/"}), @Platform(value = "linux-armhf", preloadpath = {"/usr/arm-linux-gnueabihf/lib/", "/usr/lib/arm-linux-gnueabihf/"}), @Platform(value = "linux-arm64", preloadpath = {"/usr/aarch64-linux-gnu/lib/", "/usr/lib/aarch64-linux-gnu/"}), + @Platform(value = "linux-loongarch64", preloadpath = {"/usr/lib/loongarch64-linux-gnu"}), @Platform(value = "linux-x86", preloadpath = {"/usr/lib32/", "/usr/lib/"}), @Platform(value = "linux-x86_64", preloadpath = {"/usr/lib64/", "/usr/lib/"}), @Platform(value = "linux-ppc64", preloadpath = {"/usr/lib/powerpc64-linux-gnu/", "/usr/lib/powerpc64le-linux-gnu/"}), diff --git a/ffmpeg/change-cmake-version.patch b/ffmpeg/change-cmake-version.patch new file mode 100644 index 00000000000..f2e8dbeed94 --- /dev/null +++ b/ffmpeg/change-cmake-version.patch @@ -0,0 +1,13 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 913a303..ef5fba9 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -9,7 +9,7 @@ + # PATENTS file, you can obtain it at https://www.aomedia.org/license/patent-license. + # + +-cmake_minimum_required(VERSION 3.16) ++cmake_minimum_required(VERSION 3.13.4) + + if("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}") + message(WARNING "Building in-source is highly not recommended\n" diff --git a/ffmpeg/cppbuild.sh b/ffmpeg/cppbuild.sh index 695919a72f1..1564a7b854e 100755 --- a/ffmpeg/cppbuild.sh +++ b/ffmpeg/cppbuild.sh @@ -110,8 +110,16 @@ cd .. export PATH=$INSTALL_PATH/bin:$PATH export PKG_CONFIG_PATH=$INSTALL_PATH/lib/pkgconfig/ - +PATCH_ARCH=$(uname -m) patch -Np1 -d $LAME < ../../lame.patch +if [ "$PATCH_ARCH" == "loongarch64" ]; then +patch -Np1 -d $LAME < ../../lame-add-loongarch-cpuinfo.patch +patch -Np1 -d $XML2 < ../../libxml2-add-loongarch-cpuinfo.patch +patch -Np1 -d $OPUS < ../../opus-add-loongarch-cpuinfo.patch +patch -Np1 -d $VO_AMRWBENC < ../../vo-amrwbenc-add-loongarch-cpuinfo.patch +patch -Np1 -d $X264 < ../../x264-stable-add-loongarch-cpuinfo.patch +patch -Np1 -d SVT-AV1-v$SVTAV1_VERSION < ../../change-cmake-version.patch +fi patch -Np1 -d $OPENSSL < ../../openssl-android.patch patch -Np1 -d ffmpeg-$FFMPEG_VERSION < ../../ffmpeg.patch patch -Np1 -d ffmpeg-$FFMPEG_VERSION < ../../ffmpeg-flv-support-hevc-opus.patch @@ -976,6 +984,145 @@ EOF make install ;; + linux-loongarch64) + echo "" + echo "--------------------" + echo "Building zlib" + echo "--------------------" + echo "" + cd $ZLIB + CC="gcc -mabi=lp64 -fPIC" ./configure --prefix=$INSTALL_PATH --static + make -j $MAKEJ V=0 + make install + echo "" + echo "--------------------" + echo "Building LAME" + echo "--------------------" + echo "" + cd ../$LAME + ./configure --prefix=$INSTALL_PATH --disable-frontend --disable-shared --with-pic --host=loongarch64-linux-gnu CFLAGS="-mabi=lp64" + make -j $MAKEJ V=0 + make install + echo "" + echo "--------------------" + echo "Building XML2" + echo "--------------------" + echo "" + cd ../$XML2 + ./configure --prefix=$INSTALL_PATH $LIBXML_CONFIG --host=loongarch64-linux-gnu CFLAGS="-mabi=lp64" + make -j $MAKEJ V=0 + make install + echo "" + echo "--------------------" + echo "Building speex" + echo "--------------------" + echo "" + cd ../$SPEEX + PKG_CONFIG= ./configure --prefix=$INSTALL_PATH --disable-shared --with-pic --host=loongarch64-linux-gnu CFLAGS="-mabi=lp64" + make -j $MAKEJ V=0 + make install + cd ../$OPUS + ./configure --prefix=$INSTALL_PATH --disable-shared --with-pic --host=loongarch64-linux-gnu CFLAGS="-mabi=lp64" + make -j $MAKEJ V=0 + make install + cd ../$OPENCORE_AMR + ./configure --prefix=$INSTALL_PATH --disable-shared --with-pic --host=loongarch64-linux-gnu CFLAGS="-mabi=lp64" CXXFLAGS="-mabi=lp64" + make -j $MAKEJ V=0 + make install + cd ../$VO_AMRWBENC + ./configure --prefix=$INSTALL_PATH --disable-shared --with-pic --host=loongarch64-linux-gnu CFLAGS="-mabi=lp64" CXXFLAGS="-mabi=lp64" + make -j $MAKEJ V=0 + make install + cd ../$OPENSSL + ./Configure linux64-loongarch64 -fPIC no-shared --prefix=$INSTALL_PATH --libdir=lib + make -s -j $MAKEJ + make install_sw + cd ../srt-$LIBSRT_VERSION + CC="gcc -mabi=lp64" CXX="g++ -mabi=lp64" CFLAGS="-I$INSTALL_PATH/include/" CXXFLAGS="-I$INSTALL_PATH/include/" LDFLAGS="-L$INSTALL_PATH/lib/" $CMAKE -DCMAKE_INSTALL_PREFIX=$INSTALL_PATH $SRT_CONFIG . + make -j $MAKEJ V=0 + make install + cd ../openh264-$OPENH264_VERSION + make -j $MAKEJ DESTDIR=./ PREFIX=.. AR=ar ARCH=loongarch64 USE_ASM=No install-static + cd ../$X264 + ./configure --prefix=$INSTALL_PATH --enable-static --enable-pic --disable-opencl --host=loongarch64-linux-gnu + make -j $MAKEJ V=0 + make install + cd ../x265-$X265/build/linux + # from x265 multilib.sh + mkdir -p 8bit 10bit 12bit + + cd 12bit + $CMAKE ../../../source -DHIGH_BIT_DEPTH=ON -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF -DMAIN12=ON -DENABLE_LIBNUMA=OFF -DCMAKE_BUILD_TYPE=Release -DNASM_EXECUTABLE:FILEPATH=$INSTALL_PATH/bin/nasm + make -j $MAKEJ + + cd ../10bit + $CMAKE ../../../source -DHIGH_BIT_DEPTH=ON -DEXPORT_C_API=OFF -DENABLE_SHARED=OFF -DENABLE_CLI=OFF -DENABLE_LIBNUMA=OFF -DCMAKE_BUILD_TYPE=Release -DNASM_EXECUTABLE:FILEPATH=$INSTALL_PATH/bin/nasm + make -j $MAKEJ + + cd ../8bit + ln -sf ../10bit/libx265.a libx265_main10.a + ln -sf ../12bit/libx265.a libx265_main12.a + $CMAKE ../../../source -DEXTRA_LIB="x265_main10.a;x265_main12.a" -DEXTRA_LINK_FLAGS=-L. -DLINKED_10BIT=ON -DLINKED_12BIT=ON -DCMAKE_INSTALL_PREFIX=$INSTALL_PATH -DENABLE_SHARED:BOOL=OFF -DENABLE_LIBNUMA=OFF -DCMAKE_BUILD_TYPE=Release -DNASM_EXECUTABLE:FILEPATH=$INSTALL_PATH/bin/nasm -DENABLE_CLI=OFF + make -j $MAKEJ + + # rename the 8bit library, then combine all three into libx265.a + mv libx265.a libx265_main.a +ar -M <${project.version} ${javacpp.platform.linux-arm64} + + ${project.groupId} + ${javacpp.moduleId} + ${project.version} + ${javacpp.platform.linux-loongarch64} + ${project.groupId} ${javacpp.moduleId} @@ -121,7 +127,7 @@ - ${javacpp.moduleId}.jar ${javacpp.moduleId}-linux-x86-gpl.jar ${javacpp.moduleId}-linux-x86_64-gpl.jar ${javacpp.moduleId}-linux-armhf-gpl.jar ${javacpp.moduleId}-linux-arm64-gpl.jar ${javacpp.moduleId}-linux-ppc64le-gpl.jar ${javacpp.moduleId}-macosx-arm64-gpl.jar ${javacpp.moduleId}-macosx-x86_64-gpl.jar ${javacpp.moduleId}-windows-x86-gpl.jar ${javacpp.moduleId}-windows-x86_64-gpl.jar + ${javacpp.moduleId}.jar ${javacpp.moduleId}-linux-x86-gpl.jar ${javacpp.moduleId}-linux-x86_64-gpl.jar ${javacpp.moduleId}-linux-armhf-gpl.jar ${javacpp.moduleId}-linux-arm64-gpl.jar ${javacpp.moduleId}-linux-loongarch64-gpl.jar ${javacpp.moduleId}-linux-ppc64le-gpl.jar ${javacpp.moduleId}-macosx-arm64-gpl.jar ${javacpp.moduleId}-macosx-x86_64-gpl.jar ${javacpp.moduleId}-windows-x86-gpl.jar ${javacpp.moduleId}-windows-x86_64-gpl.jar @@ -174,6 +180,7 @@ requires static org.bytedeco.${javacpp.moduleId}.linux.x86_64.gpl; // requires static org.bytedeco.${javacpp.moduleId}.linux.armhf.gpl; requires static org.bytedeco.${javacpp.moduleId}.linux.arm64.gpl; + requires static org.bytedeco.${javacpp.moduleId}.linux.loongarch64.gpl; requires static org.bytedeco.${javacpp.moduleId}.linux.ppc64le.gpl; requires static org.bytedeco.${javacpp.moduleId}.macosx.arm64.gpl; requires static org.bytedeco.${javacpp.moduleId}.macosx.x86_64.gpl; diff --git a/ffmpeg/platform/pom.xml b/ffmpeg/platform/pom.xml index a32bba20f59..ba7f5a54b5a 100644 --- a/ffmpeg/platform/pom.xml +++ b/ffmpeg/platform/pom.xml @@ -78,6 +78,12 @@ ${project.version} ${javacpp.platform.linux-arm64} + + ${project.groupId} + ${javacpp.moduleId} + ${project.version} + ${javacpp.platform.linux-loongarch64} + ${project.groupId} ${javacpp.moduleId} @@ -120,7 +126,7 @@ - ${javacpp.moduleId}.jar ${javacpp.moduleId}-linux-x86.jar ${javacpp.moduleId}-linux-x86_64.jar ${javacpp.moduleId}-linux-armhf.jar ${javacpp.moduleId}-linux-arm64.jar ${javacpp.moduleId}-linux-ppc64le.jar ${javacpp.moduleId}-macosx-arm64.jar ${javacpp.moduleId}-macosx-x86_64.jar ${javacpp.moduleId}-windows-x86.jar ${javacpp.moduleId}-windows-x86_64.jar + ${javacpp.moduleId}.jar ${javacpp.moduleId}-linux-x86.jar ${javacpp.moduleId}-linux-x86_64.jar ${javacpp.moduleId}-linux-armhf.jar ${javacpp.moduleId}-linux-arm64.jar ${javacpp.moduleId}-linux-loongarch64.jar ${javacpp.moduleId}-linux-ppc64le.jar ${javacpp.moduleId}-macosx-arm64.jar ${javacpp.moduleId}-macosx-x86_64.jar ${javacpp.moduleId}-windows-x86.jar ${javacpp.moduleId}-windows-x86_64.jar @@ -173,6 +179,7 @@ requires static org.bytedeco.${javacpp.moduleId}.linux.x86_64; // requires static org.bytedeco.${javacpp.moduleId}.linux.armhf; requires static org.bytedeco.${javacpp.moduleId}.linux.arm64; + requires static org.bytedeco.${javacpp.moduleId}.linux.loongarch64; requires static org.bytedeco.${javacpp.moduleId}.linux.ppc64le; requires static org.bytedeco.${javacpp.moduleId}.macosx.arm64; requires static org.bytedeco.${javacpp.moduleId}.macosx.x86_64; diff --git a/ffmpeg/vo-amrwbenc-add-loongarch-cpuinfo.patch b/ffmpeg/vo-amrwbenc-add-loongarch-cpuinfo.patch new file mode 100644 index 00000000000..24c10f13ea5 --- /dev/null +++ b/ffmpeg/vo-amrwbenc-add-loongarch-cpuinfo.patch @@ -0,0 +1,26 @@ +diff --git a/config.guess b/config.guess +index d622a44..6a7cb1e 100755 +--- a/config.guess ++++ b/config.guess +@@ -868,6 +868,9 @@ EOF + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; ++ loongarch64:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-gnu ++ exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; +diff --git a/config.sub b/config.sub +index 6205f84..407785a 100755 +--- a/config.sub ++++ b/config.sub +@@ -256,6 +256,7 @@ case $basic_machine in + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ ++ | loongarch64 \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ diff --git a/ffmpeg/x264-stable-add-loongarch-cpuinfo.patch b/ffmpeg/x264-stable-add-loongarch-cpuinfo.patch new file mode 100644 index 00000000000..a96752651ed --- /dev/null +++ b/ffmpeg/x264-stable-add-loongarch-cpuinfo.patch @@ -0,0 +1,26 @@ +diff --git a/config.guess b/config.guess +index d437be0..3a3f5fc 100755 +--- a/config.guess ++++ b/config.guess +@@ -875,6 +875,9 @@ EOF + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; ++ loongarch64:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-gnu ++ exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; +diff --git a/config.sub b/config.sub +index 72e9265..51cd1c4 100755 +--- a/config.sub ++++ b/config.sub +@@ -256,6 +256,7 @@ case $basic_machine in + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be | arm64 \ ++ | loongarch64 \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ diff --git a/leptonica/cppbuild.sh b/leptonica/cppbuild.sh index 3e13a9cbf5a..4614a6d6eb9 100755 --- a/leptonica/cppbuild.sh +++ b/leptonica/cppbuild.sh @@ -415,6 +415,48 @@ case $PLATFORM in make -j $MAKEJ make install/strip ;; + linux-loongarch64) + export CFLAGS="-pthread -I$INSTALL_PATH/include/" + export CXXFLAGS="$CFLAGS" + export CPPFLAGS="$CFLAGS" + export LDFLAGS="-L$INSTALL_PATH/lib/" + export CC="gcc -mabi=lp64 -fPIC" + export CXX="g++ -mabi=lp64 -fPIC" + export STRIP="strip" + export CMAKE_CONFIG="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_VERSION=1 -DCMAKE_SYSTEM_PROCESSOR=loongarch64 $CMAKE_CONFIG" + cd $ZLIB + $CMAKE $CMAKE_CONFIG . + make -j $MAKEJ + make install + cd ../$GIFLIB + $CMAKE $CMAKE_CONFIG . + make -j $MAKEJ + make install + cd ../$LIBJPEG + $CMAKE $CMAKE_CONFIG . + make -j $MAKEJ + make install + cd ../$LIBPNG + $CMAKE $CMAKE_CONFIG . + make -j $MAKEJ + make install + cd ../$LIBWEBP + $CMAKE $CMAKE_CONFIG $WEBP_CONFIG . + make -j $MAKEJ + make install + cd ../$LIBTIFF + $CMAKE $CMAKE_CONFIG -Dlzma=OFF -Dzstd=OFF . + make -j $MAKEJ + make install + cd ../openjpeg-$OPENJPEG_VERSION + $CMAKE $CMAKE_CONFIG -DBUILD_CODEC=OFF . + make -j $MAKEJ + make install + cd ../leptonica-$LEPTONICA_VERSION + $CMAKE $CMAKE_CONFIG -DBUILD_SHARED_LIBS=ON -DOpenJPEG_DIR=$INSTALL_PATH/lib/openjpeg-2.5/ . + make -j $MAKEJ + make install/strip + ;; linux-ppc64le) export CFLAGS="-pthread -I$INSTALL_PATH/include/" export CXXFLAGS="$CFLAGS" diff --git a/leptonica/platform/pom.xml b/leptonica/platform/pom.xml index 0cfa07ffd3e..d5d164fac1c 100644 --- a/leptonica/platform/pom.xml +++ b/leptonica/platform/pom.xml @@ -78,6 +78,12 @@ ${project.version} ${javacpp.platform.linux-arm64} + + ${project.groupId} + ${javacpp.moduleId} + ${project.version} + ${javacpp.platform.linux-loongarch64} + ${project.groupId} ${javacpp.moduleId} @@ -120,7 +126,7 @@ - ${javacpp.moduleId}.jar ${javacpp.moduleId}-linux-x86.jar ${javacpp.moduleId}-linux-x86_64.jar ${javacpp.moduleId}-linux-armhf.jar ${javacpp.moduleId}-linux-arm64.jar ${javacpp.moduleId}-linux-ppc64le.jar ${javacpp.moduleId}-macosx-arm64.jar ${javacpp.moduleId}-macosx-x86_64.jar ${javacpp.moduleId}-windows-x86.jar ${javacpp.moduleId}-windows-x86_64.jar + ${javacpp.moduleId}.jar ${javacpp.moduleId}-linux-x86.jar ${javacpp.moduleId}-linux-x86_64.jar ${javacpp.moduleId}-linux-armhf.jar ${javacpp.moduleId}-linux-arm64.jar ${javacpp.moduleId}-linux-loongarch64.jar ${javacpp.moduleId}-linux-ppc64le.jar ${javacpp.moduleId}-macosx-arm64.jar ${javacpp.moduleId}-macosx-x86_64.jar ${javacpp.moduleId}-windows-x86.jar ${javacpp.moduleId}-windows-x86_64.jar @@ -173,6 +179,7 @@ requires static org.bytedeco.${javacpp.moduleId}.linux.x86_64; // requires static org.bytedeco.${javacpp.moduleId}.linux.armhf; requires static org.bytedeco.${javacpp.moduleId}.linux.arm64; + requires static org.bytedeco.${javacpp.moduleId}.linux.loongarch64; requires static org.bytedeco.${javacpp.moduleId}.linux.ppc64le; requires static org.bytedeco.${javacpp.moduleId}.macosx.arm64; requires static org.bytedeco.${javacpp.moduleId}.macosx.x86_64; diff --git a/leptonica/src/main/java/org/bytedeco/leptonica/presets/leptonica.java b/leptonica/src/main/java/org/bytedeco/leptonica/presets/leptonica.java index efd6401446a..69803cfe93e 100644 --- a/leptonica/src/main/java/org/bytedeco/leptonica/presets/leptonica.java +++ b/leptonica/src/main/java/org/bytedeco/leptonica/presets/leptonica.java @@ -44,6 +44,7 @@ @Platform(value = "linux", preloadpath = {"/usr/lib/", "/usr/lib32/", "/usr/lib64/"}, preload = "gomp@.1"), @Platform(value = "linux-armhf", preloadpath = {"/usr/arm-linux-gnueabihf/lib/", "/usr/lib/arm-linux-gnueabihf/"}), @Platform(value = "linux-arm64", preloadpath = {"/usr/aarch64-linux-gnu/lib/", "/usr/lib/aarch64-linux-gnu/"}), + @Platform(value = "linux-loongarch64", preloadpath = {"/usr/lib/loongarch64-linux-gnu"}), @Platform(value = "linux-x86", preloadpath = {"/usr/lib32/", "/usr/lib/"}), @Platform(value = "linux-x86_64", preloadpath = {"/usr/lib64/", "/usr/lib/"}), @Platform(value = "linux-ppc64", preloadpath = {"/usr/lib/powerpc64-linux-gnu/", "/usr/lib/powerpc64le-linux-gnu/"}), diff --git a/libdc1394/cppbuild.sh b/libdc1394/cppbuild.sh index cb61e79529e..ac344a90af5 100755 --- a/libdc1394/cppbuild.sh +++ b/libdc1394/cppbuild.sh @@ -24,6 +24,13 @@ if [[ "$PLATFORM" == windows* ]]; then export C_INCLUDE_PATH="$INSTALL_PATH/1394camera/include/" export LIBRARY_PATH="$INSTALL_PATH/bin/" fi + +PATCH_ARCH=$(uname -m) + +if [ "$PATCH_ARCH" == "loongarch64" ]; then +patch -Np1 -d libdc1394-$LIBDC1394_VERSION < ../../libdc1394-add-loongarch-cpuinfo.patch +fi + cd libdc1394-$LIBDC1394_VERSION case $PLATFORM in @@ -47,6 +54,11 @@ case $PLATFORM in make -j4 make install-strip ;; + linux-loongarch64) + CC="gcc -mabi=lp64" ./configure --prefix=$INSTALL_PATH --disable-sdltest + make -j4 + make install-strip + ;; linux-ppc64le) MACHINE_TYPE=$( uname -m ) sed -i s/elf64ppc/elf64lppc/ configure diff --git a/libdc1394/libdc1394-add-loongarch-cpuinfo.patch b/libdc1394/libdc1394-add-loongarch-cpuinfo.patch new file mode 100644 index 00000000000..de7c360102c --- /dev/null +++ b/libdc1394/libdc1394-add-loongarch-cpuinfo.patch @@ -0,0 +1,26 @@ +diff --git a/config.guess b/config.guess +index b79252d..cd814ad 100755 +--- a/config.guess ++++ b/config.guess +@@ -890,6 +890,9 @@ EOF + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; ++ loongarch64:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; +diff --git a/config.sub b/config.sub +index 9633db7..4d3e28d 100755 +--- a/config.sub ++++ b/config.sub +@@ -249,6 +249,7 @@ case $basic_machine in + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ ++ | loongarch64 \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ diff --git a/libdc1394/platform/pom.xml b/libdc1394/platform/pom.xml index 677a233cb43..9966d8c3728 100644 --- a/libdc1394/platform/pom.xml +++ b/libdc1394/platform/pom.xml @@ -54,6 +54,12 @@ ${project.version} ${javacpp.platform.linux-arm64} + + ${project.groupId} + ${javacpp.moduleId} + ${project.version} + ${javacpp.platform.linux-loongarch64} + ${project.groupId} ${javacpp.moduleId} @@ -90,7 +96,7 @@ - ${javacpp.moduleId}.jar ${javacpp.moduleId}-linux-x86.jar ${javacpp.moduleId}-linux-x86_64.jar ${javacpp.moduleId}-linux-armhf.jar ${javacpp.moduleId}-linux-arm64.jar ${javacpp.moduleId}-linux-ppc64le.jar ${javacpp.moduleId}-macosx-x86_64.jar ${javacpp.moduleId}-windows-x86.jar ${javacpp.moduleId}-windows-x86_64.jar + ${javacpp.moduleId}.jar ${javacpp.moduleId}-linux-x86.jar ${javacpp.moduleId}-linux-x86_64.jar ${javacpp.moduleId}-linux-armhf.jar ${javacpp.moduleId}-linux-arm64.jar ${javacpp.moduleId}-linux-loongarch64.jar ${javacpp.moduleId}-linux-ppc64le.jar ${javacpp.moduleId}-macosx-x86_64.jar ${javacpp.moduleId}-windows-x86.jar ${javacpp.moduleId}-windows-x86_64.jar @@ -139,6 +145,7 @@ requires static org.bytedeco.${javacpp.moduleId}.linux.x86_64; requires static org.bytedeco.${javacpp.moduleId}.linux.armhf; requires static org.bytedeco.${javacpp.moduleId}.linux.arm64; + requires static org.bytedeco.${javacpp.moduleId}.linux.loongarch64; requires static org.bytedeco.${javacpp.moduleId}.linux.ppc64le; requires static org.bytedeco.${javacpp.moduleId}.macosx.x86_64; requires static org.bytedeco.${javacpp.moduleId}.windows.x86; diff --git a/libfreenect/cppbuild.sh b/libfreenect/cppbuild.sh index 9c3be005db5..91d2faf7c44 100755 --- a/libfreenect/cppbuild.sh +++ b/libfreenect/cppbuild.sh @@ -29,6 +29,12 @@ if [[ $PLATFORM == windows* ]]; then patch -Np1 -d libfreenect-$LIBFREENECT_VERSION < ../../libfreenect-windows.patch fi +PATCH_ARCH=$(uname -m) + +if [ "$PATCH_ARCH" == "loongarch64" ]; then +patch -Np1 -d libusb-$LIBUSB_VERSION < ../../libusb-add-loongarch-cpuinfo.patch +fi + cd libfreenect-$LIBFREENECT_VERSION case $PLATFORM in @@ -72,6 +78,16 @@ case $PLATFORM in make -j $MAKEJ make install ;; + linux-loongarch64) + cd ../libusb-$LIBUSB_VERSION + CC="gcc -mabi=lp64" CXX="g++ -mabi=lp64" ./configure --prefix=$INSTALL_PATH --disable-shared --with-pic --host=loongarch64-linux-gnu --disable-udev + make -j $MAKEJ + make install + cd ../libfreenect-$LIBFREENECT_VERSION + CC="gcc -mabi=lp64" CXX="g++ -mabi=lp64" $CMAKE -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=OFF -DBUILD_FAKENECT=OFF -DCMAKE_INSTALL_PREFIX=.. -DLIBUSB_1_INCLUDE_DIR=$INSTALL_PATH/include/libusb-1.0/ -DLIBUSB_1_LIBRARY=$INSTALL_PATH/lib/libusb-1.0.a . + make -j $MAKEJ + make install + ;; linux-ppc64le) cd ../libusb-$LIBUSB_VERSION MACHINE_TYPE=$( uname -m ) diff --git a/libfreenect/libusb-add-loongarch-cpuinfo.patch b/libfreenect/libusb-add-loongarch-cpuinfo.patch new file mode 100644 index 00000000000..06ccb8d548a --- /dev/null +++ b/libfreenect/libusb-add-loongarch-cpuinfo.patch @@ -0,0 +1,26 @@ +diff --git a/config.guess b/config.guess +index 1659250..4f42dde 100755 +--- a/config.guess ++++ b/config.guess +@@ -908,6 +908,9 @@ EOF + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; ++ loongarch64:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; +diff --git a/config.sub b/config.sub +index 1acc966..0e51c5e 100755 +--- a/config.sub ++++ b/config.sub +@@ -249,6 +249,7 @@ case $basic_machine in + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ ++ | loongarch64 \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ diff --git a/libfreenect/platform/pom.xml b/libfreenect/platform/pom.xml index 650a098c204..23f128afc2d 100644 --- a/libfreenect/platform/pom.xml +++ b/libfreenect/platform/pom.xml @@ -54,6 +54,12 @@ ${project.version} ${javacpp.platform.linux-arm64} + + ${project.groupId} + ${javacpp.moduleId} + ${project.version} + ${javacpp.platform.linux-loongarch64} + ${project.groupId} ${javacpp.moduleId} @@ -90,7 +96,7 @@ - ${javacpp.moduleId}.jar ${javacpp.moduleId}-linux-x86.jar ${javacpp.moduleId}-linux-x86_64.jar ${javacpp.moduleId}-linux-armhf.jar ${javacpp.moduleId}-linux-arm64.jar ${javacpp.moduleId}-linux-ppc64le.jar ${javacpp.moduleId}-macosx-x86_64.jar ${javacpp.moduleId}-windows-x86.jar ${javacpp.moduleId}-windows-x86_64.jar + ${javacpp.moduleId}.jar ${javacpp.moduleId}-linux-x86.jar ${javacpp.moduleId}-linux-x86_64.jar ${javacpp.moduleId}-linux-armhf.jar ${javacpp.moduleId}-linux-arm64.jar ${javacpp.moduleId}-linux-loongarch64.jar ${javacpp.moduleId}-linux-ppc64le.jar ${javacpp.moduleId}-macosx-x86_64.jar ${javacpp.moduleId}-windows-x86.jar ${javacpp.moduleId}-windows-x86_64.jar @@ -139,6 +145,7 @@ requires static org.bytedeco.${javacpp.moduleId}.linux.x86_64; requires static org.bytedeco.${javacpp.moduleId}.linux.armhf; requires static org.bytedeco.${javacpp.moduleId}.linux.arm64; + requires static org.bytedeco.${javacpp.moduleId}.linux.loongarch64; requires static org.bytedeco.${javacpp.moduleId}.linux.ppc64le; requires static org.bytedeco.${javacpp.moduleId}.macosx.x86_64; requires static org.bytedeco.${javacpp.moduleId}.windows.x86; diff --git a/librealsense/cppbuild.sh b/librealsense/cppbuild.sh index 531dfd26c9f..463c9776c11 100755 --- a/librealsense/cppbuild.sh +++ b/librealsense/cppbuild.sh @@ -20,6 +20,12 @@ echo "Decompressing archives..." tar --totals -xzf ../librealsense-$LIBREALSENSE_VERSION.tar.gz tar --totals -xjf ../libusb-$LIBUSB_VERSION.tar.bz2 +PATCH_ARCH=$(uname -m) + +if [ "$PATCH_ARCH" == "loongarch64" ]; then +patch -Np1 -d libusb-$LIBUSB_VERSION < ../../libusb-add-loongarch-cpuinfo.patch +fi + cd librealsense-$LIBREALSENSE_VERSION patch -Np1 --binary < ../../../librealsense.patch || true @@ -44,6 +50,16 @@ case $PLATFORM in make -j $MAKEJ make install/strip ;; + linux-loongarch64) + cd ../libusb-$LIBUSB_VERSION + CC="gcc -mabi=lp64" CXX="g++ -mabi=lp64" ./configure --prefix=$INSTALL_PATH --disable-shared --with-pic --host=loongarch64-linux-gnu --disable-udev + make -j $MAKEJ + make install + cd ../librealsense-$LIBREALSENSE_VERSION + PKG_CONFIG_PATH="../lib/pkgconfig" CC="gcc -mabi=lp64" CXX="g++ -mabi=lp64 --std=c++11" LDFLAGS="-lstdc++" "$CMAKE" -DCMAKE_INSTALL_PREFIX="$INSTALL_PATH" -DLIBUSB1_INCLUDE_DIRS=$INSTALL_PATH/include/libusb-1.0/ -DLIBUSB1_LIBRARY_DIRS=$INSTALL_PATH/lib/ -DBUILD_UNIT_TESTS=OFF . + make -j $MAKEJ + make install/strip + ;; linux-x86) cd ../libusb-$LIBUSB_VERSION CC="gcc -m32" CXX="g++ -m32" ./configure --prefix=$INSTALL_PATH --disable-shared --with-pic --host=i686-linux --disable-udev diff --git a/librealsense/libusb-add-loongarch-cpuinfo.patch b/librealsense/libusb-add-loongarch-cpuinfo.patch new file mode 100644 index 00000000000..06ccb8d548a --- /dev/null +++ b/librealsense/libusb-add-loongarch-cpuinfo.patch @@ -0,0 +1,26 @@ +diff --git a/config.guess b/config.guess +index 1659250..4f42dde 100755 +--- a/config.guess ++++ b/config.guess +@@ -908,6 +908,9 @@ EOF + UNAME_MACHINE=aarch64_be + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; ++ loongarch64:Linux:*:*) ++ echo ${UNAME_MACHINE}-unknown-linux-${LIBC} ++ exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; +diff --git a/config.sub b/config.sub +index 1acc966..0e51c5e 100755 +--- a/config.sub ++++ b/config.sub +@@ -249,6 +249,7 @@ case $basic_machine in + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ ++ | loongarch64 \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ diff --git a/librealsense/platform/pom.xml b/librealsense/platform/pom.xml index 17786df05dc..d6b51d61da0 100644 --- a/librealsense/platform/pom.xml +++ b/librealsense/platform/pom.xml @@ -42,6 +42,12 @@ ${project.version} ${javacpp.platform.linux-arm64} + + ${project.groupId} + ${javacpp.moduleId} + ${project.version} + ${javacpp.platform.linux-loongarch64} + ${project.groupId} ${javacpp.moduleId} @@ -84,7 +90,7 @@ - ${javacpp.moduleId}.jar ${javacpp.moduleId}-linux-armhf.jar ${javacpp.moduleId}-linux-arm64.jar ${javacpp.moduleId}-linux-x86.jar ${javacpp.moduleId}-linux-x86_64.jar ${javacpp.moduleId}-macosx-x86_64.jar ${javacpp.moduleId}-windows-x86.jar ${javacpp.moduleId}-windows-x86_64.jar + ${javacpp.moduleId}.jar ${javacpp.moduleId}-linux-armhf.jar ${javacpp.moduleId}-linux-arm64.jar ${javacpp.moduleId}-linux-loongarch64.jar ${javacpp.moduleId}-linux-x86.jar ${javacpp.moduleId}-linux-x86_64.jar ${javacpp.moduleId}-macosx-x86_64.jar ${javacpp.moduleId}-windows-x86.jar ${javacpp.moduleId}-windows-x86_64.jar @@ -130,7 +136,8 @@ module org.bytedeco.${javacpp.moduleId}.platform { requires static org.bytedeco.${javacpp.moduleId}.linux.armhf; - requires static org.bytedeco.${javacpp.moduleId}.linux.arm64; + requires static org.bytedeco.${javacpp.moduleId}.linux.arm64; + requires static org.bytedeco.${javacpp.moduleId}.linux.loongarch64; requires static org.bytedeco.${javacpp.moduleId}.linux.x86; requires static org.bytedeco.${javacpp.moduleId}.linux.x86_64; requires static org.bytedeco.${javacpp.moduleId}.macosx.x86_64; diff --git a/librealsense/src/main/java/org/bytedeco/librealsense/presets/RealSense.java b/librealsense/src/main/java/org/bytedeco/librealsense/presets/RealSense.java index 1d0978fa81c..9ec2b70c9fb 100644 --- a/librealsense/src/main/java/org/bytedeco/librealsense/presets/RealSense.java +++ b/librealsense/src/main/java/org/bytedeco/librealsense/presets/RealSense.java @@ -39,7 +39,7 @@ * @author Jérémy Laviole */ @Properties(inherit = javacpp.class, target = "org.bytedeco.librealsense", global = "org.bytedeco.librealsense.global.RealSense", value = { - @Platform(value = {"linux-armhf", "linux-arm64", "linux-x86", "macosx-x86", "windows-x86"}, compiler = "cpp11", + @Platform(value = {"linux-armhf", "linux-arm64", "linux-loongarch64", "linux-x86", "macosx-x86", "windows-x86"}, compiler = "cpp11", include = {"", "", "", ""}, link = "realsense@.1"), @Platform(value = "macosx", preload = "usb-1.0@.0", preloadpath = "/usr/local/lib/") }) diff --git a/numpy/cppbuild.sh b/numpy/cppbuild.sh index 4ad0df68e97..9dd20a80a9e 100755 --- a/numpy/cppbuild.sh +++ b/numpy/cppbuild.sh @@ -135,6 +135,10 @@ case $PLATFORM in ATLAS=None CC="gcc -m64" "$PYTHON_BIN_PATH" setup.py --quiet build -j $MAKEJ build_ext -I$CPYTHON_PATH/include/ -L$CPYTHON_PATH/lib/ install --prefix $INSTALL_PATH strip $(find ../ -iname *.so) ;; + linux-loongarch64) + ATLAS=None CC="gcc -mabi=lp64" "$PYTHON_BIN_PATH" setup.py --quiet build -j $MAKEJ build_ext -I$CPYTHON_PATH/include/ -L$CPYTHON_PATH/lib/ install --prefix $INSTALL_PATH + strip $(find ../ -iname *.so) + ;; macosx-*) sedinplace 's/-std=c99/-w/g' numpy/distutils/ccompiler.py ATLAS=None "$PYTHON_BIN_PATH" setup.py --quiet build -j $MAKEJ build_ext -I$CPYTHON_PATH/include/ -L$CPYTHON_PATH/lib/ install --prefix $INSTALL_PATH diff --git a/numpy/platform/pom.xml b/numpy/platform/pom.xml index d8550483508..9b4a5005e89 100644 --- a/numpy/platform/pom.xml +++ b/numpy/platform/pom.xml @@ -59,6 +59,12 @@ + + ${project.groupId} + ${javacpp.moduleId} + ${project.version} + ${javacpp.platform.linux-loongarch64} + ${project.groupId} ${javacpp.moduleId} @@ -95,7 +101,7 @@ - ${javacpp.moduleId}.jar ${javacpp.moduleId}-linux-armhf.jar ${javacpp.moduleId}-linux-arm64.jar ${javacpp.moduleId}-linux-ppc64le.jar ${javacpp.moduleId}-linux-x86.jar ${javacpp.moduleId}-linux-x86_64.jar ${javacpp.moduleId}-macosx-x86_64.jar ${javacpp.moduleId}-windows-x86.jar ${javacpp.moduleId}-windows-x86_64.jar + ${javacpp.moduleId}.jar ${javacpp.moduleId}-linux-armhf.jar ${javacpp.moduleId}-linux-arm64.jar ${javacpp.moduleId}-linux-ppc64le.jar ${javacpp.moduleId}-linux-x86.jar ${javacpp.moduleId}-linux-x86_64.jar ${javacpp.moduleId}-linux-loongarch64.jar ${javacpp.moduleId}-macosx-x86_64.jar ${javacpp.moduleId}-windows-x86.jar ${javacpp.moduleId}-windows-x86_64.jar @@ -145,6 +151,7 @@ // requires static org.bytedeco.${javacpp.moduleId}.linux.ppc64le; // requires static org.bytedeco.${javacpp.moduleId}.linux.x86; requires static org.bytedeco.${javacpp.moduleId}.linux.x86_64; + requires static org.bytedeco.${javacpp.moduleId}.linux.loongarch64; requires static org.bytedeco.${javacpp.moduleId}.macosx.x86_64; // requires static org.bytedeco.${javacpp.moduleId}.windows.x86; requires static org.bytedeco.${javacpp.moduleId}.windows.x86_64; diff --git a/openblas/cppbuild.sh b/openblas/cppbuild.sh index 5c6a56aa406..11ac24a562e 100755 --- a/openblas/cppbuild.sh +++ b/openblas/cppbuild.sh @@ -178,6 +178,13 @@ case $PLATFORM in export BINARY=64 export TARGET=MIPS ;; + linux-loongarch64) + export CC="gcc -mabi=lp64" + export FC="gfortran -mabi=lp64" + export LDFLAGS='-s -Wl,-rpath,\$$ORIGIN/ -Wl,-z,noexecstack' + export BINARY=BINARY64 + export TARGET= + ;; linux-armhf) export CC="arm-linux-gnueabihf-gcc" export FC="arm-linux-gnueabihf-gfortran" diff --git a/openblas/platform/pom.xml b/openblas/platform/pom.xml index ddf3b7941b4..e9a8415ae36 100644 --- a/openblas/platform/pom.xml +++ b/openblas/platform/pom.xml @@ -90,6 +90,12 @@ ${project.version} ${javacpp.platform.linux-arm64} + + ${project.groupId} + ${javacpp.moduleId} + ${project.version} + ${javacpp.platform.linux-loongarch64} + ${project.groupId} ${javacpp.moduleId} @@ -132,7 +138,7 @@ - ${javacpp.moduleId}.jar ${javacpp.moduleId}-linux-x86.jar ${javacpp.moduleId}-linux-x86_64.jar ${javacpp.moduleId}-linux-armhf.jar ${javacpp.moduleId}-linux-arm64.jar ${javacpp.moduleId}-linux-ppc64le.jar ${javacpp.moduleId}-macosx-arm64.jar ${javacpp.moduleId}-macosx-x86_64.jar ${javacpp.moduleId}-windows-x86.jar ${javacpp.moduleId}-windows-x86_64.jar + ${javacpp.moduleId}.jar ${javacpp.moduleId}-linux-x86.jar ${javacpp.moduleId}-linux-x86_64.jar ${javacpp.moduleId}-linux-armhf.jar ${javacpp.moduleId}-linux-arm64.jar ${javacpp.moduleId}-linux-loongarch_64.jar ${javacpp.moduleId}-linux-ppc64le.jar ${javacpp.moduleId}-macosx-arm64.jar ${javacpp.moduleId}-macosx-x86_64.jar ${javacpp.moduleId}-windows-x86.jar ${javacpp.moduleId}-windows-x86_64.jar @@ -187,6 +193,7 @@ requires static org.bytedeco.${javacpp.moduleId}.linux.x86_64; // requires static org.bytedeco.${javacpp.moduleId}.linux.armhf; requires static org.bytedeco.${javacpp.moduleId}.linux.arm64; + requires static org.bytedeco.${javacpp.moduleId}.linux.loongarch64; requires static org.bytedeco.${javacpp.moduleId}.linux.ppc64le; requires static org.bytedeco.${javacpp.moduleId}.macosx.arm64; requires static org.bytedeco.${javacpp.moduleId}.macosx.x86_64; diff --git a/openblas/src/main/java/org/bytedeco/openblas/presets/openblas_nolapack.java b/openblas/src/main/java/org/bytedeco/openblas/presets/openblas_nolapack.java index 426cea99c6b..604640c8d78 100644 --- a/openblas/src/main/java/org/bytedeco/openblas/presets/openblas_nolapack.java +++ b/openblas/src/main/java/org/bytedeco/openblas/presets/openblas_nolapack.java @@ -57,6 +57,7 @@ @Platform(value = "linux", preloadpath = {"/usr/lib/", "/usr/lib32/", "/usr/lib64/"}), @Platform(value = "linux-armhf", preloadpath = {"/usr/arm-linux-gnueabihf/lib/", "/usr/lib/arm-linux-gnueabihf/"}), @Platform(value = "linux-arm64", preloadpath = {"/usr/aarch64-linux-gnu/lib/", "/usr/lib/aarch64-linux-gnu/"}), + @Platform(value = "linux-loongarch64", preloadpath = {"/usr/lib/loongarch64-linux-gnu"}), @Platform(value = "linux-x86", preloadpath = {"/lib32/", "/lib/", "/usr/lib32/", "/usr/lib/", "/opt/intel/oneapi/mkl/latest/lib/ia32/", "/opt/intel/oneapi/compiler/latest/linux/compiler/lib/ia32_lin/"}), @Platform(value = "linux-x86_64", preloadpath = {"/lib64/", "/lib/", "/usr/lib64/", "/usr/lib/", "/opt/intel/oneapi/mkl/latest/lib/intel64/", "/opt/intel/oneapi/compiler/latest/linux/compiler/lib/intel64_lin/"}), @Platform(value = "linux-ppc64", preloadpath = {"/usr/powerpc64-linux-gnu/lib/", "/usr/powerpc64le-linux-gnu/lib/", diff --git a/opencv/cppbuild.sh b/opencv/cppbuild.sh index 137bc104eba..f52d1488d48 100755 --- a/opencv/cppbuild.sh +++ b/opencv/cppbuild.sh @@ -374,6 +374,18 @@ case $PLATFORM in cp ../share/java/opencv4/libopencv_java.so ../lib sedinplace "s/.so.${OPENCV_VERSION%-*}/.so/g" ../lib/cmake/opencv4/OpenCVModules-release.cmake ;; + linux-loongarch64) + CC="gcc -mabi=lp64" CXX="g++ -std=c++11 -mabi=lp64" $CMAKE -DCMAKE_INSTALL_PREFIX="$INSTALL_PATH" -DCMAKE_INSTALL_LIBDIR="lib" $BUILD_X -DENABLE_PRECOMPILED_HEADERS=OFF $WITH_X $GPU_FLAGS -DCUDA_HOST_COMPILER="$(which g++)" $BUILD_CONTRIB_X . + # download files CMake failed to download + if [[ -f download_with_curl.sh ]]; then + bash download_with_curl.sh + $CMAKE . + fi + make -j $MAKEJ + make install/strip + cp ../share/java/opencv4/libopencv_java.so ../lib + sedinplace "s/.so.${OPENCV_VERSION%-*}/.so/g" ../lib/cmake/opencv4/OpenCVModules-release.cmake + ;; macosx-arm64) # also use pthreads on Mac for increased usability and more consistent behavior with Linux sedinplace '/IF HAVE_GCD/d' CMakeLists.txt diff --git a/opencv/platform/pom.xml b/opencv/platform/pom.xml index d7c2e4adfb9..3ed685d785b 100644 --- a/opencv/platform/pom.xml +++ b/opencv/platform/pom.xml @@ -90,6 +90,12 @@ ${project.version} ${javacpp.platform.linux-arm64} + + ${project.groupId} + ${javacpp.moduleId} + ${project.version} + ${javacpp.platform.linux-loongarch64} + ${project.groupId} ${javacpp.moduleId} @@ -132,7 +138,7 @@ - ${javacpp.moduleId}.jar ${javacpp.moduleId}-linux-x86.jar ${javacpp.moduleId}-linux-x86_64.jar ${javacpp.moduleId}-linux-armhf.jar ${javacpp.moduleId}-linux-arm64.jar ${javacpp.moduleId}-linux-ppc64le.jar ${javacpp.moduleId}-macosx-arm64.jar ${javacpp.moduleId}-macosx-x86_64.jar ${javacpp.moduleId}-windows-x86.jar ${javacpp.moduleId}-windows-x86_64.jar + ${javacpp.moduleId}.jar ${javacpp.moduleId}-linux-x86.jar ${javacpp.moduleId}-linux-x86_64.jar ${javacpp.moduleId}-linux-armhf.jar ${javacpp.moduleId}-linux-arm64.jar ${javacpp.moduleId}-linux-loongarch64.jar ${javacpp.moduleId}-linux-ppc64le.jar ${javacpp.moduleId}-macosx-arm64.jar ${javacpp.moduleId}-macosx-x86_64.jar ${javacpp.moduleId}-windows-x86.jar ${javacpp.moduleId}-windows-x86_64.jar @@ -187,6 +193,7 @@ requires static org.bytedeco.${javacpp.moduleId}.linux.x86_64; // requires static org.bytedeco.${javacpp.moduleId}.linux.armhf; requires static org.bytedeco.${javacpp.moduleId}.linux.arm64; + requires static org.bytedeco.${javacpp.moduleId}.linux.loongarch64; requires static org.bytedeco.${javacpp.moduleId}.linux.ppc64le; requires static org.bytedeco.${javacpp.moduleId}.macosx.arm64; requires static org.bytedeco.${javacpp.moduleId}.macosx.x86_64; diff --git a/opencv/src/main/java/org/bytedeco/opencv/presets/opencv_core.java b/opencv/src/main/java/org/bytedeco/opencv/presets/opencv_core.java index 712366cff52..ac4181b547f 100644 --- a/opencv/src/main/java/org/bytedeco/opencv/presets/opencv_core.java +++ b/opencv/src/main/java/org/bytedeco/opencv/presets/opencv_core.java @@ -65,6 +65,7 @@ @Platform(value = "linux", preloadpath = {"/usr/lib/", "/usr/lib32/", "/usr/lib64/"}), @Platform(value = "linux-armhf", preloadpath = {"/usr/arm-linux-gnueabihf/lib/", "/usr/lib/arm-linux-gnueabihf/"}), @Platform(value = "linux-arm64", preloadpath = {"/usr/aarch64-linux-gnu/lib/", "/usr/lib/aarch64-linux-gnu/"}), + @Platform(value = "linux-loongarch64", preloadpath = {"/usr/lib/loongarch64-linux-gnu"}), @Platform(value = "linux-x86", preloadpath = {"/usr/lib32/", "/usr/lib/"}), @Platform(value = "linux-x86_64", preloadpath = {"/usr/lib64/", "/usr/lib/"}), @Platform(value = "linux-ppc64", preloadpath = {"/usr/lib/powerpc64-linux-gnu/", "/usr/lib/powerpc64le-linux-gnu/"}),