Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Compilation on ARM #41

Closed
fwilliams opened this issue May 11, 2022 · 24 comments
Closed

Fix Compilation on ARM #41

fwilliams opened this issue May 11, 2022 · 24 comments

Comments

@fwilliams
Copy link
Owner

It seems like -m64 is an x86 tag. See (compilation error cc: error: unrecognized command line option ‘-m64' in #40 ). This appears to be breaking ARM builds.

@fwilliams
Copy link
Owner Author

fwilliams commented May 16, 2022

@LilyGinger could you add the following to external/geogram/CMakeLists.txt at line 41:

message("VORPALINE_PLATFORM: ${VORPALINE_PLATFORM}")

and then run python setup.py build and paste the output

@LilyGinger
Copy link

Hi, @fwilliams Here is the output:

running build
running build_py
running build_ext
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Deprecation Warning at CMakeLists.txt:4 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


Cloning into 'numpyeigen'...
HEAD is now at 4916d92... update pybind11
-- Performing Test COMPILER_SUPPORT_OPENMP
-- Performing Test COMPILER_SUPPORT_OPENMP - Success
CMake Warning (dev) at external/numpyeigen/cmake/numpyeigen.cmake:98 (set):
  Cannot set "NPE_ROOT_DIR": current scope has no parent.
Call Stack (most recent call first):
  CMakeLists.txt:21 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Deprecation Warning at CMakeLists.txt:4 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


Cloning into 'eigen'...
HEAD is now at 21ae2af... bump to 3.3.7
CMake Deprecation Warning at CMakeLists.txt:4 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


Cloning into 'pybind11'...
Switched to a new branch 'numpy_hacks_stable'
HEAD is now at aeda673... Hacks for numpyeigen
-- pybind11 v2.9.0
-- Found PythonInterp: /usr/bin/python3 (found version "3.8.7")
-- Found PythonLibs: /usr/lib/arm-linux-gnueabihf/libpython3.8.so
-- Performing Test HAS_FLTO
-- Performing Test HAS_FLTO - Success
CMake Deprecation Warning at CMakeLists.txt:4 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


Cloning into 'manifold'...
HEAD is now at 81fd342... Update README.md
CMake Deprecation Warning at CMakeLists.txt:4 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


Cloning into 'embree'...
HEAD is now at 69bd4c2... regenerated documentation
-- Found Git: /usr/bin/git (found version "2.7.4")
CMake Deprecation Warning at external/embree/CMakeLists.txt:64 (cmake_policy):
  The OLD behavior for policy CMP0072 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.


-- Detecting default ISA...
-- Detected default ISA: SSE2
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
CMake Deprecation Warning at external/geogram/CMakeLists.txt:9 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


VORPALINE_PLATFORM: Linux64-gcc-dynamic
-- Using local options file: /home/orca/zbz/point-cloud-utils/external/geogram/CMakeOptions.txt
-- Configuring build for standalone Geogram (without Vorpaline)
-- GCC version >= 4.3, activating sign conversion warnings
-- GCC version >= 4.6, activating double promotion warnings
-- Doxygen >= 1.7.0 not found, cannot generate documentation
CMake Deprecation Warning at external/geogram/doc/CMakeLists.txt:7 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- Found OpenMP_C: -fopenmp (found version "4.0")
-- Found OpenMP_CXX: -fopenmp (found version "4.0")
-- Found OpenMP: TRUE (found version "4.0")
-- Found OpenMP_C: -fopenmp (found version "4.0")
-- Found OpenMP_CXX: -fopenmp (found version "4.0")
-- Configuring done
-- Generating done
-- Build files have been written to: /home/orca/zbz/point-cloud-utils/build/temp.linux-armv7l-3.8
[  0%] Building CXX object CMakeFiles/npe.dir/external/numpyeigen/src/npe_typedefs.cpp.o
[  0%] Building C object geogram/src/lib/geogram/third_party/CMakeFiles/geogram_third_party.dir/LM7/libmeshb7.c.o
cc: error: unrecognized command line option '-m64'
geogram/src/lib/geogram/third_party/CMakeFiles/geogram_third_party.dir/build.make:75: recipe for target 'geogram/src/lib/geogram/third_party/CMakeFiles/geogram_third_party.dir/LM7/libmeshb7.c.o' failed
make[2]: *** [geogram/src/lib/geogram/third_party/CMakeFiles/geogram_third_party.dir/LM7/libmeshb7.c.o] Error 1
CMakeFiles/Makefile2:716: recipe for target 'geogram/src/lib/geogram/third_party/CMakeFiles/geogram_third_party.dir/all' failed
make[1]: *** [geogram/src/lib/geogram/third_party/CMakeFiles/geogram_third_party.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
In file included from /home/orca/zbz/point-cloud-utils/external/numpyeigen/src/npe_typedefs.h:6:0,
                 from /home/orca/zbz/point-cloud-utils/external/numpyeigen/src/npe_typedefs.cpp:1:
/home/orca/zbz/point-cloud-utils/external/numpyeigen/cmake/../src/npe_sparse_array.h:17:8: warning: 'npe::sparse_array' declared with greater visibility than the type of its field 'npe::sparse_array::<anonymous>' [-Wattributes]
 struct sparse_array : pybind11::object {
        ^
/home/orca/zbz/point-cloud-utils/external/numpyeigen/cmake/../src/npe_sparse_array.h:17:8: warning: 'npe::sparse_array' declared with greater visibility than its base 'pybind11::object' [-Wattributes]
In file included from /home/orca/zbz/point-cloud-utils/external/numpyeigen/src/npe_typedefs.cpp:1:0:
/home/orca/zbz/point-cloud-utils/external/numpyeigen/src/npe_typedefs.h:18:1: error: static assertion failed: NumpyEigen Does not support 32-bit platforms
 static_assert(sizeof(long) == sizeof(long long), "NumpyEigen Does not support 32-bit platforms");
 ^
/home/orca/zbz/point-cloud-utils/external/numpyeigen/src/npe_typedefs.h:19:1: error: static assertion failed: NumpyEigen Does not support 32-bit platforms
 static_assert(sizeof(unsigned long) == sizeof(unsigned long long), "NumpyEigen Does not support 32-bit platforms");
 ^
/home/orca/zbz/point-cloud-utils/external/numpyeigen/src/npe_typedefs.h: In function 'constexpr char npe::detail::transform_typechar(char)':
/home/orca/zbz/point-cloud-utils/external/numpyeigen/src/npe_typedefs.h:281:5: error: static assertion failed: Expected sizeof(long) = sizeof(long long)
     static_assert(sizeof(long) == sizeof(long long), "Expected sizeof(long) = sizeof(long long)");
     ^
/home/orca/zbz/point-cloud-utils/external/numpyeigen/src/npe_typedefs.h:282:5: error: static assertion failed: Expected sizeof(unsigned long) = sizeof(unsigned long long)
     static_assert(sizeof(unsigned long) == sizeof(unsigned long long), "Expected sizeof(unsigned long) = sizeof(unsigned long long)");
     ^
/home/orca/zbz/point-cloud-utils/external/numpyeigen/src/npe_typedefs.h: In function 'constexpr int npe::detail::transform_typeid(int)':
/home/orca/zbz/point-cloud-utils/external/numpyeigen/src/npe_typedefs.h:341:5: error: static assertion failed: Expected sizeof(long) = sizeof(long long)
     static_assert(sizeof(long) == sizeof(long long), "Expected sizeof(long) = sizeof(long long)");
     ^
/home/orca/zbz/point-cloud-utils/external/numpyeigen/src/npe_typedefs.h:342:5: error: static assertion failed: Expected sizeof(unsigned long) = sizeof(unsigned long long)
     static_assert(sizeof(unsigned long) == sizeof(unsigned long long), "Expected sizeof(unsigned long) = sizeof(unsigned long long)");
     ^
/home/orca/zbz/point-cloud-utils/external/numpyeigen/src/npe_typedefs.cpp: In function 'int npe::detail::get_type_id(bool, char, npe::detail::StorageOrder)':
/home/orca/zbz/point-cloud-utils/external/numpyeigen/src/npe_typedefs.cpp:98:7: error: static assertion failed: Expected sizeof(long) = sizeof(long long)
       static_assert(sizeof(long) == sizeof(long long), "Expected sizeof(long) = sizeof(long long)");
       ^
/home/orca/zbz/point-cloud-utils/external/numpyeigen/src/npe_typedefs.cpp:117:7: error: static assertion failed: Expected sizeof(unsigned long) = sizeof(unsigned long long)
       static_assert(sizeof(unsigned long) == sizeof(unsigned long long), "Expected sizeof(unsigned long) = sizeof(unsigned long long)");
       ^
/home/orca/zbz/point-cloud-utils/external/numpyeigen/src/npe_typedefs.cpp:154:7: error: static assertion failed: Expected sizeof(long) = sizeof(long long)
       static_assert(sizeof(long) == sizeof(long long), "Expected sizeof(long) = sizeof(long long)");
       ^
/home/orca/zbz/point-cloud-utils/external/numpyeigen/src/npe_typedefs.cpp:173:7: error: static assertion failed: Expected sizeof(unsigned long) = sizeof(unsigned  long long)
       static_assert(sizeof(unsigned long) == sizeof(unsigned long long), "Expected sizeof(unsigned long) = sizeof(unsigned  long long)");
       ^
/home/orca/zbz/point-cloud-utils/external/numpyeigen/src/npe_typedefs.cpp:211:7: error: static assertion failed: Expected sizeof(long) = sizeof(long long)
       static_assert(sizeof(long) == sizeof(long long), "Expected sizeof(long) = sizeof(long long)");
       ^
/home/orca/zbz/point-cloud-utils/external/numpyeigen/src/npe_typedefs.cpp:230:7: error: static assertion failed: Expected sizeof(unsigned long) = sizeof(unsigned  long long)
       static_assert(sizeof(unsigned long) == sizeof(unsigned long long), "Expected sizeof(unsigned long) = sizeof(unsigned  long long)");
       ^
/home/orca/zbz/point-cloud-utils/external/numpyeigen/src/npe_typedefs.cpp:273:7: error: static assertion failed: Expected sizeof(long) = sizeof(long long)
       static_assert(sizeof(long) == sizeof(long long), "Expected sizeof(long) = sizeof(long long)");
       ^
/home/orca/zbz/point-cloud-utils/external/numpyeigen/src/npe_typedefs.cpp:292:7: error: static assertion failed: Expected sizeof(unsigned long) = sizeof(unsigned  long long)
       static_assert(sizeof(unsigned long) == sizeof(unsigned long long), "Expected sizeof(unsigned long) = sizeof(unsigned  long long)");
       ^
/home/orca/zbz/point-cloud-utils/external/numpyeigen/src/npe_typedefs.cpp:329:7: error: static assertion failed: Expected sizeof(long) = sizeof(long long)
       static_assert(sizeof(long) == sizeof(long long), "Expected sizeof(long) = sizeof(long long)");
       ^
/home/orca/zbz/point-cloud-utils/external/numpyeigen/src/npe_typedefs.cpp:348:7: error: static assertion failed: Expected sizeof(unsigned long) = sizeof(unsigned  long long)
       static_assert(sizeof(unsigned long) == sizeof(unsigned long long), "Expected sizeof(unsigned long) = sizeof(unsigned  long long)");
       ^
CMakeFiles/npe.dir/build.make:75: recipe for target 'CMakeFiles/npe.dir/external/numpyeigen/src/npe_typedefs.cpp.o' failed
make[2]: *** [CMakeFiles/npe.dir/external/numpyeigen/src/npe_typedefs.cpp.o] Error 1
CMakeFiles/Makefile2:363: recipe for target 'CMakeFiles/npe.dir/all' failed
make[1]: *** [CMakeFiles/npe.dir/all] Error 2
Makefile:165: recipe for target 'all' failed
make: *** [all] Error 2
Traceback (most recent call last):
  File "setup.py", line 116, in <module>
    main()
  File "setup.py", line 89, in main
    setuptools.setup(
  File "/usr/local/lib/python3.8/dist-packages/setuptools/__init__.py", line 153, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib/python3.8/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.8/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/lib/python3.8/distutils/command/build.py", line 135, in run
    self.run_command(cmd_name)
  File "/usr/lib/python3.8/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.8/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "setup.py", line 39, in run
    self.build_extension(ext)
  File "setup.py", line 72, in build_extension
    subprocess.check_call(['cmake', '--build', '.'] + build_args, cwd=self.build_temp)
  File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '-j2']' returned non-zero exit status 2.

@fwilliams
Copy link
Owner Author

fwilliams commented May 18, 2022

Thanks @LilyGinger

Can you also add the following after that line and rerun the build:

IF(${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm") 
    message("ON ARM CPU")
ELSE(${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
    message("NOT ON ARM CPU")
ENDIF(${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")

@LilyGinger
Copy link

Hi, Here is the new output.

zbz@nvidia-desktop ~/z/point-cloud-utils (master)> python3 setup.py build
running build
running build_py
running build_ext
CMake Warning (dev) at external/numpyeigen/cmake/numpyeigen.cmake:98 (set):
  Cannot set "NPE_ROOT_DIR": current scope has no parent.
Call Stack (most recent call first):
  CMakeLists.txt:21 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- pybind11 v2.9.0
-- Detecting default ISA...
-- Detected default ISA: SSE2
VORPALINE_PLATFORM: Linux64-gcc-dynamic
-- Using local options file: /home/zbz/zbz/point-cloud-utils/external/geogram/CMakeOptions.txt
-- Configuring build for standalone Geogram (without Vorpaline)
-- GCC version >= 4.3, activating sign conversion warnings
-- GCC version >= 4.6, activating double promotion warnings
-- Doxygen >= 1.7.0 not found, cannot generate documentation
-- Found OpenMP_C: -fopenmp
-- Found OpenMP_CXX: -fopenmp
-- Found OpenMP_C: -fopenmp
-- Found OpenMP_CXX: -fopenmp
-- Configuring done
-- Generating done
-- Build files have been written to: /home/zbz/zbz/point-cloud-utils/build/temp.linux-aarch64-3.6
[  1%] Built target npe
[  3%] Built target manifold
[  3%] Building C object geogram/src/lib/geogram/third_party/CMakeFiles/geogram_third_party.dir/LM7/libmeshb7.c.o
[  3%] Building CXX object embree/common/sys/CMakeFiles/sys.dir/sysinfo.cpp.o
cc: error: unrecognized command line option ‘-m64’
geogram/src/lib/geogram/third_party/CMakeFiles/geogram_third_party.dir/build.make:62: recipe for target 'geogram/src/lib/geogram/third_party/CMakeFiles/geogram_third_party.dir/LM7/libmeshb7.c.o' failed
make[2]: *** [geogram/src/lib/geogram/third_party/CMakeFiles/geogram_third_party.dir/LM7/libmeshb7.c.o] Error 1
CMakeFiles/Makefile2:780: recipe for target 'geogram/src/lib/geogram/third_party/CMakeFiles/geogram_third_party.dir/all' failed
make[1]: *** [geogram/src/lib/geogram/third_party/CMakeFiles/geogram_third_party.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
c++: error: unrecognized command line option ‘-msse2’
embree/common/sys/CMakeFiles/sys.dir/build.make:62: recipe for target 'embree/common/sys/CMakeFiles/sys.dir/sysinfo.cpp.o' failed
make[2]: *** [embree/common/sys/CMakeFiles/sys.dir/sysinfo.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[  3%] Building CXX object embree/common/sys/CMakeFiles/sys.dir/alloc.cpp.o
c++: error: unrecognized command line option ‘-msse2’
embree/common/sys/CMakeFiles/sys.dir/build.make:86: recipe for target 'embree/common/sys/CMakeFiles/sys.dir/alloc.cpp.o' failed
make[2]: *** [embree/common/sys/CMakeFiles/sys.dir/alloc.cpp.o] Error 1
CMakeFiles/Makefile2:310: recipe for target 'embree/common/sys/CMakeFiles/sys.dir/all' failed
make[1]: *** [embree/common/sys/CMakeFiles/sys.dir/all] Error 2
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2
Traceback (most recent call last):
  File "setup.py", line 116, in <module>
    main()
  File "setup.py", line 111, in main
    test_suite="tests"
  File "/usr/local/lib/python3.6/dist-packages/setuptools/__init__.py", line 153, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib/python3.6/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.6/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/usr/lib/python3.6/distutils/command/build.py", line 135, in run
    self.run_command(cmd_name)
  File "/usr/lib/python3.6/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.6/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "setup.py", line 39, in run
    self.build_extension(ext)
  File "setup.py", line 72, in build_extension
    subprocess.check_call(['cmake', '--build', '.'] + build_args, cwd=self.build_temp)
  File "/usr/lib/python3.6/subprocess.py", line 311, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '-j2']' returned non-zero exit status 2.

@fwilliams
Copy link
Owner Author

@LilyGinger I think something might be amiss. Did you paste the above lines in external/geogram/CMakeLists.txt around line 41? Your output should contain ON ARM CPU or NOT ON ARM CPU in the output. Can you run python setup.py clean before building?

@brunovollmer
Copy link

brunovollmer commented Aug 4, 2022

Is there a solution to build on ARM systems that you have not documented here @fwilliams ?

@brunovollmer
Copy link

From my understanding the problem comes from geogram, which (as you mentioned) has the -m64 tag that breaks the ARM build.

In the geogram repo they mention a way to make it work but I'm unsure on how to integrate it into this repository. Any suggestions?

alicevision/geogram#19

@fwilliams
Copy link
Owner Author

Hi, yes it seems the problem is with geogram (geogram is also blocking builds on M1 macs).

I have a copy of geogram directly in the repo (i.e. not a CMake external project), so you can modify geogram's CMake directly to make it work. I don't have an ARM machine to test this on so I haven't done it. If you manage to get it compiling, I would love a PR. Also very happy to answer any questions/work with you to get this working!

@brunovollmer
Copy link

I'm actually working on a Khadas Vim3 board (https://www.khadas.com/vim3). I will see what i can do to make it work. Any initial hints what I should look out for?

@fwilliams
Copy link
Owner Author

I think making a branch in the geogram cmake without the -m64 flag is a good start. Embree may also give you trouble but bumping the version should work. See the M1 Mac issue #42 which has more on that. Geogram had issues building on M1 Mac but that's just because the ifdefs for OSX assume Intel CPUs and include things like SSE headers. This shouldn't impact your case. Let me know if you run into any issues!

@Layer3
Copy link
Contributor

Layer3 commented Aug 5, 2022

Geogram should indeed just have a switch for excluding the -m64 and -m32 flags on non arm builds and as you mentioned eigen is the next problem a build runs into.
I am figuring that one out now and will let you know as soon as I found something. Maybe I'll come round the corner with a PR ;P

@fwilliams
Copy link
Owner Author

Thanks @Layer3! Did you embree instead of Eigen?

For both @brunovollmer and @Layer3, I created an arm branch which has the latest version of embree. If you can fix geogram, you can use that as the base for your PR.

@Layer3
Copy link
Contributor

Layer3 commented Aug 6, 2022

Yea @fwilliams compiling geogram isn't the big issue for me, that is easily doable by adding a little cmake switchto exclude the -m64/-m32 flags. The bigger problem is that the CortexA73 doesn't play nice with sse, so now I'm currently stuck with this.

In file included from /home/khadas/point-cloud-utils/external/igl/fast_winding_number.h:4,
                       from /home/khadas/point-cloud-utils/external/igl/signed_distance.h:14,
                       from /home/khadas/point-cloud-utils/build/temp.linux-aarch64-cpython-38/signed_distance.out.cpp:4:
      /home/khadas/point-cloud-utils/external/igl/FastWindingNumberForSoups.h:374:10: fatal error: emmintrin.h: No such file or directory
        374 | #include <emmintrin.h>
            |          ^~~~~~~~~~~~~
      compilation terminated.

Up to this point I've just been deactivating sse where I could or adjust the asm calls if I had to, but this one feels just too wrong.
Upside though. It's getting to 94% now : )

@Layer3
Copy link
Contributor

Layer3 commented Aug 13, 2022

Hey @fwilliams,
I managed to compile point_cloud_utils on arm now. In the end I used simde to translate the sse2 calls that are used in igl to arm compatible instructions.
I'm now running into the issue that _pcu_internal is not found when I try importing the module.
Just wondering if you got any thoughts on this.
I have all my changes for this on a fork currently.

@fwilliams
Copy link
Owner Author

Thanks for this, I'd love to merge these changes into the repo!

Could you create a PR with your fork? That would help me resolve your issue.

@Layer3
Copy link
Contributor

Layer3 commented Aug 14, 2022

Sure, I can clean them up some more and then PR them to one of the arm branches.
Regarding the issue I still had.
I am able to manualy import _pcu_internal from the build directory, so I think the pcu should be generally good to go still and it's probably just some confusion between the build and deploy configurations.
Also I've seen that you already did some updates on the arm branches. I haven't used those as a base, so will have to merge that in first and confirm that everything still works.

@Layer3
Copy link
Contributor

Layer3 commented Aug 14, 2022

Just to confirm that it runs, this is on a CortexA73

Python 3.8.1 (default, Apr 12 2022, 13:08:56)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import point_cloud_utils
>>> import numpy as np
>>> a = np.random.rand(100, 3)
>>> b = np.random.rand(100, 3)
>>> M = point_cloud_utils.pairwise_distances(a,b)
>>> w_a = np.ones(a.shape[0])
>>> w_b = np.ones(b.shape[0])
>>> P = point_cloud_utils.sinkhorn(w_a, w_b, M, eps=1e-3)
>>> sinkhorn_dist = (M*P).sum()
>>> sinkhorn_dist
2.960956756340707

@fwilliams
Copy link
Owner Author

Amazing that it works!!!

I would ignore the current arm branch! I was messing around with updating embree but didn't really get anywhere. I'll delete it for now.

@Layer3
Copy link
Contributor

Layer3 commented Aug 21, 2022

@fwilliams Prepared the PR, do you want to open a separate branch for that?

@BupyeongHealer
Copy link

Hi @fwilliams, I am trying to install your repo.
But I can't install using pip and source code.

Can you make a documentation about installation for M1 mac users?
It will be useful for arm users.
Thanks a lot and have a good day :)

@fwilliams
Copy link
Owner Author

Hi @BupyeongHealer thanks for posting here. There's currently an open PR which fixes M1 mac compilation #55
I'm going to try and merge this soon and cut a new release which works on M1 macs.

@BupyeongHealer
Copy link

Good to hear that! Thanks a lot 👍

@fwilliams
Copy link
Owner Author

This is fixed!

@BrunoLevy
Copy link

Hello, just to notify that the new version of Geogram is compatible with M1, in case it is useful to you !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants